Question

I'm trying to make a pomodoro script, just for fun haha. The ideia is that every 30 minutes, a pic pop up on the screen... so its coffee time! ;) I planned something simple, like a scrip that opens a pic, run by the crontab. I got a script that opens a jpg image using EOG. Something like that:

#!/bin/bash
eog -n /home/lscardeal/Pictures/pic.jpg

It works when i run it myself, but it doesn't open the file when its run by the crontab. My crontab runs the script, but the pic doesn't open. How can i make it work?

thx

Was it helpful?

Solution

Check if this script works:

#!/bin/bash

#Export DISPLAY
export DISPLAY=:0.0

#Call Gnome EOG
/usr/bin/eog -f /home/user/image.png &

#Time to display
sleep 100

killall eog

Tks

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top