New Setup 📦

This commit is contained in:
Luca 2023-02-05 05:02:49 +01:00
parent d16174b447
commit 415dbd08a1
10194 changed files with 1368647 additions and 4 deletions

View file

@ -0,0 +1,152 @@
-- ## Bar ##
-- ~~~~~~~~~
-- Requirements :
-- ~~~~~~~~~~~~~~
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local xresources = require("beautiful.xresources")
local dpi = xresources.apply_dpi
-- # Libs :
-- ~~~~~~~~
local helpers = require("libs.helpers")
-- # Main Bar Widgets :
-- ~~~~~~~~~~~~~~~~~~~~
local taglist = require("ui.bar.taglist")
local tasklist = require("ui.bar.tasklist")
local layoutbox = require("ui.bar.layoutbox")
mylayoutbox = wibox.container.margin(layoutbox(s), dpi(0), dpi(0), dpi(6), dpi(6))
mylauncher = wibox.container.margin(mylauncher, dpi(0), dpi(0), dpi(6), dpi(6))
-- # Widgets :
-- ~~~~~~~~~~~
-- # Sidebar button :
local sidebar_button = require('ui.widgets.sidebar_button')
-- # Systray :
local systray = require('ui.widgets.systray')
-- # Clock :
local clock_widget = require('ui.widgets.clock')
-- # Keyboard :
local keyboard_widget = require('ui.widgets.keyboardlayout')
-- # RAM :
local mem_widget = require('ui.widgets.memory')
-- # CPU :
local cpu_widget = require('ui.widgets.cpu')
-- # Temprature :
local temprature_widget = require('ui.widgets.temprature')
-- # Launcher :
local launcher = require('ui.widgets.launcher')
-- # Status widgets :
local status_widgets = wibox.widget {
{
-- # Updates :
--netspeed_widget,
-- # CPU TEMP :
temprature_widget,
-- # CPU :
cpu_widget,
-- # RAM :
mem_widget,
-- # Keybord :
keyboard_widget,
-- # Clock :
clock_widget,
spacing = dpi(20),
layout = wibox.layout.fixed.horizontal,
},
margins = {top = dpi(4), bottom = dpi(4)},
widget = wibox.container.margin,
}
-- Bar :
local function get_bar(s)
-- Create the wibox
s.mywibar = awful.wibar({
position = "bottom",
type = "dock",
ontop = false,
stretch = false,
visible = true,
height = dpi(42),
width = s.geometry.width,
--width = s.geometry.width - dpi(120),
screen = s,
bg = colors.black,
--bg = colors.main_transparent,
--bg = colors.transparent,
--opacity = 0.85,
})
--awful.placement.bottom(s.mywibar, { margins = theme.useless_gap * 1 })
--s.mywibar:struts { bottom = dpi(45), top = dpi(0), left = dpi(0), right = dpi(0) }
-- Bar setup :
s.mywibar:setup {
{
{
{
{
launcher,
taglist(s),
--tasklist(s),
spacing = dpi(10),
layout = wibox.layout.fixed.horizontal
},
--nil,
-- # Tasks in middel :
{
tasklist(s),
--clock_widget,
layout = wibox.layout.fixed.horizontal
},
{
status_widgets,
systray,
sidebar_button,
mylayoutbox,
layout = wibox.layout.fixed.horizontal,
spacing = dpi(10)
},
layout = wibox.layout.align.horizontal,
expand = "none"
},
widget = wibox.container.margin,
margins = {left = dpi(15), right = dpi(15), top = dpi(2), bottom = dpi(2)}
},
widget = wibox.container.background,
bg = colors.bg_color,
forced_height = s.mywibar.height
},
layout = wibox.layout.fixed.vertical,
spacing = dpi(10)
}
-- function to remove the bar in maxmized/fullscreen apps
local function remove_wibar(c)
if c.fullscreen or c.maximized then
c.screen.mywibar.visible = false
else
c.screen.mywibar.visible = true
end
end
local function add_wibar(c)
if c.fullscreen or c.maximized then
c.screen.mywibar.visible = true
end
end
client.connect_signal("property::fullscreen", remove_wibar)
client.connect_signal("request::unmanage", add_wibar)
end
screen.connect_signal("request::desktop_decoration", function(s)
get_bar(s)
end)

View file

@ -0,0 +1,26 @@
-- ## Layoutbox ##
-- ~~~~~~~~~~~~~~~
-- Requirements :
-- ~~~~~~~~~~~~~~
local awful = require("awful")
local wibox = require("wibox")
local xresources = require("beautiful.xresources")
local dpi = xresources.apply_dpi
return function(s)
-- Create a layoutbox widget
local layoutbox = awful.widget.layoutbox
{
screen = s,
buttons =
{
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),
}
}
layoutbox = wibox.container.margin(layoutbox, dpi(4), dpi(4), dpi(4), dpi(4))
return layoutbox
end

