65 lines
1.2 KiB
Bash
Executable file
65 lines
1.2 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
. $HOME/.config/rootwm/rwm_var
|
|
|
|
FLAG=$1
|
|
RID=$(lsw -r) # root window id
|
|
|
|
usage() {
|
|
echo "usage:
|
|
rwm_setting.sh [ -m, -M ]
|
|
-m) minimize tiling master area
|
|
-M) maximize tiling master area"
|
|
}
|
|
|
|
mp=$(atomx WM_MP $RID) # tiling master area percent from atom
|
|
master_inc() {
|
|
atomx WM_MP=$((mp + 5)) $RID
|
|
rwm_arrangement.sh -t
|
|
} # 5% + calculation
|
|
|
|
master_dec() {
|
|
atomx WM_MP=$((mp - 5)) $RID
|
|
rwm_arrangement.sh -t
|
|
} # 5% - calculation
|
|
|
|
wp=$(atomx WM_WP $RID) # windows percent size from atom
|
|
windowperc_inc() {
|
|
atomx WM_WP=$((wp + 5)) $RID
|
|
rwm_arrangement.sh -w
|
|
} # 5% + calculation
|
|
|
|
windowperc_dec() {
|
|
atomx WM_WP=$((wp -5)) $RID
|
|
rwm_arrangement.sh -w
|
|
} # 5% - calculation
|
|
|
|
if [ -n "$FLAG" ]; then
|
|
case $FLAG in
|
|
-m) # reduce tiling master area
|
|
master_dec
|
|
;;
|
|
-M) # increase tiling master area
|
|
master_inc
|
|
;;
|
|
-w) # reduce window size
|
|
windowperc_dec
|
|
;;
|
|
-W) # increase window size
|
|
windowperc_inc
|
|
;;
|
|
*)
|
|
usage
|
|
;;
|
|
esac
|
|
|
|
else
|
|
atomx WM_NAME=$NAME $RID # set root window name
|
|
atomx WM_WP=$WP $RID # set window percent atom
|
|
atomx WM_MP=$MP $RID # set tiling master area percent atom
|
|
|
|
fi
|
|
|
|
|
|
|
|
|