71 lines
1.1 KiB
Bash
Executable file
71 lines
1.1 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
. /tmp/wms_var
|
|
|
|
FLAG=$1
|
|
RID=$(lsw -r) # root window id
|
|
WMSVAR="/tmp/wms_var"
|
|
|
|
usage() {
|
|
cat<<EOF
|
|
usage:
|
|
wms_revalue.sh [ -m, -M ]
|
|
-m) minimize tiling master area
|
|
-M) maximize tiling master area
|
|
EOF
|
|
}
|
|
|
|
master_inc() {
|
|
if [ $MP -le 80 ]; then
|
|
sed -i "s/^.*\bMP=\b.*$/MP=$((mp + 5))/" $WMSVAR
|
|
wms_usher.sh -t
|
|
fi
|
|
} # 5% + calculation
|
|
|
|
master_dec() {
|
|
if [ $MP -ge 20 ]; then
|
|
sed -i "s/^.*\bMP=\b.*$/MP=$((mp - 5))/" $WMSVAR
|
|
wms_usher.sh -t
|
|
fi
|
|
} # 5% - calculation
|
|
|
|
windowperc_inc() {
|
|
if [ $WP -le 90 ]; then
|
|
sed -i "s/^.*\bWP=\b.*$/WP=$((wp + 5))/" $WMSVAR
|
|
wms_usher.sh -w
|
|
fi
|
|
} # 5% + calculation
|
|
|
|
windowperc_dec() {
|
|
if [ $WP -ge 60 ]; then
|
|
sed -i "s/^.*\bWP=\b.*$/WP=$((wp + 5))/" $WMSVAR
|
|
wms_usher.sh -w
|
|
fi
|
|
} # 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
|
|
exit 0
|
|
fi
|
|
|
|
|
|
|
|
|