mirror of
https://gitlab.com/Zaney/zaneyos.git
synced 2025-08-17 17:21:03 +02:00
testing new theme changing and selector scripts
This commit is contained in:
16
config/scripts/theme-selector.nix
Normal file
16
config/scripts/theme-selector.nix
Normal 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
|
||||
''
|
@@ -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
|
||||
|
||||
''
|
||||
|
Reference in New Issue
Block a user