3 # 01pidgin: suspend/wakeup pidgin
5 purple_remote
='/usr/bin/purple-remote';
7 purple_global_remote
() {
8 for user
in $
(ps
-o euser
,comm -C dbus-daemon |
tail -n +2 | cut
-d ' ' -f 1 |
grep -v '^dbus$'); do
10 tempfile
="/tmp/pidgin-last-status-$user";
11 if [ "$command" == 'resume' ]; then
12 command='setstatus?status='$
(cat "$tempfile");
14 last_status
=$
(su
"$user" -c "$purple_remote getstatus");
15 echo -n "$last_status" > "$tempfile";
16 echo "user $user will be resumed to: $last_status";
18 su
"$user" -c "$purple_remote $command";
24 purple_global_remote
'setstatus?status=offline';
28 purple_global_remote resume
;