linux:notifications
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| linux:notifications [2020/07/17 20:22] – created Wulf Rajek | linux:notifications [2023/05/29 11:55] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Notifications ====== | + | ====== |
| VNC notifications example: | VNC notifications example: | ||
| 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.1595013730.txt.gz · Last modified: (external edit)