aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/toggle-lid-switch-handling
diff options
context:
space:
mode:
authorkj_sh6042025-11-10 08:37:05 -0500
committerkj_sh6042025-11-10 08:37:05 -0500
commit0812ea28c4add18ef4ee9d8f21fabcae84dd351f (patch)
treea9ed9470ac5f82098b7548cce4220114b6afa448 /.local/bin/toggle-lid-switch-handling
parentac5e3fb377492af21ceb5234b5c7b5d3f12e0b6a (diff)
revert-to: 77949a068755ee72d7b5eaf5570cd2cd34a8d222 with changes
Diffstat (limited to '.local/bin/toggle-lid-switch-handling')
-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"