~emersion/kanshi#91: 
bug: no output when docking with primary screen suspended via dpms

Hi, first of all thank you for your work in kanshi, I noticed this behaviour when attaching a usb-c dock.

#Environment

Laptop: Thinkpad X13 AMD Gen 1 (4750U) OS: Debian 12 + sway + swayidle Kernel: same behaviour with official debian kernel and with 6.4.4 compiled from source Dock: Lenovo USB-C Docking Station (40AY)

#kanshi config:

profile default { output "eDP-1" enable } profile dock { output "Lenovo Group Limited LEN L27q-10 U4330047" enable output "eDP-1" disable }

#Steps to reproduce:

  • let idle action in swayidle suspend the internal display (dpms off)
  • plug the laptop to the docking station

#Expected result:

kanshi configuration applied: laptop screen disabled and external display enabled

#Actual Result:

primary display off, external monitor off. unplug and replug doesn't work, no signal on both screens.

#Workaround:

I found this workaround effective apparently: a udev rule that activates via dpms both monitors at drm status change

#udev rule:

KERNEL=="card0", SUBSYSTEM=="drm", RUN+="/bin/su $user -c /etc/conf.d/kanshi-fix.sh"

#/etc/conf.d/kanshi-fix.sh:

#!/bin/sh export SWAYSOCK=/run/user/$(id -u)/sway-ipc.$(id -u).$(pgrep -x sway).sock export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u)/bus" swaymsg "output * dpms on"

Please let me know if I can help. Thank you again

Status
REPORTED
Submitter
21
Assigned to
No-one
Submitted
1 year, 8 months ago
Updated
1 year, 8 months ago
Labels
No labels applied.

~emersion 1 year, 8 months ago*

kanshi does not manage the DPMS state. swayidle is responsible for powering on all outputs again.

21 1 year, 8 months ago ยท edit

Thank you, unfortunately swayidle doesn't seems to handle the resume when an usb-c display/dock is added, so there is no way to wake up the display before applying the kanshi profile (except with the udev workaround I mentioned early). I tried to exec "swaymsg output * dpms on" in kanshi config, but I think (correct me if I'm wrong) that kanshi executes all commands after applying the output profile, so it's too late.

on 20/07/2023 16.24, ~emersion wrote:

kanshi does not managed the DPMS state. swayidle is responsible for powering on all outputs again.