summaryrefslogtreecommitdiff
path: root/volume-widget/volume.lua
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2020-12-07 15:33:55 -0500
committerGitHub <noreply@github.com>2020-12-07 15:33:55 -0500
commitd4971690cec1e074999e730d87045e578d71e43c (patch)
treeb0f05079840eba5467e14bdcd093ad3ed5362cf4 /volume-widget/volume.lua
parentf078748e76eacae599cf0ad06120d9fff54f8fa5 (diff)
parented2b256407291d8edadfcea9380029633cc7d9d8 (diff)
Merge pull request #224 from streetturtle/comply-with-luacheck
Comply with luacheck
Diffstat (limited to 'volume-widget/volume.lua')
-rw-r--r--volume-widget/volume.lua20
1 files changed, 13 insertions, 7 deletions
diff --git a/volume-widget/volume.lua b/volume-widget/volume.lua
index 0e13f38..cb8c21d 100644
--- a/volume-widget/volume.lua
+++ b/volume-widget/volume.lua
@@ -9,7 +9,6 @@
-------------------------------------------------
local wibox = require("wibox")
-local watch = require("awful.widget.watch")
local spawn = require("awful.spawn")
local naughty = require("naughty")
local gfs = require("gears.filesystem")
@@ -19,7 +18,13 @@ local PATH_TO_ICONS = "/usr/share/icons/Arc/status/symbolic/"
local volume_icon_name="audio-volume-high-symbolic"
local GET_VOLUME_CMD = 'amixer sget Master'
-local volume = {device = '', display_notification = false, display_notification_onClick = true, notification = nil, delta = 5}
+local volume = {
+ device = '',
+ display_notification = false,
+ display_notification_onClick = true,
+ notification = nil,
+ delta = 5
+}
function volume:toggle()
volume:_cmd('amixer ' .. volume.device .. ' sset Master toggle')
@@ -88,9 +93,9 @@ end
--}}}
-local function worker(args)
+local function worker(user_args)
--{{{ Args
- local args = args or {}
+ local args = user_args or {}
local volume_audio_controller = args.volume_audio_controller or 'pulse'
volume.display_notification = args.display_notification or false
@@ -120,7 +125,8 @@ local function worker(args)
resize = false,
widget = wibox.widget.imagebox,
},
- layout = wibox.container.margin(_, _, _, 3),
+ margins = 3,
+ layout = wibox.container.margin,
set_image = function(self, path)
self.icon.image = path
end
@@ -136,7 +142,7 @@ local function worker(args)
local function show()
spawn.easy_async(GET_VOLUME_CMD, function(stdout, _, _, _)
- txt = parse_output(stdout)
+ local txt = parse_output(stdout)
notif(txt, true)
end
)
@@ -165,7 +171,7 @@ local function worker(args)
--}}}
--{{{ Set initial icon
- spawn.easy_async(GET_VOLUME_CMD, function(stdout, stderr, exitreason, exitcode)
+ spawn.easy_async(GET_VOLUME_CMD, function(stdout)
parse_output(stdout)
volume.widget.image = PATH_TO_ICONS .. volume_icon_name .. ".svg"
end)