Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Openrc equivalant to... (Read 986 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Openrc equivalant to...

I have successfully moved (not migrated) to Artix w/OpenRC.
I'm running dwm and I would like to know what the equivalents are to the following:

Logout) loginctl kill-session $XDG_SESSION_ID
Suspend) systemctl suspend
Hibernate) systemctl hibernate
Reboot) systemctl reboot
Shutdown) systemctl poweroff

TIA,
cds
Supercalifragilisticexpialidocious

Re: Openrc equivalant to...

Reply #1
Here is a handy dmenu script with all of the above mentioned equivalents:

Code: [Select]
#!/bin/sh

powermenu() {
        options=" Poweroff\n Reboot\n󰤄 Suspend\n Hibernate\n󰍃 Logout\n Lock"
        selected=$(echo "$options" | dmenu -i -p "Session:" )
        if [ "$selected" = " Poweroff" ]; then
                loginctl poweroff
        elif [ "$selected" = " Reboot" ]; then
                loginctl reboot
        elif [ "$selected" = "󰤄 Suspend" ]; then
                loginctl suspend
        elif [ "$selected" = " Hibernate" ]; then
                loginctl hibernate
        elif [ "$selected" = "󰍃 Logout" ]; then
                pkill dwm
        elif [ "$selected" = " Lock" ]; then
                slock
                return
        fi
}

powermenu

Edit: The blocks are just icons in case you are wondering about them.

Re: Openrc equivalant to...

Reply #2
Awesome and thank you!

Doesn't loginctl require elevated access to run ?
Supercalifragilisticexpialidocious

Re: Openrc equivalant to...

Reply #3
Quote
Doesn't loginctl require elevated access to run ?

Yes it does. It interacts with the systems login manager and user sessions.
It depends how you want your system to run. Personally I always just install and enable elogind.


Re: Openrc equivalant to...

Reply #4
Ah - that explains things.
Again, thanks! works like a charm!
Supercalifragilisticexpialidocious