diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2013-08-28 14:16:42 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2013-08-28 14:16:43 +0200 |
commit | dc5203f899462bc9e5bb7ac908201a95931295ab (patch) | |
tree | 337ea60be2a57ebaad3c332386053da6d2e01ecd /.i3/scripts | |
parent | 8af0ef0898e4f99a96f3e1f9cd495f3dc9f2f6f4 (diff) | |
download | dotfiles-dc5203f899462bc9e5bb7ac908201a95931295ab.tar.gz dotfiles-dc5203f899462bc9e5bb7ac908201a95931295ab.tar.bz2 dotfiles-dc5203f899462bc9e5bb7ac908201a95931295ab.zip |
Nice pidgin startup script
Diffstat (limited to '')
-rwxr-xr-x | .i3/scripts/start_pidgin.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/.i3/scripts/start_pidgin.sh b/.i3/scripts/start_pidgin.sh new file mode 100755 index 0000000..5fbee02 --- /dev/null +++ b/.i3/scripts/start_pidgin.sh @@ -0,0 +1,24 @@ +#!/bin/zsh +# +# Start Pidgin and make sure, that the buddylist is shown. +# + +# test for pidgin already running +(( `pgrep -xc pidgin` )) && return + +# start pidgin in background +pidgin & + +# wait for the DBus-Service to be available +# we use '--profile' because it renders nicer output +coproc dbus-monitor --profile "interface=im.pidgin.purple.PurpleInterface" + +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 + [[ $line =~ 'GtkblistUnhiding$' ]] && return +done + +# if we are here, pidgin is running and the blist is not yet visible +exec purple-send-async PurpleBlistSetVisible int32:1 |