summaryrefslogtreecommitdiff
path: root/.i3
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2013-12-09 11:48:31 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2013-12-09 11:48:32 +0100
commite4e094b03ced09bf00c0e181bdeee865f86dac1d (patch)
treeeae53aca3ef2268655ac6f4349adc0df92d5950d /.i3
parent13df827cf4002497582c7dcdcb49b7768a000858 (diff)
downloaddotfiles-e4e094b03ced09bf00c0e181bdeee865f86dac1d.tar.gz
dotfiles-e4e094b03ced09bf00c0e181bdeee865f86dac1d.tar.bz2
dotfiles-e4e094b03ced09bf00c0e181bdeee865f86dac1d.zip
Fix start_pidgin.sh to not have lurking dbus-monitor processes
Diffstat (limited to '.i3')
-rwxr-xr-x.i3/scripts/start_pidgin.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/.i3/scripts/start_pidgin.sh b/.i3/scripts/start_pidgin.sh
index 6fb144b..8261113 100755
--- a/.i3/scripts/start_pidgin.sh
+++ b/.i3/scripts/start_pidgin.sh
@@ -6,13 +6,19 @@
# test for pidgin already running
(( `pgrep -xc pidgin` )) && return
+# start dbus-monitor
+coproc dbus-monitor --profile "interface=im.pidgin.purple.PurpleInterface"
+dbus_pid=$!
+
+# kill it on exit
+TRAPEXIT() { kill $dbus_pid }
+
# start pidgin in background
pidgin &
# wait for the DBus-Service to be available
# we use '--profile' because it renders nicer output
-dbus-monitor --profile "interface=im.pidgin.purple.PurpleInterface" |
-while read line; do
+while read -p line; do
[[ $line =~ 'UpdateIdle$' ]] && break
# if the blist is automatically shown, we exit
# else we would move the focus, which is bad