From 663fbd1f8c04a4d333ccabc2b89faf5d5590c121 Mon Sep 17 00:00:00 2001 From: Yessiest Date: Sun, 4 Sep 2022 14:49:18 +0400 Subject: [PATCH] Various QoL improvements --- desktop.conf | 2 +- modules/desktop.lua | 91 +++++++++++++++++++++-------------------- themes/reno98/theme.lua | 4 +- 3 files changed, 49 insertions(+), 48 deletions(-) diff --git a/desktop.conf b/desktop.conf index b8ff721..14a1ada 100644 --- a/desktop.conf +++ b/desktop.conf @@ -28,4 +28,4 @@ modkey+n = ":client.minimize" modkey+m = ":client.maximize" # Custom keys -modkey+v = "notify-send test" +Print = "flameshot gui" diff --git a/modules/desktop.lua b/modules/desktop.lua index 246246d..f6b1c65 100644 --- a/modules/desktop.lua +++ b/modules/desktop.lua @@ -46,6 +46,51 @@ for k,v in pairs(json.decode(config) or {}) do 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 local titlebar_config = {} @@ -98,52 +143,8 @@ client.connect_signal("request::titlebars",function(c) fg_focus = style[v].fg_focus, font = style[v].font }):setup(t.titlebar(contents)) + awful.rules.rules[1].properties.placement(c) 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 -- }}} diff --git a/themes/reno98/theme.lua b/themes/reno98/theme.lua index 34836fd..49c789a 100644 --- a/themes/reno98/theme.lua +++ b/themes/reno98/theme.lua @@ -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-suspend-symbolic"] = themes_path.."reno98/icons/action-suspend-symbolic.png" -- Notification popups settings -theme.notification_width = 200 -theme.notification_height = 40 +theme.notification_width = 240 +theme.notification_height = 60 -- Default icon for clients -- This one has to be baked as a surface to avoid memory leaks