diff --git a/dots/.config/hypr/scripts/disable-laptop-screen.bash b/dots/.config/hypr/scripts/disable-laptop-screen.bash new file mode 100755 index 00000000..57d50441 --- /dev/null +++ b/dots/.config/hypr/scripts/disable-laptop-screen.bash @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +main() { + local mon_count + mon_count="$(hyprctl monitors -j | jq length)" + if (( mon_count > 1 )); then + hyprctl keyword monitor "eDP-1, disable" + fi +} + +main diff --git a/dots/.config/hypr/wm/monitors.conf b/dots/.config/hypr/wm/monitors.conf index d65fc01e..f7852a17 100644 --- a/dots/.config/hypr/wm/monitors.conf +++ b/dots/.config/hypr/wm/monitors.conf @@ -1,4 +1,4 @@ monitor = , preferred, auto, 1 monitor=eDP-1,preferred,auto,1.4 bindl=,switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1, preferred, auto, 1" -bindl=,switch:on:Lid Switch,exec,hyprctl keyword monitor "eDP-1, disable" +bindl=,switch:on:Lid Switch,exec,~/.config/hypr/scripts/disable-laptop-screen.bash