aboutsummaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
authorkj-sh6042025-09-25 16:08:25 -0400
committerkj-sh6042025-09-25 16:08:25 -0400
commit2fb31c4961210b6b4f6d5f8a50ebe4124c10cda8 (patch)
treed8a1751d5b7070014164f7f4f4d0911c4963f724 /.local/bin
parent9b64dc47f94cf059885109ee63af2d66f11e0112 (diff)
kj-gitbot: .local/bin/toggle-lid-switch-handling
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/toggle-lid-switch-handling26
1 files changed, 0 insertions, 26 deletions
diff --git a/.local/bin/toggle-lid-switch-handling b/.local/bin/toggle-lid-switch-handling
deleted file mode 100755
index 00eb45b..0000000
--- a/.local/bin/toggle-lid-switch-handling
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-CONFIG_FILE="/etc/systemd/logind.conf"
-
-if [ ! -f "$CONFIG_FILE" ]; then
- echo "Error: $CONFIG_FILE not found"
- exit 1
-fi
-
-CURRENT_VALUE=$(grep "^HandleLidSwitch=" "$CONFIG_FILE" | cut -d "=" -f 2-)
-
-if [ -z "$CURRENT_VALUE" ]; then
- sudo sed -i "s/#HandleLidSwitch=suspend/HandleLidSwitch=suspend/" "$CONFIG_FILE"
- echo "HandleLidSwitch set to suspend"
- exit 0
-fi
-
-if [ "$CURRENT_VALUE" = "suspend" ]; then
- NEW_VALUE="ignore"
-else
- NEW_VALUE="suspend"
-fi
-
-sudo sed -i "s/^HandleLidSwitch=.*/HandleLidSwitch=$NEW_VALUE/" "$CONFIG_FILE"
-
-sudo systemctl restart systemd-logind && echo "HandleLidSwitch toggled to $NEW_VALUE"