herbstluftwm: improve panel startup and add autokill-hooks
Save pids of each panel in order to kill each process in case of herbstluftwm restart/reload.
This commit is contained in:
parent
f7a6dddd7b
commit
66efcc883e
1 changed files with 21 additions and 7 deletions
|
|
@ -189,10 +189,24 @@ herbstclient set tree_style '╾│ ├└╼─┐'
|
||||||
# or simply:
|
# or simply:
|
||||||
# hc detect_monitors
|
# hc detect_monitors
|
||||||
|
|
||||||
|
# add external panel
|
||||||
|
{
|
||||||
# find the panel
|
# find the panel
|
||||||
panel=~/.config/herbstluftwm/panel.sh
|
panel=~/.config/herbstluftwm/panel.sh
|
||||||
[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
|
[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
|
||||||
|
|
||||||
|
# initialize array to store panel-pids
|
||||||
|
pids=( )
|
||||||
|
|
||||||
|
# start panel on every monitor
|
||||||
for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
|
for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
|
||||||
# start it on each monitor
|
# start it on each monitor and save pids
|
||||||
"$panel" $monitor &
|
"$panel" $monitor &
|
||||||
|
pids+=( $! )
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# wait until the panels should be stopped
|
||||||
|
herbstclient -w '(quit_panel|reload)'
|
||||||
|
# stop all started panels
|
||||||
|
kill ${pids[@]}
|
||||||
|
} &
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue