Compare commits
3 Commits
ab0c30f719
...
f8f500d306
Author | SHA1 | Date |
---|---|---|
Yessiest | f8f500d306 | |
Yessiest | e8dfae3013 | |
Yessiest | 663fbd1f8c |
|
@ -1,3 +1,4 @@
|
||||||
|
/desktop.conf
|
||||||
/wallpaper.txt
|
/wallpaper.txt
|
||||||
/links
|
/links
|
||||||
/libs/pam
|
/libs/pam
|
||||||
|
|
13
desktop.conf
13
desktop.conf
|
@ -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,4 +28,5 @@ modkey+n = ":client.minimize"
|
||||||
modkey+m = ":client.maximize"
|
modkey+m = ":client.maximize"
|
||||||
|
|
||||||
# Custom keys
|
# Custom keys
|
||||||
modkey+v = "notify-send test"
|
Print = "flameshot gui"
|
||||||
|
Shift+Print = "flameshot launcher"
|
||||||
|
|
|
@ -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 then
|
if (widget == v) and mouse.current_widget_geometries then
|
||||||
widget_geo = mouse.current_widget_geometries[k]
|
widget_geo = mouse.current_widget_geometries[k]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,6 +38,7 @@ 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()
|
||||||
|
@ -83,36 +84,39 @@ 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 dtype = fhandler:read("*a"):match("%S*")
|
local uevent_f = io.open("/sys/class/power_supply/"..dev_name.."/uevent","r")
|
||||||
fhandler:close()
|
if not uevent_f then
|
||||||
local full_path = "/sys/class/power_supply/"..dev_name
|
return nil, "Unable to open uevent file"
|
||||||
|
end
|
||||||
|
local uevent_data = {}
|
||||||
local device = {
|
local device = {
|
||||||
type = dtype,
|
type = fhandler:read("*a"),
|
||||||
full_path = full_path,
|
full_path = "/sys/class/power_supply/"..dev_name,
|
||||||
name = dev_name
|
name = dev_name
|
||||||
}
|
}
|
||||||
if dtype == "Mains" then
|
fhandler:close()
|
||||||
local online_f = io.open(full_path.."/online","r")
|
uevent:read("*a"):gsub("[^\n]+",function(line)
|
||||||
device.online = (online_f:read("*a"):match("%S*") == "1")
|
local key,value = line:match("^([^=]+)=([^=]*)")
|
||||||
online_f:close()
|
if value:match("^%d+$") then
|
||||||
elseif dtype == "Battery" then
|
value = tonumber(value)
|
||||||
local capacity_f = io.open(full_path.."/capacity","r")
|
end
|
||||||
local model_f = io.open(full_path.."/model_name","r")
|
uevent_data[key] = value
|
||||||
local energy_full_design_f = io.open(full_path.."/energy_full_design","r")
|
end)
|
||||||
local energy_full_f = io.open(full_path.."/energy_full","r")
|
uevent:close()
|
||||||
local charging_f = io.open(full_path.."/status","r")
|
if device.type == "Battery" then
|
||||||
device.model = model_f:read("*a"):match("[^\n]*")
|
device.model = uevent_data.POWER_SUPPLY_MODEL_NAME or "N/A"
|
||||||
device.energy_full_design = tonumber(energy_full_design_f:read("*a"))
|
device.energy_full_design = uevent_data.POWER_SUPPLY_ENERGY_FULL_DESIGN
|
||||||
device.energy_full = tonumber(energy_full_f:read("*a"))
|
device.energy_full = uevent_data.POWER_SUPPLY_ENERGY_FULL
|
||||||
|
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 = tonumber(capacity_f:read("*a"))
|
device.capacity = uevent_data.POWER_SUPPLY_CAPACITY or 0
|
||||||
device.charging = (charging_f:read("*a"):match("%S*") == "Charging")
|
device.charging = (uevent_data.POWER_SUPPLY_STATUS == "Charging")
|
||||||
capacity_f:close()
|
elseif device.type == "Mains" then
|
||||||
model_f:close()
|
device.online = (uevent_data.POWER_SUPPLY_ONLINE == 1)
|
||||||
energy_full_design_f:close()
|
|
||||||
energy_full_f:close()
|
|
||||||
end
|
end
|
||||||
return device
|
|
||||||
else
|
else
|
||||||
return nil, err
|
return nil, err
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,6 +46,51 @@ 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 = {}
|
||||||
|
@ -98,52 +143,8 @@ 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 -- }}}
|
|
||||||
|
|
|
@ -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 = 200
|
theme.notification_width = 240
|
||||||
theme.notification_height = 40
|
theme.notification_height = 60
|
||||||
|
|
||||||
-- 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
|
||||||
|
|
Loading…
Reference in New Issue