Compare commits

..

No commits in common. "f8f500d30660760db4c9bc86d9dd53697ce9efd0" and "ab0c30f719460e127332d82a84704e1114cbace6" have entirely different histories.

6 changed files with 80 additions and 87 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
/desktop.conf
/wallpaper.txt /wallpaper.txt
/links /links
/libs/pam /libs/pam

View File

@ -1,10 +1,10 @@
# Global variables # Global variables
[global] [global]
terminal = "$HOME/.local/bin/st" terminal = "$HOME/.local/bin/st"
browser = "prime-run librewolf" browser = "prime-run librewolf"
modkey = "Mod4" modkey = "Mod4"
theme = "reno98" theme = "reno98"
shell = "zsh" shell = "zsh"
# Keybindings # Keybindings
# Format: <modifier>(+<modifier>+...)+<key> = "<command or :internal.function>" # Format: <modifier>(+<modifier>+...)+<key> = "<command or :internal.function>"
@ -28,5 +28,4 @@ modkey+n = ":client.minimize"
modkey+m = ":client.maximize" modkey+m = ":client.maximize"
# Custom keys # Custom keys
Print = "flameshot gui" modkey+v = "notify-send test"
Shift+Print = "flameshot launcher"

View File

@ -19,7 +19,7 @@ local function position_popup(popup,widget,style)
-- Figure out the geometry of the base widget -- Figure out the geometry of the base widget
local widget_geo local widget_geo
for k,v in pairs(mouse.current_widgets or {}) do for k,v in pairs(mouse.current_widgets or {}) do
if (widget == v) and mouse.current_widget_geometries then if widget == v then
widget_geo = mouse.current_widget_geometries[k] widget_geo = mouse.current_widget_geometries[k]
end end
end end

View File

@ -38,7 +38,6 @@ syscontrol.backlight.read_attribs = function(dev_name)
writable = false writable = false
} }
fhandler:close() fhandler:close()
bhandler:close()
local wfhandler = io.open("/sys/class/backlight/"..dev_name.."/brightness","w") local wfhandler = io.open("/sys/class/backlight/"..dev_name.."/brightness","w")
if wfhandler then if wfhandler then
wfhandler:close() wfhandler:close()
@ -84,39 +83,36 @@ end
syscontrol.power_supply.read_attribs = function(dev_name) syscontrol.power_supply.read_attribs = function(dev_name)
local fhandler,err = io.open("/sys/class/power_supply/"..dev_name.."/type","r") local fhandler,err = io.open("/sys/class/power_supply/"..dev_name.."/type","r")
if fhandler then if fhandler then
local uevent_f = io.open("/sys/class/power_supply/"..dev_name.."/uevent","r") local dtype = fhandler:read("*a"):match("%S*")
if not uevent_f then fhandler:close()
return nil, "Unable to open uevent file" local full_path = "/sys/class/power_supply/"..dev_name
end
local uevent_data = {}
local device = { local device = {
type = fhandler:read("*a"), type = dtype,
full_path = "/sys/class/power_supply/"..dev_name, full_path = full_path,
name = dev_name name = dev_name
} }
fhandler:close() if dtype == "Mains" then
uevent:read("*a"):gsub("[^\n]+",function(line) local online_f = io.open(full_path.."/online","r")
local key,value = line:match("^([^=]+)=([^=]*)") device.online = (online_f:read("*a"):match("%S*") == "1")
if value:match("^%d+$") then online_f:close()
value = tonumber(value) elseif dtype == "Battery" then
end local capacity_f = io.open(full_path.."/capacity","r")
uevent_data[key] = value local model_f = io.open(full_path.."/model_name","r")
end) local energy_full_design_f = io.open(full_path.."/energy_full_design","r")
uevent:close() local energy_full_f = io.open(full_path.."/energy_full","r")
if device.type == "Battery" then local charging_f = io.open(full_path.."/status","r")
device.model = uevent_data.POWER_SUPPLY_MODEL_NAME or "N/A" device.model = model_f:read("*a"):match("[^\n]*")
device.energy_full_design = uevent_data.POWER_SUPPLY_ENERGY_FULL_DESIGN device.energy_full_design = tonumber(energy_full_design_f:read("*a"))
device.energy_full = uevent_data.POWER_SUPPLY_ENERGY_FULL device.energy_full = tonumber(energy_full_f:read("*a"))
if not device.energy_full_design then
device.energy_full_design = uevent_data.POWER_SUPPLY_CHARGE_FULL_DESIGN or -1
device.energy_full = uevent_data.POWER_SUPPLY_CHARGE_FULL or -1
end
device.quality = (device.energy_full/device.energy_full_design)*100 device.quality = (device.energy_full/device.energy_full_design)*100
device.capacity = uevent_data.POWER_SUPPLY_CAPACITY or 0 device.capacity = tonumber(capacity_f:read("*a"))
device.charging = (uevent_data.POWER_SUPPLY_STATUS == "Charging") device.charging = (charging_f:read("*a"):match("%S*") == "Charging")
elseif device.type == "Mains" then capacity_f:close()
device.online = (uevent_data.POWER_SUPPLY_ONLINE == 1) model_f:close()
energy_full_design_f:close()
energy_full_f:close()
end end
return device
else else
return nil, err return nil, err
end end

