litle changes.
This commit is contained in:
parent
b23101fa67
commit
41121c4a24
3 changed files with 99 additions and 71 deletions
31
wms_usher.sh
31
wms_usher.sh
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/bin/sh
|
||||
|
||||
## some layouts to order the windows ##
|
||||
|
@ -59,21 +58,29 @@ tiling() {
|
|||
# stack width.
|
||||
swidth=$((sw - mwidth - GAP - 2 * BW))
|
||||
# stack height.
|
||||
sheight=$((ssh / swcount - GAP - 2 * BW))
|
||||
|
||||
# if swcount in 0 or not.
|
||||
[ "$swcount" = "0" ] && sheight=ssh \
|
||||
|| sheight=$((ssh / swcount - GAP - 2 * BW))
|
||||
|
||||
# stack x coordinate.
|
||||
sx=$((mwidth + 2 * GAP + 2 * BW))
|
||||
# stack y coordinate.
|
||||
sy=$GAP
|
||||
|
||||
# put focused window as master
|
||||
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 $swidth $sheight $wid
|
||||
# incremental stack Y coordinate.
|
||||
sy=$((sy + sheight + GAP + 2 * BW))
|
||||
done
|
||||
if [ "$swcount" = "0" ]; then
|
||||
wtp $mx $my $sw $msh $FW
|
||||
else
|
||||
# put focused window as master
|
||||
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 $swidth $sheight $wid
|
||||
# incremental stack Y coordinate.
|
||||
sy=$((sy + sheight + GAP + 2 * BW))
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# widespread
|
||||
|
@ -118,3 +125,5 @@ if [ -n "$FW" ]; then
|
|||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
|
|
93
wms_value.sh
93
wms_value.sh
|
@ -20,8 +20,6 @@ usage() {
|
|||
cat<<EOF
|
||||
usage:
|
||||
wms_revalue.sh [ -b, -B, -d, -g, -G, -m, -M, -w, -W]
|
||||
-b) minimize borderwidth
|
||||
-B) maximize borderwidth
|
||||
-d) load default
|
||||
-g) minimize gaps
|
||||
-G) maximize
|
||||
|
@ -37,29 +35,14 @@ default() {
|
|||
# copy wms_var file in /tmp.
|
||||
cp $HOME/.config/wms/wms_var /tmp/wms_var
|
||||
# give some name to the window manager.
|
||||
atomx WM_NAME=wms $(lsw -r) &
|
||||
atomx WM_NAME=wms $(lsw -r) > /dev/null
|
||||
}
|
||||
|
||||
# increase border. (+2 pixels)
|
||||
border_inc() {
|
||||
if [ $BW -le 10 ]; then
|
||||
sed -i "s/^.*\bBW=\b.*$/BW=$((BW + 2))/" $WMSVAR
|
||||
wms_mainrole.sh $FW
|
||||
fi
|
||||
}
|
||||
|
||||
# decrease border. (-2 pixels)
|
||||
border_dec() {
|
||||
if [ $BW -ge 4 ]; then
|
||||
sed -i "s/^.*\bBW=\b.*$/BW=$((BW - 2))/" $WMSVAR
|
||||
wms_mainrole.sh $FW
|
||||
fi
|
||||
}
|
||||
|
||||
# increase gaps. (+2 pixels)
|
||||
gap_inc() {
|
||||
if [ $GAP -le 40 ]; then
|
||||
sed -i "s/^.*\bGAP=\b.*$/GAP=$((GAP + 2))/" $WMSVAR
|
||||
wms_usher.sh -t
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -67,6 +50,7 @@ gap_inc() {
|
|||
gap_dec() {
|
||||
if [ $GAP -ge 2 ]; then
|
||||
sed -i "s/^.*\bGAP=\b.*$/GAP=$((GAP - 2))/" $WMSVAR
|
||||
wms_usher.sh -t
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -74,6 +58,7 @@ gap_dec() {
|
|||
master_inc() {
|
||||
if [ $MP -le 80 ]; then
|
||||
sed -i "s/^.*\bMP=\b.*$/MP=$((MP + 5))/" $WMSVAR
|
||||
wms_usher.sh -t
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -81,6 +66,7 @@ master_inc() {
|
|||
master_dec() {
|
||||
if [ $MP -ge 20 ]; then
|
||||
sed -i "s/^.*\bMP=\b.*$/MP=$((MP - 5))/" $WMSVAR
|
||||
wms_usher.sh -t
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -88,6 +74,7 @@ master_dec() {
|
|||
windowperc_inc() {
|
||||
if [ $WP -le 90 ]; then
|
||||
sed -i "s/^.*\bWP=\b.*$/WP=$((WP + 5))/" $WMSVAR
|
||||
wms_usher.sh -w
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -95,47 +82,33 @@ windowperc_inc() {
|
|||
windowperc_dec() {
|
||||
if [ $WP -ge 60 ]; then
|
||||
sed -i "s/^.*\bWP=\b.*$/WP=$((WP - 5))/" $WMSVAR
|
||||
wms_usher.sh -w
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -n "$FLAG" ]; then
|
||||
case $FLAG in
|
||||
-b)
|
||||
border_dec
|
||||
;;
|
||||
-B)
|
||||
border_inc
|
||||
;;
|
||||
-d)
|
||||
default
|
||||
;;
|
||||
-g)
|
||||
gap_dec
|
||||
;;
|
||||
-G)
|
||||
gap_inc
|
||||
;;
|
||||
-m)
|
||||
master_dec
|
||||
;;
|
||||
-M)
|
||||
master_inc
|
||||
;;
|
||||
-w)
|
||||
windowperc_dec
|
||||
;;
|
||||
-W)
|
||||
windowperc_inc
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
case $FLAG in
|
||||
-d)
|
||||
default
|
||||
;;
|
||||
-g)
|
||||
gap_dec
|
||||
;;
|
||||
-G)
|
||||
gap_inc
|
||||
;;
|
||||
-m)
|
||||
master_dec
|
||||
;;
|
||||
-M)
|
||||
master_inc
|
||||
;;
|
||||
-w)
|
||||
windowperc_dec
|
||||
;;
|
||||
-W)
|
||||
windowperc_inc
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
|
46
wms_var_example
Normal file
46
wms_var_example
Normal file
|
@ -0,0 +1,46 @@
|
|||
# wallpaper #
|
||||
WALL="$HOME/.wall.png"
|
||||
BITMAP="$HOME/.bitmap.xbm"
|
||||
|
||||
# gif #
|
||||
GIF="$HOME/.gif"
|
||||
|
||||
# terminal
|
||||
TERMINAL="xterm"
|
||||
|
||||
# x editor
|
||||
XENAME="emacs"
|
||||
XECMD="emacsclient -c --alternate-editor="""
|
||||
|
||||
# menu command
|
||||
XMENU=wms_menu.sh
|
||||
|
||||
# launcher / menu geometry
|
||||
GEOMETRY=66x11+314+250
|
||||
|
||||
# border width
|
||||
BW=2
|
||||
|
||||
# active color
|
||||
AC=829AA6
|
||||
|
||||
# inactive color
|
||||
IC=4D4D4D
|
||||
|
||||
# background color
|
||||
BC=101010
|
||||
|
||||
# font color
|
||||
FC=A0A0A0
|
||||
|
||||
# windows percentage
|
||||
WP=85
|
||||
|
||||
# tiling master area percentage
|
||||
MP=60
|
||||
|
||||
# gaps
|
||||
GAP=6
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue