aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/Wallpaper.sh
diff options
context:
space:
mode:
authorJaKooLit <jimmielovejay@gmail.com>2023-10-22 15:55:57 +0900
committerJaKooLit <jimmielovejay@gmail.com>2023-10-22 15:55:57 +0900
commitc222e1bad2ba5e779c3af5b956906c82ead43271 (patch)
treea5253e0861c200ff90354169e1f67ef42ebf0ef9 /config/hypr/scripts/Wallpaper.sh
parentbb0be21dba7980fc1c047eaba24eda1712bd7f31 (diff)
Initial upload
Diffstat (limited to 'config/hypr/scripts/Wallpaper.sh')
-rwxr-xr-xconfig/hypr/scripts/Wallpaper.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/config/hypr/scripts/Wallpaper.sh b/config/hypr/scripts/Wallpaper.sh
new file mode 100755
index 00000000..db186269
--- /dev/null
+++ b/config/hypr/scripts/Wallpaper.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+DIR=$HOME/Pictures/wallpapers/
+PICS=($(find ${DIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \)))
+RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]}
+
+change_swaybg(){
+ pkill swww
+ pkill swaybg
+ swaybg -m fill -i ${RANDOMPICS}
+}
+
+change_swww(){
+ pkill swaybg
+ swww query || swww init
+ swww img ${RANDOMPICS} --transition-fps 30 --transition-type any --transition-duration 3
+}
+
+change_current(){
+ if pidof swaybg >/dev/null; then
+ change_swaybg
+ else
+ change_swww
+ fi
+}
+
+switch(){
+ if pidof swaybg >/dev/null; then
+ change_swww
+ else
+ change_swaybg
+ fi
+}
+
+case "$1" in
+ "swaybg")
+ change_swaybg
+ ;;
+ "swww")
+ change_swww
+ ;;
+ "s")
+ switch
+ ;;
+ *)
+ change_current
+ ;;
+esac \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage