]> git.phdru.name Git - IM.git/blob - im-status.sh
Feat(im-status.sh): Check if the programs are running
[IM.git] / im-status.sh
1 #! /bin/sh
2
3 case "$2" in
4    online)
5       status="available"
6       skype_status="online"
7    ;;
8
9    busy|dnd)
10       status="unavailable"
11       skype_status="dnd"
12    ;;
13
14    xa)
15       status="extended_away"
16       skype_status="na"
17    ;;
18
19    *) status="$2"
20       skype_status="$2"
21    ;;
22 esac
23
24 case "$LC_CTYPE" in
25    *KOI8-R)
26       title="$3"
27       status_msg="`echo \"$3\" | iconv -t utf-8`"
28    ;;
29
30    *)
31       title="`echo \"$3\" | iconv -f koi8-r`"
32       status_msg="$title"
33    ;;
34 esac
35
36 xtitle "$1" "$2" "$title" &&
37 if [ "`gajim-remote check_gajim_running 2>/dev/null | tail -1`" = True ]; then
38    gajim-remote change_status "$2" "$title"
39 elif pgrep pidgin >/dev/null; then
40    purple-remote "setstatus?status=$status&message=$status_msg"
41 fi
42 if pgrep skype >/dev/null; then
43    exec skype_status_mood.py "$skype_status" "$3" >/dev/null 2>&1
44 fi