LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Current - notify-send with fvwm (or any WM) (https://www.linuxquestions.org/questions/slackware-14/current-notify-send-with-fvwm-or-any-wm-4175706394/)

jmccue 01-14-2022 08:09 PM

Current - notify-send with fvwm (or any WM)
 
Hi all,

I moved to Current today performing a full install, fully replacing Slackware 14.2. I also searched LQ Slackware and Google without luck.

I noticed this issue with notify-send.

1. When I 'startx' for fvwm, notify-send fails to show a message. This also prevents nm-applet from prompting its status and it causes nm-applet to take longer to show up in the tray (stalonetray)

2. When I 'startx' for xfce, notify-send and nm-applet works as expected with nm-applet appearing quickly.

Is there a setting I need ?

I see this in /var/message:
Quote:

Jan 14 20:40:13 jmclin1 dbus-daemon[7646]: [session uid=0 pid=7644] Activating service name='org.freedesktop.Notifications' requested by ':1.0' (uid=0 pid=7640 comm="notify-send HI ")

all dbus processes:
Quote:

1271 /usr/bin/dbus-daemon --system 0.0 0.0 messagebus
5602 dbus-launch --exit-with-session /usr/bin/startfvwm2 0.0 0.0 jmccue
5603 /usr/bin/dbus-daemon --syslog --fork --print-pid 5 --p 0.0 0.0 jmccue
5727 /usr/bin/dbus-daemon --config-file=/usr/share/defaults 0.0 0.0 jmccue
7928 grep dbus 0.0 0.0 jmccue
and $DBUS_SESSION_BUS_ADDRESS has this value:
Quote:

unix:abstract=/tmp/dbus-roh9ZaR43A,guid=622721f6e6085fe4659f390961e21dd4
Thanks
John

Mechanikx 01-14-2022 09:27 PM

In order to use notify-send you need a notification server. DE's like xfce have one but WM's (at least the ones I've used) don't. I use notification-daemon (there are others) which is available from slackbuilds.org or ponce's repo. I have this line in my .xinitrc to start the daemon:

Quote:

/usr/libexec/notification-daemon &

khronosschoty 01-14-2022 11:17 PM

I use dunst with my windows manager.

https://slackbuilds.org/repository/1.../?search=dunst

allend 01-15-2022 06:22 AM

This thread has alternative solutions that do not require any package additions.

jmccue 01-15-2022 07:42 AM

Thanks allend

Starting
/usr/lib64/xfce4/notifyd/xfce4-notifyd
corrected the issue.

I am marking this solved.

John

ethelack 01-21-2022 06:24 PM

Quote:

Originally Posted by Mechanikx (Post 6318272)
In order to use notify-send you need a notification server. DE's like xfce have one but WM's (at least the ones I've used) don't. I use notification-daemon (there are others) which is available from slackbuilds.org or ponce's repo. I have this line in my .xinitrc to start the daemon:

/usr/libexec/notification-daemon &

Hi Mechanikx, thanks for your tip I have been looking at notify-send for the last few days.
Using fvwm and fluxbox have put the notification-daemon command at the bottom of .xinitrc but the daemon is not starting.

Any advice about where in .xinitrc you put the command to start the notification daemon with your window manager would be much appreciated.

I have figured out two ways to get the daemon to autostart and display a message in fvwm. One is to create the file "/usr/share/dbus-1/services/org.freedesktop.Notifications.service" to start the daemon for the notify-send message in my fvwm config.

Code:

[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/libexec/notification-daemon

The other is to start the daemon from my ~/.fvwm/config file with a short sleep to allow notify-send time to send a message.

Code:

Exec /usr/libexec/notification-daemon &

Exec sleep 1 && notify-send "Connection status" "$(nmcli d | grep ' connected')" && notify-send "Disk space" "$(df -h | grep -e '/root' -e 'efi' -e '/home')"

Have also tried dunst which has the advantage it autostarts its notification server on notify-send request.

Mechanikx 01-21-2022 07:38 PM

Quote:

Originally Posted by ethelack (Post 6320744)
Hi Mechanikx, thanks for your tip I have been looking at notify-send for the last few days.
Using fvwm and fluxbox have put the notification-daemon command at the bottom of .xinitrc but the daemon is not starting.

Any advice about where in .xinitrc you put the command to start the notification daemon with your window manager would be much appreciated.

...

You need to put it before you launch your window manager. If you put it after then that line won't get executed and, in this case, notification-daemon won't get launched.

Try this and you'll see it's not running:

Code:

ps aux | grep notification-daemon
Here's my .xinitrc:

Code:

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# Merge in defaults and keymaps
[ -f $sysresources ] && /usr/bin/xrdb -merge $sysresources
[ -f $sysmodmap ] && /usr/bin/xmodmap $sysmodmap
[ -f $userresources ] && /usr/bin/xrdb -merge $userresources
[ -f $usermodmap ] && /usr/bin/xmodmap $usermodmap

# Display settings
~/Bin/display_settings.sh &

# Wallpaper
~/.fehbg &

# status
~/Bin/Dwm/dwm-status.sh &

# start sxhkd
/usr/bin/sxhkd &

# start notification server
/usr/libexec/notification-daemon &


# start nm-applet
/usr/bin/nm-applet &

# Start dwm
if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
    exec ck-launch-session dbus-launch --exit-with-session /usr/bin/dwm
else
    exec /usr/bin/dwm
fi


ethelack 01-22-2022 05:49 PM

Quote:

Originally Posted by Mechanikx (Post 6320768)
You need to put it before you launch your window manager. If you put it after then that line won't get executed and, in this case, notification-daemon won't get launched.


thanks it works with the notification-daemon line edited into /usr/bin/startfvwm which ~/.xinitrc points to but not in ~/.xinitrc itself. Because this requires root to edit the startfvwm file I will just stick to starting the notification-daemon from ~/.fvwm/config.


All times are GMT -5. The time now is 08:33 PM.