diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-10-24 22:29:35 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-10-24 22:29:35 +0530 |
commit | 4f0a26b94993e4a910ab9dc54bb5c93ce2aa660d (patch) | |
tree | 6e7ed889e119b3aa9602cf4bb0a8b25fc6743412 /.scripts/screensetup.sh | |
parent | 2e3d99acd413c663c489312daadd3197fd558c15 (diff) |
not turning on laptop screen if lid is off upon login
Diffstat (limited to '.scripts/screensetup.sh')
-rwxr-xr-x | .scripts/screensetup.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/.scripts/screensetup.sh b/.scripts/screensetup.sh new file mode 100755 index 0000000..31d9c3a --- /dev/null +++ b/.scripts/screensetup.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if [[ $(xrandr --query | grep "eDP-1-1" ) ]]; then + if [[ $(cat /proc/acpi/button/lid/LID/state | awk '{print $2}') = "closed" ]]; then + xrandr --output HDMI-0 --primary --mode 1920x1080 --pos 1920x0 --rotate normal --output eDP-1-1 --off + else + xrandr --output HDMI-0 --primary --mode 1920x1080 --pos 1920x0 --rotate normal --output eDP-1-1 --mode 1920x1080 --pos 0x489 --rotate normal # monitor front, laptop left + fi +fi |