diff --git a/users/profiles/desktop/bin/hotplug-monitor.sh b/users/profiles/desktop/bin/hotplug-monitor.sh new file mode 100755 index 00000000..0fc021a3 --- /dev/null +++ b/users/profiles/desktop/bin/hotplug-monitor.sh @@ -0,0 +1,11 @@ +#! /usr/bin/env bash + +connect() { + xrandr --output HDMI-2 --same-as eDP-1 +} + +disconnect() { + xrandr --output HDMI-2 --off +} + +xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect diff --git a/users/profiles/desktop/default.nix b/users/profiles/desktop/default.nix index 0d784a61..ace80caa 100644 --- a/users/profiles/desktop/default.nix +++ b/users/profiles/desktop/default.nix @@ -75,6 +75,8 @@ in nlSupport = true; }) papirus-icon-theme + calendar-cli + wyrd ]; @@ -143,8 +145,19 @@ in *.color239: #565761 *.color240: #6272a4 *.color241: #b6b6b2 - xsetroot -cursor_name left_ptr EOF + + xsetroot -cursor_name left_ptr + # hotplug + connect() { + xrandr --output HDMI-2 --same-as eDP-1 + } + + disconnect() { + xrandr --output HDMI-2 --off + } + + xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect ''; lightdm.enable = true; lightdm.greeters.mini.enable = true; @@ -263,6 +276,7 @@ in ".local/bin/passmenu".source = ./bin/passmenu; ".local/bin/powermenu".source = ./bin/powermenu; ".local/bin/screenshot".source = ./bin/screenshot; + # ".local/bin/hotplug-monitor.sh".source = ./bin/hotplug-monitor.sh; }; qt = { diff --git a/users/profiles/desktop/run.sh b/users/profiles/desktop/run.sh index 6fcdcf4d..fb646408 100755 --- a/users/profiles/desktop/run.sh +++ b/users/profiles/desktop/run.sh @@ -4,4 +4,3 @@ pkill -u $UID -x polybar while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done polybar mybar >$XDG_DATA_HOME/polybar.log 2>&1 & -echo 'Polybar launched...'