code changes

This commit is contained in:
rootniformaticaservice 2023-03-07 08:54:01 -03:00
parent aa3cb2e1ce
commit 57f3cc6afe
5 changed files with 102 additions and 10 deletions

65
revalue.sh Executable file
View file

@ -0,0 +1,65 @@
#!/bin/sh
. $HOME/.config/rootwm/rwm_var
FLAG=$1
RID=$(lsw -r) # root window id
usage() {
echo "usage:
rwm_setting.sh [ -m, -M ]
-m) minimize tiling master area
-M) maximize tiling master area"
}
mp=$(atomx WM_MP $RID) # tiling master area percent from atom
master_inc() {
atomx WM_MP=$((mp + 5)) $RID
rwm_arrangement.sh -t
} # increase master area percent
master_dec() {
atomx WM_MP=$((mp - 5)) $RID
rwm_arrangement.sh -t
} # decrease master area percent
wp=$(atomx WM_WP $RID) # windows percent size from atom
windowperc_inc() {
atomx WM_WP=$((wp + 5)) $RID
rwm_arrangement.sh -w
} # increase windows percent size
windowperc_dec() {
atomx WM_WP=$((wp -5)) $RID
rwm_arrangement.sh -w
} # decrease windows percent size
if [ -n "$FLAG" ]; then
case $FLAG in
-m) # minimize tiling master area
master_dec
;;
-M) # maximize tiling master area
master_inc
;;
-w) # minimize window size
windowperc_dec
;;
-W) # maximize window size
windowperc_inc
;;
*)
usage
;;
esac
else
atomx WM_NAME=$NAME $RID
atomx WM_WP=$WP $RID
atomx WM_MP=$MP $RID
fi

8
rootwm.ascii Normal file
View file

@ -0,0 +1,8 @@
━━━━━━━━━━━━┏┓━━━━━━━━━━━
━━━━━━━━━━━┏┛┗┓━━━━━━━━━━
┏━┓┏━━┓┏━━┓┗┓┏┛┏┓┏┓┏┓┏┓┏┓
┃┏┛┃┏┓┃┃┏┓┃━┃┃━┃┗┛┗┛┃┃┗┛┃
┃┃━┃┗┛┃┃┗┛┃━┃┗┓┗┓┏┓┏┛┃┃┃┃
┗┛━┗━━┛┗━━┛━┗━┛━┗┛┗┛━┗┻┻┛
━━━━━━━━━━━━━━━━━━━━━━━━━
━━━━━━━━━━━━━━━━━━━━━━━━━

View file

@ -44,8 +44,9 @@ if [ -n "$FW" ]; then
done
;;
-w) # widespread
ww=$((SW * WP / 100)) # windows width
wh=$((SH * WP / 100)) # windows height
wp=$(atomx WM_WP $RID)
ww=$((SW * wp / 100)) # windows width
wh=$((SH * wp / 100)) # windows height
x=$(((RW - ww) / (CMW*2))) # initial X coordinate
y=$(((RH - wh) / (CMW*2))) # initial Y coordinate
xmax=$(((RW - ww) / CMW)) # function X value

View file

@ -12,16 +12,27 @@ rwm_setting.sh [ -m, -M ]
-M) maximize tiling master area"
}
mp=$(atomx WM_MP $RID)
master_in() {
mp=$(atomx WM_MP $RID) # tiling master area percent from atom
master_inc() {
atomx WM_MP=$((mp + 5)) $RID
rwm_layout.sh -t
}
rwm_arrangement.sh -t
} # increase master area percent
master_dec() {
atomx WM_MP=$((mp - 5)) $RID
rwm_layout.sh -t
}
rwm_arrangement.sh -t
} # decrease master area percent
wp=$(atomx WM_WP $RID) # windows percent size from atom
windowperc_inc() {
atomx WM_WP=$((wp + 5)) $RID
rwm_arrangement.sh -w
} # increase windows percent size
windowperc_dec() {
atomx WM_WP=$((wp -5)) $RID
rwm_arrangement.sh -w
} # decrease windows percent size
if [ -n "$FLAG" ]; then
case $FLAG in
@ -29,7 +40,13 @@ if [ -n "$FLAG" ]; then
master_dec
;;
-M) # maximize tiling master area
master_in
master_inc
;;
-w) # minimize window size
windowperc_dec
;;
-W) # maximize window size
windowperc_inc
;;
*)
usage
@ -38,6 +55,7 @@ if [ -n "$FLAG" ]; then
else
atomx WM_NAME=$NAME $RID
atomx WM_WP=$WP $RID
atomx WM_MP=$MP $RID
fi

View file

@ -9,5 +9,5 @@ TARGET=$(
printf '%s\n' "$wid $(atomx WM_CLASS $wid)"
done | grep "$TNAME" | cut -d ' ' -f 1 | head -n 1)
rwm_starship.sh $TARGET # focus terminal
rwm_mainrole.sh $TARGET # focus terminal