Compare commits

...

3 Commits

Author SHA1 Message Date
b58a7327f2 Minor edits 2024-04-12 07:51:25 -07:00
885ee3d66f Backlight fixes 2024-04-11 16:21:10 -07:00
219873c890 Typo 2023-10-10 11:29:52 -07:00
7 changed files with 219 additions and 10 deletions

View File

@ -7,6 +7,7 @@ return {
submenu = conf_dir .. "assets/icons/submenu.svg", submenu = conf_dir .. "assets/icons/submenu.svg",
arch = conf_dir .. "assets/icons/arch.svg", arch = conf_dir .. "assets/icons/arch.svg",
nix = conf_dir .. "assets/icons/nix.svg", nix = conf_dir .. "assets/icons/nix.svg",
sys76 = conf_dir .. "assets/icons/sys76.svg",
nix_grey = conf_dir .. "assets/icons/nix-grey.svg", nix_grey = conf_dir .. "assets/icons/nix-grey.svg",
arch_grey = conf_dir .. "assets/icons/arch-grey.svg", arch_grey = conf_dir .. "assets/icons/arch-grey.svg",

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="512"
height="512"
viewBox="0 0 480.00001 480"
id="svg2"
version="1.1"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
sodipodi:docname="sys76.svg"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"><defs
id="defs4" /><sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.0844886"
inkscape:cx="301.5246"
inkscape:cy="154.91172"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="2560"
inkscape:window-height="1362"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:snap-global="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showguides="true" /><metadata
id="metadata7"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><g
inkscape:label="print-logo"
inkscape:groupmode="layer"
id="layer1"
style="display:inline"
transform="translate(-132.5822,958.04022)"><circle
style="display:inline;fill:#faa41a;fill-opacity:1;stroke-width:1.00645"
id="path2-6"
cx="372.58221"
cy="-718.04022"
r="239.99998" /><circle
style="fill:#ffffff;fill-opacity:1;stroke-width:0.884138"
id="path2"
cx="372.58221"
cy="-718.04022"
r="210.83322" /><path
d="m 365.13622,-928.75782 a 210.72083,210.72083 0 0 0 -141.52888,359.73483 l 2.17872,2.12607 114.76933,-212.77665 h -122.7814 l 21.55875,36.30037 a 11.104441,11.104441 0 0 1 1.33626,8.60935 11.895105,11.895105 0 0 1 -11.4206,8.89068 11.174722,11.174722 0 0 1 -9.55826,-5.23605 l -32.03063,-53.90572 a 11.122011,11.122011 0 0 1 -1.66988,-6.00897 v -0.47419 a 11.385566,11.385566 0 0 1 11.28023,-11.03414 h 162.63086 c 2.9342,0 6.46588,1.05328 8.25795,2.45989 l 0.16869,0.13116 a 12.879043,12.879043 0 0 1 3.86547,16.55133 l -124.20465,230.29411 a 12.879043,12.879043 0 0 1 -2.45982,3.19789 210.73839,210.73839 0 0 0 249.93781,3.25037 h -98.95603 a 13.072317,13.072317 0 0 1 -13.07231,-13.07231 v -0.26427 a 13.072317,13.072317 0 0 1 13.07231,-13.07231 h 129.17699 a 210.73839,210.73839 0 0 0 -4.07632,-294.00417 211.89803,211.89803 0 0 0 -28.42886,-23.86044 l -0.0563,0.11245 -0.57911,1.73929 c -4.09375,7.60782 -51.67416,93.64964 -67.4348,122.1312 l -5.78069,10.45431 c -13.23049,22.87663 -19.30972,48.61701 -16.25259,68.87563 a 66.327949,66.327949 0 0 0 11.54374,28.5342 68.770224,68.770224 0 0 0 44.80443,27.98956 71.30035,71.30035 0 0 0 11.98287,1.01954 69.947434,69.947434 0 0 0 42.25665,-14.02101 66.626645,66.626645 0 0 0 26.00407,-42.3796 66.486082,66.486082 0 0 0 -12.29922,-50.81337 70.544824,70.544824 0 0 0 -45.38408,-27.77871 76.905277,76.905277 0 0 0 -3.11,-0.45731 12.281653,12.281653 0 0 1 -10.78827,-12.61559 12.123519,12.123519 0 0 1 4.09393,-8.83782 12.387074,12.387074 0 0 1 9.64616,-3.02209 95.055416,95.055416 0 0 1 65.62509,38.33834 91.014244,91.014244 0 0 1 16.55133,69.27991 91.014244,91.014244 0 0 1 -38.3033,60.05526 94.756727,94.756727 0 0 1 -54.25714,16.92015 h -0.0175 a 96.267769,96.267769 0 0 1 -16.0768,-1.37001 93.175398,93.175398 0 0 1 -61.00415,-38.19795 98.095086,98.095086 0 0 1 -7.46743,-12.40457 c -12.59797,-24.87957 -13.23049,-53.94094 -1.79171,-84.074 a 323.99665,323.99665 0 0 1 13.3184,-29.48291 l 71.65167,-130.89902 1.68675,-2.05571 0.0748,-0.14996 a 211.54663,211.54663 0 0 0 -17.21892,-8.20527 210.72083,210.72083 0 0 0 -89.48549,-16.51606 z"
id="path1"
style="fill:#000000;fill-opacity:1;stroke-width:17.5703" /></g></svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

57
assets/icons/sys76.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@ -156,7 +156,7 @@ return gears.table.join(
description = "Down", description = "Down",
group = "Tags" group = "Tags"
} }
), )
--[[ --[[
awful.key( {"Mod4", "Shift"}, "j", awful.key( {"Mod4", "Shift"}, "j",

View File

@ -35,8 +35,13 @@ config.screenshot = { enabled = true }
config.simple_widgets = { enabled = true } config.simple_widgets = { enabled = true }
config.keymap_popup = { enabled = true } config.keymap_popup = { enabled = true }
config.battery = { enabled = false } config.battery = { enabled = false }
config.backlight = { enabled = false }
config.picom = { enabled = true } config.picom = { enabled = true }
config.backlight = {
enabled = false,
button_step = 5,
scroll_step = 5,
backend = "xbacklight"
}
config.core = { config.core = {
-- Icon to use when a window doesn't provide one -- Icon to use when a window doesn't provide one
@ -76,7 +81,7 @@ config.core = {
bar_margin = 3, bar_margin = 3,
-- Preferred terminal. -- Preferred terminal.
terminal = "kitty", terminal = "alacritty",
-- Preferred browser. -- Preferred browser.
browser = "firefox --new-tab", browser = "firefox --new-tab",
@ -206,4 +211,4 @@ config.ibus = {
} }
} }
return config return config

View File

@ -129,6 +129,10 @@ return function(s)
awesome.connect_signal("module::backlight:update", awesome.connect_signal("module::backlight:update",
function(value) function(value)
if value == nil then
value = 0
end
-- Update slider -- Update slider
widget. widget.
container. container.

View File

@ -1,6 +1,69 @@
local backlight = {} local brightnessctl = {}
brightnessctl.parse = function(s)
local batpec = string.match(s, ",%d?%d?%d%%,")
batpec = batpec:sub(2, batpec:len() - 2)
return tonumber(batpec)
end
backlight.get = function(callback) brightnessctl.get = function(callback)
awful.spawn.easy_async(
"brightnessctl info -m",
function(stdout, stderr, exitreason, exitcode)
callback(brightnessctl.parse(stdout))
end
)
end
brightnessctl.set = function(value)
awful.spawn.easy_async(
"brightnessctl set " .. value .. "% -m",
function(stdout, stderr, exitreason, exitcode)
awesome.emit_signal(
"module::backlight:update",
brightnessctl.parse(stdout)
)
end
)
end
brightnessctl.watch = function(timeout, callback, widget)
awful.widget.watch(
"brightnessctl get -m",
timeout,
function(stdout, stderr, exitreason, exitcode)
callback(brightnessctl.parse(stdout))
end,
widget
)
end
brightnessctl.backlight_up = function(value)
awful.spawn.easy_async(
"brightnessctl set " .. value .. "%+ -m",
function(stdout, stderr, exitreason, exitcode)
awesome.emit_signal(
"module::backlight:update",
brightnessctl.parse(stdout)
)
end
)
end
brightnessctl.backlight_down = function(value)
awful.spawn.easy_async(
"brightnessctl set " .. value .. "%- -m",
function(stdout, stderr, exitreason, exitcode)
awesome.emit_signal(
"module::backlight:update",
brightnessctl.parse(stdout)
)
end
)
end
local xbacklight = {}
xbacklight.get = function(callback)
awful.spawn.easy_async( awful.spawn.easy_async(
"xbacklight -get", "xbacklight -get",
function(stdout, stderr, exitreason, exitcode) function(stdout, stderr, exitreason, exitcode)
@ -9,11 +72,11 @@ backlight.get = function(callback)
) )
end end
backlight.set = function(value) xbacklight.set = function(value)
awful.spawn("xbacklight -set " .. value, false) awful.spawn("xbacklight -set " .. value, false)
end end
backlight.watch = function(timeout, callback, widget) xbacklight.watch = function(timeout, callback, widget)
awful.widget.watch( awful.widget.watch(
"xbacklight -get", "xbacklight -get",
timeout, timeout,
@ -23,7 +86,7 @@ backlight.watch = function(timeout, callback, widget)
end end
backlight.backlight_up = function(value) xbacklight.backlight_up = function(value)
awful.spawn.easy_async( awful.spawn.easy_async(
"xbacklight -inc " .. value, "xbacklight -inc " .. value,
function(stdout, stderr, exitreason, exitcode) function(stdout, stderr, exitreason, exitcode)
@ -32,7 +95,7 @@ backlight.backlight_up = function(value)
) )
end end
backlight.backlight_down = function(value) xbacklight.backlight_down = function(value)
awful.spawn.easy_async( awful.spawn.easy_async(
"xbacklight -dec " .. value, "xbacklight -dec " .. value,
function(stdout, stderr, exitreason, exitcode) function(stdout, stderr, exitreason, exitcode)
@ -41,6 +104,18 @@ backlight.backlight_down = function(value)
) )
end end
local backlight = {}
if config.backlight.backend == "xbacklight" then
backlight = xbacklight
elseif config.backlight.backend == "brightnessctl" then
backlight = brightnessctl
else
backlight = xbacklight
end
awesome.connect_signal("module::backlight:update_read", awesome.connect_signal("module::backlight:update_read",
function() function()
backlight.get( backlight.get(