system-76-keyboards icon indicating copy to clipboard operation
system-76-keyboards copied to clipboard

No protocol specified / Root doesn't have permission to see your DPMS state

Open yochananmarqos opened this issue 4 years ago • 5 comments

Serval WS (serw12) Manjaro GNOME

❯ systemctl status keyboard-colors.service
● keyboard-colors.service - System76 Keyboard Colors
     Loaded: loaded (/usr/lib/systemd/system/keyboard-colors.service; disabled; vendor preset: disabled)
     Active: active (running) since Fri 2021-02-12 12:23:21 MST; 12s ago
   Main PID: 319912 (keyboard-color)
      Tasks: 20 (limit: 38385)
     Memory: 34.7M
     CGroup: /system.slice/keyboard-colors.service
             └─319912 /usr/bin/keyboard-color run -c /etc/keyboard-colors.json

Feb 12 12:23:21 manjaro keyboard-color[319912]: No protocol specified
Feb 12 12:23:21 manjaro keyboard-color[319912]: No protocol specified
Feb 12 12:23:21 manjaro keyboard-color[319912]: Root doesn't have permission to see your DPMS state, to give it permission run as your user: xhost si:localuser:root
Feb 12 12:23:21 manjaro keyboard-color[319912]: No protocol specified
Feb 12 12:23:21 manjaro keyboard-color[319912]: I've detected that root doesn't have access to your x-session. If you would like to
Feb 12 12:23:21 manjaro keyboard-color[319912]: turn off the keyboard backlights when the screen is off, you'll need to give root
Feb 12 12:23:21 manjaro keyboard-color[319912]: permission to access it. This might have security implications that you'll need to
Feb 12 12:23:21 manjaro keyboard-color[319912]: evaluate for yourself. To give root permission to your screen until you logout:
Feb 12 12:23:21 manjaro keyboard-color[319912]:    xhost +SI:localuser:root
Feb 12 12:23:21 manjaro keyboard-color[319912]: You can add it to your ~/.profile if you'd like to make it permanent.

This makes no difference:

❯ xhost +si:yochanan:root
yochanan:root being added to access control list
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  109 (X_ChangeHosts)
  Value in failed request:  0xd
  Serial number of failed request:  7
  Current serial number in output stream:  9
❯ ls /sys/class/leds/system76::kbd_backlight/
brightness  brightness_hw_changed  color_center  color_extra  color_left  color_right  device  max_brightness  power  subsystem  trigger  uevent

yochananmarqos avatar Feb 12 '21 19:02 yochananmarqos

That sounds like it might be a missing driver somewhere or maybe xhost isn't supported on that distro. Are you running wayland by chance?

withinboredom avatar Dec 17 '21 07:12 withinboredom

xhost is part of the xorg-xhost package which is required by gdm. I'm running a Xorg session.

yochananmarqos avatar Dec 17 '21 16:12 yochananmarqos

Ah, the localuser part is verbatim and not your user name.

xhost +SI:localuser:root

withinboredom avatar Dec 20 '21 12:12 withinboredom

It didn't seem to make any difference:

❯ xhost +SI:localuser:root
localuser:root being added to access control list
● keyboard-colors.service - System76 Keyboard Colors
     Loaded: loaded (/usr/lib/systemd/system/keyboard-colors.service; disabled; vendor preset: disabled)
     Active: active (running) since Mon 2021-12-20 09:43:36 MST; 5s ago
   Main PID: 1275832 (keyboard-color)
      Tasks: 20 (limit: 38304)
     Memory: 48.9M
        CPU: 614ms
     CGroup: /system.slice/keyboard-colors.service
             └─1275832 /usr/bin/keyboard-color run -c /etc/keyboard-colors.json

Dec 20 09:43:36 serval systemd[1]: Started System76 Keyboard Colors.
Dec 20 09:43:36 serval keyboard-color[1275832]: I've detected that root doesn't have permanent access to your x-session. If you would like to
Dec 20 09:43:36 serval keyboard-color[1275832]: turn off the keyboard backlights when the screen is off, you'll need to give root
Dec 20 09:43:36 serval keyboard-color[1275832]: permission to access it. This might have security implications that you'll need to
Dec 20 09:43:36 serval keyboard-color[1275832]: evaluate for yourself. To give root permission to your screen until you logout:
Dec 20 09:43:36 serval keyboard-color[1275832]:    xhost +SI:localuser:root
Dec 20 09:43:36 serval keyboard-color[1275832]: Add it to your ~/.profile to make it permanent.

yochananmarqos avatar Dec 20 '21 16:12 yochananmarqos

Hey. It turns out I have the same message in my logs. Probably a systemd cgroup thing. I'll experiment and get an update together, it's about time for one anyway.

withinboredom avatar Dec 20 '21 18:12 withinboredom