diff --git a/configs/awesome/keymapping/init.lua b/configs/awesome/keymapping/init.lua new file mode 100644 index 0000000..a0e8502 --- /dev/null +++ b/configs/awesome/keymapping/init.lua @@ -0,0 +1,10 @@ +local function bind(globalkeys, clientkeys, clientbuttons) + -- Media Control + globalkeys, clientkeys, clientbuttons = require('keymapping.mediacontrol').bind(globalkeys, clientkeys, clientbuttons) + + return globalkeys, clientkeys, clientbuttons +end + +return { + bind = bind +} \ No newline at end of file diff --git a/configs/awesome/keymapping/mediacontrol.lua b/configs/awesome/keymapping/mediacontrol.lua new file mode 100644 index 0000000..5b94b8d --- /dev/null +++ b/configs/awesome/keymapping/mediacontrol.lua @@ -0,0 +1,19 @@ +local awful = require("awful") +local gears = require("gears") + +local function bind(globalkeys, clientkeys, clientbuttons) + globalkeys = gears.table.join(globalkeys, + awful.key({ }, "XF86AudioPlay", function () awful.util.spawn_with_shell("playerctl play-pause") end), + awful.key({ }, "XF86AudioNext", function () awful.util.spawn_with_shell("playerctl next") end), + awful.key({ }, "XF86AudioPrev", function () awful.util.spawn_with_shell("playerctl previous") end), + awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn_with_shell("amixer -c 0 set Master 1dB+") end), + awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn_with_shell("amixer -c 0 set Master 1dB-") end), + awful.key({ }, "XF86AudioMute", function () awful.util.spawn_with_shell("amixer -c 0 set Master toggle") end) + ) + + return globalkeys, clientkeys, clientbuttons +end + +return { + bind = bind +} \ No newline at end of file diff --git a/configs/awesome/rc.lua b/configs/awesome/rc.lua index 5e77312..133280c 100644 --- a/configs/awesome/rc.lua +++ b/configs/awesome/rc.lua @@ -494,6 +494,8 @@ end), awful.button({modkey}, 3, function(c) awful.mouse.client.resize(c) end)) +globalkeys, clientkeys, clientbuttons = require('keymapping').bind(globalkeys, clientkeys, clientbuttons) + -- Set keys root.keys(globalkeys) -- }}} @@ -616,4 +618,4 @@ end) client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) --- }}} +-- }}} \ No newline at end of file diff --git a/scripts/window_manager/awesome/install.sh b/scripts/window_manager/awesome/install.sh index 53793c1..d8c393f 100755 --- a/scripts/window_manager/awesome/install.sh +++ b/scripts/window_manager/awesome/install.sh @@ -6,7 +6,7 @@ if [[ "$WINDOW_MANAGER" == 'awesome' ]]; then echo '[INFO] Awesome installed' if [[ "$WITH_WINDOW_MANAGER_DEPENDENCIES" == 'yes' ]]; then - install_package alacritty rofi + install_package alacritty rofi playerctl fi else echo '[INFO] Awesome already installed'