From bec18633e67513363265e79e28358e5089f3e85c Mon Sep 17 00:00:00 2001 From: pmakhov Date: Sat, 2 Dec 2017 13:50:14 -0500 Subject: use dbus to check is spotify is playing --- spotify-widget/spotify.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'spotify-widget/spotify.lua') diff --git a/spotify-widget/spotify.lua b/spotify-widget/spotify.lua index 4ecce79..be3225c 100644 --- a/spotify-widget/spotify.lua +++ b/spotify-widget/spotify.lua @@ -2,7 +2,8 @@ local awful = require("awful") local wibox = require("wibox") local watch = require("awful.widget.watch") -local GET_SPOTIFY_STATUS_CMD = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/spotify-widget/spotify_stat' +-- local GET_SPOTIFY_STATUS_CMD = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/spotify-widget/spotify_stat' +local GET_SPOTIFY_STATUS_CMD = 'sp status' local GET_CURRENT_SONG_CMD = 'sp current-oneline' local PATH_TO_ICONS = "/usr/share/icons/Arc" @@ -27,9 +28,9 @@ spotify_widget = wibox.widget { local update_widget_icon = function(widget, stdout, _, _, _) stdout = string.gsub(stdout, "\n", "") - if (stdout == 'RUNNING') then + if (stdout == 'Playing') then widget:set_image(PATH_TO_ICONS .. "/actions/24/player_play.png") - elseif (stdout == "CORKED") then + elseif (stdout == "Paused") then widget:set_image(PATH_TO_ICONS .. "/actions/24/player_pause.png") else widget:set_image(nil) -- cgit v1.2.3