updated toolbelt to not create a new window for chscheme; it now resizes the same window and moves it so that the mouse is at the center of the window. If chscheme is closed, it reverts back to its original size and goes back to the previous menu
This commit is contained in:
16
modules/home/scripts/commands/chpaper.nix
Normal file
16
modules/home/scripts/commands/chpaper.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{ pkgs }:
|
||||
|
||||
pkgs.writeShellScriptBin "chpaper" ''
|
||||
paper="$\{self}/assets/wallpapers/$(find "$FLAKEPATH"/assets/wallpapers -exec basename {} \; | rg "\.\w+$" | fzf --preview "chafa -s 30x40 $FLAKEPATH/assets/wallpapers/{}")"
|
||||
[ "$paper" = "$\{self}/assets/wallpapers/" ] && echo "Cancelling wallpaper change" && exit 0
|
||||
echo "$paper" | xargs -I {} sed -i '/wallpaper =/s|"[^"]*"|"{}"|' "$FLAKEPATH"/flake.nix
|
||||
echo "Successfully changed wallpaper. Rebuild now?" && \
|
||||
select choice in "Yes" "No"; do
|
||||
case $choice in
|
||||
"Yes")
|
||||
rebuild;pkill -9 hyprpaper;exit 0;;
|
||||
"No")
|
||||
echo "Exiting...";exit 0;;
|
||||
esac
|
||||
done
|
||||
''
|
||||
Reference in New Issue
Block a user