From dc5203f899462bc9e5bb7ac908201a95931295ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Wed, 28 Aug 2013 14:16:42 +0200 Subject: Nice pidgin startup script --- .i3/config | 2 +- .i3/scripts/start_pidgin.sh | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 .i3/scripts/start_pidgin.sh (limited to '.i3') diff --git a/.i3/config b/.i3/config index c296885..c8a822b 100644 --- a/.i3/config +++ b/.i3/config @@ -200,7 +200,7 @@ bindsym $mod+space exec dmenu_run -b # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop # Misc (minus shift are the focus options) -bindsym $mod+Shift+p exec pidgin +bindsym $mod+Shift+p exec $script/start_pidgin.sh bindsym $mod+Shift+b exec firefox bindsym $mod+Shift+m exec thunderbird 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 -- cgit v1.2.3