View File

@ -46,51 +46,6 @@ for k,v in pairs(json.decode(config) or {}) do
end end
end -- }}} end -- }}}
do --{{{ Screen
local wibar_config = {}
local style = awmtk2.create_style("wibar",awmtk2.default,{})
for k,v in pairs({"wibar_top","wibar_bottom","wibar_left","wibar_right"}) do
style[v] = awmtk2.create_delta(v, {},
(beautiful.widgets and beautiful.widgets.wibar) or {},
style.wibar)
wibar_config[v] = read_file(root_path.."/themes/"..global.theme.."/config/"..v..".json")
end
local templates = awmtk2.create_template_lib("wibar",awmtk2.templates,{})
local t = awmtk2.build_templates(templates,style)
awful.screen.connect_for_each_screen(function(s)
for k,v in pairs({"wibar_top","wibar_bottom","wibar_left","wibar_right"}) do
local contents = { widget = wibox.container.background }
if wibar_config[v] then
contents = builder(wibar_config[v],{
client = c,
style = style[v],
buttons = buttons,
screen = s
})
s[v] = awful.wibar({
-- There really isn't a better way to do this. I wish there was.
position = v:gsub("wibar_",""),
screen = s,
visible = true,
stretch = style[v].stretch,
ontop = style[v].ontop,
width = style[v].width,
height = style[v].height,
border_width = style[v].border_width,
border_color = style[v].border_color,
opacity = style[v].opacity or 1,
shape = style[v].shape,
bg = style[v].bg,
bgimage = style[v].bgimage,
fg = style[v].fg,
input_passthrough = style[v].input_passthrough
})
s[v]:setup(t.wibar(contents))
end
end
end)
end -- }}}
do -- {{{ Titlebars do -- {{{ Titlebars
local titlebar_config = {} local titlebar_config = {}
@ -143,8 +98,52 @@ client.connect_signal("request::titlebars",function(c)
fg_focus = style[v].fg_focus, fg_focus = style[v].fg_focus,
font = style[v].font font = style[v].font
}):setup(t.titlebar(contents)) }):setup(t.titlebar(contents))
awful.rules.rules[1].properties.placement(c)
end end
end) end)
end --}}} end --}}}
do --{{{ Screen
local wibar_config = {}
local style = awmtk2.create_style("wibar",awmtk2.default,{})
for k,v in pairs({"wibar_top","wibar_bottom","wibar_left","wibar_right"}) do
style[v] = awmtk2.create_delta(v, {},
(beautiful.widgets and beautiful.widgets.wibar) or {},
style.wibar)
wibar_config[v] = read_file(root_path.."/themes/"..global.theme.."/config/"..v..".json")
end
local templates = awmtk2.create_template_lib("wibar",awmtk2.templates,{})
local t = awmtk2.build_templates(templates,style)
awful.screen.connect_for_each_screen(function(s)
for k,v in pairs({"wibar_top","wibar_bottom","wibar_left","wibar_right"}) do
local contents = { widget = wibox.container.background }
if wibar_config[v] then
contents = builder(wibar_config[v],{
client = c,
style = style[v],
buttons = buttons,
screen = s
})
s[v] = awful.wibar({
-- There really isn't a better way to do this. I wish there was.
position = v:gsub("wibar_",""),
screen = s,
visible = true,
stretch = style[v].stretch,
ontop = style[v].ontop,
width = style[v].width,
height = style[v].height,
border_width = style[v].border_width,
border_color = style[v].border_color,
opacity = style[v].opacity or 1,
shape = style[v].shape,
bg = style[v].bg,
bgimage = style[v].bgimage,
fg = style[v].fg,
input_passthrough = style[v].input_passthrough
})
s[v]:setup(t.wibar(contents))
end
end
end)
end -- }}}

View File

@ -328,8 +328,8 @@ theme["action-poweroff-symbolic"] = themes_path.."reno98/icons/action-poweroff-s
theme["action-lock-screen-symbolic"] = themes_path.."reno98/icons/action-lock-screen-symbolic.png" theme["action-lock-screen-symbolic"] = themes_path.."reno98/icons/action-lock-screen-symbolic.png"
theme["action-suspend-symbolic"] = themes_path.."reno98/icons/action-suspend-symbolic.png" theme["action-suspend-symbolic"] = themes_path.."reno98/icons/action-suspend-symbolic.png"
-- Notification popups settings -- Notification popups settings
theme.notification_width = 240 theme.notification_width = 200
theme.notification_height = 60 theme.notification_height = 40
-- Default icon for clients -- Default icon for clients
-- This one has to be baked as a surface to avoid memory leaks -- This one has to be baked as a surface to avoid memory leaks