Browse Source

feat(wallpaper):wallpaper switcher with a previewer,powered by fzf

pull/127/head
PostCyberPunk 2 years ago
parent
commit
3cb40bbe39
  1. 9
      config/hypr/UserConfigs/Wallpaper.conf
  2. 10
      config/hypr/UserScripts/WallpaperSwitcher.sh
  3. 3
      config/hypr/hyprland.conf

9
config/hypr/UserConfigs/Wallpaper.conf

@ -0,0 +1,9 @@
$wallpaper_switcher=$HOME/.config/hypr/UserScripts/WallpaerSwitcher.sh
$wallpaper_dir=$HOME/Pictures/wallpapers
windowrulev2=size 1200 500,title:^(FTQCW)$
windowrulev2=center,title:^(FTQCW)$
#Move this to keybind files,i just want to avoid conflict.
$mainMod =SUPER
bind = $mainMod CTRL, W, exec,kitty -T "FTQCW" --class floating bash $wallpaper_switcher "$wallpaper_dir"

10
config/hypr/UserScripts/WallpaperSwitcher.sh

@ -0,0 +1,10 @@
#!/bin/bash
cd $1
result=$(find . -type f|fzf \
--reverse --header="WallPaperSwitcher" --preview-window=44% \
--preview='kitten icat --clear --transfer-mode=memory --place="$FZF_PREVIEW_COLUMNS"x"$FZF_PREVIEW_LINES"@$(math $COLUMNS+5)x1 --align center --stdin=no -z -1 {}')
#?? Maybe its a good idea to make a global function for changing wallpaper, something like :$hypr_dir/Scirpt/ChangeWallpapper.sh "SomePic.jpg"
#so if you change wallpaper somewhere else,the workflow stay the same.
#and you can move SWWW_PARAMS to the Wallpaper.conf so user can change that without touching the scirpt
swww img "$result"
exit 0

3
config/hypr/hyprland.conf

@ -16,4 +16,5 @@ source= $UserConfigs/Laptops.conf
source= $UserConfigs/LaptopDisplay.conf source= $UserConfigs/LaptopDisplay.conf
source= $UserConfigs/WindowRules.conf source= $UserConfigs/WindowRules.conf
source= $UserConfigs/UserKeybinds.conf source= $UserConfigs/UserKeybinds.conf
source= $UserConfigs/UserSettings.conf source= $UserConfigs/UserSettings.conf
source= $UserConfigs/Wallpaper.conf

Loading…
Cancel
Save