Swayscript : Fix multiple toggles.
This commit is contained in:
parent
1c7afa8072
commit
a01d65e118
|
@ -20,11 +20,8 @@
|
||||||
|
|
||||||
# Toggle monitors.
|
# Toggle monitors.
|
||||||
function montoggle() {
|
function montoggle() {
|
||||||
if [[ "$(_monstate)" = "on" ]]; then
|
local state=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .power')
|
||||||
monoff
|
''${state} && monoff || monon
|
||||||
else
|
|
||||||
monon
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function monbar() {
|
function monbar() {
|
||||||
|
@ -78,11 +75,8 @@
|
||||||
|
|
||||||
# Toggle gaming.
|
# Toggle gaming.
|
||||||
function gamingtoggle() {
|
function gamingtoggle() {
|
||||||
if [[ "$(_gamingstate)" = "on" ]]; then
|
local state=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .adaptive_sync_status')
|
||||||
gamingoff
|
[[ "''${state}" = "disabled" ]] && gamingon || gamingoff
|
||||||
else
|
|
||||||
gamingon
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _gamingstate() {
|
function _gamingstate() {
|
||||||
|
|
Loading…
Reference in a new issue