Centered option added.

This commit is contained in:
#root_informatica 2024-02-27 16:02:12 -03:00
parent 425172301c
commit 22ee8a583a
1 changed files with 19 additions and 4 deletions

View File

@ -22,7 +22,8 @@ SH=$((RH - 2 * BW))
usage() {
cat<<EOF
usage:
wms_usher.sh [ -n, -s, -e, -o, -r, -l, -d, -u, -w, -W, -h, -H ]
wms_usher.sh [ -c, -f, -n, -s, -e, -o, -r, -l, -d, -u, -w, -W, -h, -H ]
-c) centered
-f) fullsize
-n) half north
-s) half south
@ -52,14 +53,14 @@ south() {
x=0
y=$((SH / 2 + BW))
w=$SW
h=$((SH / 2))
h=$((SH / 2 - BW))
}
# half est value
est() {
x=$((SW / 2 + BW))
y=0
w=$((SW / 2))
w=$((SW / 2 - BW))
h=$SH
}
@ -71,7 +72,18 @@ west() {
h=$SH
}
# fulsize function
# centered function.
center() {
# windows width.
ww=$((SW * WP / 100))
# windows height.
wh=$((SH * WP / 100))
x=$(((SW - ww) / 2))
y=$(((SH - wh) / 2))
wtp $x $y $ww $wh $FW
}
# fulsize function
fullsize() {
# original size and position.
osp=$(atomx WM_FS $FW)
@ -98,6 +110,9 @@ fullsize() {
}
case $FLAG in
-c)
center
;;
-f)
fullsize
;;