diff --git a/Makefile b/Makefile index df27ee1..0369894 100644 --- a/Makefile +++ b/Makefile @@ -10,4 +10,11 @@ install: # files in /usr/lib install -d $(DESTDIR)$(PREFIX)/lib/gotify-dunst/ install main.py $(DESTDIR)$(PREFIX)/lib/gotify-dunst/ - install gotify-dunst.conf $(DESTDIR)$(PREFIX)/lib/gotify-dunst/ \ No newline at end of file + install gotify-dunst.conf $(DESTDIR)$(PREFIX)/lib/gotify-dunst/ + + # files in /usr/share + install gotify-dunst.desktop $(DESTDIR)$(PREFIX)/share/applications + install gotify-16.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/gotify.png + install gotify-32.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/gotify.png + install gotify-96.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/96x96/apps/gotify.png + install gotify-128.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/gotify.png \ No newline at end of file diff --git a/gotify-128.png b/gotify-128.png new file mode 100644 index 0000000..cb74a8f Binary files /dev/null and b/gotify-128.png differ diff --git a/gotify-16.png b/gotify-16.png new file mode 100644 index 0000000..860d29e Binary files /dev/null and b/gotify-16.png differ diff --git a/gotify-32.png b/gotify-32.png new file mode 100644 index 0000000..a6ca19f Binary files /dev/null and b/gotify-32.png differ diff --git a/gotify-96.png b/gotify-96.png new file mode 100644 index 0000000..77981fb Binary files /dev/null and b/gotify-96.png differ diff --git a/gotify-dunst.desktop b/gotify-dunst.desktop new file mode 100644 index 0000000..1af3b70 --- /dev/null +++ b/gotify-dunst.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=gotify-dunst +Exec=/usr/lib/gotify-dunst/main.py +Icon=gotify +# Hide application from user menu +NoDisplay=true \ No newline at end of file diff --git a/main.py b/main.py index 8366c86..2c3c26b 100644 --- a/main.py +++ b/main.py @@ -57,11 +57,11 @@ def get_picture(appid): def send_notification(message): m = json.loads(message) if m['priority'] <= 3: - subprocess.Popen(['notify-send', m['title'], m['message'], "-u", "low", "-i", get_picture(m['appid']), "-a", "Gotify"]) + subprocess.Popen(['notify-send', m['title'], m['message'], "-u", "low", "-i", get_picture(m['appid']), "-a", "Gotify", "-h", "string:desktop-entry:gotify-dunst"]) if 4 <= m['priority'] <= 7: - subprocess.Popen(['notify-send', m['title'], m['message'], "-u", "normal", "-i", get_picture(m['appid']), "-a", "Gotify"]) + subprocess.Popen(['notify-send', m['title'], m['message'], "-u", "normal", "-i", get_picture(m['appid']), "-a", "Gotify", "-h", "string:desktop-entry:gotify-dunst"]) if m['priority'] > 7: - subprocess.Popen(['notify-send', m['title'], m['message'], "-u", "critical", "-i", get_picture(m['appid']), "-a", "Gotify"]) + subprocess.Popen(['notify-send', m['title'], m['message'], "-u", "critical", "-i", get_picture(m['appid']), "-a", "Gotify", "-h", "string:desktop-entry:gotify-dunst"]) def on_message(ws, message): print(message)