From 583f0a44fcf38c350b7a45becedfa5103802f473 Mon Sep 17 00:00:00 2001 From: rootniformaticaservice Date: Sun, 19 Mar 2023 22:46:41 -0300 Subject: [PATCH] new sensible name --- config/names | 30 ++++++++++ config/sxhkdrc_example | 58 +++++++++----------- config/wms_var | 12 ++++ rwm.sh => wms.sh | 4 +- rwm_backgroundize.sh => wms_backgroundize.sh | 4 +- rwm_clearer.sh => wms_clearer.sh | 2 +- rwm_mainrole.sh => wms_mainrole.sh | 4 +- rwm_moveresize.sh => wms_moveresize.sh | 4 +- rwm_revalue.sh => wms_revalue.sh | 16 +++--- rwm_screensaver.sh => wms_screensaver.sh | 4 +- rwm_session.sh => wms_session.sh | 2 +- rwm_shepperd.sh => wms_shepperd.sh | 6 +- rwm_switcher.sh => wms_switcher.sh | 5 +- rwm_termrename.sh => wms_termrename.sh | 4 +- rwm_termtogle.sh => wms_termtogle.sh | 4 +- rwm_layout.sh => wms_usher.sh | 4 +- rwm_voyeur.sh => wms_voyeur.sh | 4 +- 17 files changed, 103 insertions(+), 64 deletions(-) create mode 100644 config/names create mode 100644 config/wms_var rename rwm.sh => wms.sh (64%) rename rwm_backgroundize.sh => wms_backgroundize.sh (94%) rename rwm_clearer.sh => wms_clearer.sh (93%) rename rwm_mainrole.sh => wms_mainrole.sh (93%) rename rwm_moveresize.sh => wms_moveresize.sh (96%) rename rwm_revalue.sh => wms_revalue.sh (88%) rename rwm_screensaver.sh => wms_screensaver.sh (91%) rename rwm_session.sh => wms_session.sh (96%) rename rwm_shepperd.sh => wms_shepperd.sh (91%) rename rwm_switcher.sh => wms_switcher.sh (74%) rename rwm_termrename.sh => wms_termrename.sh (77%) rename rwm_termtogle.sh => wms_termtogle.sh (80%) rename rwm_layout.sh => wms_usher.sh (97%) rename rwm_voyeur.sh => wms_voyeur.sh (82%) diff --git a/config/names b/config/names new file mode 100644 index 0000000..1566df6 --- /dev/null +++ b/config/names @@ -0,0 +1,30 @@ +arigram +audio +chat +code +config +demo +edit +emacs +files +game +group-1 +group-2 +group-3 +group-4 +mail +matrix +movie +music +paint +photo +read +reddit +script +study +system +text +tox +typing +video +web diff --git a/config/sxhkdrc_example b/config/sxhkdrc_example index 86a005c..7d33e16 100755 --- a/config/sxhkdrc_example +++ b/config/sxhkdrc_example @@ -4,7 +4,7 @@ # session and reload sxhkd conf## super + shift + e - rwm_session.sh + wms_session.sh ####### ########## 1 to 9 ################################## @@ -19,8 +19,8 @@ super + 1 rt_status.sh # browser ## -super + 2 - xlinks.sh +super + {_,shift +}2 + {xbrowser.sh -d,xbrowser.sh -t} # musicplayer ## super + 3 @@ -56,11 +56,11 @@ super + Return # rename terminal ## super + r - rwm_termrename.sh + wms_termrename.sh # togle terminal super + Tab - rwm_termtogle.sh + wms_termtogle.sh ####### ########## launcher ################################## @@ -120,19 +120,19 @@ super + BackSpace # zzz ## super + {_,shift + }z - {windowsaver.sh,rwm_screensaver.sh} + {windowsaver.sh,wms_screensaver.sh} ####### ######### manage windows ######################################## ############################ # clear desktop # -super + {_,shift +}c - rwm_clearer.sh {-c,-u} +super + c + wms_clearer.sh ## backgroundize ## super + {_,shift +}b - rwm_backgroundize.sh {-b,-r} + wms_backgroundize.sh {-b,-r} # kill ## super + {_,shift +}q @@ -140,61 +140,57 @@ super + {_,shift +}q # switch focus ## super + space - rwm_switcher.sh + wms_switcher.sh # focus next/prev ## super + {n,p} - rwm_mainrole.sh {-n,-p} + wms_mainrole.sh {-n,-p} # move ## super + {l,h,j,k} - rwm_moveresize.sh {-r,-l,-d,-u} + wms_moveresize.sh {-r,-l,-d,-u} # resize ## super + shift + {l,h,j,k} - rwm_moveresize.sh {-W,-w,-H,-h} + wms_moveresize.sh {-W,-w,-H,-h} # warp ## super + {Up,Down,Right,Left} - rwm_moveresize.sh {-n,-s,-e,-o} + wms_moveresize.sh {-n,-s,-e,-o} # fullsize ## super + f - rwm_moveresize.sh -f + wms_moveresize.sh -f ###### ######### layouts ######################################## ################### -## monocule layout ## -super + m - rwm_layout.sh -m +## monocule / tilling / widespread ## +super + {m,t,w} + wms_usher.sh {-m,-t,-w} -# tilling layout ## -super + t - rwm_layout.sh -t - -# widespread layout ## -super + w - rwm_layout.sh -w - -# maximize window percentage and master area +# maximize / minimize window percentage and master area super + {_,shift +}{minus,plus} - rwm_revalue.sh {-w,-m,-W,-M} + wms_revalue.sh {-w,-m,-W,-M} +# maximize / minimize gaps ## +super + {dead_acute,ccedilla} + wms_revalue.sh {-g,-G} + ####### ########## shepperd ###################### ################### # add focused window / all windows to group ## super + {_,shift + }a - rwm_shepperd.sh {-a,-A} + wms_shepperd.sh {-a,-A} # delete focused window / all windows from group ## super + {_,shift +}d - rwm_shepperd.sh {-d,-D} + wms_shepperd.sh {-d,-D} # map / unmap groups ## super + s - rwm_shepperd.sh -t + wms_shepperd.sh -t diff --git a/config/wms_var b/config/wms_var new file mode 100644 index 0000000..829d92c --- /dev/null +++ b/config/wms_var @@ -0,0 +1,12 @@ +NAME=rootwm # wm name +TERMINAL=xterm # terminal command +XMENU=fzfmenu.sh # menu command +XMENU_XL=fzfmenu_xl.sh # large menu command +XMENU_G=60x10+300+300 # menu geometry +XMENU_XL_G=80x20+180+180 # large menu geometry +BW=2 # border width +FG=A2A6A6 +BG=393D41 +WP=80 # windows percentage +MP=60 # tiling master area percentage +GAP=6 # tiling gaps diff --git a/rwm.sh b/wms.sh similarity index 64% rename from rwm.sh rename to wms.sh index a6e9c1d..38d8558 100755 --- a/rwm.sh +++ b/wms.sh @@ -1,6 +1,6 @@ #!/bin/sh -rwm_revalue.sh & +wms_revalue.sh & xrdb -merge .Xresources & @@ -8,4 +8,4 @@ sxhkd & wallpaper.sh & -exec rwm_voyeur.sh +exec wms_voyeur.sh diff --git a/rwm_backgroundize.sh b/wms_backgroundize.sh similarity index 94% rename from rwm_backgroundize.sh rename to wms_backgroundize.sh index 4dd8c1b..8b4b258 100755 --- a/rwm_backgroundize.sh +++ b/wms_backgroundize.sh @@ -2,7 +2,7 @@ ## send windows to desktop background ## -. $HOME/.config/rootwm/rwm_var +. $HOME/.config/wms/wms_var FLAG=$1 FW=$(pfw) # focused window @@ -14,7 +14,7 @@ SH=$((RH - 2*BW)) # usable screen height usage() { echo "usage: -nowm_ignore.sh [ -b, -r ] +wms_backgroundize.sh [ -b, -r ] -b) backgroundize focused window -r) open menu and choose the window/s to restore" } diff --git a/rwm_clearer.sh b/wms_clearer.sh similarity index 93% rename from rwm_clearer.sh rename to wms_clearer.sh index fe99e53..ecde1e3 100755 --- a/rwm_clearer.sh +++ b/wms_clearer.sh @@ -2,7 +2,7 @@ ## clean screen ## -. $HOME/.config/rootwm/rwm_var +. $HOME/.config/wms/wms_var FLAG=$1 FW=$(pfw) # focused window diff --git a/rwm_mainrole.sh b/wms_mainrole.sh similarity index 93% rename from rwm_mainrole.sh rename to wms_mainrole.sh index 5d52588..1eb828d 100755 --- a/rwm_mainrole.sh +++ b/wms_mainrole.sh @@ -2,14 +2,14 @@ ## give windows the stardom ## -. $HOME/.config/rootwm/rwm_var +. $HOME/.config/wms/wms_var FLAG=$1 FW=$(pfw) usage() { echo "usage: -rwm_starship.sh [ -n, -p, -l, wid ] +wms_mainrole.sh [ -n, -p, -l, wid ] -n) next in order stack -p) prev in order stack -t) focus the top window in the server’s window stack diff --git a/rwm_moveresize.sh b/wms_moveresize.sh similarity index 96% rename from rwm_moveresize.sh rename to wms_moveresize.sh index 83e4ddb..cb2a800 100755 --- a/rwm_moveresize.sh +++ b/wms_moveresize.sh @@ -2,7 +2,7 @@ ## move and resize windows ## -. $HOME/.config/rootwm/rwm_var +. $HOME/.config/wms/wms_var FLAG=$1 # flag FW=$(pfw) # focused window id @@ -15,7 +15,7 @@ SH=$((RH - 2 * BW - 2 * GAP)) # screen utilizable height usage() { echo "usage: -rwm_moveresize.sh [ -n, -s, -e, -o, -r, -l, -d, -u, -w, -W, -h, -H ] +wms_moveresize.sh [ -n, -s, -e, -o, -r, -l, -d, -u, -w, -W, -h, -H ] -f) fullsize -n) half north -s) half south diff --git a/rwm_revalue.sh b/wms_revalue.sh similarity index 88% rename from rwm_revalue.sh rename to wms_revalue.sh index e8fa2ba..13789a4 100755 --- a/rwm_revalue.sh +++ b/wms_revalue.sh @@ -1,13 +1,13 @@ #!/bin/sh -. $HOME/.config/rootwm/rwm_var +. $HOME/.config/wms/wms_var FLAG=$1 RID=$(lsw -r) # root window id usage() { echo "usage: -rwm_setting.sh [ -m, -M ] +wms_revalue.sh [ -m, -M ] -m) minimize tiling master area -M) maximize tiling master area" } @@ -15,34 +15,34 @@ rwm_setting.sh [ -m, -M ] mp=$(atomx WM_MP $RID) # tiling master area percent from atom master_inc() { atomx WM_MP=$((mp + 5)) $RID - rwm_layout.sh -t + wms_usher.sh -t } # 5% + calculation master_dec() { atomx WM_MP=$((mp - 5)) $RID - rwm_layout.sh -t + wms_usher.sh -t } # 5% - calculation wp=$(atomx WM_WP $RID) # windows percent size from atom windowperc_inc() { atomx WM_WP=$((wp + 5)) $RID - rwm_layout.sh -w + wms_usher.sh -w } # 5% + calculation windowperc_dec() { atomx WM_WP=$((wp -5)) $RID - rwm_layout.sh -w + wms_usher.sh -w } # 5% - calculation gap=$(atomx WM_GAP $RID) gap_inc() { atomx WM_GAP=$((gap + 2)) $RID - rwm_layout.sh -t + wms_usher.sh -t } # 5 + pixels gaps gap_dec() { atomx WM_GAP=$((gap - 2)) $RID - rwm_layout.sh -t + wms_usher.sh -t } # 5 - pixels gaps if [ -n "$FLAG" ]; then diff --git a/rwm_screensaver.sh b/wms_screensaver.sh similarity index 91% rename from rwm_screensaver.sh rename to wms_screensaver.sh index d8b40e6..01ec463 100755 --- a/rwm_screensaver.sh +++ b/wms_screensaver.sh @@ -9,14 +9,14 @@ FW=$(pfw) # focused window SW=$(wattr w $(lsw -r)) # screen width SH=$(wattr h $(lsw -r)) # screen height WW=$((SW * 40 / 100)) # windows width = 80% of the screen -WH=$((SH * 40 / 100)) # windows height = 80% of the screen +WH=$((SH * 40 / 100)) # windows height = 80% of the screen MAXX=$((SW - WW)) # max X coordinate MAXY=$((SH - WH)) # max Y coordinate FREQ=20 # refresh frequency usage() { echo "usage: -wrm.sh [ -a, -f ] +wms_screensaver.sh [ -a, -f ] -a) all windows -f) focused window" } diff --git a/rwm_session.sh b/wms_session.sh similarity index 96% rename from rwm_session.sh rename to wms_session.sh index 06a07dc..c9e4d49 100755 --- a/rwm_session.sh +++ b/wms_session.sh @@ -2,7 +2,7 @@ ## manage session and some more things ## -. $HOME/.config/rootwm/rwm_var +. $HOME/.config/wms/wms_var KBRELOAD="pkill -usr1 -x sxhkd" # keybindings reload LOCK="slock" # lock screen monitor diff --git a/rwm_shepperd.sh b/wms_shepperd.sh similarity index 91% rename from rwm_shepperd.sh rename to wms_shepperd.sh index a6d1c90..1c1e6b5 100755 --- a/rwm_shepperd.sh +++ b/wms_shepperd.sh @@ -2,16 +2,16 @@ ## sort windows by herds/flock ## -. $HOME/.config/rootwm/rwm_var +. $HOME/.config/wms/wms_var -NAMES="$HOME/.config/rootwm/names" # disponible names +NAMES="$HOME/.config/wms/wms_names" # disponible names FLAG=$1 # input FW=$(pfw) # focused window id AMW=$(lsw) # all maped windows usage() { echo "usage: -rwm_shepperd.sh [ -a, -r, -t ] +wms_shepperd.sh [ -a, -r, -t ] -a) add -A) add all -d) delete diff --git a/rwm_switcher.sh b/wms_switcher.sh similarity index 74% rename from rwm_switcher.sh rename to wms_switcher.sh index 6c0deab..a16c870 100755 --- a/rwm_switcher.sh +++ b/wms_switcher.sh @@ -2,11 +2,12 @@ ## switch between windows ## -. $HOME/.config/rootwm/rwm_var +. $HOME/.config/wms/wms_var TARGET=$(\ for wid in $(lsw); do # print id, class and name in xmenu printf '%s\n' "$wid | $(atomx WM_CLASS $wid) | $(wname $wid)" done | cut -c 1-100 | $XMENU | cut -d '|' -f 1) -rwm_mainrole.sh "$TARGET" # focus target +sleep 1; +wms_mainrole.sh "$TARGET" # focus target diff --git a/rwm_termrename.sh b/wms_termrename.sh similarity index 77% rename from rwm_termrename.sh rename to wms_termrename.sh index dd2e68c..76dd497 100755 --- a/rwm_termrename.sh +++ b/wms_termrename.sh @@ -2,10 +2,10 @@ ## rename terminals ## -. $HOME/.config/rootwm/rwm_var +. $HOME/.config/wms/wms_var TARGET=$(pfw) # focused window -NAMES="$HOME/.config/rootwm/names" +NAMES="$HOME/.config/wms/wms_names" if [ "$(atomx WM_CLASS $TARGET)" = "$TERMINAL" ]; then # if any terminal is focused atomx WM_NAME="$($XMENU < $NAMES)" $TARGET # change atom name diff --git a/rwm_termtogle.sh b/wms_termtogle.sh similarity index 80% rename from rwm_termtogle.sh rename to wms_termtogle.sh index f84c7c4..430499a 100755 --- a/rwm_termtogle.sh +++ b/wms_termtogle.sh @@ -2,7 +2,7 @@ ## toggle between terminals ## -. $HOME/.config/rootwm/rwm_var +. $HOME/.config/wms/wms_var TNAME=$(echo $TERMINAL | cut -d ' ' -f 1) # terminal name @@ -11,5 +11,5 @@ TARGET=$( printf '%s\n' "$wid $(atomx WM_CLASS $wid)" done | grep "$TNAME" | cut -d ' ' -f 1 | head -n 1) -rwm_mainrole.sh $TARGET # focus terminal +wms_mainrole.sh $TARGET # focus terminal diff --git a/rwm_layout.sh b/wms_usher.sh similarity index 97% rename from rwm_layout.sh rename to wms_usher.sh index fc122a2..facb857 100755 --- a/rwm_layout.sh +++ b/wms_usher.sh @@ -2,7 +2,7 @@ ## some layouts to order the windows ## -. $HOME/.config/rootwm/rwm_var +. $HOME/.config/wms/wms_var FLAG=$1 # input RID=$(lsw -r) # root window id @@ -15,7 +15,7 @@ SH=$((RH - 2 * BW)) # usable screen height usage() { echo "usage: -rwm_layout.sh [ -m, -t, -w ] +wms_usher.sh [ -m, -t, -w ] -m) monucule -t) tiled -w) widespread" diff --git a/rwm_voyeur.sh b/wms_voyeur.sh similarity index 82% rename from rwm_voyeur.sh rename to wms_voyeur.sh index 151a8de..3a258d0 100755 --- a/rwm_voyeur.sh +++ b/wms_voyeur.sh @@ -5,11 +5,11 @@ wew | while read ev wid args; do case $ev in MAP) # focus on mappng requests - wattr o $wid || rwm_mainrole.sh -t + wattr o $wid || wms_mainrole.sh -t ;; UNMAP) # focus the top window in the server’s window stack if [ ! "$(pfw)" ]; then - rwm_mainrole.sh -t + wms_mainrole.sh -t fi ;; esac