Openrc and i3exit: suspend, reboot, shutdown as user fail

openrc
i3

#1

I have a manjaro architect-installed version of i3 using openrc. I have to use sudo shutdown -h etc. in a terminal to shutdown. Normal logging out of session and using the menu on the login screen works OK.

Where/How is the i3exit command permitted to be used by a normal user in OpenRC?

from ~/.i3/config:

bindsym $mod+0 mode "$mode_system"
set $mode_system (l)ock, (e)xit, switch_(u)ser, (s)uspend, (h)ibernate, (r)eboot,  (Shift+s)hutdown
mode "$mode_system" {
    bindsym l exec --no-startup-id i3exit lock, mode "default"
    bindsym s exec --no-startup-id i3exit suspend, mode "default"
    bindsym u exec --no-startup-id i3exit switch_user, mode "default"
    bindsym e exec --no-startup-id i3exit logout, mode "default"
    bindsym h exec --no-startup-id i3exit hibernate, mode "default"
    bindsym r exec --no-startup-id i3exit reboot, mode "default"
    bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default"

    # exit system mode: "Enter" or "Escape"
    bindsym Return mode "default"
    bindsym Escape mode "default"
}

Ta.
Edited to include all code on 2nd line


#2

Shouldn’t it be ®eboot instead of ®eboo$ ?

# Set shut down, restart and locking features
bindsym $mod+0 mode "$mode_system"
set $mode_system (l)ock, (e)xit, switch_(u)ser, (s)uspend, (h)ibernate, (r)eboot, (Shift+s)hutdown
mode "$mode_system" {
    bindsym l exec --no-startup-id i3exit lock, mode "default"
    bindsym s exec --no-startup-id i3exit suspend, mode "default"
    bindsym u exec --no-startup-id i3exit switch_user, mode "default"
    bindsym e exec --no-startup-id i3exit logout, mode "default"
    bindsym h exec --no-startup-id i3exit hibernate, mode "default"
    bindsym r exec --no-startup-id i3exit reboot, mode "default"
    bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default"

    # exit system mode: "Enter" or "Escape"
    bindsym Return mode "default"
    bindsym Escape mode "default"
}

#3

My mistake, thats just nano indicating the text scrolls off the terminal window. Edited above for full line


#4

I think you need to be added to the group…

Can you show me the ouput of cat /etc/group ?


#5

Here you are:
root:x:0:root
bin:x:1:root,bin,daemon
daemon:x:2:root,bin,daemon
sys:x:3:root,bin
adm:x:4:root,daemon
tty:x:5:
disk:x:6:root
lp:x:7:daemon,myuser
mem:x:8:
kmem:x:9:
wheel:x:10:root,myuser
ftp:x:11:
mail:x:12:
uucp:x:14:
log:x:19:root
utmp:x:20:
locate:x:21:
rfkill:x:24:
smmsp:x:25:
proc:x:26:polkitd
http:x:33:
games:x:50:
lock:x:54:
uuidd:x:68:
dbus:x:81:
network:x:90:myuser
video:x:91:myuser
audio:x:92:myuser
optical:x:93:
floppy:x:94:
storage:x:95:myuser
scanner:x:96:
input:x:97:
power:x:98:myuser
nobody:x:99:
users:x:100:
systemd-journal:x:190:
systemd-journal-gateway:x:191:
systemd-timesync:x:192:
systemd-network:x:193:
systemd-bus-proxy:x:194:
systemd-resolve:x:195:
rpc:x:32:
avahi:x:84:
polkitd:x:102:
usbmux:x:140:
lightdm:x:620:
ntp:x:87:
nm-openconnect:x:619:
nm-openvpn:x:618:
myuser:x:1000:
git:x:617:


#6

It looks like the i3exit script is written for consolekit, which is no longer used with Manjaro OpenRC (it’s been replaced by elogind). So it needs to be rewritten. @oberon?


#7

OK, as a stop-gap measure, I’m using loginctl

bindsym s exec --no-startup-id loginctl suspend, mode "default"
bindsym u exec --no-startup-id i3exit switch_user, mode "default"
bindsym e exec --no-startup-id i3exit logout, mode "default"
bindsym h exec --no-startup-id loginctl hibernate, mode "default"
bindsym r exec --no-startup-id loginctl reboot, mode "default"
bindsym Shift+s exec --no-startup-id loginctl poweroff, mode "default"

Not sure if it was necessary but I also added the following to /etc/pam.d/lightdm-greeter:

session   optional pam_ck_connector.so nox11
session   optional pam_elogind.so

#8

Yes, i3exit will need adaptation… Will have to check it soon, thank you!


#10

Updated i3exit to 20170616. Should now be working again also with elogind.
Thank you for pointing out the problem :wink:


closed #11

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.