Seperate taglist tasklist and layoutbox for each screen
This commit is contained in:
parent
75eebc16c4
commit
7ab7fdbb81
|
@ -1,4 +1,5 @@
|
|||
-- ████████╗ ██████╗ ██████╗ ██████╗ █████╗ ███╗ ██╗███████╗██╗
|
||||
-- ████████╗ ██████╗ ██████╗ █
|
||||
-- █████╗ █████╗ ███╗ ██╗███████╗██╗
|
||||
-- ╚══██╔══╝██╔═══██╗██╔══██╗ ██╔══██╗██╔══██╗████╗ ██║██╔════╝██║
|
||||
-- ██║ ██║ ██║██████╔╝ ██████╔╝███████║██╔██╗ ██║█████╗ ██║
|
||||
-- ██║ ██║ ██║██╔═══╝ ██╔═══╝ ██╔══██║██║╚██╗██║██╔══╝ ██║
|
||||
|
@ -16,6 +17,7 @@ local wibox = require("wibox")
|
|||
local theme = require("theme")
|
||||
local lain = require("lain")
|
||||
local tag_list = require("widgets.tag-list")
|
||||
local layout_box = require("widgets.layout-box")
|
||||
local battery_widget = require("widgets.battery-widget.battery")
|
||||
local volume_widget = require("widgets.volume-widget.volume")
|
||||
local pl = require("powerline")
|
||||
|
@ -23,8 +25,6 @@ local pl = require("powerline")
|
|||
-- import widgets
|
||||
local task_list = require("widgets.task-list")
|
||||
|
||||
|
||||
|
||||
-- ===================================================================
|
||||
-- Custom Widgets
|
||||
-- ===================================================================
|
||||
|
@ -80,6 +80,21 @@ local cpu_widget = wibox.widget{
|
|||
|
||||
local clock = wibox.widget.textclock('%a %b %d, %H:%M:%S', 1)
|
||||
|
||||
local tag_lists = {}
|
||||
local current_tag_list = wibox.widget {
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
||||
|
||||
local layout_boxes = {}
|
||||
local current_layout_box = wibox.widget {
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
||||
|
||||
local task_lists = {}
|
||||
local current_task_list = wibox.widget {
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
||||
|
||||
-- ===================================================================
|
||||
-- Bar Creation
|
||||
-- ===================================================================
|
||||
|
@ -94,11 +109,19 @@ top_panel.create = function(s)
|
|||
bg = theme.bg_normal .. "99"
|
||||
})
|
||||
|
||||
for t in screen do
|
||||
tag_lists[t] = tag_list.create(t)
|
||||
layout_boxes[t] = layout_box.create(t)
|
||||
end
|
||||
|
||||
current_tag_list:add(tag_lists[s])
|
||||
current_layout_box:add(layout_boxes[s])
|
||||
|
||||
panel:setup {
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.horizontal,
|
||||
task_list.create(s),
|
||||
tag_list.create(s),
|
||||
current_tag_list,
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
pl(wibox.widget{}, theme.bg_normal .. "00", theme.top_panel_powerline),
|
||||
|
@ -109,7 +132,7 @@ top_panel.create = function(s)
|
|||
pl(cpu_widget, theme.top_panel_powerline, theme.bg_normal),
|
||||
pl(frequency_widget, theme.bg_normal, theme.top_panel_powerline),
|
||||
pl(updates_indicator, theme.top_panel_powerline, theme.bg_normal),
|
||||
pl(require("widgets.layout-box"), theme.bg_normal, theme.top_panel_powerline),
|
||||
pl(current_layout_box, theme.bg_normal, theme.top_panel_powerline),
|
||||
pl(clock, theme.top_panel_powerline, theme.top_panel_powerline),
|
||||
}
|
||||
}
|
||||
|
@ -119,18 +142,14 @@ top_panel.create = function(s)
|
|||
-- Functionality
|
||||
-- ===================================================================
|
||||
|
||||
|
||||
-- hide panel when client is fullscreen
|
||||
local function change_panel_visibility(client)
|
||||
if client.screen == s then
|
||||
panel.ontop = not client.fullscreen
|
||||
end
|
||||
end
|
||||
client.connect_signal("focus", function (c, _)
|
||||
current_tag_list:reset(current_tag_list)
|
||||
current_tag_list:add(tag_lists[c.screen])
|
||||
current_layout_box:reset(current_layout_box)
|
||||
current_layout_box:add(layout_boxes[c.screen])
|
||||
end)
|
||||
|
||||
-- connect panel visibility function to relevant signals
|
||||
client.connect_signal("property::fullscreen", change_panel_visibility)
|
||||
client.connect_signal("focus", change_panel_visibility)
|
||||
|
||||
updates_indicator:connect_signal("button::press", function(c, _, _, button)
|
||||
awful.spawn.with_shell('WINIT_X11_SCALE_FACTOR=1 alacritty -e bash -c "yay ; echo \'\nDone, press any key to exit...\' ; read"')
|
||||
end)
|
||||
|
|
|
@ -90,6 +90,7 @@ client.connect_signal("manage", function (c)
|
|||
-- Prevent clients from being unreachable after screen count changes.
|
||||
awful.placement.no_offscreen(c)
|
||||
end
|
||||
gears.timer.delayed_call(function() awful.placement.centered(mouse, {parent=c}) end)
|
||||
end)
|
||||
|
||||
|
||||
|
@ -106,7 +107,6 @@ client.connect_signal("mouse::enter", function(c)
|
|||
c:emit_signal("request::activate", "mouse_enter", {raise = false})
|
||||
end)
|
||||
|
||||
|
||||
-- ===================================================================
|
||||
-- Screen Change Functions (ie multi monitor)
|
||||
-- ===================================================================
|
||||
|
|
|
@ -20,31 +20,36 @@ local awful = require('awful')
|
|||
|
||||
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
|
||||
-- We need one layoutbox per screen.
|
||||
local layout_box = awful.widget.layoutbox(s)
|
||||
|
||||
layout_box:buttons(
|
||||
awful.util.table.join(
|
||||
awful.button({}, 1,
|
||||
function()
|
||||
awful.layout.inc(1)
|
||||
end
|
||||
),
|
||||
awful.button({}, 3,
|
||||
function()
|
||||
awful.layout.inc(-1)
|
||||
end
|
||||
),
|
||||
awful.button({}, 4,
|
||||
function()
|
||||
awful.layout.inc(1)
|
||||
end
|
||||
),
|
||||
awful.button({}, 5,
|
||||
function()
|
||||
awful.layout.inc(-1)
|
||||
end
|
||||
local layout_box = {}
|
||||
|
||||
layout_box.create = function(s)
|
||||
local box = awful.widget.layoutbox(s)
|
||||
box:buttons(
|
||||
awful.util.table.join(
|
||||
awful.button({}, 1,
|
||||
function()
|
||||
awful.layout.inc(1)
|
||||
end
|
||||
),
|
||||
awful.button({}, 3,
|
||||
function()
|
||||
awful.layout.inc(-1)
|
||||
end
|
||||
),
|
||||
awful.button({}, 4,
|
||||
function()
|
||||
awful.layout.inc(1)
|
||||
end
|
||||
),
|
||||
awful.button({}, 5,
|
||||
function()
|
||||
awful.layout.inc(-1)
|
||||
end
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
return box
|
||||
end
|
||||
|
||||
return layout_box
|
||||
|
|
|
@ -114,10 +114,10 @@ local function list_update(w, buttons, label, data, objects)
|
|||
else
|
||||
-- truncate when title is too long
|
||||
local text_only = text:match('>(.*)<')
|
||||
local max_length = 10
|
||||
local max_length = math.floor(220 / count)
|
||||
if (text_only:len() > max_length) then
|
||||
text = text:gsub('>(.*)<', '>' .. utf8.char(utf8.codepoint(text_only, 1, max_length)) .. '...<')
|
||||
tt:set_text(text)
|
||||
tt:set_text(text_only)
|
||||
tt:add_to_object(tb)
|
||||
else
|
||||
tt:remove_from_object(tb)
|
||||
|
@ -195,7 +195,7 @@ local filter = function(c, _)
|
|||
if t.selected then
|
||||
local ctags = c:tags()
|
||||
for _, v in ipairs(ctags) do
|
||||
if v == t then
|
||||
if v == t and c.screen == client.focus.screen then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -157,6 +157,10 @@ require('lspconfig').cssls.setup {
|
|||
capabilities = capabilities
|
||||
}
|
||||
|
||||
require('lspconfig').jdtls.setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
require'lspconfig'.sumneko_lua.setup {
|
||||
settings = {
|
||||
Lua = {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
require('packer').startup(function(use)
|
||||
use 'mbbill/undotree'
|
||||
use 'nvim-tree/nvim-web-devicons'
|
||||
use 'airblade/vim-rooter'
|
||||
use "rafamadriz/friendly-snippets"
|
||||
use 'ConradIrwin/vim-bracketed-paste'
|
||||
|
|
Loading…
Reference in New Issue