Closed HugoDelval closed 4 years ago
Are you using pulseaudio? Also, does your service yield any output what-so-ever (journalctl -u xidlehook
)?
Hi jD91mZM2,
I do use pulseaudio, but maybe vlc and firefox are using another software? I've tried to find if firefox can use another lib than pulseaudio but it doesn't look so.
journalctl -u xidlehook
outputs only normal logs, the only weird thing is:
mars 19 15:47:26 hd systemd[1]: xidlehook.service: Current command vanished from the unit file, execution of the command list won't be resumed.
but I don't believe it is related to sound stuff.
Also, just to be clear, the tool is doing the job properly for everything else (fullscreen detection is working for example).
What happens if you run the command outside of systemd, just for testing? I must admit I'm a little stumped. This particular feature has been the one feature that has always worked for me, haha.
Oh! You're right that's interesting! It does work properly when running it directly from the command line. So it means it has something to do with systemd..
It looks like it's a permission issue, because when I launch the service as root it works fine.
Is this something I can help with from xidlehook or can I close this?
https://unix.stackexchange.com/questions/339638/difference-between-systemd-and-terminal-starting-program/339645
Then answer to that question might help debug this. Are you able to run lock.sh
with systemd-run /path/to/lock.sh
?
Since running the systemd service as root works then it is probably not this, but could also be related to the double command being run with service type simple
. See https://www.freedesktop.org/software/systemd/man/systemd.service.html#Command%20lines
Example:
ExecStart=echo one ; echo "two two"
This will execute echo two times, each time with one argument: "one" and "two two", respectively. Because two commands are specified, Type=oneshot must be used.
If it is the service type, change to oneshot
and add RemainAfterExit=yes
.
I had also assumed that --not-when-audio
was not working, but after debugging my setup I found other side effects were the culprit. Consider looking into DPMS if you're using xss-lock
.
For example, in my case, while I did set xset dpms 0 0 0
to disable DPMS timers, the xss-lock
hook was still triggered by the screen saver timer. So, I also had to disable the screensaver timer: xset dpms 0 0 0 s off
.
You can debug the setting simply with xidlehook --not-when-audio --timer 1 "echo 'triggered'" ""
to see if the audio postpones the timer.
I think this ticket can be closed for now since it's been stale for almost a year. @jD91mZM2 Thanks for this great software!
Aww, thanks for the compliment ❤️
Hi,
I tried this tool because I was really interested in the feature
--not-when-audio
but I can't make it work :/ I've tried to run a youtube video under firefox and a mp4 file under vlc and still my screen is locking up.here is my systemd file for clarity :
Any idea how I could debug this? Thanks by advance :)
EDIT: I'm runing i3 under archlinux, if it can help in any way