removed the inflated gaps function

This commit is contained in:
#root_informatica 2023-08-03 00:20:54 -03:00
parent 05c7f08dda
commit dd5586b7dd
3 changed files with 10 additions and 35 deletions

View file

@ -7,7 +7,6 @@
FLAG=$1 # flag
FW=$(pfw) # focused window id
RID=$(lsw -r) # root window id
GAP=$(atomx WM_GAP $RID) # gaps value
RW=$(wattr w $RID) # root window width
RH=$(wattr h $RID) # root window heigth
SW=$((RW - 2 * BW - 2 * GAP)) # screen utilizable width

View file

@ -32,20 +32,19 @@ monocule() {
# tiling. Master and stack
tiling() {
gap=$(atomx WM_GAP $RID) # gaps
sw=$((RW - 2 * gap - 2 * BW)) # screen widht width gaps added
msh=$((RH - 2 * gap - 2 * BW)) # master screen height
ssh=$((RH - gap)) # stack screen height ((- BW))?
sw=$((RW - 2 * GAP - 2 * BW)) # screen widht width gaps added
msh=$((RH - 2 * GAP - 2 * BW)) # master screen height
ssh=$((RH - GAP)) # stack screen height ((- BW))?
sw_count=$((CMW - 1)) # stack windows count
m_perc=$(atomx WM_MP $RID) # master area percent
m_width=$((sw * m_perc / 100 - 2 * BW)) # master area width
m_height=$msh # master area height
mx=$gap # master x coordinate
my=$gap # master y coordinate
s_width=$((sw - m_width - gap - 2 * BW)) # stack width
s_height=$((ssh / sw_count - gap - 2 * BW)) # stack height
sx=$((m_width + 2 * gap + 2 * BW)) # stack x coordinate
sy=$gap # stack y coordinate
mx=$GAP # master x coordinate
my=$GAP # master y coordinate
s_width=$((sw - m_width - GAP - 2 * BW)) # stack width
s_height=$((ssh / sw_count - GAP - 2 * BW)) # stack height
sx=$((m_width + 2 * GAP + 2 * BW)) # stack x coordinate
sy=$GAP # stack y coordinate
# put focused window as master
wtp $mx $my $m_width $m_height $FW
@ -53,7 +52,7 @@ tiling() {
# put the rest of the windows in stack
for wid in $(lsw | grep -v $FW); do
wtp $sx $sy $s_width $s_height $wid
sy=$((sy + s_height + gap + 2 * BW)) # incremental stack y coordinate
sy=$((sy + s_height + GAP + 2 * BW)) # incremental stack y coordinate
done
}

View file

@ -44,29 +44,8 @@ windowperc_dec() {
fi
} # 5% - calculation
gap=$(atomx WM_GAP $RID)
gap_inc() {
if [ $gap -le 50 ]; then
atomx WM_GAP=$((gap + 2)) $RID
wms_usher.sh -t
fi
} # 5 + pixels gaps
gap_dec() {
if [ $gap -ge 2 ]; then
atomx WM_GAP=$((gap - 2)) $RID
wms_usher.sh -t
fi
} # 5 - pixels gaps
if [ -n "$FLAG" ]; then
case $FLAG in
-g) # reduce gaps
gap_dec
;;
-G) # increase gaps
gap_inc
;;
-m) # reduce tiling master area
master_dec
;;
@ -88,8 +67,6 @@ 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
atomx WM_GAP=$GAP $RID # set tiling gaps
fi