summaryrefslogtreecommitdiff
path: root/spotify-widget/spotify.lua
diff options
context:
space:
mode:
authorSam Delmerico <svdelmerico@gmail.com>2018-11-26 16:21:48 -0500
committerSam Delmerico <svdelmerico@gmail.com>2018-11-26 16:21:48 -0500
commit2cf217dc6c45f206aef0e065fa3ede4c36d73e3b (patch)
treea257f029216862d7525ca7e6e1818982b4a03085 /spotify-widget/spotify.lua
parentf369e1cb28a308f6967d7bc31375c637755b1e3f (diff)
parent1eefac87faefa22b0d3941a9fd4c76010688f59e (diff)
merge biased battery levels
Diffstat (limited to 'spotify-widget/spotify.lua')
-rw-r--r--spotify-widget/spotify.lua14
1 files changed, 4 insertions, 10 deletions
diff --git a/spotify-widget/spotify.lua b/spotify-widget/spotify.lua
index ee5217b..c6f2188 100644
--- a/spotify-widget/spotify.lua
+++ b/spotify-widget/spotify.lua
@@ -28,11 +28,9 @@ local spotify_widget = wibox.widget {
},
layout = wibox.layout.align.horizontal,
set_status = function(self, is_playing)
- if (is_playing) then
- self.icon.image = PATH_TO_ICONS .. "/actions/24/player_play.png"
- else
- self.icon.image = PATH_TO_ICONS .. "/actions/24/player_pause.png"
- end
+ self.icon.image = PATH_TO_ICONS ..
+ (is_playing and "/actions/24/player_play.png"
+ or "/actions/24/player_pause.png")
end,
set_text = function(self, path)
self.current_song.markup = path
@@ -41,11 +39,7 @@ local spotify_widget = wibox.widget {
local update_widget_icon = function(widget, stdout, _, _, _)
stdout = string.gsub(stdout, "\n", "")
- if (stdout == 'Playing') then
- widget:set_status(true)
- else
- widget:set_status(false)
- end
+ widget:set_status(stdout == 'Playing' and true or false)
end
local update_widget_text = function(widget, stdout, _, _, _)