Last active
March 5, 2022 01:22
-
-
Save primalmotion/04705b4f26ff56288978a5b1ee2671fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
## add this to sway conf | |
# exec_always lid.sh | |
# bindswitch --reload --locked lid:toggle exec lid.sh | |
if grep -q open /proc/acpi/button/lid/LID0/state; then | |
swaymsg "output eDP-1 enable" | |
else | |
# If we are not in CLAMSHELL mode | |
if [[ "$(swaymsg -t get_outputs | grep -c name)" == "1" ]]; then | |
suspend.sh force | |
else | |
swaymsg "output eDP-1 disable" | |
fi | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
# if swaylock is running, we're good | |
killall rofi | |
pgrep swaylock >/dev/null && exit 0 | |
swaylock | |
sleep 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if grep -q open /proc/acpi/button/lid/LID0/state; then | |
swaymsg "output * enable" | |
else | |
swaymsg "output DP-1 enable" | |
fi | |
iwctl station wlan0 scan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ "$1" == "force" || ! $(playerctl -a status | grep 'Playing') && "$(pactl list source-outputs short | wc -l)" == "0" ]]; then | |
playerctl -a pause | |
systemctl suspend-then-hibernate | |
else | |
lockscreen.sh | |
swaymsg "output * disable" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment