add keybindings for ALSA volume control.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local awful = require("awful");
|
||||
local beautiful = require("beautiful")
|
||||
local altkey = "Mod1"
|
||||
local modkey = "Mod4"
|
||||
|
||||
@@ -11,6 +12,7 @@ end
|
||||
|
||||
|
||||
pravitekeys = awful.util.table.join(
|
||||
-- if app is running, raise it, otherwise launch it
|
||||
awful.key({ altkey, "Control" }, "a",
|
||||
function ()
|
||||
run_or_raise("android-studio", {class = "jetbrains-studio"})
|
||||
@@ -39,6 +41,40 @@ pravitekeys = awful.util.table.join(
|
||||
awful.key({ altkey, "Shift" }, "e",
|
||||
function ()
|
||||
run_or_raise("pcmanfm", {class = "Pcmanfm"})
|
||||
end),
|
||||
|
||||
-- ALSA volume control
|
||||
awful.key({ }, "XF86AudioRaiseVolume",
|
||||
function ()
|
||||
os.execute(string.format("amixer set %s 1%%+", beautiful.volume.channel))
|
||||
beautiful.volume.update()
|
||||
end),
|
||||
awful.key({ altkey }, "Up",
|
||||
function ()
|
||||
os.execute(string.format("amixer set %s 1%%+", beautiful.volume.channel))
|
||||
beautiful.volume.update()
|
||||
end),
|
||||
awful.key({ }, "XF86AudioLowerVolume",
|
||||
function ()
|
||||
os.execute(string.format("amixer set %s 1%%-", beautiful.volume.channel))
|
||||
beautiful.volume.update()
|
||||
end),
|
||||
awful.key({ altkey }, "Down",
|
||||
function ()
|
||||
os.execute(string.format("amixer set %s 1%%-", beautiful.volume.channel))
|
||||
beautiful.volume.update()
|
||||
end),
|
||||
awful.key({ }, "XF86AudioMute",
|
||||
function ()
|
||||
os.execute(string.format("amixer set %s toggle", beautiful.volume.togglechannel
|
||||
or beautiful.volume.channel))
|
||||
beautiful.volume.update()
|
||||
end),
|
||||
awful.key({ altkey }, "m",
|
||||
function ()
|
||||
os.execute(string.format("amixer set %s toggle", beautiful.volume.togglechannel
|
||||
or beautiful.volume.channel))
|
||||
beautiful.volume.update()
|
||||
end)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user