]> git.rmz.io Git - dotfiles.git/commitdiff
awesome: add mopidy server to awesompd + adapt bindings
authorSamir Benmendil <samir.benmendil@gmail.com>
Wed, 4 Jun 2014 04:25:55 +0000 (05:25 +0100)
committerSamir Benmendil <samir.benmendil@gmail.com>
Wed, 4 Jun 2014 04:28:12 +0000 (05:28 +0100)
awesome/bindings.lua
awesome/widgets/awesompd.lua

index 44e63388e73fcba10e4b39f80e5adf08f35b4551..9e83c3246d9554530b524c44b6ef0b199b7662ee 100644 (file)
@@ -18,7 +18,7 @@ clientbuttons = awful.util.table.join(
     awful.button({ modkey }, 3, awful.mouse.client.resize))
 
 -- {{{1 Global Keys
-globalkeys = awful.util.table.join(
+globalkeys = awful.util.table.join(globalkeys,
     -- {{{2 Awesome Keys
     awful.key({ modkey,           }, "Left",   awful.tag.viewprev       ),
     awful.key({ modkey,           }, "Right",  awful.tag.viewnext       ),
@@ -93,11 +93,7 @@ globalkeys = awful.util.table.join(
     -- Volume
     awful.key({ }, "XF86AudioRaiseVolume",  function () awful.util.spawn("ponymix increase 5") end),
     awful.key({ }, "XF86AudioLowerVolume",  function () awful.util.spawn("ponymix decrease 5") end),
-    awful.key({ }, "XF86AudioMute",         function () awful.util.spawn("ponymix toggle")     end),
-    -- mpd
-    awful.key({ }, "XF86AudioPlay",         function () awful.util.spawn("mpc toggle") end),
-    awful.key({ }, "XF86AudioNext",         function () awful.util.spawn("mpc next")   end),
-    awful.key({ }, "XF86AudioPrev",         function () awful.util.spawn("mpc prev")   end)
+    awful.key({ }, "XF86AudioMute",         function () awful.util.spawn("ponymix toggle")     end)
 )
 
 -- {{{1 Client keys
index ea8ea2a37bd5e58df27e4fd8c5c815d1cf4c1ed3..6ac896435332e498b6195f8e889f40702d895e06 100644 (file)
@@ -2,12 +2,12 @@ local awesompd = require("widgets/awesompd/awesompd")
 local musicwidget
 
 musicwidget = awesompd:create() -- Create awesompd widget
-musicwidget.font = "Liberation Mono" -- Set widget font 
+musicwidget.font = "Liberation Mono" -- Set widget font
 musicwidget.scrolling = true -- If true, the text in the widget will be scrolled
 musicwidget.output_size = 30 -- Set the size of widget in symbols
 musicwidget.update_interval = 1 -- Set the update interval in seconds
 -- Set the folder where icons are located
-musicwidget.path_to_icons = "/home/ramsi/.config/awesome/widgets/awesompd/icons" 
+musicwidget.path_to_icons = "/home/ramsi/.config/awesome/widgets/awesompd/icons"
 -- Set the default music format for Jamendo streams. You can change
 -- this option on the fly in awesompd itself.
 -- possible formats: awesompd.FORMAT_MP3, awesompd.FORMAT_OGG
@@ -32,7 +32,9 @@ musicwidget.rdecorator = " "
 -- Set all the servers to work with (here can be any servers you use)
 musicwidget.servers = {
     { server = "localhost",
-        port = 6600 } }
+        port = 6600 },
+    { server = "localhost",
+        port = 6601 } }
 -- Set the buttons of the widget
 musicwidget:register_buttons({
     { "",        awesompd.MOUSE_LEFT,        musicwidget:command_playpause()   },
@@ -41,7 +43,16 @@ musicwidget:register_buttons({
     { "",        awesompd.MOUSE_SCROLL_UP,   musicwidget:command_volume_up()   },
     { "",        awesompd.MOUSE_SCROLL_DOWN, musicwidget:command_volume_down() },
     { "",        awesompd.MOUSE_RIGHT,       musicwidget:command_show_menu()   },
+    { "",        "XF86AudioPlay",            musicwidget:command_playpause()   },
+    { "",        "XF86AudioPrev",            musicwidget:command_prev_track()  },
+    { "",        "XF86AudioNext",            musicwidget:command_next_track()  },
+    { "Shift",   "XF86AudioPrev",            musicwidget:command_previous_server()  },
+    { "Shift",   "XF86AudioNext",            musicwidget:command_next_server()  }
 })
-musicwidget:run() -- After all configuration is done, run the widget
+
+-- register global_keys
+musicwidget:append_global_keys()
+-- After all configuration is done, run the widget
+musicwidget:run()
 
 return musicwidget.widget