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:
|
||||
# hc detect_monitors
|
||||
|
||||
# find the panel
|
||||
panel=~/.config/herbstluftwm/panel.sh
|
||||
[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
|
||||
for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
|
||||
# start it on each monitor
|
||||
"$panel" $monitor &
|
||||
done
|
||||
# add external panel
|
||||
{
|
||||
# find the panel
|
||||
panel=~/.config/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
|
||||
# start it on each monitor and save pids
|
||||
"$panel" $monitor &
|
||||
pids+=( $! )
|
||||
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