From 7a24b71373f915fb95bdc1868b7a839dee3a6523 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 10 Oct 2024 10:11:35 +0200 Subject: hypr: laptop docking --- .config/hypr/conf/keybinds.conf | 2 ++ .config/hypr/scripts/switch.sh | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100755 .config/hypr/scripts/switch.sh diff --git a/.config/hypr/conf/keybinds.conf b/.config/hypr/conf/keybinds.conf index e1d9695..b192c5d 100644 --- a/.config/hypr/conf/keybinds.conf +++ b/.config/hypr/conf/keybinds.conf @@ -92,3 +92,5 @@ bind = $mainMod SHIFT, code:58, movetoworkspace, name:music # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow + +bindl=,switch:Lid Switch, exec, ~/.config/hypr/scripts/switch.sh diff --git a/.config/hypr/scripts/switch.sh b/.config/hypr/scripts/switch.sh new file mode 100755 index 0000000..81ae9e8 --- /dev/null +++ b/.config/hypr/scripts/switch.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# https://github.com/hyprwm/Hyprland/issues/1754#issue-1618824532 + +if grep open /proc/acpi/button/lid/LID0/state; then + hyprctl keyword monitor "eDP-1,highres,auto,1" +else + if [[ `hyprctl monitors | grep "Monitor" | wc -l` != 1 ]]; then + hyprctl keyword monitor "eDP-1, disable" + fi +fi -- cgit v1.2.3-70-g09d2