Skip to content

Instantly share code, notes, and snippets.

@theissn
Created July 27, 2025 16:26
Show Gist options
  • Select an option

  • Save theissn/d4cbb99d6159fddd65e1a5e5ad51c492 to your computer and use it in GitHub Desktop.

Select an option

Save theissn/d4cbb99d6159fddd65e1a5e5ad51c492 to your computer and use it in GitHub Desktop.
bindl=,switch:off:Lid Switch,exec,~/.local/bin/lid open
bindl=,switch:on:Lid Switch,exec,~/.local/bin/lid close
#!/usr/bin/env bash
monitors="$(hyprctl monitors)"
if echo "$monitors" | grep -qE '^Monitor DP-[0-9]+'; then
case "$1" in
open)
hyprctl keyword monitor "eDP-1,1920x1200,2560x0,1"
;;
close)
hyprctl keyword monitor "eDP-1,disable"
;;
*)
echo "Usage: $0 {open|close}"
exit 1
;;
esac
else
if [[ $1 == "open" ]]; then
hyprctl keyword monitor "eDP-1,1920x1200,0x0,1"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment