- Update installer to use git+https://git.bemagri.xyz/bernardo/Nomarchy.git - Remove redundant bundling/copying of the engine to /etc/nixos/nomarchy - Expose all themes via xdg.dataFile for script accessibility - Update theme scripts to resolve directories via local share instead of hardcoded system paths - Update documentation to reflect the new remote-first architecture
59 lines
2.2 KiB
Nix
59 lines
2.2 KiB
Nix
{ config, pkgs, ... }:
|
|
|
|
let
|
|
palettes = import ../../themes/nomarchy-palettes.nix;
|
|
themeNames = builtins.attrNames palettes;
|
|
themeList = builtins.concatStringsSep "\\n" themeNames;
|
|
|
|
nomarchy-theme-selector = pkgs.writeShellScriptBin "nomarchy-theme-selector" ''
|
|
SELECTED_THEME=$(echo -e "${themeList}" | walker --dmenu)
|
|
|
|
if [ -n "$SELECTED_THEME" ]; then
|
|
nomarchy-theme-set "$SELECTED_THEME"
|
|
fi
|
|
'';
|
|
nomarchy-font-selector = pkgs.writeShellScriptBin "nomarchy-font-selector" ''
|
|
STATE_DIR="$HOME/.config/home-manager"
|
|
STATE_FILE="$STATE_DIR/state.json"
|
|
|
|
mkdir -p "$STATE_DIR"
|
|
[[ ! -f $STATE_FILE ]] && echo "{}" > "$STATE_FILE"
|
|
|
|
# Simple list of common nerd fonts, could be expanded
|
|
FONTS="JetBrainsMono Nerd Font\nRobotoMono Nerd Font\nFiraCode Nerd Font\nUbuntuMono Nerd Font"
|
|
SELECTED_FONT=$(echo -e "$FONTS" | walker --dmenu)
|
|
|
|
if [ -n "$SELECTED_FONT" ]; then
|
|
TMP_JSON=$(mktemp)
|
|
jq ".font = \"$SELECTED_FONT\"" "$STATE_FILE" > "$TMP_JSON" && mv "$TMP_JSON" "$STATE_FILE"
|
|
env-update
|
|
fi
|
|
'';
|
|
nomarchy-wallpaper-selector = pkgs.writeShellScriptBin "nomarchy-wallpaper-selector" ''
|
|
STATE_DIR="$HOME/.config/home-manager"
|
|
STATE_FILE="$STATE_DIR/state.json"
|
|
THEMES_DIR="$HOME/.local/share/nomarchy/themes"
|
|
|
|
mkdir -p "$STATE_DIR"
|
|
[[ ! -f $STATE_FILE ]] && echo "{}" > "$STATE_FILE"
|
|
|
|
# List all images in all themes backgrounds
|
|
WALLPAPERS=$(find "$THEMES_DIR" -type f \( -name "*.jpg" -o -name "*.png" \))
|
|
# Include user themes if they exist
|
|
if [ -d "$HOME/.config/nomarchy/themes" ]; then
|
|
WALLPAPERS="$WALLPAPERS\n$(find "$HOME/.config/nomarchy/themes" -type f \( -name "*.jpg" -o -name "*.png" \))"
|
|
fi
|
|
SELECTED_WP=$(echo -e "$WALLPAPERS" | walker --dmenu)
|
|
|
|
if [ -n "$SELECTED_WP" ]; then
|
|
TMP_JSON=$(mktemp)
|
|
jq ".wallpaper = \"$SELECTED_WP\"" "$STATE_FILE" > "$TMP_JSON" && mv "$TMP_JSON" "$STATE_FILE"
|
|
swww img "$SELECTED_WP" --transition-type outer --transition-pos 0.85,0.97 --transition-step 90 &
|
|
env-update
|
|
fi
|
|
'';
|
|
in
|
|
{
|
|
home.packages = [ nomarchy-theme-selector nomarchy-font-selector nomarchy-wallpaper-selector ];
|
|
}
|