Fix sleep and wake on lock screen
This commit is contained in:
37
way-displays-enable
Executable file
37
way-displays-enable
Executable file
@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
let just_list=0
|
||||
local operation="-d"
|
||||
local jq_filter_neg="| not"
|
||||
local ignored=()
|
||||
|
||||
while getopts 'ldi:' name; do
|
||||
case "${name}" in
|
||||
l)
|
||||
just_list=1
|
||||
;;
|
||||
d)
|
||||
jq_filter_neg=""
|
||||
operation="-s"
|
||||
;;
|
||||
i)
|
||||
ignored+="${OPTARG}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
SCRIPT=".[] | select(.enabled${jq_filter_neg}) | .name"
|
||||
|
||||
set -e
|
||||
displays=("${(0)$(wlr-randr --json | jq --raw-output0 "${SCRIPT}")}")
|
||||
set +e
|
||||
|
||||
displays=(${displays:|ignored})
|
||||
|
||||
if ((just_list)); then
|
||||
printf '%s\0' ${displays}
|
||||
else
|
||||
for display in ${displays}; do
|
||||
way-displays "${operation}" DISABLED "${display}"
|
||||
done
|
||||
fi
|
Reference in New Issue
Block a user