Improved wibar slightly

This commit is contained in:
Mutzi 2024-07-06 21:51:47 +02:00
parent 134575e0fe
commit abbd482ae3
Signed by: root
GPG Key ID: 2437494E09F13876
3 changed files with 14 additions and 6 deletions

2
rc.lua
View File

@ -45,5 +45,5 @@ screen.connect_signal('arrange', function(s)
end end
end) end)
local on_screen_connect = require('src.theme.screen') local on_screen_connect = require('src.theme.wibar')
require('awful').screen.connect_for_each_screen(function(s) on_screen_connect(s) end) require('awful').screen.connect_for_each_screen(function(s) on_screen_connect(s) end)

View File

@ -5,10 +5,14 @@ local dpi = require('beautiful.xresources').apply_dpi
local theme = require('src.theme') local theme = require('src.theme')
local widgets = require('src.widgets') local widgets = require('src.widgets')
local function create_separator()
return wibox.widget.separator({ orientation = 'vertical', forced_width = 7, thickness = 1, span_ratio = 0.7, color = theme.fg_normal })
end
local info_widgets = {} local info_widgets = {}
for i = #widgets, 1, -1 do for i = #widgets, 1, -1 do
table.insert(info_widgets, wibox.widget.separator({ orientation = 'vertical', forced_width = 9, thickness = 1, span_ratio = 0.7, color = theme.fg_normal }))
table.insert(info_widgets, widgets[i]) table.insert(info_widgets, widgets[i])
if i > 1 then table.insert(info_widgets, create_separator()) end
end end
info_widgets['layout'] = wibox.layout.fixed.horizontal info_widgets['layout'] = wibox.layout.fixed.horizontal
@ -63,10 +67,14 @@ return function(s)
s.wibox = awful.wibar({ position = 'top', screen = s, height = dpi(19), bg = theme.bg_normal, fg = theme.fg_normal }) s.wibox = awful.wibar({ position = 'top', screen = s, height = dpi(19), bg = theme.bg_normal, fg = theme.fg_normal })
local screen_info_widgets = info_widgets
if s.index == theme.systray_screen then if s.index == theme.systray_screen then
local tray = wibox.widget.systray() local tray = wibox.widget.systray()
tray.screen = s tray.screen = s
table.insert(info_widgets, 1, tray) screen_info_widgets = gears.table.join(
{ create_separator(),tray },
info_widgets
)
end end
s.wibox:setup({ s.wibox:setup({
@ -76,8 +84,8 @@ return function(s)
awful.widget.layoutbox({ screen = s, buttons = layout_buttons }), awful.widget.layoutbox({ screen = s, buttons = layout_buttons }),
awful.widget.taglist({ screen = s, filter = function() return true end, buttons = taglist_buttons}) awful.widget.taglist({ screen = s, filter = function() return true end, buttons = taglist_buttons})
}, },
wibox.container.margin(tasklist, 10, 10, 0, 0), wibox.container.margin(tasklist, 10, 5, 0, 0),
info_widgets, screen_info_widgets,
{ widget = wibox.container.margin, left = 50, { widget = wibox.widget.textbox } } { widget = wibox.container.margin, left = 50, { widget = wibox.widget.textbox } }
}) })
end end

View File

@ -56,7 +56,7 @@ local function signal_cbk(_conn, _sender, _object_path, _interface_name, _signal
data = data['Metadata'] data = data['Metadata']
local title = data['xesam:title'] or '' local title = data['xesam:title'] or ''
local artist = (data['xesam:artist'] or {})[1] or '' local artist = (data['xesam:artist'] or {})[1] or ''
mpris_widget.text = artist .. ' | ' .. title mpris_widget.text = artist .. ' -> ' .. title
end end
end end