diff options
| author | iceyrazor <iceyrazor@mailfence.com> | 2025-06-04 10:16:12 -0500 |
|---|---|---|
| committer | iceyrazor <iceyrazor@mailfence.com> | 2025-06-04 10:16:12 -0500 |
| commit | b69040fda091cb2a55e00c05e924cd0c0a42cb57 (patch) | |
| tree | 7b6c8282841c2f6a3767c12d5d8bd053847454e9 /env/.local/bin/scripts/setwll | |
| parent | edf3d20945518c55394975b3641229124776d195 (diff) | |
fixed awesome autostart dir. added wallpaper setter script. made no extension be filetype sh in neovim. renamed some scripts.
Diffstat (limited to 'env/.local/bin/scripts/setwll')
| -rwxr-xr-x | env/.local/bin/scripts/setwll | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/env/.local/bin/scripts/setwll b/env/.local/bin/scripts/setwll new file mode 100755 index 0000000..b19fdf3 --- /dev/null +++ b/env/.local/bin/scripts/setwll @@ -0,0 +1,69 @@ +#!/bin/bash +# may be moved to theme setter +cd "$(dirname "$0")" + +unload=0 +secondary="" +primary="" +all="" + +while getopts "up:s:a:" opt; do + case "$opt" in + u) unload=1 + ;; + p) primary="$OPTARG" + ;; + s) secondary="$OPTARG" + ;; + a) all="$OPTARG" + ;; + esac +done + +shift $((OPTIND-1)) +[ "${1:-}" = "--" ] && shift + +if [ "$all" ]; then + primary="$all" + secondary="$all" +fi + +if [ -z "$primary" ]; then + primary="$(./wallpaper_scripts/default-primary)" +else + if [ -f "./wallpaper_scripts/$primary" ]; then + primary="$(./wallpaper_scripts/$primary)" + fi +fi + +if [ -z "$secondary" ]; then + secondary="$(./wallpaper_scripts/default-secondary)" +else + if [ -f "./wallpaper_scripts/$secondary" ]; then + secondary="$(./wallpaper_scripts/$secondary)" + 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 + |