View file

@ -0,0 +1,113 @@
-- ## Tag ##
-- ~~~~~~~~~
-- Requirements :
-- ~~~~~~~~~~~~~~
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local xresources = require("beautiful.xresources")
local dpi = xresources.apply_dpi
-- # Libs :
-- ~~~~~~~~
local helpers = require("libs.helpers")
-- Tags :
--awful.util.tagnames = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }
--awful.util.tagnames = { "", "", "", "", "", "", "", "", ""} -- font size : 14
awful.util.tagnames = {"", "", "", "", "", "", "", "", ""}
-- Each screen has its own tag table.
screen.connect_signal("request::desktop_decoration", function(s)
awful.tag(awful.util.tagnames, s, awful.layout.layouts[1])
end)
local function update_tag(item, tag, index)
if tag.selected then
item.markup = helpers.colorize_text(" 󰮯 ", colors.main_scheme)
elseif tag.urgent then
item.markup = helpers.colorize_text("", colors.red)
elseif #tag:clients() > 0 then
item.markup = helpers.colorize_text("", colors.white)
else
item.markup = helpers.colorize_text(" 󱙝 ", colors.white)
end
end
return function(s)
-- Taglist buttons
local taglist_buttons = gears.table.join(
awful.button({ }, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t)
if client.focus then
client.focus:move_to_tag(t)
end
end),
awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t)
if client.focus then
client.focus:toggle_tag(t)
end
end)
--awful.button({ }, 4, function(t) awful.tag.viewprev(t.screen) end),
--awful.button({ }, 5, function(t) awful.tag.viewnext(t.screen) end),
)
-- Create a taglist widget
local taglist = awful.widget.taglist {
screen = s,
--filter = awful.widget.taglist.filter.all,
filter = function (t) return t.selected or #t:clients() > 0 end, -- Show only used Tags
buttons = taglist_buttons,
layout = {
spacing = dpi(8),
layout = wibox.layout.fixed.horizontal,
},
style = {
spacing = dpi(-4),
},
widget_template = {
id = "tag",
font = theme.ui_font,
widget = wibox.widget.textbox,
create_callback = function(self, c3, index, object)
update_tag(self, c3, index)
end,
update_callback = function(self, c3, index, object)
update_tag(self, c3, index)
end
}
}
tags = wibox.widget{
{
{
taglist,
top = dpi(0),
bottom = dpi(0),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = colors.container,
shape = helpers.rrect(theme.rounded - 4),
widget = wibox.container.background
},
top = dpi(4),
bottom = dpi(4),
left = dpi(0),
right = dpi(0),
widget = wibox.container.margin
}
--return taglist
return tags
end

View file

@ -0,0 +1,91 @@
-- ## Tasklist ##
-- ~~~~~~~~~~~~~~
-- Requirements :
-- ~~~~~~~~~~~~~~
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local xresources = require("beautiful.xresources")
local dpi = xresources.apply_dpi
-- # Libs :
-- ~~~~~~~~
local helpers = require("libs.helpers")
return function(s)
-- Tasklist buttons
local tasklist_buttons = gears.table.join(
awful.button({ }, 1, function (c) c:activate { context = "tasklist", action = "toggle_minimization" } end),
awful.button({ }, 3, function() awful.menu.client_list { theme = { width = 250 } } end),
awful.button({ }, 4, function() awful.client.focus.byidx(-1) end),
awful.button({ }, 5, function() awful.client.focus.byidx( 1) end)
)
-- Create a tasklist widget
local tasklist = awful.widget.tasklist
{
screen = s,
filter = awful.widget.tasklist.filter.currenttags,
buttons = tasklist_buttons,
style = {
font = theme.font,
bg_normal = colors.container,
bg_focus = colors.container,
bg_minimize = colors.black ,
shape = helpers.rrect(dpi(4)),
},
layout = {
spacing = dpi(8),
layout = wibox.layout.fixed.horizontal,
},
widget_template = {
{
{
{
{
awful.widget.clienticon,
forced_height = dpi(15),
forced_width = dpi(15),
halign = "center",
valign = "center",
widget = wibox.container.place,
},
margins = dpi(2),
widget = wibox.container.margin,
},
{
nil,
nil,
{
nil,
{
widget = wibox.container.background,
id = "pointer",
bg = colors.main_scheme,
shape = gears.shape.rounded_bar,
forced_height = dpi(2),
forced_width = dpi(20)
},
expand = "none",
layout = wibox.layout.align.horizontal
},
layout = wibox.layout.align.vertical
},
layout = wibox.layout.stack,
},
forced_width = dpi(40),
id = "background_role",
widget = wibox.container.background,
},
top = dpi(4),
bottom = dpi(4),
left = dpi(2),
right = dpi(2),
widget = wibox.container.margin
}
}
return tasklist
end