t2ctl improvements

master
Daniel Napora 2022-04-01 16:30:22 +02:00
parent 7be3c59295
commit af03f5d1a1
1 changed files with 36 additions and 2 deletions

View File

@ -16,13 +16,38 @@ killall -SIGUSR1 tint2
}
pos () {
echo "$1"
sd "^panel_position.*$" "panel_position = ${1} center horizontal" ${T2CONFFILE}
case "$1" in
tch)
sd "^panel_position.*$" "panel_position = top center horizontal" ${T2CONFFILE};;
bch)
sd "^panel_position.*$" "panel_position = bottom center horizontal" ${T2CONFFILE};;
tlh)
sd "^panel_position.*$" "panel_position = top left horizontal" ${T2CONFFILE};;
trh)
sd "^panel_position.*$" "panel_position = top right horizontal" ${T2CONFFILE};;
blh)
sd "^panel_position.*$" "panel_position = bottom left horizontal" ${T2CONFFILE};;
brh)
sd "^panel_position.*$" "panel_position = bottom right horizontal" ${T2CONFFILE};;
clv)
sd "^panel_position.*$" "panel_position = center left vertical" ${T2CONFFILE};;
crv)
sd "^panel_position.*$" "panel_position = center right vertical" ${T2CONFFILE};;
tlv)
sd "^panel_position.*$" "panel_position = top left vertical" ${T2CONFFILE};;
trv)
sd "^panel_position.*$" "panel_position = top right vertical" ${T2CONFFILE};;
blv)
sd "^panel_position.*$" "panel_position = bottom left vertical" ${T2CONFFILE};;
brv)
sd "^panel_position.*$" "panel_position = bottom right vertical" ${T2CONFFILE};;
esac
restartt2
}
width () {
read WIDTH HEIGHT <<< "$(grep panel_size ${T2CONFFILE} | cut -d'=' -f2)"
sd "^panel_size.*$" "panel_size = ${1} ${HEIGHT}" ${T2CONFFILE}
sd "^panel_shrink.*$" "panel_shrink = 0" ${T2CONFFILE}
restartt2
}
@ -63,8 +88,16 @@ shrink () {
}
autohide () {
sd "^autohide .*$" "autohide = ${1}" ${T2CONFFILE}
sd "^panel_margin.*$" "panel_margin = 0 0" ${T2CONFFILE}
restartt2
}
hideheight () {
sh "^autohide_height.*$" "autohide_height = ${1}" ${T2TCONFFILE}
sd "^panel_margin.*$" "panel_margin = 0 0" ${T2CONFFILE}
sd "^autohide .*$" "autohide = 1" ${T2CONFFILE}
restartt2
}
reset () {
case "$LANG" in
pl*) LNG=pl ;;
@ -86,6 +119,7 @@ case "$1" in
paddingv) paddingver "$2" ;;
spacing) spacing "$2" ;;
autohide) autohide "$2" ;;
hideheight) hideheight "$2" ;;
reset) reset "$2" ;;
*) : ;;
esac