New Setup 📦
This commit is contained in:
parent
d16174b447
commit
415dbd08a1
10194 changed files with 1368647 additions and 4 deletions
37
home/.config/awesome/ui/widgets/clock.lua
Normal file
37
home/.config/awesome/ui/widgets/clock.lua
Normal file
|
@ -0,0 +1,37 @@
|
|||
-- ## Clock ##
|
||||
-- ~~~~~~~~~~~~~
|
||||
|
||||
-- Requirements :
|
||||
-- ~~~~~~~~~~~~~~
|
||||
local wibox = require('wibox')
|
||||
local beautiful = require('beautiful')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
|
||||
-- # Libs :
|
||||
-- ~~~~~~~~
|
||||
local helpers = require("libs.helpers")
|
||||
|
||||
-- Clock :
|
||||
--local clock = wibox.widget.textclock('<span font="' .. theme.font .. '">%a %d %b | %H:%M</span>')
|
||||
local clock = wibox.widget.textclock('%H : %M')
|
||||
|
||||
-- Icon :
|
||||
local widget_icon = " "
|
||||
local icon = wibox.widget{
|
||||
font = theme.icon_font,
|
||||
markup = helpers.colorize_text(widget_icon, colors.main_scheme),
|
||||
widget = wibox.widget.textbox,
|
||||
valign = "center",
|
||||
align = "center"
|
||||
}
|
||||
|
||||
return wibox.widget {
|
||||
icon,
|
||||
wibox.widget{
|
||||
clock,
|
||||
fg = colors.brightwhite,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
spacing = dpi(2),
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
58
home/.config/awesome/ui/widgets/cpu.lua
Normal file
58
home/.config/awesome/ui/widgets/cpu.lua
Normal file
|
@ -0,0 +1,58 @@
|
|||
-- ## Cpu ##
|
||||
-- ~~~~~~~~~
|
||||
|
||||
-- Requirements :
|
||||
-- ~~~~~~~~~~~~~~
|
||||
local wibox = require('wibox')
|
||||
local beautiful = require('beautiful')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
local watch = require('awful.widget.watch')
|
||||
|
||||
-- # Libs :
|
||||
-- ~~~~~~~~
|
||||
local helpers = require("libs.helpers")
|
||||
|
||||
local cpu = wibox.widget.textbox()
|
||||
local total_prev = 0
|
||||
local idle_prev = 0
|
||||
|
||||
watch([[bash -c "cat /proc/stat | grep '^cpu '"]], 2, function(_, stdout)
|
||||
local user, nice, system, idle, iowait, irq, softirq, steal, guest, guest_nice =
|
||||
stdout:match('(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s(%d+)%s')
|
||||
|
||||
local total = user + nice + system + idle + iowait + irq + softirq + steal
|
||||
|
||||
local diff_idle = idle - idle_prev
|
||||
local diff_total = total - total_prev
|
||||
local diff_usage = (1000 * (diff_total - diff_idle) / diff_total + 5) / 10
|
||||
|
||||
cpu.text = math.floor(diff_usage) .. '%'
|
||||
if diff_usage < 10 then cpu.text = '0' .. cpu.text end
|
||||
|
||||
total_prev = total
|
||||
idle_prev = idle
|
||||
collectgarbage('collect')
|
||||
end)
|
||||
|
||||
|
||||
|
||||
-- Icon :
|
||||
local widget_icon = " "
|
||||
local icon = wibox.widget{
|
||||
font = theme.icon_font,
|
||||
markup = helpers.colorize_text(widget_icon, colors.main_scheme),
|
||||
widget = wibox.widget.textbox,
|
||||
valign = "center",
|
||||
align = "center"
|
||||
}
|
||||
|
||||
return wibox.widget {
|
||||
icon,
|
||||
wibox.widget{
|
||||
cpu,
|
||||
fg = colors.brightwhite,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
spacing = dpi(2),
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
37
home/.config/awesome/ui/widgets/keyboardlayout.lua
Normal file
37
home/.config/awesome/ui/widgets/keyboardlayout.lua
Normal file
|
@ -0,0 +1,37 @@
|
|||
-- ## Keyboard layout ##
|
||||
-- ~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
-- Requirements :
|
||||
-- ~~~~~~~~~~~~~~
|
||||
local wibox = require('wibox')
|
||||
local awful = require("awful")
|
||||
local beautiful = require('beautiful')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
|
||||
-- # Libs :
|
||||
-- ~~~~~~~~
|
||||
local helpers = require("libs.helpers")
|
||||
|
||||
-- Keyboard :
|
||||
keyboardlayout = awful.widget.keyboardlayout()
|
||||
|
||||
-- Icon :
|
||||
local widget_icon = " "
|
||||
local icon = wibox.widget{
|
||||
font = theme.icon_font,
|
||||
markup = helpers.colorize_text(widget_icon, colors.main_scheme),
|
||||
widget = wibox.widget.textbox,
|
||||
valign = "center",
|
||||
align = "center"
|
||||
}
|
||||
|
||||
return wibox.widget {
|
||||
icon,
|
||||
wibox.widget{
|
||||
keyboardlayout,
|
||||
fg = colors.brightwhite,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
spacing = dpi(2),
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
30
home/.config/awesome/ui/widgets/launcher.lua
Normal file
30
home/.config/awesome/ui/widgets/launcher.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
-- ## Launcher ##
|
||||
-- ~~~~~~~~~~~~~~
|
||||
|
||||
-- Requirements :
|
||||
-- ~~~~~~~~~~~~~~
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
|
||||
-- # Libs :
|
||||
-- ~~~~~~~~
|
||||
local helpers = require("libs.helpers")
|
||||
|
||||
-- launcher :
|
||||
local launcher = wibox.widget{
|
||||
widget = wibox.widget.textbox,
|
||||
font = theme.ui_font,
|
||||
markup = helpers.colorize_text(" ", colors.main_scheme),
|
||||
align = "center",
|
||||
valign = "center",
|
||||
}
|
||||
|
||||
launcher:buttons(gears.table.join({
|
||||
awful.button({ }, 1, function ()
|
||||
awful.spawn.with_shell(require("libs.misc").rofiCommand, false)
|
||||
end)
|
||||
|
||||
}))
|
||||
|
||||
return launcher
|
56
home/.config/awesome/ui/widgets/memory.lua
Normal file
56
home/.config/awesome/ui/widgets/memory.lua
Normal file
|
@ -0,0 +1,56 @@
|
|||
-- ## Memory ##
|
||||
-- ~~~~~~~~~
|
||||
|
||||
-- Requirements :
|
||||
-- ~~~~~~~~~~~~~~
|
||||
local wibox = require('wibox')
|
||||
local beautiful = require('beautiful')
|
||||
local watch = require('awful.widget.watch')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
|
||||
-- # Libs :
|
||||
-- ~~~~~~~~
|
||||
local helpers = require("libs.helpers")
|
||||
|
||||
local memory = wibox.widget.textbox()
|
||||
memory.font = theme.font
|
||||
|
||||
--function round(exact, quantum)
|
||||
-- local quant,frac = math.modf(exact/quantum)
|
||||
-- return quantum * (quant + (frac > 0.5 and 1 or 0))
|
||||
--end
|
||||
--
|
||||
--watch('bash -c "free | grep -z Mem.*Swap.*"', 2, function(_, stdout)
|
||||
-- local total, used, free, shared, buff_cache, available, total_swap, used_swap, free_swap =
|
||||
-- stdout:match('(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*Swap:%s*(%d+)%s*(%d+)%s*(%d+)')
|
||||
--
|
||||
-- memory.text = round((used / 1048576), 0.01) .. ' GB'
|
||||
-- collectgarbage('collect')
|
||||
--end)
|
||||
|
||||
watch([[bash -c "free -h | awk '/^Mem/ { print $3 }' | sed s/i//g"]], 2, function(_, stdout)
|
||||
memory.text = stdout
|
||||
collectgarbage('collect')
|
||||
end)
|
||||
|
||||
|
||||
-- Icon :
|
||||
local widget_icon = " "
|
||||
local icon = wibox.widget{
|
||||
font = theme.icon_font,
|
||||
markup = helpers.colorize_text(widget_icon, colors.main_scheme),
|
||||
widget = wibox.widget.textbox,
|
||||
valign = "center",
|
||||
align = "center"
|
||||
}
|
||||
|
||||
return wibox.widget {
|
||||
icon,
|
||||
wibox.widget{
|
||||
memory,
|
||||
fg = colors.brightwhite,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
spacing = dpi(2),
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
30
home/.config/awesome/ui/widgets/sidebar_button.lua
Normal file
30
home/.config/awesome/ui/widgets/sidebar_button.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
-- ## Sidebar button ##
|
||||
-- ~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
-- Requirements :
|
||||
-- ~~~~~~~~~~~~~~
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require('beautiful')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
local sidebar = require("ui.sidebar")
|
||||
|
||||
|
||||
local sidebar_icon = wibox.widget{
|
||||
markup = "",
|
||||
font = theme.taglist_font,
|
||||
valign = "center",
|
||||
align = "center",
|
||||
widget = wibox.widget.textbox
|
||||
}
|
||||
|
||||
sidebar_icon:buttons{gears.table.join(
|
||||
awful.button({ }, 1, function ()
|
||||
sidebar.toggle(s)
|
||||
end)
|
||||
)}
|
||||
|
||||
--return sidebar_icon
|
||||
return awful.widget.only_on_screen(sidebar_icon, 'primary')
|
31
home/.config/awesome/ui/widgets/systray.lua
Normal file
31
home/.config/awesome/ui/widgets/systray.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
-- ## Clock ##
|
||||
-- ~~~~~~~~~~~~~
|
||||
|
||||
-- Requirements :
|
||||
-- ~~~~~~~~~~~~~~
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require('beautiful')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
|
||||
|
||||
-- Systray
|
||||
local systray = wibox.widget {
|
||||
visible = true,
|
||||
base_size = dpi(30),
|
||||
horizontal = true,
|
||||
screen = 'primary',
|
||||
{
|
||||
{
|
||||
wibox.widget.systray,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
margins = {top = dpi(6), bottom = dpi(6), left = dpi(6), right = dpi(6)},
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
margins = {top = dpi(2), bottom = dpi(2)},
|
||||
widget = wibox.container.margin,
|
||||
}
|
||||
|
||||
return systray
|
42
home/.config/awesome/ui/widgets/temprature.lua
Normal file
42
home/.config/awesome/ui/widgets/temprature.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
-- ## Temprature ##
|
||||
-- ~~~~~~~~~~~~~~~~
|
||||
|
||||
-- Requirements :
|
||||
-- ~~~~~~~~~~~~~~
|
||||
local wibox = require('wibox')
|
||||
local watch = require('awful.widget.watch')
|
||||
local beautiful = require('beautiful')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
|
||||
-- # Libs :
|
||||
-- ~~~~~~~~
|
||||
local helpers = require("libs.helpers")
|
||||
|
||||
local temprature = wibox.widget.textbox()
|
||||
temprature.font = theme.font
|
||||
|
||||
watch('bash -c "sensors | awk \'/Core 0/ {print substr($3, 2) }\'"', 30, function(_, stdout)
|
||||
temprature.text = stdout
|
||||
end)
|
||||
|
||||
|
||||
-- Icon :
|
||||
local widget_icon = " "
|
||||
local icon = wibox.widget{
|
||||
font = theme.icon_font,
|
||||
markup = helpers.colorize_text(widget_icon, colors.main_scheme),
|
||||
widget = wibox.widget.textbox,
|
||||
valign = "center",
|
||||
align = "center"
|
||||
}
|
||||
|
||||
return wibox.widget {
|
||||
icon,
|
||||
wibox.widget{
|
||||
temprature,
|
||||
fg = colors.brightwhite,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
spacing = dpi(2),
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue