mirror of
https://github.com/sahinakkaya/dotfiles.git
synced 2025-07-15 23:39:40 +03:00
Update hyprland config
This commit is contained in:
21
scripts/smart-switch
Executable file
21
scripts/smart-switch
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
monitors=$(hyprctl monitors -j | jq '.[] | .name')
|
||||
edp=$(echo "$monitors" | grep eDP)
|
||||
hdmi=$(echo "$monitors" | grep HDMI)
|
||||
|
||||
if [[ "$1" == "close" ]]; then # lid is closing
|
||||
if [[ -n "$hdmi" ]]; then # -n means if string is not empty
|
||||
hyprctl keyword monitor "eDP-1, disable"
|
||||
else
|
||||
hyprctl dispatch exec lock-screen
|
||||
|
||||
fi
|
||||
else
|
||||
if [[ -z "$edp" ]]; then # -z means if string is empty
|
||||
hyprctl keyword monitor eDP-1,preferred,0x1107,2.0
|
||||
killall ags
|
||||
ags
|
||||
fi
|
||||
fi
|
||||
|
Reference in New Issue
Block a user