diff --git a/.settings/wallpaper-effect.sh b/.settings/wallpaper-effect.sh new file mode 100644 index 0000000..cfb931e --- /dev/null +++ b/.settings/wallpaper-effect.sh @@ -0,0 +1 @@ +off diff --git a/hypr/effects/wallpaper/blackwhite b/hypr/effects/wallpaper/blackwhite new file mode 100644 index 0000000..0f985b3 --- /dev/null +++ b/hypr/effects/wallpaper/blackwhite @@ -0,0 +1 @@ +magick $wallpaper -set colorspace Gray -separate -average $used_wallpaper \ No newline at end of file diff --git a/hypr/effects/wallpaper/blackwhite-blur b/hypr/effects/wallpaper/blackwhite-blur new file mode 100644 index 0000000..85a5a51 --- /dev/null +++ b/hypr/effects/wallpaper/blackwhite-blur @@ -0,0 +1,2 @@ +magick $wallpaper -set colorspace Gray -separate -average $used_wallpaper +magick $used_wallpaper -blur "50x30" $used_wallpaper \ No newline at end of file diff --git a/hypr/effects/wallpaper/blur1 b/hypr/effects/wallpaper/blur1 new file mode 100644 index 0000000..f401e1a --- /dev/null +++ b/hypr/effects/wallpaper/blur1 @@ -0,0 +1 @@ +magick $wallpaper -blur "50x30" $used_wallpaper \ No newline at end of file diff --git a/hypr/effects/wallpaper/blur2 b/hypr/effects/wallpaper/blur2 new file mode 100644 index 0000000..cb13630 --- /dev/null +++ b/hypr/effects/wallpaper/blur2 @@ -0,0 +1 @@ +magick $wallpaper -blur "10x30" $used_wallpaper \ No newline at end of file diff --git a/hypr/scripts/wallpaper-effects.sh b/hypr/scripts/wallpaper-effects.sh new file mode 100755 index 0000000..fb1d020 --- /dev/null +++ b/hypr/scripts/wallpaper-effects.sh @@ -0,0 +1,12 @@ + #!/bin/bash + + # Open rofi to select the Hyprshade filter for toggle + options="$(ls ~/dotfiles/hypr/effects/wallpaper/)\noff" + + # Open rofi + choice=$(echo -e "$options" | rofi -dmenu -replace -config ~/dotfiles/rofi/config-themes.rasi -i -no-show-icons -l 5 -width 30 -p "Hyprshade") + if [ ! -z $choice ] ;then + echo "$choice" > ~/dotfiles/.settings/wallpaper-effect.sh + dunstify "Changing Wallpaper Effect to " "$choice" + ~/dotfiles/hypr/scripts/wallpaper.sh init + fi \ No newline at end of file diff --git a/hypr/scripts/wallpaper.sh b/hypr/scripts/wallpaper.sh index 9355f7f..457e7c5 100755 --- a/hypr/scripts/wallpaper.sh +++ b/hypr/scripts/wallpaper.sh @@ -14,6 +14,7 @@ wallpaper_folder="$HOME/wallpaper" if [ -f ~/dotfiles/.settings/wallpaper-folder.sh ] ;then source ~/dotfiles/.settings/wallpaper-folder.sh fi +used_wallpaper="$HOME/.cache/used_wallpaper" cache_file="$HOME/.cache/current_wallpaper" blurred="$HOME/.cache/blurred_wallpaper.png" square="$HOME/.cache/square_wallpaper.png" @@ -74,7 +75,6 @@ esac # Load current pywal color scheme # ----------------------------------------------------- source "$HOME/.cache/wal/colors.sh" -echo ":: Wallpaper: $wallpaper" # ----------------------------------------------------- # get wallpaper image name @@ -93,11 +93,27 @@ transition_type="wipe" # transition_type="outer" # transition_type="random" +cp $wallpaper $HOME/.cache/ +mv $HOME/.cache/$newwall $used_wallpaper + +# Load Wallpaper Effect +if [ -f $HOME/dotfiles/.settings/wallpaper-effect.sh ] ;then + effect=$(cat $HOME/dotfiles/.settings/wallpaper-effect.sh) + if [ ! "$effect" == "off" ] ;then + if [ "$1" == "init" ] ;then + echo ":: Init" + else + dunstify "Using wallpaper effect $effect..." "with image $newwall" -h int:value:10 -h string:x-dunst-stack-tag:wallpaper + fi + source $HOME/dotfiles/hypr/effects/wallpaper/$effect + fi +fi + wallpaper_engine=$(cat $HOME/dotfiles/.settings/wallpaper-engine.sh) if [ "$wallpaper_engine" == "swww" ] ;then # swww echo ":: Using swww" - swww img $wallpaper \ + swww img $used_wallpaper \ --transition-bezier .43,1.19,1,.4 \ --transition-fps=60 \ --transition-type=$transition_type \ @@ -108,7 +124,7 @@ elif [ "$wallpaper_engine" == "hyprpaper" ] ;then echo ":: Using hyprpaper" killall hyprpaper wal_tpl=$(cat $HOME/dotfiles/.settings/hyprpaper.tpl) - output=${wal_tpl//WALLPAPER/$wallpaper} + output=${wal_tpl//WALLPAPER/$used_wallpaper} echo "$output" > $HOME/dotfiles/hypr/hyprpaper.conf hyprpaper & else diff --git a/waybar/modules.json b/waybar/modules.json index 14f559a..4ad007f 100644 --- a/waybar/modules.json +++ b/waybar/modules.json @@ -111,7 +111,7 @@ "custom/wallpaper": { "format": "", "on-click": "~/dotfiles/hypr/scripts/wallpaper.sh select", - "on-click-right": "~/dotfiles/hypr/scripts/wallpaper.sh", + "on-click-right": "~/dotfiles/hypr/scripts/wallpaper-effects.sh", "tooltip": false },