Fuxx
This commit is contained in:
parent
8268fba83d
commit
7ed2a6e110
9565 changed files with 1315332 additions and 90 deletions
65
home/.config/awesome/ui/sidebar/redshift.lua
Normal file
65
home/.config/awesome/ui/sidebar/redshift.lua
Normal file
|
@ -0,0 +1,65 @@
|
|||
-- ## redshift ##
|
||||
-- ~~~~~~~~~~~~~~
|
||||
|
||||
-- requirements
|
||||
-- ~~~~~~~~~~~~
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require ("beautiful")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
local toggle = wibox.widget.textbox()
|
||||
toggle.font = theme.sidebar_font
|
||||
|
||||
--toggle:buttons(gears.table.join(
|
||||
-- awful.button({}, 1, function()
|
||||
-- awful.spawn("redshift -l 0:0 -t 4500:4500 -r &>/dev/null & echo 'ON'", function(stdout))
|
||||
-- if stdout:match("ON") then
|
||||
-- toggle.markup = ""
|
||||
-- else
|
||||
-- toggle.markup = ""
|
||||
-- end
|
||||
-- end)
|
||||
--))
|
||||
|
||||
toggle:buttons(gears.table.join(
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[
|
||||
if [ ! -z $(pgrep redshift) ];
|
||||
then
|
||||
redshift -x && pkill redshift && killall redshift
|
||||
echo 'OFF'
|
||||
else
|
||||
redshift -l 0:0 -t 4500:4500 -r &>/dev/null &
|
||||
echo 'ON'
|
||||
fi
|
||||
]],
|
||||
function(stdout)
|
||||
if stdout:match("ON") then
|
||||
toggle.markup = ""
|
||||
else
|
||||
toggle.markup = ""
|
||||
end
|
||||
end
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
local buttons = wibox.widget {
|
||||
toggle,
|
||||
spacing = dpi(8),
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}
|
||||
|
||||
return wibox.widget {
|
||||
{
|
||||
nil,
|
||||
buttons,
|
||||
expand = 'none',
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
spacing = dpi(12),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue