Bugs fixed.
This commit is contained in:
parent
dd6cf96ce2
commit
380c159f15
2 changed files with 61 additions and 9 deletions
|
@ -4,6 +4,9 @@
|
||||||
|
|
||||||
. /tmp/wms_var
|
. /tmp/wms_var
|
||||||
|
|
||||||
|
AMW=$(lsw) # all maped windows
|
||||||
|
|
||||||
|
if [ -n "$AMW" ]; then
|
||||||
TARGET=$(\
|
TARGET=$(\
|
||||||
for wid in $(lsw); do # print id, class and name in xmenu
|
for wid in $(lsw); do # print id, class and name in xmenu
|
||||||
printf '%s\n' "$wid | $(atomx WM_CLASS $wid) | $(wname $wid)"
|
printf '%s\n' "$wid | $(atomx WM_CLASS $wid) | $(wname $wid)"
|
||||||
|
@ -11,3 +14,5 @@ TARGET=$(\
|
||||||
|
|
||||||
sleep .1;
|
sleep .1;
|
||||||
wms_mainrole.sh "$TARGET" # focus target
|
wms_mainrole.sh "$TARGET" # focus target
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
57
wms_value.sh
57
wms_value.sh
|
@ -4,47 +4,94 @@
|
||||||
|
|
||||||
FLAG=$1
|
FLAG=$1
|
||||||
RID=$(lsw -r) # root window id
|
RID=$(lsw -r) # root window id
|
||||||
|
FW=$(pfw)
|
||||||
WMSVAR="/tmp/wms_var"
|
WMSVAR="/tmp/wms_var"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat<<EOF
|
cat<<EOF
|
||||||
usage:
|
usage:
|
||||||
wms_revalue.sh [ -m, -M ]
|
wms_revalue.sh [ -b, -B, -g, -G, -m, -M, -w, -W]
|
||||||
|
-b) minimize borderwidth
|
||||||
|
-B) maximize borderwidth
|
||||||
|
-g) minimize gaps
|
||||||
|
-G) maximize gaps
|
||||||
-m) minimize tiling master area
|
-m) minimize tiling master area
|
||||||
-M) maximize tiling master area
|
-M) maximize tiling master area
|
||||||
|
-w) minimize window percentage
|
||||||
|
-W) maximize window percentage
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
border_inc() {
|
||||||
|
if [ $BW -le 10 ]; then
|
||||||
|
sed -i "s/^.*\bBW=\b.*$/BW=$((BW + 2))/" $WMSVAR
|
||||||
|
wms_mainrole.sh $FW
|
||||||
|
fi
|
||||||
|
} # +2 pixel calculation
|
||||||
|
|
||||||
|
border_dec() {
|
||||||
|
if [ $BW -ge 4 ]; then
|
||||||
|
sed -i "s/^.*\bBW=\b.*$/BW=$((BW - 2))/" $WMSVAR
|
||||||
|
wms_mainrole.sh $FW
|
||||||
|
fi
|
||||||
|
} # -2 pixel calculation
|
||||||
|
|
||||||
|
gap_inc() {
|
||||||
|
if [ $GAP -le 40 ]; then
|
||||||
|
sed -i "s/^.*\bGAP=\b.*$/GAP=$((GAP + 2))/" $WMSVAR
|
||||||
|
wms_usher.sh -t
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
gap_dec() {
|
||||||
|
if [ $GAP -ge 2 ]; then
|
||||||
|
sed -i "s/^.*\bGAP=\b.*$/GAP=$((GAP - 2))/" $WMSVAR
|
||||||
|
wms_usher.sh -t
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
master_inc() {
|
master_inc() {
|
||||||
if [ $MP -le 80 ]; then
|
if [ $MP -le 80 ]; then
|
||||||
sed -i "s/^.*\bMP=\b.*$/MP=$((mp + 5))/" $WMSVAR
|
sed -i "s/^.*\bMP=\b.*$/MP=$((MP + 5))/" $WMSVAR
|
||||||
wms_usher.sh -t
|
wms_usher.sh -t
|
||||||
fi
|
fi
|
||||||
} # 5% + calculation
|
} # 5% + calculation
|
||||||
|
|
||||||
master_dec() {
|
master_dec() {
|
||||||
if [ $MP -ge 20 ]; then
|
if [ $MP -ge 20 ]; then
|
||||||
sed -i "s/^.*\bMP=\b.*$/MP=$((mp - 5))/" $WMSVAR
|
sed -i "s/^.*\bMP=\b.*$/MP=$((MP - 5))/" $WMSVAR
|
||||||
wms_usher.sh -t
|
wms_usher.sh -t
|
||||||
fi
|
fi
|
||||||
} # 5% - calculation
|
} # 5% - calculation
|
||||||
|
|
||||||
windowperc_inc() {
|
windowperc_inc() {
|
||||||
if [ $WP -le 90 ]; then
|
if [ $WP -le 90 ]; then
|
||||||
sed -i "s/^.*\bWP=\b.*$/WP=$((wp + 5))/" $WMSVAR
|
sed -i "s/^.*\bWP=\b.*$/WP=$((WP + 5))/" $WMSVAR
|
||||||
wms_usher.sh -w
|
wms_usher.sh -w
|
||||||
fi
|
fi
|
||||||
} # 5% + calculation
|
} # 5% + calculation
|
||||||
|
|
||||||
windowperc_dec() {
|
windowperc_dec() {
|
||||||
if [ $WP -ge 60 ]; then
|
if [ $WP -ge 60 ]; then
|
||||||
sed -i "s/^.*\bWP=\b.*$/WP=$((wp + 5))/" $WMSVAR
|
sed -i "s/^.*\bWP=\b.*$/WP=$((WP - 5))/" $WMSVAR
|
||||||
wms_usher.sh -w
|
wms_usher.sh -w
|
||||||
fi
|
fi
|
||||||
} # 5% - calculation
|
} # 5% - calculation
|
||||||
|
|
||||||
if [ -n "$FLAG" ]; then
|
if [ -n "$FLAG" ]; then
|
||||||
case $FLAG in
|
case $FLAG in
|
||||||
|
-b) # decrease border width
|
||||||
|
border_dec
|
||||||
|
;;
|
||||||
|
-B) # increase border width
|
||||||
|
border_inc
|
||||||
|
;;
|
||||||
|
-g) # decrease gaps
|
||||||
|
gap_dec
|
||||||
|
;;
|
||||||
|
-G) # increase gaps
|
||||||
|
gap_inc
|
||||||
|
;;
|
||||||
-m) # reduce tiling master area
|
-m) # reduce tiling master area
|
||||||
master_dec
|
master_dec
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue