aboutsummaryrefslogtreecommitdiff
path: root/rcsample.lua
diff options
context:
space:
mode:
authorAlexander Yakushev <yakushev.alex@gmail.com>2011-12-07 20:35:23 +0200
committerAlexander Yakushev <yakushev.alex@gmail.com>2011-12-07 20:35:23 +0200
commit6935c91c1bf11db5584be59dab959586d25b0b31 (patch)
treeefa6fb2a07b1aeb32135bfe2412c6f58c246d9f4 /rcsample.lua
parent0a22b6a911c10d2a07455846f1ee1cd40940b2e6 (diff)
downloadawesompd-6935c91c1bf11db5584be59dab959586d25b0b31.tar.gz
awesompd-6935c91c1bf11db5584be59dab959586d25b0b31.tar.bz2
Add support for global keybindings
See rcsample.lua and wikipage for instructions
Diffstat (limited to 'rcsample.lua')
-rw-r--r--rcsample.lua14
1 files changed, 11 insertions, 3 deletions
diff --git a/rcsample.lua b/rcsample.lua
index 30acbb9..c5e0364 100644
--- a/rcsample.lua
+++ b/rcsample.lua
@@ -127,17 +127,22 @@ mysystray = widget({ type = "systray" })
port = 6600 }
}
- -- Set the buttons of the widget
+ -- Set the buttons of the widget. Keyboard keys are working in the
+ -- entire Awesome environment. Also look at the line 352.
musicwidget:register_buttons({ { "", awesompd.MOUSE_LEFT, musicwidget:command_playpause() },
{ "Control", awesompd.MOUSE_SCROLL_UP, musicwidget:command_prev_track() },
{ "Control", awesompd.MOUSE_SCROLL_DOWN, musicwidget:command_next_track() },
{ "", awesompd.MOUSE_SCROLL_UP, musicwidget:command_volume_up() },
{ "", awesompd.MOUSE_SCROLL_DOWN, musicwidget:command_volume_down() },
- { "", awesompd.MOUSE_RIGHT, musicwidget:command_show_menu() } })
+ { "", awesompd.MOUSE_RIGHT, musicwidget:command_show_menu() },
+ { "", "XF86AudioLowerVolume", musicwidget:command_volume_down() },
+ { "", "XF86AudioRaiseVolume", musicwidget:command_volume_up() },
+ { modkey, "Pause", musicwidget:command_playpause() } })
+
musicwidget:run() -- After all configuration is done, run the widget
-- END OF AWESOMPD WIDGET DECLARATION
--- Don't forget to add the widget to the wibox. It is done on the line 207.
+-- Don't forget to add the widget to the wibox. It is done on the line 216.
mywibox = {}
mypromptbox = {}
@@ -343,6 +348,9 @@ clientbuttons = awful.util.table.join(
awful.button({ modkey }, 3, awful.mouse.client.resize))
-- Set keys
+-- Add this line before root.keys(globalkeys).
+musicwidget:append_global_keys()
+
root.keys(globalkeys)
-- }}}