Litle changes.

This commit is contained in:
root_sti 2023-08-06 23:23:00 -03:00
parent e24d315a6c
commit 8e8b0922df
3 changed files with 18 additions and 18 deletions

View file

@ -11,8 +11,8 @@ RID=$(lsw -r) # root widnow id
BID=$(lsw -o) # bachground window id
RW=$(wattr w $RID) # root width
RH=$(wattr h $RID) # root height
SW=$((RW - 2*BW)) # usable screen width
SH=$((RH - 2*BW)) # usable screen height
SW=$((RW - 2 * BW)) # usable screen width
SH=$((RH - 2 * BW)) # usable screen height
# send windows to background
background() {

View file

@ -4,10 +4,10 @@
. $HOME/.config/wms/wms_var
NAMES="$HOME/.config/wms/wms_names" # disponible names
FLAG=$1 # input
FW=$(pfw) # focused window id
AMW=$(lsw) # all maped windows
NAMES="$HOME/.config/wms/wms_names"
usage() {
cat<<EOF
@ -24,7 +24,7 @@ EOF
# create atom in focused window
add_focused() {
name="$($XMENU < $NAMES)"
if [ -n "$name " ]; then
if [ -n "$name" ]; then
atomx WM_HERD="$name $FW" $FW
else
exit 0

View file

@ -35,24 +35,24 @@ tiling() {
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
swcount=$((CMW - 1)) # stack windows count
mperc=$(atomx WM_MP $RID) # master area percent
mwidth=$((sw * mperc / 100 - 2 * BW)) # master area width
mheight=$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
swidth=$((sw - mwidth - GAP - 2 * BW)) # stack width
sheight=$((ssh / swcount - GAP - 2 * BW)) # stack height
sx=$((mwidth + 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
wtp $mx $my $mwidth $mheight $FW
# 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
wtp $sx $sy $swidth $sheight $wid
sy=$((sy + sheight + GAP + 2 * BW)) # incremental stack y coordinate
done
}
@ -63,14 +63,14 @@ widespread() {
wh=$((SH * wp / 100)) # windows height
x=$(((RW - ww) / (CMW * 2))) # initial X coordinate
y=$(((RH - wh) / (CMW * 2))) # initial Y coordinate
x_max=$(((RW - ww) / CMW)) # function X value
y_max=$(((RH - wh) / CMW)) # function Y value
xmax=$(((RW - ww) / CMW)) # function X value
ymax=$(((RH - wh) / CMW)) # function Y value
# put windows in cascade
for wid in $(lsw); do
wtp $x $y $ww $wh $wid
x=$((x + x_max)) # incremental X value
y=$((y + y_max)) # incremental Y value
x=$((x + xmax)) # incremental X value
y=$((y + ymax)) # incremental Y value
done
}