awesome: change font, terminal and theme detection

This commit is contained in:
2026-02-21 22:16:06 +01:00
parent 832080bbe6
commit 6e0320da4f
3 changed files with 36 additions and 36 deletions

View File

@@ -54,14 +54,12 @@ end
local function read_theme() local function read_theme()
local theme = "theme_dark.lua" local theme = "theme_dark.lua"
local f = io.open(os.getenv('HOME') .. '/.config/alacritty/alacritty.toml') local f = io.open(os.getenv('HOME') .. '/.lightmode')
if f then if f then
if string.find(f:read('*all'), 'light') then
theme = 'theme_light.lua' theme = 'theme_light.lua'
end
f:close() f:close()
return theme
end end
return theme
end end
local theme = read_theme() local theme = read_theme()
@@ -88,7 +86,7 @@ local function switch_theme()
end end
-- This is used later as the default terminal and editor to run. -- This is used later as the default terminal and editor to run.
local terminal = "st" local terminal = "kitty --single-instance --instance-group default"
-- Default modkey. -- Default modkey.
local modkey = "Mod4" local modkey = "Mod4"
@@ -236,13 +234,15 @@ local function layout_menu()
awful.menu(layouts):show() awful.menu(layouts):show()
end end
local function focus_nth_window (n) local function focus_nth_window(n)
local cc = {} local cc = {}
for _, c in ipairs(client.get()) do for _, c in ipairs(client.get()) do
if awful.widget.tasklist.filter.currenttags(c, mouse.screen) then cc[#cc + 1] = c end if awful.widget.tasklist.filter.currenttags(c, mouse.screen) then cc[#cc + 1] = c end
end end
local new_focused = cc[n] local new_focused = cc[n]
if new_focused then client.focus = new_focused; new_focused:raise() end if new_focused then
client.focus = new_focused; new_focused:raise()
end
end end
-- {{{ Key bindings -- {{{ Key bindings
@@ -296,7 +296,7 @@ local globalkeys = gears.table.join(
{ description = "open a terminal", group = "launcher" }), { description = "open a terminal", group = "launcher" }),
awful.key({ modkey, "Control", "Shift" }, "s", function() awful.spawn("systemctl suspend") end, awful.key({ modkey, "Control", "Shift" }, "s", function() awful.spawn("systemctl suspend") end,
{ description = "open a terminal", group = "launcher" }), { description = "open a terminal", group = "launcher" }),
awful.key({ modkey, "Shift" }, "F6", switch_theme, awful.key({ modkey, "Control", "Shift" }, "t", switch_theme,
{ description = "switch theme", group = "launcher" }), { description = "switch theme", group = "launcher" }),
awful.key({ modkey, }, "q", awesome.restart, awful.key({ modkey, }, "q", awesome.restart,
{ description = "reload awesome", group = "awesome" }), { description = "reload awesome", group = "awesome" }),
@@ -347,7 +347,7 @@ local globalkeys = gears.table.join(
end, end,
{ description = "lua execute prompt", group = "awesome" }), { description = "lua execute prompt", group = "awesome" }),
-- Menubar -- Menubar
awful.key({ modkey }, "p", function() awful.spawn("dmenu_run -fn 'FiraCode Nerd Font Ret:size=10'") end, awful.key({ modkey }, "p", function() awful.spawn("dmenu_run -fn 'HurmitNerdFont:size=16'") end,
{ description = "run command", group = "launcher" }) { description = "run command", group = "launcher" })
) )
@@ -571,15 +571,15 @@ client.connect_signal("mouse::enter", function(c)
end) end)
-- local function set_border(c) -- local function set_border(c)
-- local s = awful.screen.focused() -- local s = awful.screen.focused()
-- if c.maximized -- if c.maximized
-- or (#s.tiled_clients == 1 and not c.floating) -- or (#s.tiled_clients == 1 and not c.floating)
-- or (s.selected_tag and s.selected_tag.layout.name == 'max') -- or (s.selected_tag and s.selected_tag.layout.name == 'max')
-- then -- then
-- c.border_width = 0 -- c.border_width = 0
-- else -- else
-- c.border_width = beautiful.border_width -- c.border_width = beautiful.border_width
-- end -- end
-- end -- end
client.connect_signal("focus", function(c) client.connect_signal("focus", function(c)

View File

@@ -5,7 +5,7 @@ local dpi = xresources.apply_dpi
local theme = {} local theme = {}
theme.font = "Fira Code Nerd Font 10" theme.font = "HurmitNerdFont 10"
theme.tasklist_disable_icon = true theme.tasklist_disable_icon = true
theme.wibar_height = 30 theme.wibar_height = 30

View File

@@ -5,7 +5,7 @@ local dpi = xresources.apply_dpi
local theme = {} local theme = {}
theme.font = "Fira Code Nerd Font 10" theme.font = "HurmitNerdFont 10"
theme.tasklist_disable_icon = true theme.tasklist_disable_icon = true
theme.wibar_height = 30 theme.wibar_height = 30