From 654453265d7bfc67609cb68eb181e49329849123 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Fri, 13 Jan 2023 14:58:11 +1000 Subject: [PATCH] make hotplug run on xinit as well --- hosts/profiles/desktop/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hosts/profiles/desktop/default.nix b/hosts/profiles/desktop/default.nix index e8120310..7f2a0011 100644 --- a/hosts/profiles/desktop/default.nix +++ b/hosts/profiles/desktop/default.nix @@ -169,6 +169,19 @@ in *.color239: #565761 *.color240: #6272a4 *.color241: #b6b6b2 + + # hotplug + connect() { + # Turn it on if it was off + xrandr --output HDMI-2 --auto + xrandr --output HDMI-2 --same-as eDP-1 + } + + disconnect() { + xrandr --output HDMI-2 --off + } + + xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect EOF ''; lightdm = {