system resources widget: Make screens it appears on configurable
This commit is contained in:
parent
64d7e9a7b0
commit
c9c5755a26
@ -33,6 +33,7 @@ config.windowSwitcher = "rofi -show window -config " .. awful.util.getdir("confi
|
|||||||
config.volume_osd_timeout = 2
|
config.volume_osd_timeout = 2
|
||||||
|
|
||||||
-- System resources widget
|
-- System resources widget
|
||||||
|
config.system_resources_widget_screens = { 1, 2 }
|
||||||
config.system_resources_widget_refresh_interval = 1.5 -- In seconds
|
config.system_resources_widget_refresh_interval = 1.5 -- In seconds
|
||||||
|
|
||||||
|
|
||||||
|
11
rc.lua
11
rc.lua
@ -300,6 +300,15 @@ awful.screen.connect_for_each_screen(function(s)
|
|||||||
height = 32
|
height = 32
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function matchesScreen(screens)
|
||||||
|
for _, allowedScreen in ipairs(screens) do
|
||||||
|
if allowedScreen == s.index then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
-- Add widgets to the wibox
|
-- Add widgets to the wibox
|
||||||
s.mywibox:setup {
|
s.mywibox:setup {
|
||||||
layout = wibox.layout.align.horizontal,
|
layout = wibox.layout.align.horizontal,
|
||||||
@ -311,7 +320,7 @@ awful.screen.connect_for_each_screen(function(s)
|
|||||||
},
|
},
|
||||||
s.mytasklist, -- Middle widget
|
s.mytasklist, -- Middle widget
|
||||||
{ -- Right widgets
|
{ -- Right widgets
|
||||||
s.index == 2 and system_resources_widget.widget or nil,
|
matchesScreen(config.system_resources_widget_screens) and system_resources_widget.widget or nil,
|
||||||
layout = wibox.layout.fixed.horizontal,
|
layout = wibox.layout.fixed.horizontal,
|
||||||
mykeyboardlayout,
|
mykeyboardlayout,
|
||||||
wibox.widget.systray(),
|
wibox.widget.systray(),
|
||||||
|
Loading…
Reference in New Issue
Block a user