31 lines
544 B
Bash
31 lines
544 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
D=$(xrandr | grep LVDS1 | grep -Eo '[0-9]+x[0-9]+')
|
||
|
DW=$(echo $D | cut -dx -f1)
|
||
|
DH=$(echo $D | cut -dx -f2)
|
||
|
|
||
|
bar() {
|
||
|
W=$1
|
||
|
H=$2
|
||
|
PADDING=$3
|
||
|
ANCHOR=$4
|
||
|
POS=$5
|
||
|
shift 5
|
||
|
|
||
|
case $ANCHOR in
|
||
|
T)
|
||
|
Y=$PADDING
|
||
|
;;
|
||
|
B|*)
|
||
|
Y=$(($DH - $PADDING - $H))
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
[ "$POS" -gt 100 ] && POS=100
|
||
|
[ "$POS" -lt 0 ] && POS=0
|
||
|
|
||
|
X=$(( ($DW - $W - 2 * $PADDING) * $POS / 100 + $PADDING ))
|
||
|
|
||
|
dzen2 -x "$X" -y "$Y" -w "$W" -h "$H" "$@" -e "onstart=lower"
|
||
|
}
|