Use dbus-send which is faster than playerctl for media keys

This commit is contained in:
Warren Hood 2023-02-28 23:24:35 +02:00
parent 5047849e3e
commit 38a7866309
2 changed files with 7 additions and 4 deletions

View file

@ -255,10 +255,10 @@ end)
-- {{{ Key bindings -- {{{ Key bindings
globalkeys = gears.table.join( globalkeys = gears.table.join(
-- Make multimedia keys work properly - mainly for spotify -- Make multimedia keys work properly - mainly for spotify
awful.key({}, "XF86AudioPlay", function() awful.util.spawn("playerctl play-pause") end), awful.key({}, "XF86AudioPlay", function() awful.util.spawn(os.getenv("HOME").."/.scripts/playerctl-fast play-pause") end),
awful.key({}, "XF86AudioStop", function() awful.util.spawn("playerctl play-pause") end), awful.key({}, "XF86AudioStop", function() awful.util.spawn(os.getenv("HOME").."/.scripts/playerctl-fast play-pause") end),
awful.key({}, "XF86AudioPrev", function() awful.util.spawn("playerctl previous") end), awful.key({}, "XF86AudioPrev", function() awful.util.spawn(os.getenv("HOME").."/.scripts/playerctl-fast previous") end),
awful.key({}, "XF86AudioNext", function() awful.util.spawn("playerctl next") end), awful.key({}, "XF86AudioNext", function() awful.util.spawn(os.getenv("HOME").."/.scripts/playerctl-fast next") end),
awful.key({ modkey, }, "s", hotkeys_popup.show_help, awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{ description = "show help", group = "awesome" }), { description = "show help", group = "awesome" }),

3
setup
View file

@ -51,3 +51,6 @@ nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
add_to_file "alias nv='nvim'" "$HOME/.zshrc" add_to_file "alias nv='nvim'" "$HOME/.zshrc"
add_to_file 'eval "$(starship init bash)"' "$HOME/.bashrc" add_to_file 'eval "$(starship init bash)"' "$HOME/.bashrc"
add_to_file 'eval "$(starship init zsh)"' "$HOME/.zshrc" add_to_file 'eval "$(starship init zsh)"' "$HOME/.zshrc"
add_to_file 'export PATH="$PATH:$HOME/.scripts"' "$HOME/.zshrc"
add_to_file 'export PATH="$PATH:$HOME/.scripts"' "$HOME/.bashrc"