Using easy_async instead of easy_async_with_shell, providing commands as a list of arguments
This commit is contained in:
parent
f25f80077a
commit
699df89ad0
|
@ -75,7 +75,7 @@ local function factory(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
function mic:mute()
|
function mic:mute()
|
||||||
awful.spawn.easy_async_with_shell("amixer set Capture nocap",
|
awful.spawn.easy_async({"amixer", "set", "Capture", "nocap"},
|
||||||
function()
|
function()
|
||||||
self:update()
|
self:update()
|
||||||
end
|
end
|
||||||
|
@ -83,7 +83,7 @@ local function factory(args)
|
||||||
end
|
end
|
||||||
|
|
||||||
function mic:unmute()
|
function mic:unmute()
|
||||||
awful.spawn.easy_async_with_shell("amixer set Capture cap",
|
awful.spawn.easy_async({"amixer", "set", "Capture", "cap"},
|
||||||
function()
|
function()
|
||||||
self:update()
|
self:update()
|
||||||
end
|
end
|
||||||
|
@ -91,7 +91,7 @@ local function factory(args)
|
||||||
end
|
end
|
||||||
|
|
||||||
function mic:toggle()
|
function mic:toggle()
|
||||||
awful.spawn.easy_async_with_shell("amixer set Capture toggle",
|
awful.spawn.easy_async({"amixer", "set", "Capture", "toggle"},
|
||||||
function()
|
function()
|
||||||
self:update()
|
self:update()
|
||||||
end
|
end
|
||||||
|
@ -115,7 +115,7 @@ local function factory(args)
|
||||||
-- - If there are lines with "[on]" then assume microphone is "unmuted".
|
-- - If there are lines with "[on]" then assume microphone is "unmuted".
|
||||||
-- - If there are NO lines with "[on]" then assume microphone is "muted".
|
-- - If there are NO lines with "[on]" then assume microphone is "muted".
|
||||||
mic, mic.timer = awful.widget.watch(
|
mic, mic.timer = awful.widget.watch(
|
||||||
"bash -c \"amixer get Capture | grep '\\[on\\]'\"",
|
{"bash", "-c", "amixer get Capture | grep '\\[on\\]'"},
|
||||||
mic.timeout,
|
mic.timeout,
|
||||||
function(self, stdout, stderr, exitreason, exitcode)
|
function(self, stdout, stderr, exitreason, exitcode)
|
||||||
local current_micState = "error"
|
local current_micState = "error"
|
||||||
|
|
Loading…
Reference in New Issue