~palb91/sway-man-inhibit

sway-man-inhibit/sway-man-inhibit -rwxr-xr-x 493 bytes
c398ff4a — Pierre-Albéric TROUPLIN init: add LICENSE, README and script 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
#
# Manage lock and manual inhibitor

lock_file="${XDG_RUNTIME_DIR}/inhibit.lock"

[ "${#}" -gt 0 ] || set -- status

case "${1}" in
    create) touch "${lock_file}"                                  ;;
    remove) rm -f "${lock_file}"                                  ;;
    toggle) rm "${lock_file}" 2>/dev/null || touch "${lock_file}" ;;
    status) [ -e "${lock_file}" ]                                 ;;
         *) exit 33                                               ;;
esac