From: Alexander Yakushev Date: Fri, 5 Nov 2010 06:43:52 +0000 (+0200) Subject: Reworked icon handling X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=58174ffbf2659a8de5c0e2c9704526e44da61912;p=awesompd.git Reworked icon handling --- 58174ffbf2659a8de5c0e2c9704526e44da61912 diff --cc awesompd.lua index 8b854ba,ac864a9..ae3c081 --- a/awesompd.lua +++ b/awesompd.lua @@@ -38,16 -38,16 +38,17 @@@ function awesompd.try_load(file end end --awesompd.ICONS = {} --awesompd.ICONS.PLAY = awesompd.try_load("/home/unlogic/.config/awesome/play_icon.png") --awesompd.ICONS.PAUSE = awesompd.try_load("/home/unlogic/.config/awesome/pause_icon.png") --awesompd.ICONS.PLAY_PAUSE = awesompd.try_load("/home/unlogic/.config/awesome/play_pause_icon.png") --awesompd.ICONS.STOP = awesompd.try_load("/home/unlogic/.config/awesome/stop_icon.png") --awesompd.ICONS.NEXT = awesompd.try_load("/home/unlogic/.config/awesome/next_icon.png") --awesompd.ICONS.PREV = awesompd.try_load("/home/unlogic/.config/awesome/prev_icon.png") --awesompd.ICONS.CHECK = awesompd.try_load("/home/unlogic/.config/awesome/check_icon.png") --awesompd.ICONS.RADIO = awesompd.try_load("/home/unlogic/.config/awesome/radio_icon.png") --awesompd.ICONS_LOADED = true ++function awesompd.load_icons(path) ++ awesompd.ICONS = {} ++ awesompd.ICONS.PLAY = awesompd.try_load(path .. "/play_icon.png") ++ awesompd.ICONS.PAUSE = awesompd.try_load(path .. "/pause_icon.png") ++ awesompd.ICONS.PLAY_PAUSE = awesompd.try_load(path .. "/play_pause_icon.png") ++ awesompd.ICONS.STOP = awesompd.try_load(path .. "/stop_icon.png") ++ awesompd.ICONS.NEXT = awesompd.try_load(path .. "/next_icon.png") ++ awesompd.ICONS.PREV = awesompd.try_load(path .. "/prev_icon.png") ++ awesompd.ICONS.CHECK = awesompd.try_load(path .. "/check_icon.png") ++ awesompd.ICONS.RADIO = awesompd.try_load(path .. "/radio_icon.png") ++end -- Function that returns a new awesompd object function awesompd:create() @@@ -74,7 -74,7 +75,7 @@@ instance.recreate_servers = true instance.recreate_options = true instance.current_number = 0 -- instance.menu_shown = false ++ instance.menu_shown = false -- Default user options instance.servers = { { server = "localhost", port = 6600 } } @@@ -82,6 -82,6 +83,7 @@@ instance.scrolling = true instance.output_size = 30 instance.update_interval = 10 ++ instance.path_to_icons = "" -- Widget configuration instance.widget:add_signal("mouse::enter", function(c) @@@ -97,7 -97,8 +99,9 @@@ en -- Registers timers for the widget function awesompd:run() self:update_track() - self:update_state() + -- self:update_state() + self:check_playlists() ++ self.load_icons(self.path_to_icons) awful.hooks.timer.register(1, function () self:update_widget() end) awful.hooks.timer.register(self.update_interval, function () self:update_track() end) end diff --cc icons/check_icon.png index 0000000,0000000..dc5cba1 new file mode 100644 Binary files differ diff --cc icons/next_icon.png index 0000000,0000000..7fe1eb6 new file mode 100644 Binary files differ diff --cc icons/pause_icon.png index 0000000,0000000..83a92ee new file mode 100644 Binary files differ diff --cc icons/play_icon.png index 0000000,0000000..83230d1 new file mode 100644 Binary files differ diff --cc icons/play_pause_icon.png index 0000000,0000000..e17846e new file mode 100644 Binary files differ diff --cc icons/prev_icon.png index 0000000,0000000..11e34a1 new file mode 100644 Binary files differ diff --cc icons/radio_icon.png index 0000000,0000000..ffdf065 new file mode 100644 Binary files differ diff --cc icons/stop_icon.png index 0000000,0000000..6bef770 new file mode 100644 Binary files differ