Swayscript : Use Y/N for DisplayWidget status.
This commit is contained in:
parent
3dc2a5e865
commit
3d8ef1bf18
|
@ -55,11 +55,11 @@
|
||||||
local __dnd=$(_dnd)
|
local __dnd=$(_dnd)
|
||||||
local class=""
|
local class=""
|
||||||
|
|
||||||
if [[ "''${__monitor}" = "on" ]] || [[ "''${__gaming}" = "on" ]] || [[ "''${__recording}" = "on" ]] || [[ "''${__dnd}" = "on" ]]; then
|
if [[ "''${__monitor}" = "Y" ]] || [[ "''${__gaming}" = "Y" ]] || [[ "''${__recording}" = "Y" ]] || [[ "''${__dnd}" = "Y" ]]; then
|
||||||
class="modified"
|
class="modified"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "{\"text\": \"\", \"tooltip\": \"DND: ''${__dnd^} / Monitor: ''${__monitor^} / Gaming: ''${__gaming^} / Recording: ''${__recording^}\", \"class\": \"''${class}\"}\n"
|
printf "{\"text\": \"\", \"tooltip\": \"DND: ''${__dnd} / Monitor: ''${__monitor} / Gaming: ''${__gaming} / Recording: ''${__recording}\", \"class\": \"''${class}\"}\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
function _monitor() {
|
function _monitor() {
|
||||||
|
@ -67,21 +67,21 @@
|
||||||
|
|
||||||
for state in "''${outputs[@]}"; do
|
for state in "''${outputs[@]}"; do
|
||||||
''${state} || {
|
''${state} || {
|
||||||
printf on
|
printf Y
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
|
||||||
printf off
|
printf n
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function _recording() {
|
function _recording() {
|
||||||
[[ "$(ps cax | rg wf-recorder)" = "" ]] && printf off || printf on
|
[[ "$(ps cax | rg wf-recorder)" = "" ]] && printf n || printf Y
|
||||||
}
|
}
|
||||||
|
|
||||||
function _dnd() {
|
function _dnd() {
|
||||||
[[ "$(makoctl mode)" = "dnd" ]] && printf on || printf off
|
[[ "$(makoctl mode)" = "dnd" ]] && printf Y || printf n
|
||||||
}
|
}
|
||||||
|
|
||||||
function _gaming() {
|
function _gaming() {
|
||||||
|
@ -89,12 +89,12 @@
|
||||||
|
|
||||||
for state in "''${outputs[@]}"; do
|
for state in "''${outputs[@]}"; do
|
||||||
[[ "''${state}" = "disabled" ]] || {
|
[[ "''${state}" = "disabled" ]] || {
|
||||||
printf on
|
printf Y
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
|
||||||
printf off
|
printf n
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue