Display (with Nexdock / ext display) configuration

Can you use this setup to trigger any event? What I’m thinking is I’d like to disable screen blanking on the phone when plugged into the nexdock but then enable screen blanking when disconnected, is this possible with kanshi?

I think you can add that to systemctl service (not kanshi itself). I’ll try to read up more about services as of now I don’t know what needs to be added to prevent screen blanking

1 Like

Does this work reliably for anyone? I have the user Systemd kanshi.service but I disable the L5 display when the Nexdock gets connected. After a restart, IF it works, it works only the first time. Powering down the Nexdock and starting it up again invariable leads to a very unstable experience, to the point where I have to restart again.

Did anybody get any experience with a method that does reliably work? Clicking through GNOME settings does, obviously, but is not very convenient.

1 Like

It looks like kanshi fails because it tries to apply its config too quickly. The only thing that seems to work 80% of the time is this kludge:

~/.config/kanshi/config

profile alone {
	exec /home/purism/.config/kanshi/on-alone
	output DSI-1 enable scale 2
}

profile nexdock {
	exec /home/purism/.config/kanshi/on-nexdock
	output "Unknown NexDock 8R33926O00Q (DP-1)" enable
	output DSI-1
}

~/.config/kanshi/on-alone

#!/usr/bin/env bash

/usr/bin/wlr-randr --output DSI-1 --on
exec pkill -f -- '--app-id nexdock'

~/.config/kanshi/on-nexdock

#!/usr/bin/env bash

/usr/bin/gnome-session-inhibit --inhibit suspend:idle --inhibit-only --app-id nexdock --reason 'Nexdock session' &
sleep 3
exec /usr/bin/wlr-randr --output DSI-1 --off

So I’m basically just using wlr-randr instead of kanshi now: I only need it so I don’t have to write udev rules myself :person_shrugging:

3 Likes