From 99a42df0d7d5caa07cd5b4923d7c02802b448d63 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Wed, 9 Dec 2020 15:37:18 +0700 Subject: Update 2020-12-09 --- awesome/.config/awesome/rc.lua | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'awesome') diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua index 1e8432f..66deb1a 100644 --- a/awesome/.config/awesome/rc.lua +++ b/awesome/.config/awesome/rc.lua @@ -60,9 +60,9 @@ local slock_suspend = "slock systemctl --ignore-inhibitors suspend" -- Audacious media player local audacious_main_window = "audacious --show-main-window" local audacious_jump_box = "audacious --show-jump-box" -local audacious_play_pause = "audacious --play-pause" -local audacious_rewind = "audacious --rew" -local audacious_forward = "audacious --fwd" +local play_pause = "playerctl play-pause" +local rewind = "playerctl previous" +local forward = "playerctl next" local scrot = "scrot /home/cnx/Desktop/%FT%T.png" local scrot_select = "scrot --border --select /home/cnx/Desktop/%FT%T.png" @@ -228,20 +228,20 @@ awful.spawn.with_line_callback( end} ) -local function audacious_seeker(time) +local function seeker(time, sign) return function () - awful.spawn(("audtool playback-seek-relative %f"):format(time)) + awful.spawn(("playerctl position %f%s"):format(time, sign)) end end local myplayer = wibox.container.background(myplayer_text, beautiful.magenta) myplayer.fg = beautiful.gray myplayer:buttons(awful.util.table.join( - awful.button({}, 1, spawner(audacious_rewind)), - awful.button({}, 2, spawner(audacious_play_pause)), - awful.button({}, 3, spawner(audacious_forward)), - awful.button({}, 4, audacious_seeker(1)), - awful.button({}, 5, audacious_seeker(-1)) + awful.button({}, 1, spawner(rewind)), + awful.button({}, 2, spawner(play_pause)), + awful.button({}, 3, spawner(forward)), + awful.button({}, 4, seeker(1, "+")), + awful.button({}, 5, seeker(1, "-")) )) -- Create a weather widget @@ -502,17 +502,17 @@ local globalkeys = awful.util.table.join( {description = "Audacious: jump-to-song", group = "multimedia"}), awful.key({modkey, "Shift"}, "a", spawner(audacious_main_window), {description = "Audacious: main window", group = "launcher"}), - awful.key({modkey, "Control"}, "a", spawner(audacious_play_pause), + awful.key({modkey, "Control"}, "a", spawner(play_pause), {description = "Audacious: play/pause", group = "multimedia"}), - awful.key({modkey}, "Up", spawner(audacious_rewind), + awful.key({modkey}, "Up", spawner(rewind), {description = "Audacious: previous track", group = "multimedia"}), - awful.key({modkey}, "Down", spawner(audacious_forward), + awful.key({modkey}, "Down", spawner(forward), {description = "Audacious: next track", group = "multimedia"}), - awful.key({}, "XF86AudioPlay", spawner(audacious_play_pause), + awful.key({}, "XF86AudioPlay", spawner(play_pause), {description = "Audacious: jump-to-song", group = "multimedia"}), - awful.key({}, "XF86AudioPrev", spawner(audacious_rewind), + awful.key({}, "XF86AudioPrev", spawner(rewind), {description = "Audacious: previous track", group = "multimedia"}), - awful.key({}, "XF86AudioNext", spawner(audacious_forward), + awful.key({}, "XF86AudioNext", spawner(forward), {description = "Audacious: next track", group = "multimedia"}), awful.key({}, "XF86Display", spawner"arandr", {description = "open Arandr", group = "multimedia"}), -- cgit 1.4.1