You are not logged in.
Pages: 1
Hi,
running devuan ascii with i3 window manager.
I would like to convert a not too complex i3 script, meant for systemd, to work with devuan so that I can use it to control pm-suspend or an alternative suspend/hibernate/shutdown tool with it.
Could somebody tell me how to transform it?
The code is:
#!/bin/sh
lock() {
i3lock
}
case "$1" in
lock)
lock
;;
logout)
i3-msg exit
;;
suspend)
lock && systemctl suspend
;;
hibernate)
lock && systemctl hibernate
;;
reboot)
systemctl reboot
;;
shutdown)
systemctl poweroff
;;
*)
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
exit 2
esac
exit 0
Offline
I don't know!
However, I was just reading the message on DNG from Steve Litt about process supervisors :-
https://lists.dyne.org/lurker/message/2 … d3.en.html
I wonder whether this might be a way forwards.
Geoff
Offline
It looks like you could just replace the systemd commands with non-systemd commands. I don't know i3. How does it handle running those commands as root? Or does user have privilege for the shutdown and reboot commands? For hibernate and suspend, you can use 'pm-hibernate' and 'pm-suspend'.
Whenever I use a window manager without a diplay manager, I give my user sudo nopasswd permission for those commands.
It's also possible to let dbus manage the session, and then you can use dbus commands for shutdown, etc. I think that's been discussed somewhere on this forum. If you need that and can't find it, just say so.
This looks like the easy solution. No idea here if it works. (Note: Tags to put this in a code box are right above the message text box when you're composing.)
#!/bin/sh
lock() {
i3lock
}
case "$1" in
lock)
lock
;;
logout)
i3-msg exit
;;
suspend)
lock && pm-suspend
;;
hibernate)
lock && pm-hibernate
;;
reboot)
reboot
;;
shutdown)
poweroff
;;
*)
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
exit 2
esac
exit 0
Offline
Pages: 1