You are not logged in.
Pages: 1
Hi all,
I want to to launch baloon message with cron. In my notes I found this:
DISPLAY=":0.0"
XAUTHORITY="/home/john/.Xauthority"
XDG_RUNTIME_DIR="/run/user/1000"
# Run every 1 Min
* * * * * /home/john/Scripts/notification_test.sh
and the corresponding script:
#!/bin/bash
kdialog --title "Long process completed!" --passivepopup "This popup will disappear in 5 seconds" 5 &
which normally should have worked otherwise it wouldn't be there.
But this was before I reinstall Arch, now it doesn't work.
There are several threads regarding this and I have tried many things without success.
zenity and notify-send also don't work:
notify-send "Test" --display=:0
zenity --warning --width=150 --height=50 --text 'Test!'
All three of them work if I run them in the console.
Any idea what is wrong?
Offline
notify-send "Test" --display=:0
does certainly not work from an interactive shell (because there's no "--display" parameter and it's also not relevant, this is dbus driven) but you're general suspicion about the issue is correct, however the relevant variables (for notify-send you're gonna require $DBUS_SESSION_BUS_ADDRESS, see https://gist.github.com/AladW/de1c5676d93d05a5a0e1 on how to dynamically import those environment variables) do not belong into the crontab (but the script that needs them)
Offline
Nothing did work for me so I finally gave up.
Offline
I am having the same problem. What exactly are the key environment variables. Or is it a different affair?
I am trying
su -l $USER
to discard most of the environment variables and trying to work my way towards getting notify-send working once more.
I dumped environment variables using
set | grep = > /tmp/environment
and using
source /tmp/environment
to reset them again (handling the read-only variables). It did not work.
Can an experienced user provide some guidance, please?
Offline
or notify-send you're gonna require $DBUS_SESSION_BUS_ADDRESS, see https://gist.github.com/AladW/de1c5676d93d05a5a0e1 on how to dynamically import those environment variables
Offline
Online
seth wrote:or notify-send you're gonna require $DBUS_SESSION_BUS_ADDRESS, see https://gist.github.com/AladW/de1c5676d93d05a5a0e1 on how to dynamically import those environment variables
I appreciate your help, seth. However I got the message
Couldn't get a file descriptor referring to the console
right at the start and I am not knowledgeable enough to fix it.
Offline
Usually a permission error. How and where exactly did you run this?
Also output of "id", in doubt, try to add your user to the tty group.
Offline
Pages: 1