-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsendmsg
executable file
·48 lines (40 loc) · 1.08 KB
/
sendmsg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Easy script to create notifications for the desktop. It can be used from ssh
# by using the -X command and display is by default exported to 0:
# It will use default vaules if they are not set by the user.
# Author: Artur O. [email protected] (Justice @ Freenode #Archlinux)
export DISPLAY=:0
if [[ "$1" == "" ]]; then
echo "[Usage]"
echo "First param: Message default: null"
echo "Second param: App Name default: Notify"
echo "Third param: Icon default: gtk-info"
echo "Fourth param: urgency default: normal"
fi
sendmsg () {
# Message
if [[ "$1" == "" ]]; then
msg="null"
else
msg="$1"
fi
# App-Name
if [[ "$2" == "" ]]; then
app="Notify"
else
app="$2"
fi
# Icon
if [[ "$3" == "" ]]; then
icon=gtk-info
else
icon="$3"
fi
if [[ "$4" == "" ]]; then
urgency=normal
else
urgency="$4"
fi
notify-send "$app" --app-name="$app" --icon="$icon" --urgency="$urgency" "$msg"
}
sendmsg "$1" "$2" "$3" "$4"