in a hook in /usr/lib/systemd/system-sleep/ locks my pc when going to sleep?
(And by lock I mean that it hangs right before going to sleep and the only thing I can do is an hard shutdown)
in a hook in /usr/lib/systemd/system-sleep/ locks my pc when going to sleep?
(And by lock I mean that it hangs right before going to sleep and the only thing I can do is an hard shutdown)
Check your journal. Scripts put on system-sleep need to return, otherwise they will block shutdown or suspend.
in a hook in /usr/lib/systemd/system-sleep/ locks my pc when going to sleep?
(And by lock I mean that it hangs right before going to sleep and the only thing I can do is an hard shutdown)
btw, the folder is /usr/lib/systemd/system-sleep, not “systemd-sleep”
Lyroy_TheToad2022-09-13 22:45:14
grazzolini2022-09-13 22:44:03
No, whatever commands they run should not hang.
The command doesn’t hang if I run it from the terminal, it hangs only in the hook
Lyroy_TheToad2022-09-13 22:45:33
grazzolini2022-09-13 22:44:59
btw, the folder is /usr/lib/systemd/system-sleep, not “systemd-sleep”
Sorry my typo, the actual folder is correct
grazzolini2022-09-13 22:46:05
Lyroy_TheToad2022-09-13 22:45:14
The command doesn’t hang if I run it from the terminal, it hangs only in the hook
The command is ran as root, there’s no DISPLAY running as root, you need to probably use sudo/su to run the command as your user. Then again, I don’t understand why you’re trying to disable your device on sleep.
Lyroy_TheToad2022-09-13 22:47:12
I don’t want to make the mouse wake up the computer because every time I have to move it to make some space it always turns back on the pc
grazzolini2022-09-13 22:47:54
Lyroy_TheToad2022-09-13 22:47:12
I don’t want to make the mouse wake up the computer because every time I have to move it to make some space it always turns back on the pc
Yeah, that’s why I use the mouse power on off button after suspending.
Lyroy_TheToad2022-09-13 22:48:09
I’m too lazy to do that haha
grazzolini2022-09-13 22:49:24
Lyroy_TheToad2022-09-13 22:48:09
I’m too lazy to do that haha
Also, I think that disabling it at xinput level won’t prevent ACPI events coming from the mouse and bringing the system from suspend. you probably will be better doing that with udev
Lyroy_TheToad2022-09-13 22:50:00
Oh okay, I’ll try looking into it
grazzolini2022-09-13 22:51:52
Lyroy_TheToad2022-09-13 22:50:00
Oh okay, I’ll try looking into it
You can simply create a rule like this: https://wiki.archlinux.org/title/Udev#Waking_from_suspend_with_USB_device
but with disabled instead of enabled
Lyroy_TheToad2022-09-13 22:53:07
Oh nice, that’s prefect! Thanks, I’ll tell you if it works =D
grazzolini2022-09-13 22:56:25
Lyroy_TheToad2022-09-13 22:53:07
Oh nice, that’s prefect! Thanks, I’ll tell you if it works =D
Lol, ready rule for you: https://wiki.archlinux.org/title/Power_management/Wakeup_triggers#Event-driven_with_udev
Lyroy_TheToad2022-09-13 23:05:39
Works amazingly! (Can I name the file how I want or do I have to follow specific rules?)
grazzolini2022-09-13 23:07:04
Lyroy_TheToad2022-09-13 23:05:39
Works amazingly! (Can I name the file how I want or do I have to follow specific rules?)
You can name it whatever you want. However, given this touches power wakeup, won’t hurt to put a number in front of it, so the file is picked up lastly, like 99. The only reason I don’t use something like this is because I have a logitech unified receiver, and I want to be able to resume from suspend using my keyboard. that’s why I simply power down my mouse
Lyroy_TheToad2022-09-13 23:08:48
I’ve seen numbers being used a lot in file names, so they represent the order they are executed it? (or is it just alphabetic order?)
Lyroy_TheToad2022-09-13 23:11:13
Oh also, if I had a logitech keyboard like you do and I wanted to disable just the mouse, how could I have done it?