]> git.rmz.io Git - dotfiles.git/blob - awesome/widgets/awesompd.lua
awesome: use lain for single screen
[dotfiles.git] / awesome / widgets / awesompd.lua
1 local awesompd = require("widgets/awesompd/awesompd")
2 local musicwidget
3
4 musicwidget = awesompd:create() -- Create awesompd widget
5 musicwidget.font = "Liberation Mono" -- Set widget font
6 musicwidget.scrolling = true -- If true, the text in the widget will be scrolled
7 musicwidget.output_size = 30 -- Set the size of widget in symbols
8 musicwidget.update_interval = 1 -- Set the update interval in seconds
9 -- Set the folder where icons are located
10 musicwidget.path_to_icons = "/home/ramsi/.config/awesome/widgets/awesompd/icons"
11 -- Set the default music format for Jamendo streams. You can change
12 -- this option on the fly in awesompd itself.
13 -- possible formats: awesompd.FORMAT_MP3, awesompd.FORMAT_OGG
14 musicwidget.jamendo_format = awesompd.FORMAT_OGG
15 -- If true, song notifications for Jamendo tracks and local tracks will also contain
16 -- album cover image.
17 musicwidget.show_album_cover = true
18 -- Specify how big in pixels should an album cover be. Maximum value
19 -- is 100.
20 musicwidget.album_cover_size = 50
21 -- This option is necessary if you want the album covers to be shown
22 -- for your local tracks.
23 musicwidget.mpd_config = "/home/ramsi/.config/mpd/mpd.conf"
24 -- Specify the browser you use so awesompd can open links from
25 -- Jamendo in it.
26 musicwidget.browser = "mimeo"
27 -- Specify decorators on the left and the right side of the
28 -- widget. Or just leave empty strings if you decorate the widget
29 -- from outside.
30 musicwidget.ldecorator = ""
31 musicwidget.rdecorator = " "
32 -- Set all the servers to work with (here can be any servers you use)
33 musicwidget.servers = {
34 { server = "localhost",
35 port = 6600 },
36 { server = "localhost",
37 port = 6601 } }
38 -- Set the buttons of the widget
39 musicwidget:register_buttons({
40 { "", awesompd.MOUSE_LEFT, musicwidget:command_playpause() },
41 { "Control", awesompd.MOUSE_SCROLL_UP, musicwidget:command_prev_track() },
42 { "Control", awesompd.MOUSE_SCROLL_DOWN, musicwidget:command_next_track() },
43 { "", awesompd.MOUSE_SCROLL_UP, musicwidget:command_volume_up() },
44 { "", awesompd.MOUSE_SCROLL_DOWN, musicwidget:command_volume_down() },
45 { "", awesompd.MOUSE_RIGHT, musicwidget:command_show_menu() },
46 { "", "XF86AudioPlay", musicwidget:command_playpause() },
47 { "", "XF86AudioPrev", musicwidget:command_prev_track() },
48 { "", "XF86AudioNext", musicwidget:command_next_track() },
49 { "Shift", "XF86AudioPrev", musicwidget:command_previous_server() },
50 { "Shift", "XF86AudioNext", musicwidget:command_next_server() }
51 })
52
53 -- register global_keys
54 musicwidget:append_global_keys()
55 -- After all configuration is done, run the widget
56 musicwidget:run()
57
58 return musicwidget.widget