code changes
This commit is contained in:
parent
aa3cb2e1ce
commit
57f3cc6afe
5 changed files with 102 additions and 10 deletions
65
revalue.sh
Executable file
65
revalue.sh
Executable 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
8
rootwm.ascii
Normal file
|
@ -0,0 +1,8 @@
|
|||
━━━━━━━━━━━━┏┓━━━━━━━━━━━
|
||||
━━━━━━━━━━━┏┛┗┓━━━━━━━━━━
|
||||
┏━┓┏━━┓┏━━┓┗┓┏┛┏┓┏┓┏┓┏┓┏┓
|
||||
┃┏┛┃┏┓┃┃┏┓┃━┃┃━┃┗┛┗┛┃┃┗┛┃
|
||||
┃┃━┃┗┛┃┃┗┛┃━┃┗┓┗┓┏┓┏┛┃┃┃┃
|
||||
┗┛━┗━━┛┗━━┛━┗━┛━┗┛┗┛━┗┻┻┛
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
@ -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
|
||||
|
|
|
@ -12,24 +12,41 @@ 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
|
||||
-m) # minimize tiling master area
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue