You are not logged in.

#1 2018-06-10 13:28:17

karcher
Member
Registered: 2018-01-09
Posts: 34

Can't launch baloon message with cron

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

#2 2018-06-10 13:37:02

seth
Member
Registered: 2012-09-03
Posts: 7,857

Re: Can't launch baloon message with cron

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

#3 2018-06-13 11:12:15

karcher
Member
Registered: 2018-01-09
Posts: 34

Re: Can't launch baloon message with cron

Nothing did work for me so I finally gave up.

Offline

Board footer

Powered by FluxBB