Files
sway-dotfile/scripts/lid-handler.sh
2026-04-13 11:47:42 +08:00

10 lines
260 B
Bash
Executable File

#!/bin/bash
# 检查是否插电
if cat /sys/class/power_supply/AC*/online 2>/dev/null | grep -q 1; then
# 插电:锁屏
swaylock -i /home/gh0s7/Pictures/Wallpapers/ThinkPad/IBM1024R.BMP -s fill
else
# 不插电:睡眠
systemctl suspend
fi