Permalink
Browse files

Added an ability to change color of text and background color of widget.

Usage:
	musicwidget.font_color = "#000000"	--Set font color to white
	musicwidget.background = '#FFFFFF"	--Set background color to black
By default colors will be taken from beatiful theme. 'fg_normal' for font color and 'bg_normal' for background colour.
  • Loading branch information...
1 parent 4142a7a commit 37934f472d774e7e4c7394d0233717f0f3a58e40 @zudov zudov committed with Mar 31, 2013
Showing with 7 additions and 3 deletions.
  1. +5 −3 awesompd.lua
  2. +2 −0 rcsample.lua
View
@@ -202,6 +202,8 @@ function awesompd:create()
-- Default user options
instance.servers = { { server = "localhost", port = 6600 } }
instance.font = "Monospace"
+ instance.font_color = beautiful.fg_normal
+ instance.background = beautiful.bg_normal
instance.scrolling = true
instance.output_size = 30
instance.update_interval = 10
@@ -843,9 +845,9 @@ function awesompd:notify_state(state_changed)
end
function awesompd:wrap_output(text)
- return format('<span font="%s">%s%s%s</span>',
- self.font, self.ldecorator,
- awesompd.protect_string(text), self.rdecorator)
+ return format('<span background="%s" font="Terminus 12"> <span font="%s" color="%s" background = "%s">%s%s%s</span></span>',
+ self.background, self.font, self.font_color,self.background,self.ldecorator,
+ awesompd.protect_string(text), self.rdecorator)
end
function awesompd:mpcquery()
View
@@ -85,6 +85,8 @@ mysystray = widget({ type = "systray" })
musicwidget = awesompd:create() -- Create awesompd widget
musicwidget.font = "Liberation Mono" -- Set widget font
+--musicwidget.font_color = "#000000" --Set widget font color
+--musicwidget.background = "#FFFFFF" --Set widget background
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

0 comments on commit 37934f4

Please sign in to comment.