diff --git a/README.md b/README.md index 010a663..fe21c53 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ +# my theme setter and wallpaper setter a set of scripts to set the theme of things i could use pywall. but i wanted to make my own thing # usage - ``set-theme.sh -h`` -- ``cycle-wall.sh "fullpath/to/wallpaper" "dont unload"`` will use hyprwall to cycle a wallpaper and use pywall to get the colors and set them. if the 2nd arg has anything in it. it wont unload the current wallpaper - ``save-theme.sh "name"`` saves the colors from pywall. +- ``setwll -h`` my wallpaper setter # targets when set-theme is run. it will source everything in targets. curently its only set for wezterm and waybar. but if you want other things to be set add a new script there. diff --git a/cycle_wall.sh b/cycle_wall.sh deleted file mode 100755 index 7c39ba2..0000000 --- a/cycle_wall.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -cd "$(dirname "$0")" - -current_wal="$(hyprctl hyprpaper listactive | grep HDMI-A-1 | sed 's/HDMI-A-1 = //')" - -hyprctl hyprpaper preload $1 && hyprctl hyprpaper wallpaper "HDMI-A-1,$1" -if [ "$2" == "" ]; then - hyprctl hyprpaper unload "$current_wal" -fi - -./set-theme.sh -p diff --git a/save-theme.sh b/save-theme similarity index 100% rename from save-theme.sh rename to save-theme diff --git a/set-theme.sh b/set-theme similarity index 78% rename from set-theme.sh rename to set-theme index c6d30d4..db06373 100755 --- a/set-theme.sh +++ b/set-theme @@ -12,13 +12,15 @@ ignore_file=0 list_files=0 ignore_background=0 run_pywal=0 +set_wallpaper=0 -while getopts "h?lpb" opt; do +while getopts "h?lpbw" opt; do case "$opt" in h) - printf -- "-l list themes --p run pywall --b ignore background and use one defined in script" + printf -- "-l list themes +-p run pywall +-b ignore background and use one defined in script +-w set wallpaper with setwll if \$wallpaper exist" exit 0 ;; l) list_files=1 @@ -28,6 +30,8 @@ while getopts "h?lpb" opt; do p) run_pywal=1 ignore_file=1 ;; + w) set_wallpaper=1 + ;; esac done @@ -69,3 +73,8 @@ runs_dir="$(find ./targets -mindepth 1 -maxdepth 1 -type f -executable)" for s in $runs_dir; do source "$s" done + +echo $wallpaper +if [ $set_wallpaper == 1 ] && [ "$wallpaper" ]; then + setwll -ua "$wallpaper" +fi diff --git a/setwll b/setwll new file mode 100755 index 0000000..1500472 --- /dev/null +++ b/setwll @@ -0,0 +1,87 @@ +#!/bin/bash +# may be moved to theme setter +cd "$(dirname "$0")" + +listwalls=0 +unload=0 +secondary="" +primary="" +all="" + +while getopts "h?lup:s:a:" opt; do + case "$opt" in + h) + printf -- "-l list wallpapers +-u unload current wall after switching +-p set primary mon wallpaper +-s set secondary mon wallpaper +-a set all mon wallpaper + +unloading only applies to hyprpaper +add scripts to wallpaper_scripts for easier switching\n" + exit 0 + ;; + l) listwalls=1 + ;; + u) unload=1 + ;; + p) primary="$OPTARG" + ;; + s) secondary="$OPTARG" + ;; + a) all="$OPTARG" + ;; + esac +done + +shift $((OPTIND-1)) +[ "${1:-}" = "--" ] && shift + +if [ $listwalls == 1 ]; then + ls ./wallpaper_scripts + exit 0 +fi + +if [ "$all" ]; then + primary="$all" + secondary="$all" +fi + +if [ -z "$primary" ]; then + primary="$(./wallpaper_scripts/default-primary.sh)" +else + if [ -f "./wallpaper_scripts/$primary.sh" ]; then + primary="$(./wallpaper_scripts/$primary.sh)" + fi +fi + +if [ -z "$secondary" ]; then + secondary="$(./wallpaper_scripts/default-secondary.sh)" +else + if [ -f "./wallpaper_scripts/$secondary.sh" ]; then + secondary="$(./wallpaper_scripts/$secondary.sh)" + fi +fi + + +if [ "$WAYLAND_DISPLAY" ]; then + current_wal="$(hyprctl hyprpaper listactive | grep HDMI-A-1 | sed 's/HDMI-A-1 = //')" + hyprctl hyprpaper preload $primary + hyprctl hyprpaper wallpaper "HDMI-A-1,$primary" + if [ $unload == 1 ]; then + hyprctl hyprpaper unload "$current_wal" + fi + + current_wal="$(hyprctl hyprpaper listactive | grep DP-1 | sed 's/DP-1 = //')" + hyprctl hyprpaper preload $secondary + hyprctl hyprpaper wallpaper "DP-1,$secondary" + if [ $unload == 1 ]; then + hyprctl hyprpaper unload "$current_wal" + fi +else + if [ -z "$1" ]; then + nitrogen --head=0 --set-zoom-fill $primary + + nitrogen --head=1 --set-zoom-fill $secondary + fi +fi diff --git a/themes/chored.sh b/themes/cho.sh similarity index 87% rename from themes/chored.sh rename to themes/cho.sh index b6e2e6a..6ea22b4 100755 --- a/themes/chored.sh +++ b/themes/cho.sh @@ -1,6 +1,6 @@ # Shell variables # Generated by 'wal' -wallpaper='/home/iceyrazor/stuff/scripts/bash/youtube-playlist-cli/thumbnails/t8DePOVpJEg.jpg' +wallpaper='/home/iceyrazor/stuff/media/wallpapers/papapa.png' # Special background='#0F0304' diff --git a/themes/chored-light.sh b/themes/cho2.sh similarity index 91% rename from themes/chored-light.sh rename to themes/cho2.sh index 987c44d..a6b502f 100755 --- a/themes/chored-light.sh +++ b/themes/cho2.sh @@ -1,6 +1,6 @@ # Shell variables # Generated by 'wal' -wallpaper='/home/iceyrazor/stuff/media/papapa abatademo.png' +wallpaper='/home/iceyrazor/stuff/media/wallpapers/papapa 2.jpg' # Special background='#0F0508' diff --git a/themes/feycave.sh b/themes/feycave.sh index 483423e..27a40a8 100755 --- a/themes/feycave.sh +++ b/themes/feycave.sh @@ -1,6 +1,6 @@ # Shell variables # Generated by 'wal' -wallpaper='/home/iceyrazor/56uvetgzh2se1.png' +wallpaper='/home/iceyrazor/stuff/media/wallpapers/fey-cave.png' # Special background='#0B0D16' diff --git a/themes/hotdog.sh b/themes/hotdog.sh index 82ba9ec..0686bd0 100755 --- a/themes/hotdog.sh +++ b/themes/hotdog.sh @@ -1,3 +1,5 @@ +wallpaper="/home/iceyrazor/stuff/media/wallpapers/hotdogstand.png" + # Special background='#ff0000' foreground='#ffffff' diff --git a/themes/redblue.sh b/themes/redblue.sh index e9bf68b..94b834f 100755 --- a/themes/redblue.sh +++ b/themes/redblue.sh @@ -1,6 +1,6 @@ # Shell variables # Generated by 'wal' -wallpaper='/home/iceyrazor/2025-06-06_19-42.png' +wallpaper='/home/iceyrazor/stuff/media/wallpapers/ado-ussewa.png' # Special background='#02000D' diff --git a/themes/spaceship.sh b/themes/spaceship.sh index 7689cee..24651be 100755 --- a/themes/spaceship.sh +++ b/themes/spaceship.sh @@ -1,6 +1,6 @@ # Shell variables # Generated by 'wal' -wallpaper='/home/iceyrazor/1a7q9jfpuf2f1.png' +wallpaper='/home/iceyrazor/stuff/media/wallpapers/spaceship-4jskal.png' # Special background='#0B092C' diff --git a/themes/warp.sh b/themes/warp.sh index 4b72b1d..c1dab0c 100755 --- a/themes/warp.sh +++ b/themes/warp.sh @@ -1,6 +1,6 @@ # Shell variables # Generated by 'wal' -wallpaper='/home/iceyrazor/1zu6aywxa7vd1.png' +wallpaper='/home/iceyrazor/stuff/media/wallpapers/warp-1.png' # Special background='#040617' diff --git a/wallpaper_scripts/cho.sh b/wallpaper_scripts/cho.sh new file mode 100755 index 0000000..f299f84 --- /dev/null +++ b/wallpaper_scripts/cho.sh @@ -0,0 +1 @@ +echo "/home/iceyrazor/stuff/media/wallpapers/papapa.png" diff --git a/wallpaper_scripts/cho2.sh b/wallpaper_scripts/cho2.sh new file mode 100755 index 0000000..5506294 --- /dev/null +++ b/wallpaper_scripts/cho2.sh @@ -0,0 +1 @@ +echo "/home/iceyrazor/stuff/media/wallpapers/papapa 2.jpg" diff --git a/wallpaper_scripts/default-primary.sh b/wallpaper_scripts/default-primary.sh new file mode 100755 index 0000000..2898bfb --- /dev/null +++ b/wallpaper_scripts/default-primary.sh @@ -0,0 +1 @@ +echo "/home/iceyrazor/stuff/media/wallpapers/4500025-retrowave-vaporwave-car-typography-purple-blue-chromatic-aberration-initial-d-hachi-roku.jpg" diff --git a/wallpaper_scripts/default-secondary.sh b/wallpaper_scripts/default-secondary.sh new file mode 100755 index 0000000..f2f5ee1 --- /dev/null +++ b/wallpaper_scripts/default-secondary.sh @@ -0,0 +1 @@ +echo "/home/iceyrazor/stuff/media/wallpapers/tumblr_06bbd355f3e355049446dac24f6e7c44_2c486f77_1280 ninesols.jpg" diff --git a/wallpaper_scripts/drg.sh b/wallpaper_scripts/drg.sh new file mode 100755 index 0000000..49ef5ca --- /dev/null +++ b/wallpaper_scripts/drg.sh @@ -0,0 +1 @@ +echo "/home/iceyrazor/stuff/media/wallpapers/6b06108fa3bc46f5.jpg" diff --git a/wallpaper_scripts/drk.sh b/wallpaper_scripts/drk.sh new file mode 100755 index 0000000..297f16a --- /dev/null +++ b/wallpaper_scripts/drk.sh @@ -0,0 +1 @@ +echo "/home/iceyrazor/stuff/media/wallpapers/dark_leaves.png" diff --git a/wallpaper_scripts/purple.sh b/wallpaper_scripts/purple.sh new file mode 100755 index 0000000..56333fb --- /dev/null +++ b/wallpaper_scripts/purple.sh @@ -0,0 +1 @@ +echo "/home/iceyrazor/stuff/media/wallpapers/purple/IMG_0276.jpg" diff --git a/wallpaper_scripts/spaceship.sh b/wallpaper_scripts/spaceship.sh new file mode 100755 index 0000000..af658f7 --- /dev/null +++ b/wallpaper_scripts/spaceship.sh @@ -0,0 +1 @@ +echo "/home/iceyrazor/stuff/media/wallpapers/spaceship-4jskal.png"