Support disabling volume control

This commit is contained in:
Alice Gaudon 2020-10-02 18:38:44 +02:00
parent 9ea205e39c
commit a29cf9e2b6
1 changed files with 18 additions and 7 deletions

View File

@ -192,22 +192,33 @@ local toggleMute = function()
end
-- }}}
function getKeys(config)
function getKeys(keys)
if config.audio.card == 'disabled' then
return
-- Media control
hotkey.make(keys.playPause, playPause,
{ description = "Toggle Play / Pause", group = "media control" }),
hotkey.make(keys.nextTrack, nextTrack,
{ description = "Next track", group = "media control" }),
hotkey.make(keys.previousTrack, previousTrack,
{ description = "Previous track", group = "media control" })
end
return
-- Volume control
hotkey.make(config.raiseVolume, raiseVolume,
hotkey.make(keys.raiseVolume, raiseVolume,
{ description = "Raise volume", group = "media control" }),
hotkey.make(config.lowerVolume, lowerVolume,
hotkey.make(keys.lowerVolume, lowerVolume,
{ description = "Lower volume", group = "media control" }),
hotkey.make(config.toggleMute, toggleMute,
hotkey.make(keys.toggleMute, toggleMute,
{ description = "Toggle mute audio", group = "media control" }),
-- Media control
hotkey.make(config.playPause, playPause,
hotkey.make(keys.playPause, playPause,
{ description = "Toggle Play / Pause", group = "media control" }),
hotkey.make(config.nextTrack, nextTrack,
hotkey.make(keys.nextTrack, nextTrack,
{ description = "Next track", group = "media control" }),
hotkey.make(config.previousTrack, previousTrack,
hotkey.make(keys.previousTrack, previousTrack,
{ description = "Previous track", group = "media control" })
end