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
|
||||
|
||||
AMW=$(lsw) # all maped windows
|
||||
|
||||
if [ -n "$AMW" ]; then
|
||||
TARGET=$(\
|
||||
for wid in $(lsw); do # print id, class and name in xmenu
|
||||
printf '%s\n' "$wid | $(atomx WM_CLASS $wid) | $(wname $wid)"
|
||||
|
@ -11,3 +14,5 @@ TARGET=$(\
|
|||
|
||||
sleep .1;
|
||||
wms_mainrole.sh "$TARGET" # focus target
|
||||
|
||||
fi
|
||||
|
|
57
wms_value.sh
57
wms_value.sh
|
@ -4,47 +4,94 @@
|
|||
|
||||
FLAG=$1
|
||||
RID=$(lsw -r) # root window id
|
||||
FW=$(pfw)
|
||||
WMSVAR="/tmp/wms_var"
|
||||
|
||||
usage() {
|
||||
cat<<EOF
|
||||
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) maximize tiling master area
|
||||
-w) minimize window percentage
|
||||
-W) maximize window percentage
|
||||
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() {
|
||||
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
|
||||
fi
|
||||
} # 5% + calculation
|
||||
|
||||
master_dec() {
|
||||
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
|
||||
fi
|
||||
} # 5% - calculation
|
||||
|
||||
windowperc_inc() {
|
||||
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
|
||||
fi
|
||||
} # 5% + calculation
|
||||
|
||||
windowperc_dec() {
|
||||
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
|
||||
fi
|
||||
} # 5% - calculation
|
||||
|
||||
if [ -n "$FLAG" ]; then
|
||||
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
|
||||
master_dec
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue