X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/6cce5b6fe11fe8c69b08140d645c604fef59e42a..a00417d8011690d977cbdab1f1378ec369e5f355:/widgets/contrib/redshift.lua?ds=sidebyside diff --git a/widgets/contrib/redshift.lua b/widgets/contrib/redshift.lua index 8a768fb..73cc100 100644 --- a/widgets/contrib/redshift.lua +++ b/widgets/contrib/redshift.lua @@ -26,7 +26,7 @@ function redshift:start() end function redshift:toggle() - async(string.format("%s -c 'ps -p %d -o pid='", awful.util.shell, redshift.pid), function(f) + async({ awful.util.shell, "-c", string.format("ps -p %d -o pid=", redshift.pid) }, function(f) if f and #f > 0 then -- redshift is running -- Sending -USR1 toggles redshift (See project website) execute("pkill -USR1 redshift") @@ -46,7 +46,9 @@ end function redshift:attach(widget, fun) redshift.update_fun = fun or function() end if not redshift.pid then redshift:start() end - widget:buttons(awful.util.table.join(awful.button({}, 1, function () redshift:toggle() end))) + if widget then + widget:buttons(awful.util.table.join(awful.button({}, 1, function () redshift:toggle() end))) + end end return redshift