testing new theme changing and selector scripts

This commit is contained in:
Tyler Kelley
2024-01-17 03:01:53 -06:00
parent 78f5931d70
commit 7b4a275fc0
5 changed files with 273 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
{ pkgs }:
pkgs.writeShellScriptBin "theme-selector" ''
# Get user selection for new theme from base16-themes file
chosen=$(cat $HOME/.base16-themes | ${pkgs.rofi-wayland}/bin/rofi -dmenu)
# Exit if none chosen.
[ -z "$chosen" ] && exit
if [ -n "$1" ]; then
themechange "$chosen"
else
themechange "$chosen"
${pkgs.libnotify}/bin/notify-send "'$chosen' theme is building this will take a second" &
fi
''

View File

@@ -6,6 +6,9 @@ pkgs.writeShellScriptBin "themechange" ''
else
replacement="$1"
sed -i "/^\s*theme[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$replacement\"/" ${flakeDir}/flake.nix
sudo nixos-rebuild switch --flake ${flakeDir}/#workstation
${pkgs.toybox}/bin/pkill ${pkgs.swaynotificationcenter}/bin/swaync
${pkgs.toybox}/bin/nohup ${pkgs.swaynotificationcenter}/bin/swaync &
rm nohup.out
fi
''