Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using herbe in a cronjob #43

Open
TheTrveAnthony opened this issue Nov 16, 2022 · 2 comments
Open

Using herbe in a cronjob #43

TheTrveAnthony opened this issue Nov 16, 2022 · 2 comments

Comments

@TheTrveAnthony
Copy link

Hi,

I wanna set up a cronjob to let me know when my battery is dying.
So basically I wrote a script that plays a sound and displays a notification with herbe when the battery level is too low. It works fine when I run it from my terminal but cron fails to run herbe.
Adding export DISPLAY=:0 in the script does not make the trick.
The arch wiki also suggests to:

  • set up a DBUS variable which obviously won't help
  • Use xuserrun but it has systemd as dependency and I intend to run this on void

Is there another global variable I gotta set ? Or is herbe simply not sable in a cronjob ?

Thanks

@jetgogol
Copy link

jetgogol commented Aug 9, 2023

Same problem. I tried "$doas -u user herbe test" and it works. So why cronie can't start it? I don't understand now, but research continues.

@jetgogol
Copy link

Hey! Found solution in days. Somewhat in my setup cronie's shell missed full path for herbe (with no modifications in Makefile paths), and "display not found". After fix for path this line works for me:

* * * * * env DISPLAY=:0 /usr/local/bin/herbe test

File for local user, so it isn't run from root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants