mirror of
https://github.com/simbelmas/gotify-dunst.git
synced 2026-01-19 14:35:23 +01:00
Merge pull request #9 from baduhai/master
Gotify icon in notification, and keep notification in notification history.
This commit is contained in:
14
Makefile
14
Makefile
@@ -10,4 +10,16 @@ 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/
|
||||
install gotify-dunst.conf $(DESTDIR)$(PREFIX)/lib/gotify-dunst/
|
||||
|
||||
# files in /usr/share
|
||||
install -d $(DESTDIR)$(PREFIX)/share/applications
|
||||
install gotify-dunst.desktop $(DESTDIR)$(PREFIX)/share/applications
|
||||
install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
|
||||
install gotify-16.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/gotify.png
|
||||
install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/
|
||||
install gotify-32.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/gotify.png
|
||||
install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/96x96/apps/
|
||||
install gotify-96.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/96x96/apps/gotify.png
|
||||
install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
|
||||
install gotify-128.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/gotify.png
|
||||
|
||||
BIN
gotify-128.png
Normal file
BIN
gotify-128.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
gotify-16.png
Normal file
BIN
gotify-16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 809 B |
BIN
gotify-32.png
Normal file
BIN
gotify-32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
gotify-96.png
Normal file
BIN
gotify-96.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
7
gotify-dunst.desktop
Normal file
7
gotify-dunst.desktop
Normal file
@@ -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
|
||||
6
main.py
6
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)
|
||||
|
||||
Reference in New Issue
Block a user