From 5b935bd395ed7401f0a1ad92d119c9d594f2796d Mon Sep 17 00:00:00 2001 From: iceyrazor Date: Sun, 24 May 2026 02:06:58 -0500 Subject: some posix changes new themes --- setwll | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'setwll') diff --git a/setwll b/setwll index 6f512ba..67e99a8 100755 --- a/setwll +++ b/setwll @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh # may be moved to theme setter -cd "$(dirname "$0")" +cd "$(dirname "$0")" || exit listwalls=0 unload=0 @@ -8,7 +8,7 @@ secondary="" primary="" all="" -while getopts "h?lup:s:a:" opt; do +while getopts "hlup:s:a:" opt; do case "$opt" in h) printf -- "-l list wallpapers @@ -31,13 +31,14 @@ add scripts to wallpaper_scripts for easier switching\n" ;; a) all="$OPTARG" ;; + *) break ;; esac done shift $((OPTIND-1)) [ "${1:-}" = "--" ] && shift -if [ $listwalls == 1 ]; then +if [ $listwalls = 1 ]; then ls ./wallpaper_scripts exit 0 fi @@ -51,7 +52,7 @@ if [ -z "$primary" ]; then primary="$(./wallpaper_scripts/default-primary.sh)" else if [ -f "./wallpaper_scripts/$primary.sh" ]; then - primary="$(./wallpaper_scripts/$primary.sh)" + primary="$(./wallpaper_scripts/"$primary.sh")" fi fi @@ -59,36 +60,36 @@ if [ -z "$secondary" ]; then secondary="$(./wallpaper_scripts/default-secondary.sh)" else if [ -f "./wallpaper_scripts/$secondary.sh" ]; then - secondary="$(./wallpaper_scripts/$secondary.sh)" + secondary="$(./wallpaper_scripts/"$secondary".sh)" fi fi if [ "$WAYLAND_DISPLAY" ]; then - if [ "$XDG_CURRENT_DESKTOP" == "sway:wlroots" ]; then + if [ "$XDG_CURRENT_DESKTOP" = "sway:wlroots" ]; then PID=$(pidof swaybg) - swaybg -o HDMI-A-1 -i "$primary" -m fill -o DP-1 -i "$secondary" -m fill & disown + swaybg -o HDMI-A-1 -i "$primary" -m fill -o DP-1 -i "$secondary" -m fill & sleep 0.4s - kill $PID + kill "$PID" else current_wal="$(hyprctl hyprpaper listactive | grep HDMI-A-1 | sed 's/HDMI-A-1 = //')" - hyprctl hyprpaper preload $primary + hyprctl hyprpaper preload "$primary" hyprctl hyprpaper wallpaper "HDMI-A-1,$primary" - if [ $unload == 1 ]; then + 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 preload "$secondary" hyprctl hyprpaper wallpaper "DP-1,$secondary" - if [ $unload == 1 ]; then + if [ $unload = 1 ]; then hyprctl hyprpaper unload "$current_wal" fi fi else if [ -z "$1" ]; then - nitrogen --head=0 --set-zoom-fill $primary + nitrogen --head=0 --set-zoom-fill "$primary" - nitrogen --head=1 --set-zoom-fill $secondary + nitrogen --head=1 --set-zoom-fill "$secondary" fi fi -- cgit v1.3