linux:notifications
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux:notifications [2020/07/17 20:26] – Wulf Rajek | linux:notifications [2023/05/29 11:55] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 21: | Line 21: | ||
< | < | ||
./ | ./ | ||
+ | </ | ||
+ | |||
+ | Alternative bash script inspired by notify-send: | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | NOTIFY_ARGS=(--session | ||
+ | | ||
+ | | ||
+ | APP_NAME=" | ||
+ | REPLACE_ID=0 | ||
+ | EXPIRE_TIME=4000 | ||
+ | ICON="/ | ||
+ | parse_notification_id(){ | ||
+ | sed ' | ||
+ | } | ||
+ | |||
+ | HOSTNAME_TO_IGNORE_REGEX=" | ||
+ | #VNC loop | ||
+ | while true | ||
+ | do | ||
+ | LOGGEDON=$(netstat -a -n | grep ": | ||
+ | if [ "`echo $LOGGEDON|wc -l`" -lt " | ||
+ | then | ||
+ | #Single VNC user, check again in 5 seconds | ||
+ | sleep 5 | ||
+ | else | ||
+ | #zenity --notification --text " | ||
+ | HINTS=" | ||
+ | |||
+ | NOTIFICATION_ID=$(gdbus call " | ||
+ | --method org.freedesktop.Notifications.Notify \ | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | | parse_notification_id) | ||
+ | sleep 4 | ||
+ | gdbus call " | ||
+ | NOTIFICATION_ID=$(gdbus call " | ||
+ | --method org.freedesktop.Notifications.Notify \ | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | | parse_notification_id) | ||
+ | sleep 4 | ||
+ | gdbus call " | ||
+ | |||
+ | fi | ||
+ | sleep 4 | ||
+ | done | ||
</ | </ |
linux/notifications.1595014002.txt.gz · Last modified: 2023/05/29 11:53 (external edit)