From d00219422a931d8bccfb90aac62be3c30e11aae3 Mon Sep 17 00:00:00 2001 From: speedie Date: Thu, 1 Sep 2022 10:02:28 +0200 Subject: [PATCH] Update scripts --- scripts/speedwm-dm | 2 ++ scripts/speedwm-swal | 20 +++++++++++++++++++- status | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/scripts/speedwm-dm b/scripts/speedwm-dm index f644e11..4a18442 100755 --- a/scripts/speedwm-dm +++ b/scripts/speedwm-dm @@ -17,8 +17,10 @@ printf "[Desktop Entry]\nEncoding=UTF-8\nName=speedwm\nComment=Dynamic window ma # If the bar is on the top, touch /usr/share/speedwm-topbar TOPBAR=$(grep "barposition" options.h | grep "1" | awk '{ print $5 }') PADDING=$(grep "barpaddingv" options.h | grep "0" | awk '{ print $5 }') +COMPOSITOR=$(grep "define COMPOSITOR " options.h | awk '{ print $3 }' | sed 's/"//g') echo $TOPBAR | grep "1" && touch /usr/share/speedwm-topbar echo $PADDING | grep "0" && touch /usr/share/speedwm-nopadding +echo $COMPOSITOR > /usr/share/speedwm-compositor echo $(pwd) > /usr/share/speedwm-sourcedir # Copy .Xresources file diff --git a/scripts/speedwm-swal b/scripts/speedwm-swal index 28ce41b..94be31a 100755 --- a/scripts/speedwm-swal +++ b/scripts/speedwm-swal @@ -94,6 +94,23 @@ SWAL_MKCONFIG() { printf "\nSWAL_RANDOMIZE=$SWAL_RANDOMIZE" >> $SWAL_EXPORTDIR/config } +# use a solid color +SOLIDCOLOR() { + ISCOL="$(printf "#000000\n#bbbbbb" | $RUNLAUNCHER -l 2 $GRIDARG $GRIDNUM -p "Enter a hex color:")" + + echo $ISCOL | grep -q "#" || exit 1 + + xwallpaper --clear + xsetroot -solid "$ISCOL" + rm -f $SWAL_EXPORTDIR/swal_wm + xrdb -remove + xsetroot -name "fsignal:31" + test ${BINDIR}notify-send && notify-send " Solid color $ISCOL set as wallpaper." + pgrep -x picom > /dev/null && pkill picom # Fix picom related bug + + exit 0 +} + BINDIR=$(cat /usr/share/speedwm-bindir) SWAL_OLDWALLPAPERDIR=$SWAL_WALLPAPERDIR @@ -138,7 +155,7 @@ SWAL_USAGE() { SWAL_SELWALLPAPER() { case "$NEW1" in - "") ls /tmp/swal_cpath || SWAL_SELWALLPAPER="$(printf "$(ls "$SWAL_WALLPAPERDIR")\n------\n..\nPreview\nPrevious\nRandom\nFavorites\nAdd used wallpaper to favorites\nOptions\nHelp\nExit" | $RUNLAUNCHER $GRIDARG $GRIDNUM -l 100 -p "What wallpaper would you like to set?")" ;; + "") ls /tmp/swal_cpath || SWAL_SELWALLPAPER="$(printf "$(ls "$SWAL_WALLPAPERDIR")\n------\n..\nPreview\nPrevious\nSolid Color\nRandom\nFavorites\nAdd used wallpaper to favorites\nOptions\nHelp\nExit" | $RUNLAUNCHER $GRIDARG $GRIDNUM -l 100 -p "What wallpaper would you like to set?")" ;; "-w") SWAL_SELWALLPAPER="$(basename "$NEW2")" && touch /tmp/swal_cpath ;; "-h") SWAL_HELP | $RUNLAUNCHER $GRIDARG $GRIDNUM 1 -l 90 ;; "-f") SWAL_FSIGNAL_RELOAD_XRESOURCES="$NEW2" ;; @@ -169,6 +186,7 @@ SWAL_SETTYPE() "Random") SWAL_FULL="$(find $SWAL_WALLPAPERDIR/* -type f | shuf -n 1)" ; SWAL_WALLPAPERDIR="$(dirname "$SWAL_FULL")" ; SWAL_SELWALLPAPER="$(basename "$SWAL_FULL")" ; SWAL_SELWAL=$SWAL_SELWALLPAPER ;; "Previous") SWAL_PREVWAL=$(readlink $SWAL_EXPORTDIR/CurrentWallpaper_prev) ; SWAL_WALLPAPERDIR="$(dirname "$SWAL_PREVWAL")" ; SWAL_SELWALLPAPER="$(basename "$SWAL_PREVWAL")" ;; "Exit") exit 0 ;; + "Solid Color") SOLIDCOLOR ;; "Help") SWAL_USAGE | $RUNLAUNCHER $GRIDARG $GRIDNUM -l 50 -p "How to use" && $0 && exit 0 ;; "------") $0 && exit 0 ;; esac diff --git a/status b/status index 18467ff..55922cc 100755 --- a/status +++ b/status @@ -26,7 +26,7 @@ SEP="<" # Separator to use. Alternative separators: "❰", "<", "|" COLORFG=true # Color foreground (true/false) COLORBG=false # Color background (true/false) USEBUILTINCOL=false # Use built in speedwm colors (col_status). This also supports Pywal. (true/false) -CHARLIMIT=auto # Limit characters to CHARLIMIT. Enter false to not have a limit. Enter auto to use xdpyinfo. (num/auto/false) +CHARLIMIT=30 # Limit characters to CHARLIMIT. Enter false to not have a limit. Enter auto to use xdpyinfo. (num/auto/false) # Status bar modules # Set to true/false to enable/disable.