Using dunst to send notifications to HDMI display monitor

Raspberry Pi related support

Using dunst to send notifications to HDMI display monitor

Postby westrock2000 » 14 Sep 2017, 21:29

I want to use something like notify-send in a script to pop up on the HDMI screen.

The command is installed, but when you run it remotely it does not do anything. I assume this is because it doesn't know what display to send to (since I'm remote logged in).

what is the DISPLAY:x syntax to get the HDMI display?

I tried a couple common ones but no go

[root@runeaudio ~]# export DISPLAY=0.0
[root@runeaudio ~]# notify-send Test "Hello World"
[root@runeaudio ~]# export DISPLAY=0
[root@runeaudio ~]# export DISPLAY=:0
[root@runeaudio ~]# notify-send Test "Hello World"
[root@runeaudio ~]# export DISPLAY=:0.0
[root@runeaudio ~]# notify-send Test "Hello World"
[root@runeaudio ~]# export DISPLAY=:1
[root@runeaudio ~]# notify-send Test "Hello World"
Last edited by westrock2000 on 16 Sep 2017, 15:38, edited 1 time in total.
westrock2000
 
Posts: 23
Joined: 26 Mar 2017, 01:19

Re: Set display to HDMI for script?

Postby westrock2000 » 14 Sep 2017, 21:31

Or is the HDMI display not a compatible "desktop" for this command?
westrock2000
 
Posts: 23
Joined: 26 Mar 2017, 01:19

Re: Set display to HDMI for script?

Postby hondagx35 » 14 Sep 2017, 23:10

Hi,

Or is the HDMI display not a compatible "desktop" for this command?

Yes, because we use matchbox-window-manager and not a full desktop.

You can try to install the package "dunst"

Code: Select all
pacman -Sy dunst


Code: Select all
export DISPLAY=":0"
dunst &
notify-send "Test" "Hello World"


Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Set display to HDMI for script?

Postby westrock2000 » 15 Sep 2017, 00:30

Thanks Frank, thats what I thought about the desktop not being traditional. Dunst did work. But it sends very small text. I tried editing the font size and other stuff like colors in /usr/share/dunst/dunstrc , but it does not appear to have any effect..

I had to update pacman first before it would install dunst, kept getting a 404 on the archlinux repository. Then try installing again after that.

[root@runeaudio]# pacman -Syy
[root@runeaudio]# pacman -Sy dunst
Last edited by westrock2000 on 16 Sep 2017, 16:11, edited 1 time in total.
westrock2000
 
Posts: 23
Joined: 26 Mar 2017, 01:19

Re: Set display to HDMI for script?

Postby westrock2000 » 15 Sep 2017, 01:17

Does the desktop run as root or some other user?
westrock2000
 
Posts: 23
Joined: 26 Mar 2017, 01:19

Re: Set display to HDMI for script?

Postby westrock2000 » 16 Sep 2017, 15:35

I figured it out (not much documentation on either Matchbox or Dunst). If I explicitly tell dunst what config to source, it works.

So set the display. Kill dunst. Restart telling what config to source. You have to kill and then immediatly restart because there is a daemon that will restart the dunst service automatically. Further research might figure out how to have the daemon start it with the config argument automatically.


[root@runeaudio dunst]# export DISPLAY=":0"
[root@runeaudio dunst]# killall dunst;/usr/bin/dunst -config /usr/share/dunst/dunstrc&
[root@runeaudio dunst]# notify-send "Track 3/12 Ripped"

Image

Setting the display and config only need to be done once in the script (or terminal session).

Some of the config things I changed

# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
idle_threshold = 0

### Text ###

font = LiberationSans Mono 20

# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = -1

# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = no

[urgency_normal]
background = "#e6dc4e"
foreground = "#000000"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#icon = /path/to/icon
Last edited by westrock2000 on 16 Sep 2017, 16:14, edited 2 times in total.
westrock2000
 
Posts: 23
Joined: 26 Mar 2017, 01:19

Re: Using dunst to send notifications to HDMI display monito

Postby westrock2000 » 16 Sep 2017, 15:39

I updated the thread title to better reflect the topic for those searching later.
westrock2000
 
Posts: 23
Joined: 26 Mar 2017, 01:19

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: Bing [Bot] and 21 guests