aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yakushev <yakushev.alex@gmail.com>2011-07-26 22:27:33 +0300
committerAlexander Yakushev <yakushev.alex@gmail.com>2011-07-26 22:27:33 +0300
commit8d0ed9774285084d0a55e5c30ae18680186db76a (patch)
tree2dcd68e0d9273b52fd0df9c396de74fa40a96075
parentf0828b11cc315e6760688a27be1660a70fc38c66 (diff)
downloadawesompd-8d0ed9774285084d0a55e5c30ae18680186db76a.tar.gz
awesompd-8d0ed9774285084d0a55e5c30ae18680186db76a.tar.bz2
Final bugfixes and updated rcsample.lua
-rw-r--r--awesompd.lua6
-rw-r--r--jamendo.lua2
-rw-r--r--rcsample.lua37
3 files changed, 38 insertions, 7 deletions
diff --git a/awesompd.lua b/awesompd.lua
index 26a17bb..3b11ad7 100644
--- a/awesompd.lua
+++ b/awesompd.lua
@@ -1,7 +1,7 @@
---------------------------------------------------------------------------
-- @author Alexander Yakushev &lt;yakushev.alex@gmail.com&gt;
-- @copyright 2010-2011 Alexander Yakushev
--- @release v0.9.5
+-- @release v1.0
---------------------------------------------------------------------------
require('utf8')
@@ -121,6 +121,10 @@ end
function awesompd:run()
enable_dbg = self.debug_mode
jamendo.set_current_format(self.jamendo_format)
+ if self.album_cover_size > 100 then
+ self.album_cover_size = 100
+ end
+
self:update_track()
self:check_playlists()
self.load_icons(self.path_to_icons)
diff --git a/jamendo.lua b/jamendo.lua
index 2e83589..f495006 100644
--- a/jamendo.lua
+++ b/jamendo.lua
@@ -77,7 +77,7 @@ function get_default_mp3_stream()
local trygetlink =
perform_request("echo $(curl -w %{redirect_url} " ..
"'http://api.jamendo.com/get2/stream/track/redirect/" ..
- "?streamencoding="..format.."&id=729304')")
+ "?streamencoding="..FORMAT_MP3.value.."&id=729304')")
local _, _, prefix = string.find(trygetlink,"stream(%d+)\.jamendo\.com")
default_mp3_stream = { id = prefix, last_checked = os.time() }
end
diff --git a/rcsample.lua b/rcsample.lua
index 768a679..71d9349 100644
--- a/rcsample.lua
+++ b/rcsample.lua
@@ -6,7 +6,6 @@ require("awful.rules")
require("beautiful")
-- Notification library
require("naughty")
-require("awesompd")
-- Load Debian menu entries
require("debian.menu")
@@ -80,14 +79,38 @@ mytextclock = awful.widget.textclock({ align = "right" })
-- Create a systray
mysystray = widget({ type = "systray" })
--- Create a wibox for each screen and add it
+-- BEGIN OF AWESOMPD WIDGET DECLARATION
+
+ require('awesompd')
musicwidget = awesompd:create() -- Create awesompd widget
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 = 10 -- Set the update interval in seconds
- musicwidget.path_to_icons = "/home/unlogic/.config/awesome/icons" -- Set the folder where icons are located (change username to your login name)
+
+ -- Set the folder where icons are located (change username to your login name)
+ musicwidget.path_to_icons = "/home/username/.config/awesome/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
+ musicwidget.jamendo_format = awesompd.FORMAT_MP3
+
+ -- If true, song notifications for Jamendo tracks will also contain
+ -- album cover image.
+ instance.show_jamendo_album_covers = true
+
+ -- Specify how big in pixels should an album cover be. Maximum value
+ -- is 100.
+ instance.album_cover_size = 50
+
+ -- Specify decorators on the left and the right side of the
+ -- widget. Or just leave empty strings if you decorate the widget
+ -- from outside.
+ musicwidget.ldecorator = " "
+ musicwidget.rdecorator = " "
+
-- Set all the servers to work with (here can be any servers you use)
musicwidget.servers = {
{ server = "localhost",
@@ -95,6 +118,7 @@ mysystray = widget({ type = "systray" })
{ server = "192.168.0.72",
port = 6600 }
}
+
-- Set the buttons of the widget
musicwidget:register_buttons({ { "", awesompd.MOUSE_LEFT, musicwidget:command_toggle() },
{ "Control", awesompd.MOUSE_SCROLL_UP, musicwidget:command_prev_track() },
@@ -102,7 +126,10 @@ mysystray = widget({ type = "systray" })
{ "", awesompd.MOUSE_SCROLL_UP, musicwidget:command_volume_up() },
{ "", awesompd.MOUSE_SCROLL_DOWN, musicwidget:command_volume_down() },
{ "", awesompd.MOUSE_RIGHT, musicwidget:command_show_menu() } })
- musicwidget:run()
+ 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 202.
mywibox = {}
mypromptbox = {}
@@ -173,7 +200,7 @@ for s = 1, screen.count() do
},
mylayoutbox[s],
mytextclock,
- musicwidget.widget,
+ musicwidget.widget, -- Awesompd widget is added like this
s == 1 and mysystray or nil,
mytasklist[s],
layout = awful.widget.layout.horizontal.rightleft