From 41121c4a249a193acaea350c19a73d62c0d7e16a Mon Sep 17 00:00:00 2001 From: root_sti Date: Fri, 9 Feb 2024 00:11:54 -0300 Subject: [PATCH] litle changes. --- wms_usher.sh | 31 +++++++++++------ wms_value.sh | 93 ++++++++++++++++++------------------------------- wms_var_example | 46 ++++++++++++++++++++++++ 3 files changed, 99 insertions(+), 71 deletions(-) create mode 100644 wms_var_example diff --git a/wms_usher.sh b/wms_usher.sh index 7b4ac54..ecfeb38 100755 --- a/wms_usher.sh +++ b/wms_usher.sh @@ -1,4 +1,3 @@ - #!/bin/sh ## some layouts to order the windows ## @@ -59,21 +58,29 @@ tiling() { # stack width. swidth=$((sw - mwidth - GAP - 2 * BW)) # stack height. - sheight=$((ssh / swcount - GAP - 2 * BW)) + + # if swcount in 0 or not. + [ "$swcount" = "0" ] && sheight=ssh \ + || sheight=$((ssh / swcount - GAP - 2 * BW)) + # stack x coordinate. sx=$((mwidth + 2 * GAP + 2 * BW)) # stack y coordinate. sy=$GAP - # put focused window as master - wtp $mx $my $mwidth $mheight $FW - - # put the rest of the windows in stack - for wid in $(lsw | grep -v $FW); do - wtp $sx $sy $swidth $sheight $wid - # incremental stack Y coordinate. - sy=$((sy + sheight + GAP + 2 * BW)) - done + if [ "$swcount" = "0" ]; then + wtp $mx $my $sw $msh $FW + else + # put focused window as master + wtp $mx $my $mwidth $mheight $FW + + # put the rest of the windows in stack + for wid in $(lsw | grep -v $FW); do + wtp $sx $sy $swidth $sheight $wid + # incremental stack Y coordinate. + sy=$((sy + sheight + GAP + 2 * BW)) + done + fi } # widespread @@ -118,3 +125,5 @@ if [ -n "$FW" ]; then ;; esac fi + + diff --git a/wms_value.sh b/wms_value.sh index 9613636..329100d 100755 --- a/wms_value.sh +++ b/wms_value.sh @@ -20,8 +20,6 @@ usage() { cat< /dev/null } -# increase border. (+2 pixels) -border_inc() { - if [ $BW -le 10 ]; then - sed -i "s/^.*\bBW=\b.*$/BW=$((BW + 2))/" $WMSVAR - wms_mainrole.sh $FW - fi -} - -# decrease border. (-2 pixels) -border_dec() { - if [ $BW -ge 4 ]; then - sed -i "s/^.*\bBW=\b.*$/BW=$((BW - 2))/" $WMSVAR - wms_mainrole.sh $FW - fi -} - # increase gaps. (+2 pixels) gap_inc() { if [ $GAP -le 40 ]; then sed -i "s/^.*\bGAP=\b.*$/GAP=$((GAP + 2))/" $WMSVAR + wms_usher.sh -t fi } @@ -67,6 +50,7 @@ gap_inc() { gap_dec() { if [ $GAP -ge 2 ]; then sed -i "s/^.*\bGAP=\b.*$/GAP=$((GAP - 2))/" $WMSVAR + wms_usher.sh -t fi } @@ -74,6 +58,7 @@ gap_dec() { master_inc() { if [ $MP -le 80 ]; then sed -i "s/^.*\bMP=\b.*$/MP=$((MP + 5))/" $WMSVAR + wms_usher.sh -t fi } @@ -81,6 +66,7 @@ master_inc() { master_dec() { if [ $MP -ge 20 ]; then sed -i "s/^.*\bMP=\b.*$/MP=$((MP - 5))/" $WMSVAR + wms_usher.sh -t fi } @@ -88,6 +74,7 @@ master_dec() { windowperc_inc() { if [ $WP -le 90 ]; then sed -i "s/^.*\bWP=\b.*$/WP=$((WP + 5))/" $WMSVAR + wms_usher.sh -w fi } @@ -95,47 +82,33 @@ windowperc_inc() { windowperc_dec() { if [ $WP -ge 60 ]; then sed -i "s/^.*\bWP=\b.*$/WP=$((WP - 5))/" $WMSVAR + wms_usher.sh -w fi } -if [ -n "$FLAG" ]; then - case $FLAG in - -b) - border_dec - ;; - -B) - border_inc - ;; - -d) - default - ;; - -g) - gap_dec - ;; - -G) - gap_inc - ;; - -m) - master_dec - ;; - -M) - master_inc - ;; - -w) - windowperc_dec - ;; - -W) - windowperc_inc - ;; - *) - usage - ;; - esac - -else - exit 0 -fi - - - - +case $FLAG in + -d) + default + ;; + -g) + gap_dec + ;; + -G) + gap_inc + ;; + -m) + master_dec + ;; + -M) + master_inc + ;; + -w) + windowperc_dec + ;; + -W) + windowperc_inc + ;; + *) + usage + ;; +esac diff --git a/wms_var_example b/wms_var_example new file mode 100644 index 0000000..8f1afdc --- /dev/null +++ b/wms_var_example @@ -0,0 +1,46 @@ +# wallpaper # +WALL="$HOME/.wall.png" +BITMAP="$HOME/.bitmap.xbm" + +# gif # +GIF="$HOME/.gif" + +# terminal +TERMINAL="xterm" + +# x editor +XENAME="emacs" +XECMD="emacsclient -c --alternate-editor=""" + +# menu command +XMENU=wms_menu.sh + +# launcher / menu geometry +GEOMETRY=66x11+314+250 + +# border width +BW=2 + +# active color +AC=829AA6 + +# inactive color +IC=4D4D4D + +# background color +BC=101010 + +# font color +FC=A0A0A0 + +# windows percentage +WP=85 + +# tiling master area percentage +MP=60 + +# gaps +GAP=6 + + +