🐛 fix: Awesome config baseline
This commit is contained in:
parent
3da95d6ec2
commit
e7fcada03c
65 changed files with 2191 additions and 2442 deletions
|
@ -7,17 +7,20 @@ M.keys = {
|
|||
|
||||
M.apps = {
|
||||
terminal = "wezterm",
|
||||
launcher = "rofi -no-lazy-grab -show drun -theme ~/.config/rofi/launcher.rasi",
|
||||
browser = "firefox",
|
||||
file_manager = "thunar",
|
||||
editor = os.getenv("EDITOR") or "nvim",
|
||||
}
|
||||
|
||||
M.apps.start_editor = M.apps.terminal .. "-e" .. M.apps.editor
|
||||
M.apps.music_player = M.apps.terminal .. "--class music -e ncmpcpp"
|
||||
|
||||
M.widget = {}
|
||||
|
||||
M.widget.weather = {
|
||||
api_key = "",
|
||||
coordinates = { lat = "", lon = "" },
|
||||
api_key = "e894c3e6c1a9d2217eee94791e845c96",
|
||||
coordinates = { lat = "47.773140", lon = "-122.303660" },
|
||||
}
|
||||
|
||||
M.widget.github = {
|
||||
|
|
|
@ -3,7 +3,6 @@ local wibox = require("wibox")
|
|||
local gshape = require("gears.shape")
|
||||
local gmatrix = require("gears.matrix")
|
||||
local ipairs = ipairs
|
||||
local table = table
|
||||
local capi = { mouse = mouse }
|
||||
|
||||
local _ui = {}
|
||||
|
@ -94,8 +93,8 @@ local function _get_widget_geometry(_hierarchy, widget)
|
|||
end
|
||||
end
|
||||
|
||||
function _ui.get_widget_geometry(wibox, widget)
|
||||
return _get_widget_geometry(wibox._drawable._widget_hierarchy, widget)
|
||||
function _ui.get_widget_geometry(_wibox, widget)
|
||||
return _get_widget_geometry(_wibox._drawable._widget_hierarchy, widget)
|
||||
end
|
||||
|
||||
function _ui.screen_mask(s, bg)
|
||||
|
@ -110,18 +109,18 @@ function _ui.screen_mask(s, bg)
|
|||
return mask
|
||||
end
|
||||
|
||||
function _ui.grouping_widget(w1,w2,dpi1)
|
||||
local container = wibox.widget {
|
||||
function _ui.grouping_widget(w1, w2, dpi1)
|
||||
local container = wibox.widget({
|
||||
w1,
|
||||
{
|
||||
nil,
|
||||
w2,
|
||||
expand = 'none',
|
||||
expand = "none",
|
||||
layout = wibox.layout.flex.vertical,
|
||||
},
|
||||
spacing = dpi1,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}
|
||||
})
|
||||
|
||||
return container
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
local gobject = require("gears.object")
|
||||
|
||||
-- Kidna copying awesotre's stores on a surface level for added compatibility
|
||||
local function subscribable(args)
|
||||
local function subscribable()
|
||||
local ret = gobject({})
|
||||
local subscribed = {}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ local tween = {
|
|||
]],
|
||||
}
|
||||
|
||||
local pow, sin, cos, pi, sqrt, abs, asin = math.pow, math.sin, math.cos, math.pi, math.sqrt, math.abs, math.asin
|
||||
local sin, cos, pi, sqrt, abs, asin = math.sin, math.cos, math.pi, math.sqrt, math.abs, math.asin
|
||||
|
||||
-- linear
|
||||
local function linear(t, b, c, d)
|
||||
|
@ -50,7 +50,7 @@ end
|
|||
|
||||
-- quad
|
||||
local function inQuad(t, b, c, d)
|
||||
return c * pow(t / d, 2) + b
|
||||
return c * ((t / d) ^ 2) + b
|
||||
end
|
||||
local function outQuad(t, b, c, d)
|
||||
t = t / d
|
||||
|
@ -59,7 +59,7 @@ end
|
|||
local function inOutQuad(t, b, c, d)
|
||||
t = t / d * 2
|
||||
if t < 1 then
|
||||
return c / 2 * pow(t, 2) + b
|
||||
return c / 2 * (t ^ 2) + b
|
||||
end
|
||||
return -c / 2 * ((t - 1) * (t - 3) - 1) + b
|
||||
end
|
||||
|
@ -72,10 +72,10 @@ end
|
|||
|
||||
-- cubic
|
||||
local function inCubic(t, b, c, d)
|
||||
return c * pow(t / d, 3) + b
|
||||
return c * ((t / d) ^ 3) + b
|
||||
end
|
||||
local function outCubic(t, b, c, d)
|
||||
return c * (pow(t / d - 1, 3) + 1) + b
|
||||
return c * (((t / d - 1) ^ 3) + 1) + b
|
||||
end
|
||||
local function inOutCubic(t, b, c, d)
|
||||
t = t / d * 2
|
||||
|
@ -94,17 +94,17 @@ end
|
|||
|
||||
-- quart
|
||||
local function inQuart(t, b, c, d)
|
||||
return c * pow(t / d, 4) + b
|
||||
return c * ((t / d) ^ 4) + b
|
||||
end
|
||||
local function outQuart(t, b, c, d)
|
||||
return -c * (pow(t / d - 1, 4) - 1) + b
|
||||
return -c * (((t / d - 1) ^ 4) - 1) + b
|
||||
end
|
||||
local function inOutQuart(t, b, c, d)
|
||||
t = t / d * 2
|
||||
if t < 1 then
|
||||
return c / 2 * pow(t, 4) + b
|
||||
return c / 2 * (t ^ 4) + b
|
||||
end
|
||||
return -c / 2 * (pow(t - 2, 4) - 2) + b
|
||||
return -c / 2 * (((t - 2) ^ 4) - 2) + b
|
||||
end
|
||||
local function outInQuart(t, b, c, d)
|
||||
if t < d / 2 then
|
||||
|
@ -115,17 +115,17 @@ end
|
|||
|
||||
-- quint
|
||||
local function inQuint(t, b, c, d)
|
||||
return c * pow(t / d, 5) + b
|
||||
return c * ((t / d) ^ 5) + b
|
||||
end
|
||||
local function outQuint(t, b, c, d)
|
||||
return c * (pow(t / d - 1, 5) + 1) + b
|
||||
return c * (((t / d - 1) ^ 5) + 1) + b
|
||||
end
|
||||
local function inOutQuint(t, b, c, d)
|
||||
t = t / d * 2
|
||||
if t < 1 then
|
||||
return c / 2 * pow(t, 5) + b
|
||||
return c / 2 * (t ^ 5) + b
|
||||
end
|
||||
return c / 2 * (pow(t - 2, 5) + 2) + b
|
||||
return c / 2 * (((t - 2) ^ 5) + 2) + b
|
||||
end
|
||||
local function outInQuint(t, b, c, d)
|
||||
if t < d / 2 then
|
||||
|
@ -156,13 +156,13 @@ local function inExpo(t, b, c, d)
|
|||
if t == 0 then
|
||||
return b
|
||||
end
|
||||
return c * pow(2, 10 * (t / d - 1)) + b - c * 0.001
|
||||
return c * (2 ^ (10 * (t / d - 1))) + b - c * 0.001
|
||||
end
|
||||
local function outExpo(t, b, c, d)
|
||||
if t == d then
|
||||
return b + c
|
||||
end
|
||||
return c * 1.001 * (-pow(2, -10 * t / d) + 1) + b
|
||||
return c * 1.001 * (-(2 ^ (-10 * t / d)) + 1) + b
|
||||
end
|
||||
local function inOutExpo(t, b, c, d)
|
||||
if t == 0 then
|
||||
|
@ -173,9 +173,9 @@ local function inOutExpo(t, b, c, d)
|
|||
end
|
||||
t = t / d * 2
|
||||
if t < 1 then
|
||||
return c / 2 * pow(2, 10 * (t - 1)) + b - c * 0.0005
|
||||
return c / 2 * (2 ^ (10 * (t - 1))) + b - c * 0.0005
|
||||
end
|
||||
return c / 2 * 1.0005 * (-pow(2, -10 * (t - 1)) + 2) + b
|
||||
return c / 2 * 1.0005 * (-(2 ^ (-10 * (t - 1))) + 2) + b
|
||||
end
|
||||
local function outInExpo(t, b, c, d)
|
||||
if t < d / 2 then
|
||||
|
@ -186,10 +186,10 @@ end
|
|||
|
||||
-- circ
|
||||
local function inCirc(t, b, c, d)
|
||||
return (-c * (sqrt(1 - pow(t / d, 2)) - 1) + b)
|
||||
return (-c * (sqrt(1 - ((t / d) ^ 2)) - 1) + b)
|
||||
end
|
||||
local function outCirc(t, b, c, d)
|
||||
return (c * sqrt(1 - pow(t / d - 1, 2)) + b)
|
||||
return (c * sqrt(1 - ((t / d - 1) ^ 2)) + b)
|
||||
end
|
||||
local function inOutCirc(t, b, c, d)
|
||||
t = t / d * 2
|
||||
|
@ -225,7 +225,7 @@ local function inElastic(t, b, c, d, a, p)
|
|||
end
|
||||
p, a, s = calculatePAS(p, a, c, d)
|
||||
t = t - 1
|
||||
return -(a * pow(2, 10 * t) * sin((t * d - s) * (2 * pi) / p)) + b
|
||||
return -(a * (2 ^ (10 * t)) * sin((t * d - s) * (2 * pi) / p)) + b
|
||||
end
|
||||
local function outElastic(t, b, c, d, a, p)
|
||||
local s
|
||||
|
@ -237,7 +237,7 @@ local function outElastic(t, b, c, d, a, p)
|
|||
return b + c
|
||||
end
|
||||
p, a, s = calculatePAS(p, a, c, d)
|
||||
return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b
|
||||
return a * (2 ^ (-10 * t)) * sin((t * d - s) * (2 * pi) / p) + c + b
|
||||
end
|
||||
local function inOutElastic(t, b, c, d, a, p)
|
||||
local s
|
||||
|
@ -251,9 +251,9 @@ local function inOutElastic(t, b, c, d, a, p)
|
|||
p, a, s = calculatePAS(p, a, c, d)
|
||||
t = t - 1
|
||||
if t < 0 then
|
||||
return -0.5 * (a * pow(2, 10 * t) * sin((t * d - s) * (2 * pi) / p)) + b
|
||||
return -0.5 * (a * (2 ^ (10 * t)) * sin((t * d - s) * (2 * pi) / p)) + b
|
||||
end
|
||||
return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) * 0.5 + c + b
|
||||
return a * (2 ^ (-10 * t)) * sin((t * d - s) * (2 * pi) / p) * 0.5 + c + b
|
||||
end
|
||||
local function outInElastic(t, b, c, d, a, p)
|
||||
if t < d / 2 then
|
||||
|
@ -405,7 +405,7 @@ local function checkSubjectAndTargetRecursively(subject, target, path)
|
|||
end
|
||||
end
|
||||
|
||||
local function checkNewParams(initial, duration, subject, target, easing)
|
||||
local function checkNewParams(_, _, subject, target, easing)
|
||||
-- assert(type(initial) == 'number' and duration > 0, "duration must be a positive number. Was " .. tostring(duration))
|
||||
-- assert(type(duration) == 'number' and duration > 0, "duration must be a positive number. Was " .. tostring(duration))
|
||||
assert(type(easing) == "function", "easing must be a function. Was " .. tostring(easing))
|
||||
|
|
|
@ -12,7 +12,7 @@ local function mouse_resize_handler(m, c)
|
|||
local x, y = start.x, start.y
|
||||
local wa = m(c.screen.workarea)
|
||||
local idx = awful.client.idx(c)
|
||||
local c_above, c_below
|
||||
local c_above
|
||||
local idx_above, idx_below
|
||||
local wfact_above, wfact_below
|
||||
local jump_to = { x = x, y = y }
|
||||
|
@ -23,17 +23,17 @@ local function mouse_resize_handler(m, c)
|
|||
|
||||
local v_border = 0.2 * g.height
|
||||
|
||||
if idx.idx > 1 and y >= g.y and y <= g.y + v_border then
|
||||
if idx and idx.idx > 1 and y >= g.y and y <= g.y + v_border then
|
||||
-- we are near the top edge of the window
|
||||
c_above = awful.client.next(-1, c)
|
||||
c_below = c
|
||||
C_BELOW = c
|
||||
jump_to.y = g.y
|
||||
idx_above = idx.idx - 1
|
||||
idx_below = idx.idx
|
||||
elseif idx.idx < idx.num and y >= g.y + g.height - v_border then
|
||||
elseif idx and idx.idx < idx.num and y >= g.y + g.height - v_border then
|
||||
-- we are near the bottom edge of the window
|
||||
c_above = c
|
||||
c_below = awful.client.next(1, c)
|
||||
C_BELOW = awful.client.next(1, c)
|
||||
idx_above = idx.idx
|
||||
idx_below = idx.idx + 1
|
||||
jump_to.y = g.y + g.height
|
||||
|
@ -49,7 +49,7 @@ local function mouse_resize_handler(m, c)
|
|||
end
|
||||
end
|
||||
|
||||
if idx_above then
|
||||
if idx and idx_above then
|
||||
local t = c.screen.selected_tag
|
||||
local data = t.windowfact or {}
|
||||
local colfact = data[idx.col] or {}
|
||||
|
@ -58,11 +58,11 @@ local function mouse_resize_handler(m, c)
|
|||
end
|
||||
|
||||
if idx_above and move_mwfact then
|
||||
cursor = "cross"
|
||||
CURSOR = "cross"
|
||||
elseif idx_above then
|
||||
cursor = m({ y = "sb_v_double_arrow", x = "sb_h_double_arrow" }).y
|
||||
CURSOR = m({ y = "sb_v_double_arrow", x = "sb_h_double_arrow" }).y
|
||||
elseif move_mwfact then
|
||||
cursor = m({ y = "sb_v_double_arrow", x = "sb_h_double_arrow" }).x
|
||||
CURSOR = m({ y = "sb_v_double_arrow", x = "sb_h_double_arrow" }).x
|
||||
else
|
||||
return false
|
||||
end
|
||||
|
@ -89,7 +89,7 @@ local function mouse_resize_handler(m, c)
|
|||
c.screen.selected_tag.master_width_factor = math.min(math.max((_mouse.x - wa.x) / wa.width, 0.01), 0.99)
|
||||
end
|
||||
|
||||
if idx_above then
|
||||
if idx and idx_above then
|
||||
local factor_delta = (_mouse.y - jump_to.y) / wa.height
|
||||
|
||||
if factor_delta < 0 then
|
||||
|
@ -109,7 +109,7 @@ local function mouse_resize_handler(m, c)
|
|||
else
|
||||
return false
|
||||
end
|
||||
end, cursor)
|
||||
end, CURSOR)
|
||||
|
||||
return true
|
||||
end
|
||||
|
@ -119,6 +119,7 @@ awful.layout.suit.tile.mouse_resize_handler = function(c)
|
|||
return x
|
||||
end, c)
|
||||
end
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
awful.layout.suit.tile.bottom.mouse_resize_handler = function(c)
|
||||
return mouse_resize_handler(function(q)
|
||||
return { x = q.y, y = q.x, width = q.height, height = q.width }
|
||||
|
|
|
@ -4,18 +4,16 @@ local wibox = require("wibox")
|
|||
local beautiful = require("beautiful")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
local helpers = require("helpers")
|
||||
--local lock_screen = require("modules.lockscreen")
|
||||
--lock_screen.init()
|
||||
|
||||
--- Minimalist Exit Screen
|
||||
--- ~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
--- Icons
|
||||
local icon_font = beautiful.font_name.."bold 45"
|
||||
local icon_font = beautiful.font_name .. "bold 45"
|
||||
local poweroff_text_icon = ""
|
||||
local reboot_text_icon = ""
|
||||
local suspend_text_icon = ""
|
||||
local exit_text_icon = ""
|
||||
local exit_text_icon = ""
|
||||
local lock_text_icon = ""
|
||||
|
||||
local button_bg = beautiful.xcolorbase
|
||||
|
@ -34,7 +32,6 @@ end
|
|||
|
||||
local suspend_command = function()
|
||||
awesome.emit_signal("module::exit_screen:hide")
|
||||
--lock_screen_show()
|
||||
awful.spawn.with_shell("systemctl suspend")
|
||||
end
|
||||
|
||||
|
@ -44,10 +41,9 @@ end
|
|||
|
||||
local lock_command = function()
|
||||
awesome.emit_signal("module::exit_screen:hide")
|
||||
--lock_screen_show()
|
||||
end
|
||||
|
||||
local create_button = function(symbol, hover_color, text, command)
|
||||
local create_button = function(symbol, hover_color, _, command)
|
||||
local icon = wibox.widget({
|
||||
forced_height = button_size,
|
||||
forced_width = button_size,
|
||||
|
@ -154,7 +150,7 @@ end)
|
|||
local exit_screen_grabber = awful.keygrabber({
|
||||
auto_start = true,
|
||||
stop_event = "release",
|
||||
keypressed_callback = function(self, mod, key, command)
|
||||
keypressed_callback = function(_, _, key, _)
|
||||
if key == "s" then
|
||||
suspend_command()
|
||||
elseif key == "e" then
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
require (... .. ".better-resize")
|
||||
require (... .. ".savefloats")
|
||||
require (... .. ".exit-screen")
|
||||
require(... .. ".better-resize")
|
||||
require(... .. ".savefloats")
|
||||
require(... .. ".exit-screen")
|
||||
|
||||
|
|
|
@ -31,111 +31,103 @@ local json = { _version = "0.1.2" }
|
|||
local encode
|
||||
|
||||
local escape_char_map = {
|
||||
[ "\\" ] = "\\",
|
||||
[ "\"" ] = "\"",
|
||||
[ "\b" ] = "b",
|
||||
[ "\f" ] = "f",
|
||||
[ "\n" ] = "n",
|
||||
[ "\r" ] = "r",
|
||||
[ "\t" ] = "t",
|
||||
["\\"] = "\\",
|
||||
['"'] = '"',
|
||||
["\b"] = "b",
|
||||
["\f"] = "f",
|
||||
["\n"] = "n",
|
||||
["\r"] = "r",
|
||||
["\t"] = "t",
|
||||
}
|
||||
|
||||
local escape_char_map_inv = { [ "/" ] = "/" }
|
||||
local escape_char_map_inv = { ["/"] = "/" }
|
||||
for k, v in pairs(escape_char_map) do
|
||||
escape_char_map_inv[v] = k
|
||||
escape_char_map_inv[v] = k
|
||||
end
|
||||
|
||||
|
||||
local function escape_char(c)
|
||||
return "\\" .. (escape_char_map[c] or string.format("u%04x", c:byte()))
|
||||
return "\\" .. (escape_char_map[c] or string.format("u%04x", c:byte()))
|
||||
end
|
||||
|
||||
|
||||
local function encode_nil(val)
|
||||
return "null"
|
||||
local function encode_nil(_)
|
||||
return "null"
|
||||
end
|
||||
|
||||
|
||||
local function encode_table(val, stack)
|
||||
local res = {}
|
||||
stack = stack or {}
|
||||
local res = {}
|
||||
stack = stack or {}
|
||||
|
||||
-- Circular reference?
|
||||
if stack[val] then error("circular reference") end
|
||||
-- Circular reference?
|
||||
if stack[val] then
|
||||
error("circular reference")
|
||||
end
|
||||
|
||||
stack[val] = true
|
||||
stack[val] = true
|
||||
|
||||
if rawget(val, 1) ~= nil or next(val) == nil then
|
||||
-- Treat as array -- check keys are valid and it is not sparse
|
||||
local n = 0
|
||||
for k in pairs(val) do
|
||||
if type(k) ~= "number" then
|
||||
error("invalid table: mixed or invalid key types")
|
||||
end
|
||||
n = n + 1
|
||||
end
|
||||
if n ~= #val then
|
||||
error("invalid table: sparse array")
|
||||
end
|
||||
-- Encode
|
||||
for i, v in ipairs(val) do
|
||||
table.insert(res, encode(v, stack))
|
||||
end
|
||||
stack[val] = nil
|
||||
return "[" .. table.concat(res, ",") .. "]"
|
||||
|
||||
else
|
||||
-- Treat as an object
|
||||
for k, v in pairs(val) do
|
||||
if type(k) ~= "string" then
|
||||
error("invalid table: mixed or invalid key types")
|
||||
end
|
||||
table.insert(res, encode(k, stack) .. ":" .. encode(v, stack))
|
||||
end
|
||||
stack[val] = nil
|
||||
return "{" .. table.concat(res, ",") .. "}"
|
||||
end
|
||||
if rawget(val, 1) ~= nil or next(val) == nil then
|
||||
-- Treat as array -- check keys are valid and it is not sparse
|
||||
local n = 0
|
||||
for k in pairs(val) do
|
||||
if type(k) ~= "number" then
|
||||
error("invalid table: mixed or invalid key types")
|
||||
end
|
||||
n = n + 1
|
||||
end
|
||||
if n ~= #val then
|
||||
error("invalid table: sparse array")
|
||||
end
|
||||
-- Encode
|
||||
for _, v in ipairs(val) do
|
||||
table.insert(res, encode(v, stack))
|
||||
end
|
||||
stack[val] = nil
|
||||
return "[" .. table.concat(res, ",") .. "]"
|
||||
else
|
||||
-- Treat as an object
|
||||
for k, v in pairs(val) do
|
||||
if type(k) ~= "string" then
|
||||
error("invalid table: mixed or invalid key types")
|
||||
end
|
||||
table.insert(res, encode(k, stack) .. ":" .. encode(v, stack))
|
||||
end
|
||||
stack[val] = nil
|
||||
return "{" .. table.concat(res, ",") .. "}"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function encode_string(val)
|
||||
return '"' .. val:gsub('[%z\1-\31\\"]', escape_char) .. '"'
|
||||
return '"' .. val:gsub('[%z\1-\31\\"]', escape_char) .. '"'
|
||||
end
|
||||
|
||||
|
||||
local function encode_number(val)
|
||||
-- Check for NaN, -inf and inf
|
||||
if val ~= val or val <= -math.huge or val >= math.huge then
|
||||
error("unexpected number value '" .. tostring(val) .. "'")
|
||||
end
|
||||
return string.format("%.14g", val)
|
||||
-- Check for NaN, -inf and inf
|
||||
if val ~= val or val <= -math.huge or val >= math.huge then
|
||||
error("unexpected number value '" .. tostring(val) .. "'")
|
||||
end
|
||||
return string.format("%.14g", val)
|
||||
end
|
||||
|
||||
|
||||
local type_func_map = {
|
||||
[ "nil" ] = encode_nil,
|
||||
[ "table" ] = encode_table,
|
||||
[ "string" ] = encode_string,
|
||||
[ "number" ] = encode_number,
|
||||
[ "boolean" ] = tostring,
|
||||
["nil"] = encode_nil,
|
||||
["table"] = encode_table,
|
||||
["string"] = encode_string,
|
||||
["number"] = encode_number,
|
||||
["boolean"] = tostring,
|
||||
}
|
||||
|
||||
|
||||
encode = function(val, stack)
|
||||
local t = type(val)
|
||||
local f = type_func_map[t]
|
||||
if f then
|
||||
return f(val, stack)
|
||||
end
|
||||
error("unexpected type '" .. t .. "'")
|
||||
local t = type(val)
|
||||
local f = type_func_map[t]
|
||||
if f then
|
||||
return f(val, stack)
|
||||
end
|
||||
error("unexpected type '" .. t .. "'")
|
||||
end
|
||||
|
||||
|
||||
function json.encode(val)
|
||||
return ( encode(val) )
|
||||
return (encode(val))
|
||||
end
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Decode
|
||||
-------------------------------------------------------------------------------
|
||||
|
@ -143,246 +135,238 @@ end
|
|||
local parse
|
||||
|
||||
local function create_set(...)
|
||||
local res = {}
|
||||
for i = 1, select("#", ...) do
|
||||
res[ select(i, ...) ] = true
|
||||
end
|
||||
return res
|
||||
local res = {}
|
||||
for i = 1, select("#", ...) do
|
||||
res[select(i, ...)] = true
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
local space_chars = create_set(" ", "\t", "\r", "\n")
|
||||
local delim_chars = create_set(" ", "\t", "\r", "\n", "]", "}", ",")
|
||||
local escape_chars = create_set("\\", "/", '"', "b", "f", "n", "r", "t", "u")
|
||||
local literals = create_set("true", "false", "null")
|
||||
local space_chars = create_set(" ", "\t", "\r", "\n")
|
||||
local delim_chars = create_set(" ", "\t", "\r", "\n", "]", "}", ",")
|
||||
local escape_chars = create_set("\\", "/", '"', "b", "f", "n", "r", "t", "u")
|
||||
local literals = create_set("true", "false", "null")
|
||||
|
||||
local literal_map = {
|
||||
[ "true" ] = true,
|
||||
[ "false" ] = false,
|
||||
[ "null" ] = nil,
|
||||
["true"] = true,
|
||||
["false"] = false,
|
||||
["null"] = nil,
|
||||
}
|
||||
|
||||
|
||||
local function next_char(str, idx, set, negate)
|
||||
for i = idx, #str do
|
||||
if set[str:sub(i, i)] ~= negate then
|
||||
return i
|
||||
end
|
||||
end
|
||||
return #str + 1
|
||||
for i = idx, #str do
|
||||
if set[str:sub(i, i)] ~= negate then
|
||||
return i
|
||||
end
|
||||
end
|
||||
return #str + 1
|
||||
end
|
||||
|
||||
|
||||
local function decode_error(str, idx, msg)
|
||||
local line_count = 1
|
||||
local col_count = 1
|
||||
for i = 1, idx - 1 do
|
||||
col_count = col_count + 1
|
||||
if str:sub(i, i) == "\n" then
|
||||
line_count = line_count + 1
|
||||
col_count = 1
|
||||
end
|
||||
end
|
||||
error( string.format("%s at line %d col %d", msg, line_count, col_count) )
|
||||
local line_count = 1
|
||||
local col_count = 1
|
||||
for i = 1, idx - 1 do
|
||||
col_count = col_count + 1
|
||||
if str:sub(i, i) == "\n" then
|
||||
line_count = line_count + 1
|
||||
col_count = 1
|
||||
end
|
||||
end
|
||||
error(string.format("%s at line %d col %d", msg, line_count, col_count))
|
||||
end
|
||||
|
||||
|
||||
local function codepoint_to_utf8(n)
|
||||
-- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=iws-appendixa
|
||||
local f = math.floor
|
||||
if n <= 0x7f then
|
||||
return string.char(n)
|
||||
elseif n <= 0x7ff then
|
||||
return string.char(f(n / 64) + 192, n % 64 + 128)
|
||||
elseif n <= 0xffff then
|
||||
return string.char(f(n / 4096) + 224, f(n % 4096 / 64) + 128, n % 64 + 128)
|
||||
elseif n <= 0x10ffff then
|
||||
return string.char(f(n / 262144) + 240, f(n % 262144 / 4096) + 128,
|
||||
f(n % 4096 / 64) + 128, n % 64 + 128)
|
||||
end
|
||||
error( string.format("invalid unicode codepoint '%x'", n) )
|
||||
-- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=iws-appendixa
|
||||
local f = math.floor
|
||||
if n <= 0x7f then
|
||||
return string.char(n)
|
||||
elseif n <= 0x7ff then
|
||||
return string.char(f(n / 64) + 192, n % 64 + 128)
|
||||
elseif n <= 0xffff then
|
||||
return string.char(f(n / 4096) + 224, f(n % 4096 / 64) + 128, n % 64 + 128)
|
||||
elseif n <= 0x10ffff then
|
||||
return string.char(f(n / 262144) + 240, f(n % 262144 / 4096) + 128, f(n % 4096 / 64) + 128, n % 64 + 128)
|
||||
end
|
||||
error(string.format("invalid unicode codepoint '%x'", n))
|
||||
end
|
||||
|
||||
|
||||
local function parse_unicode_escape(s)
|
||||
local n1 = tonumber( s:sub(1, 4), 16 )
|
||||
local n2 = tonumber( s:sub(7, 10), 16 )
|
||||
-- Surrogate pair?
|
||||
if n2 then
|
||||
return codepoint_to_utf8((n1 - 0xd800) * 0x400 + (n2 - 0xdc00) + 0x10000)
|
||||
else
|
||||
return codepoint_to_utf8(n1)
|
||||
end
|
||||
local n1 = tonumber(s:sub(1, 4), 16)
|
||||
local n2 = tonumber(s:sub(7, 10), 16)
|
||||
-- Surrogate pair?
|
||||
if n2 then
|
||||
return codepoint_to_utf8((n1 - 0xd800) * 0x400 + (n2 - 0xdc00) + 0x10000)
|
||||
else
|
||||
return codepoint_to_utf8(n1)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function parse_string(str, i)
|
||||
local res = ""
|
||||
local j = i + 1
|
||||
local k = j
|
||||
local res = ""
|
||||
local j = i + 1
|
||||
local k = j
|
||||
|
||||
while j <= #str do
|
||||
local x = str:byte(j)
|
||||
while j <= #str do
|
||||
local x = str:byte(j)
|
||||
|
||||
if x < 32 then
|
||||
decode_error(str, j, "control character in string")
|
||||
if x < 32 then
|
||||
decode_error(str, j, "control character in string")
|
||||
elseif x == 92 then -- `\`: Escape
|
||||
res = res .. str:sub(k, j - 1)
|
||||
j = j + 1
|
||||
local c = str:sub(j, j)
|
||||
if c == "u" then
|
||||
local hex = str:match("^[dD][89aAbB]%x%x\\u%x%x%x%x", j + 1)
|
||||
or str:match("^%x%x%x%x", j + 1)
|
||||
or decode_error(str, j - 1, "invalid unicode escape in string")
|
||||
res = res .. parse_unicode_escape(hex)
|
||||
j = j + #hex
|
||||
else
|
||||
if not escape_chars[c] then
|
||||
decode_error(str, j - 1, "invalid escape char '" .. c .. "' in string")
|
||||
end
|
||||
res = res .. escape_char_map_inv[c]
|
||||
end
|
||||
k = j + 1
|
||||
elseif x == 34 then -- `"`: End of string
|
||||
res = res .. str:sub(k, j - 1)
|
||||
return res, j + 1
|
||||
end
|
||||
|
||||
elseif x == 92 then -- `\`: Escape
|
||||
res = res .. str:sub(k, j - 1)
|
||||
j = j + 1
|
||||
local c = str:sub(j, j)
|
||||
if c == "u" then
|
||||
local hex = str:match("^[dD][89aAbB]%x%x\\u%x%x%x%x", j + 1)
|
||||
or str:match("^%x%x%x%x", j + 1)
|
||||
or decode_error(str, j - 1, "invalid unicode escape in string")
|
||||
res = res .. parse_unicode_escape(hex)
|
||||
j = j + #hex
|
||||
else
|
||||
if not escape_chars[c] then
|
||||
decode_error(str, j - 1, "invalid escape char '" .. c .. "' in string")
|
||||
end
|
||||
res = res .. escape_char_map_inv[c]
|
||||
end
|
||||
k = j + 1
|
||||
j = j + 1
|
||||
end
|
||||
|
||||
elseif x == 34 then -- `"`: End of string
|
||||
res = res .. str:sub(k, j - 1)
|
||||
return res, j + 1
|
||||
end
|
||||
|
||||
j = j + 1
|
||||
end
|
||||
|
||||
decode_error(str, i, "expected closing quote for string")
|
||||
decode_error(str, i, "expected closing quote for string")
|
||||
end
|
||||
|
||||
|
||||
local function parse_number(str, i)
|
||||
local x = next_char(str, i, delim_chars)
|
||||
local s = str:sub(i, x - 1)
|
||||
local n = tonumber(s)
|
||||
if not n then
|
||||
decode_error(str, i, "invalid number '" .. s .. "'")
|
||||
end
|
||||
return n, x
|
||||
local x = next_char(str, i, delim_chars)
|
||||
local s = str:sub(i, x - 1)
|
||||
local n = tonumber(s)
|
||||
if not n then
|
||||
decode_error(str, i, "invalid number '" .. s .. "'")
|
||||
end
|
||||
return n, x
|
||||
end
|
||||
|
||||
|
||||
local function parse_literal(str, i)
|
||||
local x = next_char(str, i, delim_chars)
|
||||
local word = str:sub(i, x - 1)
|
||||
if not literals[word] then
|
||||
decode_error(str, i, "invalid literal '" .. word .. "'")
|
||||
end
|
||||
return literal_map[word], x
|
||||
local x = next_char(str, i, delim_chars)
|
||||
local word = str:sub(i, x - 1)
|
||||
if not literals[word] then
|
||||
decode_error(str, i, "invalid literal '" .. word .. "'")
|
||||
end
|
||||
return literal_map[word], x
|
||||
end
|
||||
|
||||
|
||||
local function parse_array(str, i)
|
||||
local res = {}
|
||||
local n = 1
|
||||
i = i + 1
|
||||
while 1 do
|
||||
local x
|
||||
i = next_char(str, i, space_chars, true)
|
||||
-- Empty / end of array?
|
||||
if str:sub(i, i) == "]" then
|
||||
i = i + 1
|
||||
break
|
||||
end
|
||||
-- Read token
|
||||
x, i = parse(str, i)
|
||||
res[n] = x
|
||||
n = n + 1
|
||||
-- Next token
|
||||
i = next_char(str, i, space_chars, true)
|
||||
local chr = str:sub(i, i)
|
||||
i = i + 1
|
||||
if chr == "]" then break end
|
||||
if chr ~= "," then decode_error(str, i, "expected ']' or ','") end
|
||||
end
|
||||
return res, i
|
||||
local res = {}
|
||||
local n = 1
|
||||
i = i + 1
|
||||
while 1 do
|
||||
local x
|
||||
i = next_char(str, i, space_chars, true)
|
||||
-- Empty / end of array?
|
||||
if str:sub(i, i) == "]" then
|
||||
i = i + 1
|
||||
break
|
||||
end
|
||||
-- Read token
|
||||
x, i = parse(str, i)
|
||||
res[n] = x
|
||||
n = n + 1
|
||||
-- Next token
|
||||
i = next_char(str, i, space_chars, true)
|
||||
local chr = str:sub(i, i)
|
||||
i = i + 1
|
||||
if chr == "]" then
|
||||
break
|
||||
end
|
||||
if chr ~= "," then
|
||||
decode_error(str, i, "expected ']' or ','")
|
||||
end
|
||||
end
|
||||
return res, i
|
||||
end
|
||||
|
||||
|
||||
local function parse_object(str, i)
|
||||
local res = {}
|
||||
i = i + 1
|
||||
while 1 do
|
||||
local key, val
|
||||
i = next_char(str, i, space_chars, true)
|
||||
-- Empty / end of object?
|
||||
if str:sub(i, i) == "}" then
|
||||
i = i + 1
|
||||
break
|
||||
end
|
||||
-- Read key
|
||||
if str:sub(i, i) ~= '"' then
|
||||
decode_error(str, i, "expected string for key")
|
||||
end
|
||||
key, i = parse(str, i)
|
||||
-- Read ':' delimiter
|
||||
i = next_char(str, i, space_chars, true)
|
||||
if str:sub(i, i) ~= ":" then
|
||||
decode_error(str, i, "expected ':' after key")
|
||||
end
|
||||
i = next_char(str, i + 1, space_chars, true)
|
||||
-- Read value
|
||||
val, i = parse(str, i)
|
||||
-- Set
|
||||
res[key] = val
|
||||
-- Next token
|
||||
i = next_char(str, i, space_chars, true)
|
||||
local chr = str:sub(i, i)
|
||||
i = i + 1
|
||||
if chr == "}" then break end
|
||||
if chr ~= "," then decode_error(str, i, "expected '}' or ','") end
|
||||
end
|
||||
return res, i
|
||||
local res = {}
|
||||
i = i + 1
|
||||
while 1 do
|
||||
local key, val
|
||||
i = next_char(str, i, space_chars, true)
|
||||
-- Empty / end of object?
|
||||
if str:sub(i, i) == "}" then
|
||||
i = i + 1
|
||||
break
|
||||
end
|
||||
-- Read key
|
||||
if str:sub(i, i) ~= '"' then
|
||||
decode_error(str, i, "expected string for key")
|
||||
end
|
||||
key, i = parse(str, i)
|
||||
-- Read ':' delimiter
|
||||
i = next_char(str, i, space_chars, true)
|
||||
if str:sub(i, i) ~= ":" then
|
||||
decode_error(str, i, "expected ':' after key")
|
||||
end
|
||||
i = next_char(str, i + 1, space_chars, true)
|
||||
-- Read value
|
||||
val, i = parse(str, i)
|
||||
-- Set
|
||||
res[key] = val
|
||||
-- Next token
|
||||
i = next_char(str, i, space_chars, true)
|
||||
local chr = str:sub(i, i)
|
||||
i = i + 1
|
||||
if chr == "}" then
|
||||
break
|
||||
end
|
||||
if chr ~= "," then
|
||||
decode_error(str, i, "expected '}' or ','")
|
||||
end
|
||||
end
|
||||
return res, i
|
||||
end
|
||||
|
||||
|
||||
local char_func_map = {
|
||||
[ '"' ] = parse_string,
|
||||
[ "0" ] = parse_number,
|
||||
[ "1" ] = parse_number,
|
||||
[ "2" ] = parse_number,
|
||||
[ "3" ] = parse_number,
|
||||
[ "4" ] = parse_number,
|
||||
[ "5" ] = parse_number,
|
||||
[ "6" ] = parse_number,
|
||||
[ "7" ] = parse_number,
|
||||
[ "8" ] = parse_number,
|
||||
[ "9" ] = parse_number,
|
||||
[ "-" ] = parse_number,
|
||||
[ "t" ] = parse_literal,
|
||||
[ "f" ] = parse_literal,
|
||||
[ "n" ] = parse_literal,
|
||||
[ "[" ] = parse_array,
|
||||
[ "{" ] = parse_object,
|
||||
['"'] = parse_string,
|
||||
["0"] = parse_number,
|
||||
["1"] = parse_number,
|
||||
["2"] = parse_number,
|
||||
["3"] = parse_number,
|
||||
["4"] = parse_number,
|
||||
["5"] = parse_number,
|
||||
["6"] = parse_number,
|
||||
["7"] = parse_number,
|
||||
["8"] = parse_number,
|
||||
["9"] = parse_number,
|
||||
["-"] = parse_number,
|
||||
["t"] = parse_literal,
|
||||
["f"] = parse_literal,
|
||||
["n"] = parse_literal,
|
||||
["["] = parse_array,
|
||||
["{"] = parse_object,
|
||||
}
|
||||
|
||||
|
||||
parse = function(str, idx)
|
||||
local chr = str:sub(idx, idx)
|
||||
local f = char_func_map[chr]
|
||||
if f then
|
||||
return f(str, idx)
|
||||
end
|
||||
decode_error(str, idx, "unexpected character '" .. chr .. "'")
|
||||
local chr = str:sub(idx, idx)
|
||||
local f = char_func_map[chr]
|
||||
if f then
|
||||
return f(str, idx)
|
||||
end
|
||||
decode_error(str, idx, "unexpected character '" .. chr .. "'")
|
||||
end
|
||||
|
||||
|
||||
function json.decode(str)
|
||||
if type(str) ~= "string" then
|
||||
error("expected argument of type string, got " .. type(str))
|
||||
end
|
||||
local res, idx = parse(str, next_char(str, 1, space_chars, true))
|
||||
idx = next_char(str, idx, space_chars, true)
|
||||
if idx <= #str then
|
||||
decode_error(str, idx, "trailing garbage")
|
||||
end
|
||||
return res
|
||||
if type(str) ~= "string" then
|
||||
error("expected argument of type string, got " .. type(str))
|
||||
end
|
||||
local res, idx = parse(str, next_char(str, 1, space_chars, true))
|
||||
idx = next_char(str, idx, space_chars, true)
|
||||
if idx <= #str then
|
||||
decode_error(str, idx, "trailing garbage")
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
|
||||
return json
|
||||
|
|
|
@ -9,13 +9,13 @@ local function rel(screen, win)
|
|||
}
|
||||
end
|
||||
|
||||
local function unrel(s, rel)
|
||||
return rel
|
||||
local function unrel(s, _rel)
|
||||
return _rel
|
||||
and {
|
||||
x = s.x + s.width * rel.x,
|
||||
y = s.y + s.height * rel.y,
|
||||
width = s.width * rel.width,
|
||||
height = rel.aspect * s.width * rel.width,
|
||||
x = s.x + s.width * _rel.x,
|
||||
y = s.y + s.height * _rel.y,
|
||||
width = s.width * _rel.width,
|
||||
height = _rel.aspect * s.width * _rel.width,
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -27,13 +27,13 @@ end
|
|||
|
||||
local floating = awful.layout.suit.floating
|
||||
|
||||
function remember(c)
|
||||
function Remember(c)
|
||||
if floating == awful.layout.get(c.screen) or c.floating then
|
||||
stored[c.window] = rel(c.screen.geometry, c:geometry())
|
||||
end
|
||||
end
|
||||
|
||||
function restore(c)
|
||||
function Restore(c)
|
||||
local s = stored[c.window]
|
||||
if s then
|
||||
c:geometry(unrel(c.screen.geometry, stored[c.window]))
|
||||
|
@ -43,8 +43,8 @@ function restore(c)
|
|||
end
|
||||
end
|
||||
|
||||
client.connect_signal("manage", remember)
|
||||
client.connect_signal("property::geometry", remember)
|
||||
client.connect_signal("manage", Remember)
|
||||
client.connect_signal("property::geometry", Remember)
|
||||
client.connect_signal("unmanage", forget)
|
||||
|
||||
tag.connect_signal("property::layout", function(t)
|
||||
|
@ -55,4 +55,4 @@ tag.connect_signal("property::layout", function(t)
|
|||
end
|
||||
end)
|
||||
|
||||
return restore
|
||||
return Restore
|
||||
|
|
|
@ -1,256 +1,246 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local naughty = require "naughty"
|
||||
local beautiful = require "beautiful"
|
||||
local awful = require("awful")
|
||||
local hotkeys_popup = require("awful.hotkeys_popup")
|
||||
local menubar = require "menubar"
|
||||
local machi = require "lib.layout-machi"
|
||||
local menu = require "main.menu"
|
||||
local menubar = require("menubar")
|
||||
local machi = require("lib.layout-machi")
|
||||
local menu = require("main.menu")
|
||||
|
||||
local apps = require "main.apps"
|
||||
local promptbox = require "ui.top-panel.widgets.promptbox"
|
||||
|
||||
modkey = "Mod4"
|
||||
local config = require("config")
|
||||
local apps = config.apps
|
||||
local keys = config.keys
|
||||
|
||||
-- General awesome keybindings
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ modkey, "Control" }, "r", awesome.restart,
|
||||
{description = "reload awesome", group = "awesome"}),
|
||||
awful.key({ modkey, "Shift" }, "q", awesome.quit,
|
||||
{description = "quit awesome", group = "awesome"}),
|
||||
--awful.key({ modkey }, "j",
|
||||
awful.key({ }, "Nothing Set",
|
||||
function ()
|
||||
awful.prompt.run {
|
||||
prompt = "Run Lua code: ",
|
||||
textbox = awful.screen.focused().promptbox.widget,
|
||||
exe_callback = awful.util.eval,
|
||||
history_path = awful.util.get_cache_dir() .. "/history_eval"
|
||||
}
|
||||
end,
|
||||
{description = "lua execute prompt", group = "awesome"}),
|
||||
awful.key({ modkey, }, "Return", function () awful.spawn(apps.terminal) end,
|
||||
{description = "open a terminal", group = "launcher"}),
|
||||
awful.key({ modkey, "Shift" }, "c", function() menu.mainmenu:show() end,
|
||||
{description = "show main menu", group = "awesome"}),
|
||||
awful.key({ modkey }, "p", function() menubar.show() end,
|
||||
{description = "show the menubar", group = "launcher"}),
|
||||
awful.key({ keys.mod, "Control" }, "r", awesome.restart, { description = "reload awesome", group = "awesome" }),
|
||||
awful.key({ keys.mod, "Shift" }, "q", awesome.quit, { description = "quit awesome", group = "awesome" }),
|
||||
awful.key({}, "Nothing Set", function()
|
||||
awful.prompt.run({
|
||||
prompt = "Run Lua code: ",
|
||||
textbox = awful.screen.focused().promptbox.widget,
|
||||
exe_callback = awful.util.eval,
|
||||
history_path = awful.util.get_cache_dir() .. "/history_eval",
|
||||
})
|
||||
end, { description = "lua execute prompt", group = "awesome" }),
|
||||
awful.key({ keys.mod }, "Return", function()
|
||||
awful.spawn(apps.terminal)
|
||||
end, { description = "open a terminal", group = "launcher" }),
|
||||
awful.key({ keys.mod, "Shift" }, "c", function()
|
||||
menu.mainmenu:show()
|
||||
end, { description = "show main menu", group = "awesome" }),
|
||||
awful.key({ keys.mod }, "p", function()
|
||||
menubar.show()
|
||||
end, { description = "show the menubar", group = "launcher" }),
|
||||
})
|
||||
|
||||
-- Tag bindings
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ modkey, "Control" }, "s", hotkeys_popup.show_help,
|
||||
{description = "show help", group = "awesome"}),
|
||||
awful.key({ modkey, }, "Left", awful.tag.viewprev,
|
||||
{description = "view previous", group = "tag"}),
|
||||
awful.key({ modkey, }, "Right", awful.tag.viewnext,
|
||||
{description = "view next", group = "tag"}),
|
||||
awful.key({ modkey, }, "Tab", awful.tag.history.restore,
|
||||
{description = "go back", group = "tag"}),
|
||||
awful.key({ keys.mod, "Control" }, "s", hotkeys_popup.show_help, { description = "show help", group = "awesome" }),
|
||||
awful.key({ keys.mod }, "Left", awful.tag.viewprev, { description = "view previous", group = "tag" }),
|
||||
awful.key({ keys.mod }, "Right", awful.tag.viewnext, { description = "view next", group = "tag" }),
|
||||
awful.key({ keys.mod }, "Tab", awful.tag.history.restore, { description = "go back", group = "tag" }),
|
||||
})
|
||||
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key {
|
||||
modifiers = { modkey },
|
||||
keygroup = "numrow",
|
||||
description = "only view tag",
|
||||
group = "tag",
|
||||
on_press = function (index)
|
||||
local screen = awful.screen.focused()
|
||||
local tag = screen.tags[index]
|
||||
if tag then
|
||||
tag:view_only()
|
||||
end
|
||||
end,
|
||||
},
|
||||
awful.key {
|
||||
modifiers = { modkey, "Control" },
|
||||
keygroup = "numrow",
|
||||
description = "toggle tag",
|
||||
group = "tag",
|
||||
on_press = function (index)
|
||||
local screen = awful.screen.focused()
|
||||
local tag = screen.tags[index]
|
||||
if tag then
|
||||
awful.tag.viewtoggle(tag)
|
||||
end
|
||||
end,
|
||||
},
|
||||
awful.key {
|
||||
modifiers = { modkey, "Shift" },
|
||||
keygroup = "numrow",
|
||||
description = "move focused client to tag",
|
||||
group = "tag",
|
||||
on_press = function (index)
|
||||
if client.focus then
|
||||
local tag = client.focus.screen.tags[index]
|
||||
if tag then
|
||||
client.focus:move_to_tag(tag)
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
awful.key {
|
||||
modifiers = { modkey, "Control", "Shift" },
|
||||
keygroup = "numrow",
|
||||
description = "toggle focused client on tag",
|
||||
group = "tag",
|
||||
on_press = function (index)
|
||||
if client.focus then
|
||||
local tag = client.focus.screen.tags[index]
|
||||
if tag then
|
||||
client.focus:toggle_tag(tag)
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
awful.key {
|
||||
modifiers = { modkey },
|
||||
keygroup = "numpad",
|
||||
description = "select layout directly",
|
||||
group = "layout",
|
||||
on_press = function (index)
|
||||
local t = awful.screen.focused().selected_tag
|
||||
if t then
|
||||
t.layout = t.layouts[index] or t.layout
|
||||
end
|
||||
end,
|
||||
}
|
||||
awful.key({
|
||||
modifiers = { keys.mod },
|
||||
keygroup = "numrow",
|
||||
description = "only view tag",
|
||||
group = "tag",
|
||||
on_press = function(index)
|
||||
local screen = awful.screen.focused()
|
||||
local tag = screen.tags[index]
|
||||
if tag then
|
||||
tag:view_only()
|
||||
end
|
||||
end,
|
||||
}),
|
||||
awful.key({
|
||||
modifiers = { keys.mod, "Control" },
|
||||
keygroup = "numrow",
|
||||
description = "toggle tag",
|
||||
group = "tag",
|
||||
on_press = function(index)
|
||||
local screen = awful.screen.focused()
|
||||
local tag = screen.tags[index]
|
||||
if tag then
|
||||
awful.tag.viewtoggle(tag)
|
||||
end
|
||||
end,
|
||||
}),
|
||||
awful.key({
|
||||
modifiers = { keys.mod, "Shift" },
|
||||
keygroup = "numrow",
|
||||
description = "move focused client to tag",
|
||||
group = "tag",
|
||||
on_press = function(index)
|
||||
if client.focus then
|
||||
local tag = client.focus.screen.tags[index]
|
||||
if tag then
|
||||
client.focus:move_to_tag(tag)
|
||||
end
|
||||
end
|
||||
end,
|
||||
}),
|
||||
awful.key({
|
||||
modifiers = { keys.mod, "Control", "Shift" },
|
||||
keygroup = "numrow",
|
||||
description = "toggle focused client on tag",
|
||||
group = "tag",
|
||||
on_press = function(index)
|
||||
if client.focus then
|
||||
local tag = client.focus.screen.tags[index]
|
||||
if tag then
|
||||
client.focus:toggle_tag(tag)
|
||||
end
|
||||
end
|
||||
end,
|
||||
}),
|
||||
awful.key({
|
||||
modifiers = { keys.mod },
|
||||
keygroup = "numpad",
|
||||
description = "select layout directly",
|
||||
group = "layout",
|
||||
on_press = function(index)
|
||||
local t = awful.screen.focused().selected_tag
|
||||
if t then
|
||||
t.layout = t.layouts[index] or t.layout
|
||||
end
|
||||
end,
|
||||
}),
|
||||
})
|
||||
|
||||
-- Focus bindings
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ modkey, }, "c",
|
||||
function ()
|
||||
awful.client.focus.byidx( 1)
|
||||
end,
|
||||
{description = "focus next by index", group = "client"}
|
||||
),
|
||||
awful.key({ modkey, }, "x",
|
||||
function ()
|
||||
awful.client.focus.byidx(-1)
|
||||
end,
|
||||
{description = "focus previous by index", group = "client"}
|
||||
),
|
||||
awful.key({ modkey, }, "Escape",
|
||||
function ()
|
||||
awful.client.focus.history.previous()
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end,
|
||||
{description = "go back", group = "client"}),
|
||||
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
|
||||
{description = "focus the next screen", group = "screen"}),
|
||||
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
|
||||
{description = "focus the previous screen", group = "screen"}),
|
||||
awful.key({ modkey, "Control" }, "n",
|
||||
function ()
|
||||
local c = awful.client.restore()
|
||||
-- Focus restored client
|
||||
if c then
|
||||
c:activate { raise = true, context = "key.unminimize" }
|
||||
end
|
||||
end,
|
||||
{description = "restore minimized", group = "client"}),
|
||||
awful.key({ keys.mod }, "c", function()
|
||||
awful.client.focus.byidx(1)
|
||||
end, { description = "focus next by index", group = "client" }),
|
||||
awful.key({ keys.mod }, "x", function()
|
||||
awful.client.focus.byidx(-1)
|
||||
end, { description = "focus previous by index", group = "client" }),
|
||||
awful.key({ keys.mod }, "Escape", function()
|
||||
awful.client.focus.history.previous()
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end, { description = "go back", group = "client" }),
|
||||
awful.key({ keys.mod, "Control" }, "j", function()
|
||||
awful.screen.focus_relative(1)
|
||||
end, { description = "focus the next screen", group = "screen" }),
|
||||
awful.key({ keys.mod, "Control" }, "k", function()
|
||||
awful.screen.focus_relative(-1)
|
||||
end, { description = "focus the previous screen", group = "screen" }),
|
||||
awful.key({ keys.mod, "Control" }, "n", function()
|
||||
local c = awful.client.restore()
|
||||
-- Focus restored client
|
||||
if c then
|
||||
c:activate({ raise = true, context = "key.unminimize" })
|
||||
end
|
||||
end, { description = "restore minimized", group = "client" }),
|
||||
})
|
||||
|
||||
-- Layout bindings
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
|
||||
{description = "swap with next client by index", group = "client"}),
|
||||
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
|
||||
{description = "swap with previous client by index", group = "client"}),
|
||||
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
|
||||
{description = "jump to urgent client", group = "client"}),
|
||||
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
|
||||
{description = "increase master width factor", group = "layout"}),
|
||||
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
|
||||
{description = "decrease master width factor", group = "layout"}),
|
||||
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
|
||||
{description = "increase the number of master clients", group = "layout"}),
|
||||
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
|
||||
{description = "decrease the number of master clients", group = "layout"}),
|
||||
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
|
||||
{description = "increase the number of columns", group = "layout"}),
|
||||
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
|
||||
{description = "decrease the number of columns", group = "layout"}),
|
||||
-- awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
|
||||
-- {description = "select next", group = "layout"}),
|
||||
-- awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
|
||||
-- {description = "select previous", group = "layout"}),
|
||||
awful.key({ modkey, }, "-", function () machi.default_editor.start_interactive() end,
|
||||
{description = "edit the current layout if it is a machi layout", group = "layout"}),
|
||||
awful.key({ modkey, }, ".", function () machi.switcher.start(client.focus) end,
|
||||
{description = "switch between windows for a machi layout", group = "layout"}),
|
||||
awful.key({ keys.mod, "Shift" }, "j", function()
|
||||
awful.client.swap.byidx(1)
|
||||
end, { description = "swap with next client by index", group = "client" }),
|
||||
awful.key({ keys.mod, "Shift" }, "k", function()
|
||||
awful.client.swap.byidx(-1)
|
||||
end, { description = "swap with previous client by index", group = "client" }),
|
||||
awful.key(
|
||||
{ keys.mod },
|
||||
"u",
|
||||
awful.client.urgent.jumpto,
|
||||
{ description = "jump to urgent client", group = "client" }
|
||||
),
|
||||
awful.key({ keys.mod }, "l", function()
|
||||
awful.tag.incmwfact(0.05)
|
||||
end, { description = "increase master width factor", group = "layout" }),
|
||||
awful.key({ keys.mod }, "h", function()
|
||||
awful.tag.incmwfact(-0.05)
|
||||
end, { description = "decrease master width factor", group = "layout" }),
|
||||
awful.key({ keys.mod, "Shift" }, "h", function()
|
||||
awful.tag.incnmaster(1, nil, true)
|
||||
end, { description = "increase the number of master clients", group = "layout" }),
|
||||
awful.key({ keys.mod, "Shift" }, "l", function()
|
||||
awful.tag.incnmaster(-1, nil, true)
|
||||
end, { description = "decrease the number of master clients", group = "layout" }),
|
||||
awful.key({ keys.mod, "Control" }, "h", function()
|
||||
awful.tag.incncol(1, nil, true)
|
||||
end, { description = "increase the number of columns", group = "layout" }),
|
||||
awful.key({ keys.mod, "Control" }, "l", function()
|
||||
awful.tag.incncol(-1, nil, true)
|
||||
end, { description = "decrease the number of columns", group = "layout" }),
|
||||
awful.key({ keys.mod }, "-", function()
|
||||
machi.default_editor.start_interactive()
|
||||
end, { description = "edit the current layout if it is a machi layout", group = "layout" }),
|
||||
awful.key({ keys.mod }, ".", function()
|
||||
machi.switcher.start(client.focus)
|
||||
end, { description = "switch between windows for a machi layout", group = "layout" }),
|
||||
})
|
||||
|
||||
-- Client bindings
|
||||
client.connect_signal("request::default_keybindings", function()
|
||||
awful.keyboard.append_client_keybindings({
|
||||
awful.key({ modkey, }, "f",
|
||||
function (c)
|
||||
c.fullscreen = not c.fullscreen
|
||||
c:raise()
|
||||
end,
|
||||
{description = "toggle fullscreen", group = "client"}),
|
||||
awful.key({ modkey }, "w", function (c) c:kill() end,
|
||||
{description = "close", group = "client"}),
|
||||
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
|
||||
{description = "toggle floating", group = "client"}),
|
||||
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
|
||||
{description = "move to master", group = "client"}),
|
||||
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
|
||||
{description = "move to screen", group = "client"}),
|
||||
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
|
||||
{description = "toggle keep on top", group = "client"}),
|
||||
awful.key({ modkey, }, "n",
|
||||
function (c)
|
||||
-- The client currently has the input focus, so it cannot be
|
||||
-- minimized, since minimized clients can't have the focus.
|
||||
c.minimized = true
|
||||
end ,
|
||||
{description = "minimize", group = "client"}),
|
||||
awful.key({ modkey, }, "m",
|
||||
function (c)
|
||||
c.maximized = not c.maximized
|
||||
c:raise()
|
||||
end ,
|
||||
{description = "(un)maximize", group = "client"}),
|
||||
awful.key({ modkey, "Control" }, "m",
|
||||
function (c)
|
||||
c.maximized_vertical = not c.maximized_vertical
|
||||
c:raise()
|
||||
end ,
|
||||
{description = "(un)maximize vertically", group = "client"}),
|
||||
awful.key({ modkey, "Shift" }, "m",
|
||||
function (c)
|
||||
c.maximized_horizontal = not c.maximized_horizontal
|
||||
c:raise()
|
||||
end ,
|
||||
{description = "(un)maximize horizontally", group = "client"}),
|
||||
})
|
||||
awful.keyboard.append_client_keybindings({
|
||||
awful.key({ keys.mod }, "f", function(c)
|
||||
c.fullscreen = not c.fullscreen
|
||||
c:raise()
|
||||
end, { description = "toggle fullscreen", group = "client" }),
|
||||
awful.key({ keys.mod }, "w", function(c)
|
||||
c:kill()
|
||||
end, { description = "close", group = "client" }),
|
||||
awful.key(
|
||||
{ keys.mod, "Control" },
|
||||
"space",
|
||||
awful.client.floating.toggle,
|
||||
{ description = "toggle floating", group = "client" }
|
||||
),
|
||||
awful.key({ keys.mod, "Control" }, "Return", function(c)
|
||||
c:swap(awful.client.getmaster())
|
||||
end, { description = "move to master", group = "client" }),
|
||||
awful.key({ keys.mod }, "o", function(c)
|
||||
c:move_to_screen()
|
||||
end, { description = "move to screen", group = "client" }),
|
||||
awful.key({ keys.mod }, "t", function(c)
|
||||
c.ontop = not c.ontop
|
||||
end, { description = "toggle keep on top", group = "client" }),
|
||||
awful.key({ keys.mod }, "n", function(c)
|
||||
-- The client currently has the input focus, so it cannot be
|
||||
-- minimized, since minimized clients can't have the focus.
|
||||
c.minimized = true
|
||||
end, { description = "minimize", group = "client" }),
|
||||
awful.key({ keys.mod }, "m", function(c)
|
||||
c.maximized = not c.maximized
|
||||
c:raise()
|
||||
end, { description = "(un)maximize", group = "client" }),
|
||||
awful.key({ keys.mod, "Control" }, "m", function(c)
|
||||
c.maximized_vertical = not c.maximized_vertical
|
||||
c:raise()
|
||||
end, { description = "(un)maximize vertically", group = "client" }),
|
||||
awful.key({ keys.mod, "Shift" }, "m", function(c)
|
||||
c.maximized_horizontal = not c.maximized_horizontal
|
||||
c:raise()
|
||||
end, { description = "(un)maximize horizontally", group = "client" }),
|
||||
})
|
||||
end)
|
||||
|
||||
-- Mouse bindings
|
||||
awful.mouse.append_global_mousebindings({
|
||||
awful.button({ }, 3, function () menu.mainmenu:toggle() return end),
|
||||
awful.button({ }, 4, awful.tag.viewprev),
|
||||
awful.button({ }, 5, awful.tag.viewnext),
|
||||
awful.button({}, 3, function()
|
||||
menu.mainmenu:toggle()
|
||||
end),
|
||||
awful.button({}, 4, awful.tag.viewprev),
|
||||
awful.button({}, 5, awful.tag.viewnext),
|
||||
})
|
||||
|
||||
client.connect_signal("request::default_mousebindings", function()
|
||||
awful.mouse.append_client_mousebindings({
|
||||
awful.button({ }, 1, function (c)
|
||||
c:activate { context = "mouse_click" }
|
||||
end),
|
||||
awful.button({ modkey }, 1, function (c)
|
||||
c:activate { context = "mouse_click", action = "mouse_move"}
|
||||
end),
|
||||
awful.button({ modkey }, 3, function (c)
|
||||
c:activate { context = "mouse_click", action = "mouse_resize"}
|
||||
end),
|
||||
})
|
||||
awful.mouse.append_client_mousebindings({
|
||||
awful.button({}, 1, function(c)
|
||||
c:activate({ context = "mouse_click" })
|
||||
end),
|
||||
awful.button({ keys.mod }, 1, function(c)
|
||||
c:activate({ context = "mouse_click", action = "mouse_move" })
|
||||
end),
|
||||
awful.button({ keys.mod }, 3, function(c)
|
||||
c:activate({ context = "mouse_click", action = "mouse_resize" })
|
||||
end),
|
||||
})
|
||||
end)
|
||||
|
||||
|
||||
|
|
|
@ -1,81 +1,53 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local naughty = require "naughty"
|
||||
local beautiful = require "beautiful"
|
||||
local apps = require "main.apps"
|
||||
local volume = require "ui.popups.volume"
|
||||
local filesystem = require "gears.filesystem"
|
||||
local awful = require("awful")
|
||||
local volume = require("ui.popups.volume")
|
||||
local filesystem = require("gears.filesystem")
|
||||
local config_dir = filesystem.get_configuration_dir()
|
||||
local utils_dir = config_dir .. "utilities/"
|
||||
|
||||
modkey = "Mod4"
|
||||
alt = "Mod1"
|
||||
|
||||
--local function delete_tag()
|
||||
-- local t = awful.tag.find_by_name(awful.screen.focused(), "")
|
||||
-- t:delete()
|
||||
--end
|
||||
--local function create_tag()
|
||||
-- awful.tag.add("", {
|
||||
-- layout = awful.layout.suit.tile,
|
||||
-- selected = true,
|
||||
-- })
|
||||
--end
|
||||
--local value = false
|
||||
local keys = require("config").keys
|
||||
|
||||
local screenshot_area = utils_dir .. "screensht area"
|
||||
local screenshot_full = utils_dir .. "screensht full"
|
||||
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({modkey}, "r", function() awful.spawn("rofi -show drun -theme ~/.config/rofi/launcher.rasi") end,
|
||||
{ description = "show rofi", group = "launcher" }),
|
||||
awful.key({modkey}, "Print", function()
|
||||
awful.spawn.easy_async_with_shell(screenshot_area, function() end)
|
||||
awful.key({ keys.mod }, "r", function()
|
||||
awful.spawn("rofi -show drun -theme ~/.config/rofi/launcher.rasi")
|
||||
end, { description = "show rofi", group = "launcher" }),
|
||||
awful.key({ keys.mod }, "Print", function()
|
||||
awful.spawn.easy_async_with_shell(screenshot_area, function() end)
|
||||
end, { description = "take a area screenshot", group = "Utils" }),
|
||||
awful.key({ }, "Print", function()
|
||||
awful.spawn.easy_async_with_shell(screenshot_full, function() end)
|
||||
awful.key({}, "Print", function()
|
||||
awful.spawn.easy_async_with_shell(screenshot_full, function() end)
|
||||
end, { description = "take a full screenshot", group = "Utils" }),
|
||||
awful.key({modkey}, "q", function() awesome.emit_signal("module::exit_screen:show") end,
|
||||
{ description = "show Exit Screen", group = "Utils" }),
|
||||
awful.key({modkey}, "s", function()
|
||||
|
||||
--if value == false then
|
||||
-- create_tag()
|
||||
-- value = true
|
||||
--else
|
||||
-- delete_tag()
|
||||
-- value = false
|
||||
--end
|
||||
|
||||
awesome.emit_signal("scratchpad::toggle") end,
|
||||
{ description = "show Scratchpad", group = "Utils" }),
|
||||
awful.key({modkey}, "b", function()
|
||||
awful.spawn.easy_async_with_shell("headsetcontrol -l 0", function() end)
|
||||
awful.key({ keys.mod }, "q", function()
|
||||
awesome.emit_signal("module::exit_screen:show")
|
||||
end, { description = "show Exit Screen", group = "Utils" }),
|
||||
awful.key({ keys.mod }, "s", function()
|
||||
awesome.emit_signal("scratchpad::toggle")
|
||||
end, { description = "show Scratchpad", group = "Utils" }),
|
||||
awful.key({ keys.mod }, "b", function()
|
||||
awful.spawn.easy_async_with_shell("headsetcontrol -l 0", function() end)
|
||||
end, { description = "headsetcontrol", group = "Utils" }),
|
||||
-- awful.key({modkey}, "r", function() awful.spawn(apps.launcher, false) end), -- Rofi
|
||||
-- awful.key({alt}, "c", function() awesome.emit_signal("sidebar::toggle") end), -- Sidebar
|
||||
awful.key({modkey}, "t", function() awful.titlebar.toggle(client.focus) end,
|
||||
{ description = "toggle titlebar for active client", group = "Utils" }), -- Toggle titlebar
|
||||
-- awful.key({alt}, "x", function() awesome.emit_signal("lockscreen::toggle") end), -- Toggle lockscreen
|
||||
awful.key({ keys.mod }, "t", function()
|
||||
awful.titlebar.toggle(client.focus)
|
||||
end, { description = "toggle titlebar for active client", group = "Utils" }), -- Toggle titlebar
|
||||
})
|
||||
|
||||
-- Volume
|
||||
-- Volume
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ }, "XF86AudioRaiseVolume", function()
|
||||
awful.key({}, "XF86AudioRaiseVolume", function()
|
||||
volume.increase()
|
||||
awesome.emit_signal("widget::update_vol")
|
||||
awesome.emit_signal("widget::update_vol")
|
||||
awesome.emit_signal("module::volume_osd:show", true)
|
||||
end),
|
||||
awful.key({ }, "XF86AudioLowerVolume", function()
|
||||
awful.key({}, "XF86AudioLowerVolume", function()
|
||||
volume.decrease()
|
||||
awesome.emit_signal("widget::update_vol")
|
||||
awesome.emit_signal("widget::update_vol")
|
||||
awesome.emit_signal("module::volume_osd:show", true)
|
||||
end),
|
||||
awful.key({}, "XF86AudioMute", function()
|
||||
volume.mute()
|
||||
awesome.emit_signal("widget::update_vol")
|
||||
awesome.emit_signal("module::volume_osd:show", true)
|
||||
end),
|
||||
awful.key({ }, "XF86AudioMute", function() volume.mute() awesome.emit_signal("widget::update_vol") awesome.emit_signal("module::volume_osd:show", true) end)
|
||||
})
|
||||
|
||||
-- Brightness
|
||||
--awful.keyboard.append_global_keybindings({
|
||||
-- awful.key({ }, "XF86MonBrightnessUp", function() brightness.increase() end),
|
||||
-- awful.key({ }, "XF86MonBrightnessDown", function() brightness.decrease() end)
|
||||
--})
|
||||
|
|
|
@ -1,26 +1,31 @@
|
|||
local naughty = require "naughty"
|
||||
local naughty = require("naughty")
|
||||
|
||||
-- {{{ Error handling
|
||||
-- Error handling
|
||||
-- Check if awesome encountered an error during startup and fell back to
|
||||
-- another config (This code will only ever execute for the fallback config)
|
||||
if awesome.startup_errors then
|
||||
naughty.notify({ preset = naughty.config.presets.critical,
|
||||
title = "Oops, there were errors during startup!",
|
||||
text = awesome.startup_errors })
|
||||
naughty.notify({
|
||||
preset = naughty.config.presets.critical,
|
||||
title = "Oops, there were errors during startup!",
|
||||
text = awesome.startup_errors,
|
||||
})
|
||||
end
|
||||
|
||||
-- Handle runtime errors after startup
|
||||
do
|
||||
local in_error = false
|
||||
awesome.connect_signal("debug::error", function (err)
|
||||
-- Make sure we don't go into an endless error loop
|
||||
if in_error then return end
|
||||
in_error = true
|
||||
local in_error = false
|
||||
awesome.connect_signal("debug::error", function(err)
|
||||
-- Make sure we don't go into an endless error loop
|
||||
if in_error then
|
||||
return
|
||||
end
|
||||
in_error = true
|
||||
|
||||
naughty.notify({ preset = naughty.config.presets.critical,
|
||||
title = "Oops, an error happened!",
|
||||
text = tostring(err) })
|
||||
in_error = false
|
||||
end)
|
||||
naughty.notify({
|
||||
preset = naughty.config.presets.critical,
|
||||
title = "Oops, an error happened!",
|
||||
text = tostring(err),
|
||||
})
|
||||
in_error = false
|
||||
end)
|
||||
end
|
||||
--- }}}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
--require "main.error_handling"
|
||||
require "main.layout"
|
||||
require "main.menu"
|
||||
require "main.wallpaper"
|
||||
require "main.bindings"
|
||||
require "main.custom_bindings"
|
||||
require "main.rules"
|
||||
require "main.tags"
|
||||
-- require("main.error_handling")
|
||||
require("main.layout")
|
||||
require("main.menu")
|
||||
require("main.wallpaper")
|
||||
require("main.bindings")
|
||||
require("main.custom_bindings")
|
||||
require("main.rules")
|
||||
require("main.tags")
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local beautiful = require "beautiful"
|
||||
local bling = require "lib.bling"
|
||||
local machi = require "lib.layout-machi"
|
||||
|
||||
local awful = require("awful")
|
||||
local bling = require("lib.bling")
|
||||
local machi = require("lib.layout-machi")
|
||||
|
||||
-- Custom Layouts
|
||||
local mstab = bling.layout.mstab
|
||||
|
@ -12,46 +9,28 @@ local equal = bling.layout.equalarea
|
|||
local deck = bling.layout.deck
|
||||
|
||||
machi.editor.nested_layouts = {
|
||||
["0"] = deck,
|
||||
["1"] = awful.layout.suit.spiral,
|
||||
["2"] = awful.layout.suit.fair,
|
||||
["3"] = awful.layout.suit.fair.horizontal,
|
||||
["0"] = deck,
|
||||
["1"] = awful.layout.suit.spiral,
|
||||
["2"] = awful.layout.suit.fair,
|
||||
["3"] = awful.layout.suit.fair.horizontal,
|
||||
}
|
||||
|
||||
|
||||
-- Table of layouts to cover with awful.layout.inc, order matters.
|
||||
awful.layout.layouts = {
|
||||
awful.layout.suit.tile,
|
||||
awful.layout.suit.spiral.dwindle,
|
||||
awful.layout.suit.floating,
|
||||
awful.layout.suit.max,
|
||||
centered,
|
||||
mstab,
|
||||
equal,
|
||||
machi.default_layout,
|
||||
-- awful.layout.suit.floating,
|
||||
-- awful.layout.suit.tile,
|
||||
--awful.layout.suit.tile.left,
|
||||
-- awful.layout.suit.tile.bottom,
|
||||
-- awful.layout.suit.tile.top,
|
||||
-- awful.layout.suit.fair,
|
||||
-- awful.layout.suit.fair.horizontal,
|
||||
-- awful.layout.suit.spiral,
|
||||
-- awful.layout.suit.spiral.dwindle,
|
||||
-- awful.layout.suit.max,
|
||||
--awful.layout.suit.max.fullscreen,
|
||||
-- awful.layout.suit.magnifier,
|
||||
-- awful.layout.suit.corner.nw,
|
||||
-- awful.layout.suit.corner.ne,
|
||||
-- awful.layout.suit.corner.sw,
|
||||
-- awful.layout.suit.corner.se,
|
||||
awful.layout.suit.tile,
|
||||
awful.layout.suit.spiral.dwindle,
|
||||
awful.layout.suit.floating,
|
||||
awful.layout.suit.max,
|
||||
centered,
|
||||
mstab,
|
||||
equal,
|
||||
machi.default_layout,
|
||||
}
|
||||
|
||||
client.connect_signal("manage", function (c)
|
||||
if awesome.startup
|
||||
and not c.size_hints.user_position
|
||||
and not c.size_hints.program_position then
|
||||
-- Prevent clients from being unreachable after screen count changes.
|
||||
awful.placement.no_offscreen(c)
|
||||
end
|
||||
end)
|
||||
client.connect_signal("manage", function(c)
|
||||
if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then
|
||||
-- Prevent clients from being unreachable after screen count changes.
|
||||
awful.placement.no_offscreen(c)
|
||||
end
|
||||
end)
|
||||
|
||||
|
|
|
@ -1,79 +1,108 @@
|
|||
---@diagnostic disable: undefined-global
|
||||
local awful = require 'awful'
|
||||
local beautiful = require 'beautiful'
|
||||
local gears = require 'gears'
|
||||
local wibox = require 'wibox'
|
||||
local helpers = require 'helpers'
|
||||
local hotkeys_popup = require 'awful.hotkeys_popup'
|
||||
local apps = require "main.apps"
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local helpers = require("helpers")
|
||||
local hotkeys_popup = require("awful.hotkeys_popup")
|
||||
|
||||
editor = os.getenv("EDITOR") or "vim"
|
||||
editor_cmd = apps.terminal .. " -e " .. editor
|
||||
local apps = require("config").apps
|
||||
|
||||
local menu = {}
|
||||
|
||||
local rofi = {}
|
||||
rofi.timer = gears.timer {
|
||||
autostart = false,
|
||||
timeout = 0.1,
|
||||
single_shot = true,
|
||||
callback = function()
|
||||
awful.spawn("rofi -show drun -theme ~/.config/rofi/launcher.rasi")
|
||||
end
|
||||
}
|
||||
rofi.timer = gears.timer({
|
||||
autostart = false,
|
||||
timeout = 0.1,
|
||||
single_shot = true,
|
||||
callback = function()
|
||||
awful.spawn("rofi -show drun -theme ~/.config/rofi/launcher.rasi")
|
||||
end,
|
||||
})
|
||||
|
||||
menu.awesome = {
|
||||
{ "Hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
|
||||
{
|
||||
"Hotkeys",
|
||||
function()
|
||||
hotkeys_popup.show_help(nil, awful.screen.focused())
|
||||
end,
|
||||
},
|
||||
{ "Manual", apps.terminal .. " -e man awesome" },
|
||||
{ "Edit Config", editor_cmd .. " " .. awesome.conffile },
|
||||
{ "Edit Config", apps.start_editor .. " " .. awesome.conffile },
|
||||
{ "Restart", awesome.restart },
|
||||
{ "Quit", function() awesome.quit() end },
|
||||
}
|
||||
|
||||
menu.mainmenu = awful.menu {
|
||||
items = {
|
||||
{ "Applications", function() menu.mainmenu:hide() rofi.timer:start() end },
|
||||
{ "Terminal", apps.terminal },
|
||||
{ "Web Browser", apps.browser },
|
||||
{ "File Manager", apps.file_manager },
|
||||
{ "Text Editor", apps.code_editor },
|
||||
{ "Music Player", apps.music_player },
|
||||
{ "Info Panel", function() awesome.emit_signal("sidebar::toggle") end },
|
||||
{ "Notifications", function() awesome.emit_signal("action::toggle") end },
|
||||
{ "Exit", function() awesome.emit_signal("module::exit_screen:show") end },
|
||||
{ "AwesomeWM", menu.awesome },
|
||||
}
|
||||
{
|
||||
"Quit",
|
||||
function()
|
||||
awesome.quit()
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
menu.mainmenu = awful.menu({
|
||||
items = {
|
||||
{
|
||||
"Applications",
|
||||
function()
|
||||
menu.mainmenu:hide()
|
||||
rofi.timer:start()
|
||||
end,
|
||||
},
|
||||
{ "Terminal", apps.terminal },
|
||||
{ "Web Browser", apps.browser },
|
||||
{ "File Manager", apps.file_manager },
|
||||
{ "Text Editor", apps.code_editor },
|
||||
{ "Music Player", apps.music_player },
|
||||
{
|
||||
"Info Panel",
|
||||
function()
|
||||
awesome.emit_signal("sidebar::toggle")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"Notifications",
|
||||
function()
|
||||
awesome.emit_signal("action::toggle")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"Exit",
|
||||
function()
|
||||
awesome.emit_signal("module::exit_screen:show")
|
||||
end,
|
||||
},
|
||||
{ "AwesomeWM", menu.awesome },
|
||||
},
|
||||
})
|
||||
|
||||
-- apply rounded corners to menus when picom isn't available, thanks to u/signalsourcesexy
|
||||
-- also applies antialiasing! - By me.
|
||||
menu.mainmenu.wibox.shape = helpers.ui.rrect(10)
|
||||
menu.mainmenu.wibox.bg = beautiful.bg_normal .. '00'
|
||||
menu.mainmenu.wibox.bg = beautiful.bg_normal .. "00"
|
||||
menu.mainmenu.wibox:set_widget(wibox.widget({
|
||||
menu.mainmenu.wibox.widget,
|
||||
bg = beautiful.bg_normal,
|
||||
shape = helpers.ui.rrect(0),
|
||||
widget = wibox.container.background,
|
||||
menu.mainmenu.wibox.widget,
|
||||
bg = beautiful.bg_normal,
|
||||
shape = helpers.ui.rrect(0),
|
||||
widget = wibox.container.background,
|
||||
}))
|
||||
|
||||
-- apply rounded corners to submenus, thanks to u/signalsourcesexy
|
||||
-- also applies antialiasing! - By me.
|
||||
awful.menu.original_new = awful.menu.new
|
||||
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
function awful.menu.new(...)
|
||||
local ret = awful.menu.original_new(...)
|
||||
local ret = awful.menu.original_new(...)
|
||||
|
||||
ret.wibox.shape = helpers.ui.rrect(10)
|
||||
ret.wibox.bg = beautiful.bg_normal .. '00'
|
||||
ret.wibox:set_widget(wibox.widget {
|
||||
ret.wibox.widget,
|
||||
widget = wibox.container.background,
|
||||
bg = beautiful.xcolorbase,
|
||||
shape = helpers.ui.rrect(0),
|
||||
})
|
||||
ret.wibox.shape = helpers.ui.rrect(10)
|
||||
ret.wibox.bg = beautiful.bg_normal .. "00"
|
||||
ret.wibox:set_widget(wibox.widget({
|
||||
ret.wibox.widget,
|
||||
widget = wibox.container.background,
|
||||
bg = beautiful.xcolorbase,
|
||||
shape = helpers.ui.rrect(0),
|
||||
}))
|
||||
|
||||
return ret
|
||||
return ret
|
||||
end
|
||||
|
||||
return menu
|
||||
|
|
|
@ -1,77 +1,78 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local ruled = require "ruled"
|
||||
local awful = require("awful")
|
||||
local ruled = require("ruled")
|
||||
local dpi = require("beautiful.xresources").apply_dpi
|
||||
local helpers = require "helpers"
|
||||
local apps = require "main.apps"
|
||||
|
||||
local screen_width = awful.screen.focused().geometry.width
|
||||
local screen_height = awful.screen.focused().geometry.height
|
||||
local helpers = require("helpers")
|
||||
local apps = require("main.apps")
|
||||
|
||||
ruled.client.connect_signal("request::rules", function()
|
||||
ruled.client.append_rule {
|
||||
id = "global",
|
||||
rule = {},
|
||||
properties = {
|
||||
-- shape = helpers.ui.rrect(15), -- Shape is in Titlebar --
|
||||
focus = awful.client.focus.filter,
|
||||
raise = true,
|
||||
screen = awful.screen.preferred,
|
||||
placement = awful.placement.no_overlap+awful.placement.no_offscreen,
|
||||
},
|
||||
}
|
||||
ruled.client.append_rule({
|
||||
id = "global",
|
||||
rule = {},
|
||||
properties = {
|
||||
focus = awful.client.focus.filter,
|
||||
raise = true,
|
||||
screen = awful.screen.preferred,
|
||||
placement = awful.placement.no_overlap + awful.placement.no_offscreen,
|
||||
},
|
||||
})
|
||||
|
||||
ruled.client.append_rule {
|
||||
id = "titlebars",
|
||||
rule_any = {
|
||||
type = {"normal", "dialog"},
|
||||
},
|
||||
properties = {
|
||||
titlebars_enabled = true
|
||||
}
|
||||
}
|
||||
ruled.client.append_rule({
|
||||
id = "titlebars",
|
||||
rule_any = {
|
||||
type = { "normal", "dialog" },
|
||||
},
|
||||
properties = {
|
||||
titlebars_enabled = true,
|
||||
},
|
||||
})
|
||||
|
||||
ruled.client.append_rule {
|
||||
rule = { class = apps["launcher"] },
|
||||
properties = {
|
||||
titlebars_enabled = false
|
||||
},
|
||||
rule = { instance = "origin.exe", },
|
||||
properties = { floating = true, titlebars_enabled = false, border_width = dpi(0), shape = helpers.ui.rrect(0), border_width = dpi(0), },
|
||||
}
|
||||
ruled.client.append_rule({
|
||||
rule = { class = apps["launcher"] },
|
||||
properties = {
|
||||
titlebars_enabled = false,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
ruled.client.append_rule {
|
||||
rule = { instance = "bf1.exe" },
|
||||
properties = { shape = helpers.ui.rrect(0), fullscreen = true, tag = "", switchtotag = true, }, --ontop = true, sticky = true, },
|
||||
}
|
||||
ruled.client.append_rule {
|
||||
rule = { instance = "wine" },
|
||||
properties = { shape = helpers.ui.rrect(0), titlebars_enabled = false, }, --ontop = true, sticky = true, },
|
||||
}
|
||||
|
||||
ruled.client.append_rule({
|
||||
rule_any = {
|
||||
floating = true,
|
||||
},
|
||||
properties = {
|
||||
placement = awful.placement.centered,
|
||||
ontop = true,
|
||||
},
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "origin.exe" },
|
||||
properties = {
|
||||
floating = true,
|
||||
titlebars_enabled = false,
|
||||
shape = helpers.ui.rrect(0),
|
||||
border_width = dpi(0),
|
||||
},
|
||||
})
|
||||
|
||||
ruled.client.append_rule({
|
||||
rule_any = {
|
||||
class = {
|
||||
"xfce",
|
||||
},
|
||||
instance = {
|
||||
"xfce",
|
||||
},
|
||||
},
|
||||
properties = {
|
||||
floating = true,
|
||||
},
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "bf1.exe" },
|
||||
properties = { shape = helpers.ui.rrect(0), fullscreen = true, tag = "", switchtotag = true },
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "wine" },
|
||||
properties = { shape = helpers.ui.rrect(0), titlebars_enabled = false },
|
||||
})
|
||||
|
||||
ruled.client.append_rule({
|
||||
rule_any = {
|
||||
floating = true,
|
||||
},
|
||||
properties = {
|
||||
placement = awful.placement.centered,
|
||||
ontop = true,
|
||||
},
|
||||
})
|
||||
|
||||
ruled.client.append_rule({
|
||||
rule_any = {
|
||||
class = {
|
||||
"xfce",
|
||||
},
|
||||
instance = {
|
||||
"xfce",
|
||||
},
|
||||
},
|
||||
properties = {
|
||||
floating = true,
|
||||
},
|
||||
})
|
||||
end)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
local awful = require "awful"
|
||||
local awful = require("awful")
|
||||
|
||||
screen.connect_signal("request::desktop_decoration", function(s)
|
||||
awful.tag({"", "", "", "", "", ""}, s, awful.layout.layouts[1])
|
||||
awful.tag({ " ", " ", " ", " ", " ", " " }, s, awful.layout.layouts[1])
|
||||
end)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
local awful = require "awful"
|
||||
local wibox = require "wibox"
|
||||
local beautiful = require "beautiful"
|
||||
local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
local function set_wall(s)
|
||||
awful.wallpaper {
|
||||
awful.wallpaper({
|
||||
screen = s,
|
||||
widget = {
|
||||
{
|
||||
|
@ -16,8 +16,8 @@ local function set_wall(s)
|
|||
halign = "center",
|
||||
tiled = true,
|
||||
widget = wibox.container.tile,
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
screen.connect_signal("request::wallpaper", function(s)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
|
||||
local function get_cpu()
|
||||
local script = [[
|
||||
|
@ -13,11 +12,12 @@ local function get_cpu()
|
|||
end)
|
||||
end
|
||||
|
||||
gears.timer {
|
||||
gears.timer({
|
||||
timeout = 1,
|
||||
call_now = true,
|
||||
autostart = true,
|
||||
callback = function()
|
||||
get_cpu()
|
||||
end
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
|
||||
local user_vars = require "user_variables"
|
||||
local user_vars = require("user_variables")
|
||||
local which_disk = user_vars.widget.disk.name
|
||||
|
||||
local function get_disk()
|
||||
local script = [[
|
||||
df -kH -B 1MB ]]..which_disk..[[ | tail -1 | awk '{printf $5}'
|
||||
df -kH -B 1MB ]] .. which_disk .. [[ | tail -1 | awk '{printf $5}'
|
||||
]]
|
||||
|
||||
awful.spawn.easy_async_with_shell(script, function(disk_perc)
|
||||
|
@ -15,11 +15,11 @@ local function get_disk()
|
|||
end)
|
||||
end
|
||||
|
||||
gears.timer {
|
||||
gears.timer({
|
||||
timeout = 2000,
|
||||
call_now = true,
|
||||
autostart = true,
|
||||
callback = function()
|
||||
get_disk()
|
||||
end
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
req = {
|
||||
local req = {
|
||||
"volume",
|
||||
"mic",
|
||||
"cpu",
|
||||
|
@ -10,5 +10,5 @@ req = {
|
|||
}
|
||||
|
||||
for _, x in pairs(req) do
|
||||
require("signals."..x)
|
||||
require("signals." .. x)
|
||||
end
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
|
||||
local function get_mem()
|
||||
local script = [[
|
||||
|
@ -13,11 +12,12 @@ local function get_mem()
|
|||
end)
|
||||
end
|
||||
|
||||
gears.timer {
|
||||
gears.timer({
|
||||
timeout = 4,
|
||||
call_now = true,
|
||||
autostart = true,
|
||||
callback = function()
|
||||
get_mem()
|
||||
end
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local wibox = require "wibox"
|
||||
local beautiful = require "beautiful"
|
||||
local awful = require("awful")
|
||||
|
||||
local user_vars = require "user_variables"
|
||||
local user_vars = require("user_variables")
|
||||
local microphone = user_vars.widget.mic.name
|
||||
|
||||
local vol_sc = 'pamixer --source ' ..microphone.. ' --get-volume'
|
||||
local mute_sc = 'pamixer --source ' ..microphone.. ' --get-mute'
|
||||
local vol_sc = "pamixer --source " .. microphone .. " --get-volume"
|
||||
local mute_sc = "pamixer --source " .. microphone .. " --get-mute"
|
||||
|
||||
local function get_vol()
|
||||
awful.spawn.easy_async_with_shell(vol_sc, function(vol)
|
||||
awful.spawn.easy_async_with_shell(mute_sc, function(mute)
|
||||
if mute:match("false") then
|
||||
local muted
|
||||
|
||||
if mute:match("false") then
|
||||
muted = false
|
||||
else
|
||||
muted = true
|
||||
|
@ -23,16 +22,6 @@ local function get_vol()
|
|||
end)
|
||||
end
|
||||
awesome.connect_signal("widget::update_mic", function() -- Needs to be Updated if muted! For Mute in Sidebar Widget
|
||||
get_vol()
|
||||
get_vol()
|
||||
end)
|
||||
--gears.timer {
|
||||
-- timeout = 10,
|
||||
-- call_now = true,
|
||||
-- autostart = true,
|
||||
-- callback = function()
|
||||
-- get_vol()
|
||||
-- end
|
||||
--}
|
||||
get_vol()
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local awful = require("awful")
|
||||
|
||||
-- Script
|
||||
local title_sc = 'mpc -f %title% | head -1'
|
||||
local artist_sc = 'mpc -f %artist% | head -1'
|
||||
local title_sc = "mpc -f %title% | head -1"
|
||||
local artist_sc = "mpc -f %artist% | head -1"
|
||||
local length_sc = "mpc | awk '{print $3}' | awk 'NR==2'"
|
||||
local status_sc = "mpc | awk '{print $1}' | awk 'NR==2' | sed 's/[[]*//g' | sed 's/[]]*//g'"
|
||||
|
||||
|
@ -27,4 +26,3 @@ awesome.connect_signal("widget::update_player", function()
|
|||
get_player()
|
||||
end)
|
||||
get_player()
|
||||
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
local bling = require("lib.bling")
|
||||
|
||||
local playerctl = {}
|
||||
local instance = nil
|
||||
|
||||
local function new()
|
||||
return bling.signal.playerctl.lib({
|
||||
update_on_activity = true,
|
||||
player = { "mpd", "spotify", "%any", },
|
||||
player = { "mopidy", "spotify", "%any" },
|
||||
debounce_delay = 1,
|
||||
})
|
||||
end
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
|
||||
local awful = require("awful")
|
||||
|
||||
local function get_uptime()
|
||||
local script = [[
|
||||
|
@ -9,11 +7,11 @@ local function get_uptime()
|
|||
|
||||
awful.spawn.easy_async_with_shell(script, function(uptime)
|
||||
uptime = string.gsub(uptime, "\n", "")
|
||||
--uptime = uptime:match("%d+")
|
||||
awesome.emit_signal("signal::uptime", uptime)
|
||||
end)
|
||||
end
|
||||
awesome.connect_signal("widget::update_uptime", function()
|
||||
get_uptime()
|
||||
end)
|
||||
get_uptime()
|
||||
get_uptime()
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local wibox = require "wibox"
|
||||
local awful = require("awful")
|
||||
|
||||
local vol_sc = 'pamixer --get-volume'
|
||||
local mute_sc = 'pamixer --get-mute'
|
||||
local vol_sc = "pamixer --get-volume"
|
||||
local mute_sc = "pamixer --get-mute"
|
||||
|
||||
local function get_vol()
|
||||
awful.spawn.easy_async_with_shell(vol_sc, function(vol)
|
||||
awful.spawn.easy_async_with_shell(mute_sc, function(mute)
|
||||
if mute:match("false") then
|
||||
local muted
|
||||
|
||||
if mute:match("false") then
|
||||
muted = false
|
||||
else
|
||||
muted = true
|
||||
|
@ -18,17 +18,9 @@ local function get_vol()
|
|||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
awesome.connect_signal("widget::update_vol", function() -- Needs to be Updated if muted! For Pulseaudio Widget
|
||||
get_vol()
|
||||
get_vol()
|
||||
end)
|
||||
--gears.timer {
|
||||
-- timeout = 10,
|
||||
-- call_now = true,
|
||||
-- autostart = true,
|
||||
-- callback = function()
|
||||
-- get_vol()
|
||||
-- end
|
||||
--}
|
||||
|
||||
get_vol()
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
---------------------------
|
||||
-- Default awesome theme --
|
||||
---------------------------
|
||||
local gears = require ("gears")
|
||||
local gears = require("gears")
|
||||
local theme_assets = require("beautiful.theme_assets")
|
||||
local xresources = require("beautiful.xresources")
|
||||
local dpi = xresources.apply_dpi
|
||||
local gfs = require("gears.filesystem")
|
||||
|
||||
local themes_path = gfs.get_configuration_dir() .. "themes/"
|
||||
local helpers = require ("helpers")
|
||||
local helpers = require("helpers")
|
||||
|
||||
local theme = {}
|
||||
|
||||
|
@ -17,12 +17,11 @@ local theme = {}
|
|||
-- Transparent Color --
|
||||
theme.transparent = "#00000000"
|
||||
|
||||
-- Base --
|
||||
-- Base --
|
||||
theme.xcolorcrust = "#11111b"
|
||||
theme.xcolormantle = "#181825"
|
||||
theme.xcolorbase = "#1E1E2E"
|
||||
|
||||
|
||||
-- Surface --
|
||||
theme.xcolorS0 = "#313244"
|
||||
theme.xcolorS1 = "#45475a"
|
||||
|
@ -46,7 +45,7 @@ theme.xcolor2 = "#89b4fa"
|
|||
theme.xcolor3 = "#74c7ec"
|
||||
-- Sky --
|
||||
theme.xcolor4 = "#89dceb"
|
||||
-- Teal --
|
||||
-- Teal --
|
||||
theme.xcolor5 = "#94e2d5"
|
||||
-- Green --
|
||||
theme.xcolor6 = "#a6e3a1"
|
||||
|
@ -67,31 +66,31 @@ theme.xcolor13 = "#f2cdcd"
|
|||
-- Rosewater --
|
||||
theme.xcolor14 = "#f5e0dc"
|
||||
|
||||
theme.music = themes_path.."catppuccin/assets/music.png"
|
||||
theme.volume_on = themes_path.."catppuccin/assets/volume-on.png"
|
||||
theme.volume_off = themes_path.."catppuccin/assets/volume-off.png"
|
||||
theme.pfp = themes_path.."catppuccin/assets/pfp.jpg"
|
||||
theme.font = "FiraCode Nerd Font 10"
|
||||
theme.music = themes_path .. "catppuccin/assets/music.png"
|
||||
theme.volume_on = themes_path .. "catppuccin/assets/volume-on.png"
|
||||
theme.volume_off = themes_path .. "catppuccin/assets/volume-off.png"
|
||||
theme.pfp = themes_path .. "catppuccin/assets/pfp.jpg"
|
||||
theme.font = "FiraCode Nerd Font Propo 10"
|
||||
|
||||
theme.font_name = "FiraCode Nerd Font "
|
||||
theme.font_name = "FiraCode Nerd Font Propo "
|
||||
|
||||
theme.titlebar_bg_focus = theme.xcolorbase
|
||||
theme.titlebar_bg = theme.xcolorbase
|
||||
theme.bg_normal = theme.xcolorbase
|
||||
theme.bg_focus = theme.xcolorS0
|
||||
theme.bg_urgent = "#ff0000"
|
||||
theme.bg_minimize = "#444444"
|
||||
theme.bg_systray = theme.bg_normal
|
||||
theme.bg_normal = theme.xcolorbase
|
||||
theme.bg_focus = theme.xcolorS0
|
||||
theme.bg_urgent = "#ff0000"
|
||||
theme.bg_minimize = "#444444"
|
||||
theme.bg_systray = theme.bg_normal
|
||||
|
||||
theme.fg_normal = theme.xcolorT2 --Text Color
|
||||
theme.fg_focus = theme.xcolor5
|
||||
theme.fg_urgent = "#ffffff"
|
||||
theme.fg_minimize = "#ffffff"
|
||||
theme.fg_normal = theme.xcolorT2 --Text Color
|
||||
theme.fg_focus = theme.xcolor5
|
||||
theme.fg_urgent = "#ffffff"
|
||||
theme.fg_minimize = "#ffffff"
|
||||
|
||||
theme.useless_gap = dpi(10)
|
||||
theme.border_width = dpi(3)
|
||||
theme.useless_gap = dpi(10)
|
||||
theme.border_width = dpi(3)
|
||||
theme.border_normal = theme.xcolorS0
|
||||
theme.border_focus = theme.xcolor5
|
||||
theme.border_focus = theme.xcolor5
|
||||
theme.border_marked = "#91231c"
|
||||
|
||||
theme.menu_font = "FiraCode Nerd Font 12"
|
||||
|
@ -103,8 +102,7 @@ theme.menu_border_color = theme.xcolorS0
|
|||
--theme.menu_submenu_icon = themes_path.."catppuccin/submenu.png"
|
||||
theme.submenu = "» "
|
||||
theme.menu_height = dpi(37)
|
||||
theme.menu_width = dpi(194)
|
||||
|
||||
theme.menu_width = dpi(194)
|
||||
|
||||
theme.tasklist_bg_focus = theme.xcolorbase
|
||||
theme.tasklist_fg_focus = theme.xcolor1
|
||||
|
@ -121,12 +119,8 @@ theme.taglist_fg_occupied = "#526c96"
|
|||
|
||||
-- Generate taglist squares:
|
||||
local taglist_square_size = dpi(0)
|
||||
theme.taglist_squares_sel = theme_assets.taglist_squares_sel(
|
||||
taglist_square_size, theme.xcolor2
|
||||
)
|
||||
theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(
|
||||
taglist_square_size, theme.taglist_fg_occupied
|
||||
)
|
||||
theme.taglist_squares_sel = theme_assets.taglist_squares_sel(taglist_square_size, theme.xcolor2)
|
||||
theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(taglist_square_size, theme.taglist_fg_occupied)
|
||||
|
||||
-- Edge Snap
|
||||
theme.snap_bg = theme.xcolor5
|
||||
|
@ -140,7 +134,7 @@ theme.hotkeys_modifiers_fg = theme.xcolorO2
|
|||
theme.hotkeys_font = "FiraCode Nerd Font 9"
|
||||
theme.hotkeys_description_font = "FiraCode Nerd Font 9"
|
||||
|
||||
-- Layoutlist
|
||||
-- Layoutlist
|
||||
theme.layoutlist_shape_selected = helpers.ui.rrect(7)
|
||||
|
||||
-- Tabs
|
||||
|
@ -191,21 +185,21 @@ theme.notification_bg = theme.xcolorbase
|
|||
--theme.bg_widget = "#cc0000"
|
||||
|
||||
-- Define the image to load
|
||||
theme.titlebar_close_button_normal = themes_path.."catppuccin/titlebar/unfocus.svg"
|
||||
theme.titlebar_close_button_focus = themes_path.."catppuccin/titlebar/close.svg"
|
||||
theme.titlebar_close_button_normal_hover = themes_path.."catppuccin/titlebar/close_hover.svg"
|
||||
theme.titlebar_close_button_focus_hover = themes_path.."catppuccin/titlebar/close_hover.svg"
|
||||
theme.titlebar_close_button_normal = themes_path .. "catppuccin/titlebar/unfocus.svg"
|
||||
theme.titlebar_close_button_focus = themes_path .. "catppuccin/titlebar/close.svg"
|
||||
theme.titlebar_close_button_normal_hover = themes_path .. "catppuccin/titlebar/close_hover.svg"
|
||||
theme.titlebar_close_button_focus_hover = themes_path .. "catppuccin/titlebar/close_hover.svg"
|
||||
|
||||
theme.titlebar_minimize_button_normal = themes_path.."catppuccin/titlebar/unfocus.svg"
|
||||
theme.titlebar_minimize_button_focus = themes_path.."catppuccin/titlebar/minimize.svg"
|
||||
theme.titlebar_minimize_button_normal_hover = themes_path.."catppuccin/titlebar/minimize_hover.svg"
|
||||
theme.titlebar_minimize_button_focus_hover = themes_path.."catppuccin/titlebar/minimize_hover.svg"
|
||||
theme.titlebar_minimize_button_normal = themes_path .. "catppuccin/titlebar/unfocus.svg"
|
||||
theme.titlebar_minimize_button_focus = themes_path .. "catppuccin/titlebar/minimize.svg"
|
||||
theme.titlebar_minimize_button_normal_hover = themes_path .. "catppuccin/titlebar/minimize_hover.svg"
|
||||
theme.titlebar_minimize_button_focus_hover = themes_path .. "catppuccin/titlebar/minimize_hover.svg"
|
||||
|
||||
theme.titlebar_ontop_button_normal_inactive = themes_path.."catppuccin/titlebar/unfocus.svg"
|
||||
theme.titlebar_ontop_button_focus_inactive = themes_path.."catppuccin/titlebar/ontop.svg"
|
||||
theme.titlebar_ontop_button_normal_inactive = themes_path .. "catppuccin/titlebar/unfocus.svg"
|
||||
theme.titlebar_ontop_button_focus_inactive = themes_path .. "catppuccin/titlebar/ontop.svg"
|
||||
|
||||
theme.titlebar_ontop_button_normal_active = themes_path.."catppuccin/titlebar/unfocus.svg"
|
||||
theme.titlebar_ontop_button_focus_active = themes_path.."catppuccin/titlebar/ontop.svg"
|
||||
theme.titlebar_ontop_button_normal_active = themes_path .. "catppuccin/titlebar/unfocus.svg"
|
||||
theme.titlebar_ontop_button_focus_active = themes_path .. "catppuccin/titlebar/ontop.svg"
|
||||
|
||||
-- theme.titlebar_sticky_button_normal_inactive = themes_path.."catppuccin/titlebar/sticky_normal_inactive.png"
|
||||
-- theme.titlebar_sticky_button_focus_inactive = themes_path.."catppuccin/titlebar/sticky_focus_inactive.png"
|
||||
|
@ -217,32 +211,30 @@ theme.titlebar_ontop_button_focus_active = themes_path.."catppuccin/titlebar/on
|
|||
-- theme.titlebar_floating_button_normal_active = themes_path.."catppuccin/titlebar/floating_normal_active.png"
|
||||
-- theme.titlebar_floating_button_focus_active = themes_path.."catppuccin/titlebar/floating_focus_active.png"
|
||||
|
||||
theme.titlebar_maximized_button_normal_active = themes_path.."catppuccin/titlebar/unfocus.svg"
|
||||
theme.titlebar_maximized_button_focus_active = themes_path.."catppuccin/titlebar/maximize.svg"
|
||||
theme.titlebar_maximized_button_normal_active_hover = themes_path.."catppuccin/titlebar/maximize_hover.svg"
|
||||
theme.titlebar_maximized_button_focus_active_hover = themes_path.."catppuccin/titlebar/maximize_hover.svg"
|
||||
theme.titlebar_maximized_button_normal_active = themes_path .. "catppuccin/titlebar/unfocus.svg"
|
||||
theme.titlebar_maximized_button_focus_active = themes_path .. "catppuccin/titlebar/maximize.svg"
|
||||
theme.titlebar_maximized_button_normal_active_hover = themes_path .. "catppuccin/titlebar/maximize_hover.svg"
|
||||
theme.titlebar_maximized_button_focus_active_hover = themes_path .. "catppuccin/titlebar/maximize_hover.svg"
|
||||
|
||||
theme.titlebar_maximized_button_normal_inactive = themes_path.."catppuccin/titlebar/unfocus.svg"
|
||||
theme.titlebar_maximized_button_focus_inactive = themes_path.."catppuccin/titlebar/maximize.svg"
|
||||
theme.titlebar_maximized_button_normal_inactive_hover = themes_path.."catppuccin/titlebar/maximize_hover.svg"
|
||||
theme.titlebar_maximized_button_focus_inactive_hover = themes_path.."catppuccin/titlebar/maximize_hover.svg"
|
||||
theme.titlebar_maximized_button_normal_inactive = themes_path .. "catppuccin/titlebar/unfocus.svg"
|
||||
theme.titlebar_maximized_button_focus_inactive = themes_path .. "catppuccin/titlebar/maximize.svg"
|
||||
theme.titlebar_maximized_button_normal_inactive_hover = themes_path .. "catppuccin/titlebar/maximize_hover.svg"
|
||||
theme.titlebar_maximized_button_focus_inactive_hover = themes_path .. "catppuccin/titlebar/maximize_hover.svg"
|
||||
|
||||
theme.wallpaper = themes_path.."catppuccin/buttons.png"
|
||||
theme.wallpaper = themes_path .. "catppuccin/buttons.png"
|
||||
|
||||
-- You can use your own layout icons like this:
|
||||
theme.layout_floating = themes_path.."catppuccin/layouts/floating.png"
|
||||
theme.layout_max = themes_path.."catppuccin/layouts/max.png"
|
||||
theme.layout_tile = themes_path.."catppuccin/layouts/tile.png"
|
||||
theme.layout_dwindle = themes_path.."catppuccin/layouts/dwindle.png"
|
||||
theme.layout_centered = themes_path.."catppuccin/layouts/centered.png"
|
||||
theme.layout_mstab = themes_path.."catppuccin/layouts/mstab.png"
|
||||
theme.layout_equalarea = themes_path.."catppuccin/layouts/equalarea.png"
|
||||
theme.layout_machi = themes_path.."catppuccin/layouts/machi.png"
|
||||
theme.layout_floating = themes_path .. "catppuccin/layouts/floating.png"
|
||||
theme.layout_max = themes_path .. "catppuccin/layouts/max.png"
|
||||
theme.layout_tile = themes_path .. "catppuccin/layouts/tile.png"
|
||||
theme.layout_dwindle = themes_path .. "catppuccin/layouts/dwindle.png"
|
||||
theme.layout_centered = themes_path .. "catppuccin/layouts/centered.png"
|
||||
theme.layout_mstab = themes_path .. "catppuccin/layouts/mstab.png"
|
||||
theme.layout_equalarea = themes_path .. "catppuccin/layouts/equalarea.png"
|
||||
theme.layout_machi = themes_path .. "catppuccin/layouts/machi.png"
|
||||
|
||||
-- Generate Awesome icon:
|
||||
theme.awesome_icon = theme_assets.awesome_icon(
|
||||
theme.menu_height, theme.bg_focus, theme.fg_focus
|
||||
)
|
||||
theme.awesome_icon = theme_assets.awesome_icon(theme.menu_height, theme.bg_focus, theme.fg_focus)
|
||||
|
||||
-- Define the icon theme for application icons. If not set then the icons
|
||||
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local wibox = require "wibox"
|
||||
local beautiful = require "beautiful"
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
-- Creating Calendar
|
||||
|
@ -10,70 +8,73 @@ local dpi = beautiful.xresources.apply_dpi
|
|||
-- copied from awesome doc and adjusted a bit
|
||||
local styles = {}
|
||||
|
||||
styles.month = { bg_color = beautiful.xcolorS0}
|
||||
styles.normal = {
|
||||
bg_color = beautiful.xcolorS0,
|
||||
styles.month = { bg_color = beautiful.xcolorS0 }
|
||||
styles.normal = {
|
||||
bg_color = beautiful.xcolorS0,
|
||||
padding = dpi(6),
|
||||
fg_color = beautiful.xcolorT2,
|
||||
}
|
||||
styles.focus = {
|
||||
styles.focus = {
|
||||
fg_color = beautiful.xcolor7,
|
||||
padding = dpi(6),
|
||||
markup = function(t) return '<b>' .. t .. '</b>' end,
|
||||
markup = function(t)
|
||||
return "<b>" .. t .. "</b>"
|
||||
end,
|
||||
}
|
||||
styles.header = {
|
||||
styles.header = {
|
||||
fg_color = beautiful.xcolor2,
|
||||
markup = function(t) return '<b>' .. t .. '</b>' end,
|
||||
markup = function(t)
|
||||
return "<b>" .. t .. "</b>"
|
||||
end,
|
||||
}
|
||||
styles.weekday = {
|
||||
styles.weekday = {
|
||||
fg_color = beautiful.xcolorT2,
|
||||
markup = function(t) return '<span font_desc="FiraCode Nerd Font Medium 16">' .. t .. '</span>' end,
|
||||
markup = function(t)
|
||||
return '<span font_desc="FiraCode Nerd Font Medium 16">' .. t .. "</span>"
|
||||
end,
|
||||
}
|
||||
|
||||
-- The Function
|
||||
local function decorate_cell(widget, flag, date)
|
||||
if flag=="monthheader" and not styles.monthheader then
|
||||
flag = "header"
|
||||
end
|
||||
local function decorate_cell(widget, flag)
|
||||
if flag == "monthheader" and not styles.monthheader then
|
||||
flag = "header"
|
||||
end
|
||||
|
||||
local props = styles[flag] or {}
|
||||
local props = styles[flag] or {}
|
||||
|
||||
if props.markup and widget.get_text and widget.set_markup then
|
||||
widget:set_markup(props.markup(widget:get_text()))
|
||||
end
|
||||
-- Change bg color for weekends
|
||||
local d = {year=date.year, month=(date.month or 1), day=(date.day or 1)}
|
||||
local weekday = tonumber(os.date("%w", os.time(d)))
|
||||
local ret = wibox.widget {
|
||||
{
|
||||
widget,
|
||||
margins = props.padding,
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
fg = props.fg_color,
|
||||
bg = props.bg_color,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
if props.markup and widget.get_text and widget.set_markup then
|
||||
widget:set_markup(props.markup(widget:get_text()))
|
||||
end
|
||||
-- Change bg color for weekends
|
||||
local ret = wibox.widget({
|
||||
{
|
||||
widget,
|
||||
margins = props.padding,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
fg = props.fg_color,
|
||||
bg = props.bg_color,
|
||||
widget = wibox.container.background,
|
||||
})
|
||||
|
||||
return ret
|
||||
return ret
|
||||
end
|
||||
|
||||
local calendar = wibox.widget {
|
||||
local calendar = wibox.widget({
|
||||
date = os.date("*t"),
|
||||
font = beautiful.font_name.."14",
|
||||
font = beautiful.font_name .. "14",
|
||||
fn_embed = decorate_cell,
|
||||
widget = wibox.widget.calendar.month,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
return wibox.widget {
|
||||
return wibox.widget({
|
||||
nil,
|
||||
{
|
||||
nil,
|
||||
calendar,
|
||||
expand = 'none',
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
expand = 'none',
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.vertical,
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local wibox = require "wibox"
|
||||
local beautiful = require "beautiful"
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
local rubato = require "lib.rubato"
|
||||
local helpers = require "helpers"
|
||||
local rubato = require("lib.rubato")
|
||||
|
||||
-- Var
|
||||
local width = dpi(410)
|
||||
|
@ -15,72 +14,69 @@ local height = awful.screen.focused().geometry.height - dpi(100)
|
|||
-----------
|
||||
|
||||
local function round_widget(radius)
|
||||
return function(cr,w,h)
|
||||
gears.shape.rounded_rect(cr,w,h,radius)
|
||||
return function(cr, w, h)
|
||||
gears.shape.rounded_rect(cr, w, h, radius)
|
||||
end
|
||||
end
|
||||
|
||||
local function center_widget(widgets)
|
||||
return wibox.widget {
|
||||
return wibox.widget({
|
||||
nil,
|
||||
{
|
||||
nil,
|
||||
widgets,
|
||||
expand = 'none',
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
expand = 'none',
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.vertical,
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
local function box_widget(widgets, width, height)
|
||||
local function box_widget(widgets, _width, _height)
|
||||
--local centered_widget = center_widget(widgets)
|
||||
|
||||
return wibox.widget {
|
||||
return wibox.widget({
|
||||
{
|
||||
{
|
||||
widgets,
|
||||
margins = dpi(16),
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
forced_width = dpi(width),
|
||||
forced_height = dpi(height),
|
||||
forced_width = dpi(_width),
|
||||
forced_height = dpi(_height),
|
||||
shape = round_widget(8),
|
||||
bg = beautiful.bg_focus, --for widget Rounded and Border
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
margins = {left = dpi(20), right = dpi(20)},
|
||||
margins = { left = dpi(20), right = dpi(20) },
|
||||
widget = wibox.container.margin,
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
local aa = wibox.widget.textbox()
|
||||
|
||||
-- Get widgets
|
||||
local weather_widget = require "ui.info-panel.weather"
|
||||
local profile_widget = require "ui.info-panel.profile"
|
||||
local weather_widget = require("ui.info-panel.weather")
|
||||
local profile_widget = require("ui.info-panel.profile")
|
||||
--local player_widget = require "ui.info-panel.player" -- Old MPD widget
|
||||
|
||||
local calendar_widget = require "ui.info-panel.calendar"
|
||||
local music_widget = require "ui.info-panel.music-player"
|
||||
local calendar_widget = require("ui.info-panel.calendar")
|
||||
local music_widget = require("ui.info-panel.music-player")
|
||||
|
||||
-- Combine some widgets
|
||||
local weather = box_widget(weather_widget, 380, 180)
|
||||
local profile = box_widget(profile_widget, 380, 210)
|
||||
--local player = box_widget(player_widget, 380, 150) -- Box MPD widget
|
||||
local calendar = box_widget(calendar_widget, 380, 340)
|
||||
local music = box_widget(music_widget, 380, 150)
|
||||
-- Spacing
|
||||
local space = function(height)
|
||||
return wibox.widget {
|
||||
forced_height = dpi(height),
|
||||
layout = wibox.layout.align.horizontal
|
||||
}
|
||||
local space = function(_height)
|
||||
return wibox.widget({
|
||||
forced_height = dpi(_height),
|
||||
layout = wibox.layout.align.horizontal,
|
||||
})
|
||||
end
|
||||
|
||||
-- Sidebar
|
||||
local sidebar = wibox {
|
||||
local sidebar = wibox({
|
||||
visible = false,
|
||||
ontop = true,
|
||||
width = width,
|
||||
|
@ -89,10 +85,10 @@ local sidebar = wibox {
|
|||
bg = beautiful.bg_normal,
|
||||
border_width = dpi(3),
|
||||
border_color = beautiful.xcolorS0,
|
||||
}
|
||||
})
|
||||
|
||||
-- Sidebar widget setup
|
||||
sidebar : setup {
|
||||
sidebar:setup({
|
||||
{
|
||||
profile,
|
||||
--player,
|
||||
|
@ -103,29 +99,29 @@ sidebar : setup {
|
|||
spacing = dpi(20),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
margins = { top = dpi(20), bottom = dpi(20)},
|
||||
margins = { top = dpi(20), bottom = dpi(20) },
|
||||
widget = wibox.container.margin,
|
||||
}
|
||||
})
|
||||
|
||||
-- Slide animation
|
||||
local slide = rubato.timed {
|
||||
local slide = rubato.timed({
|
||||
pos = awful.screen.focused().geometry.x - sidebar.width,
|
||||
rate = 60,
|
||||
intro = 0.2,
|
||||
duration = 0.4,
|
||||
subscribed = function(pos)
|
||||
subscribed = function(pos)
|
||||
sidebar.x = awful.screen.focused().geometry.x + pos
|
||||
end
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
-- Timer of sidebar's death
|
||||
sidebar.timer = gears.timer {
|
||||
-- Timer of sidebar's death
|
||||
sidebar.timer = gears.timer({
|
||||
timeout = 0.5,
|
||||
single_shot = true,
|
||||
callback = function()
|
||||
callback = function()
|
||||
sidebar.visible = not sidebar.visible
|
||||
end
|
||||
}
|
||||
end,
|
||||
})
|
||||
--aa.timer = gears.timer { -- Updates the Player every second
|
||||
-- timeout = 1,
|
||||
-- autostart = false,
|
||||
|
@ -133,19 +129,19 @@ sidebar.timer = gears.timer {
|
|||
-- awesome.emit_signal("widget::update_player")
|
||||
-- end
|
||||
--}
|
||||
sidebar.shape = function(cr,w,h) --Rounded Corners
|
||||
gears.shape.rounded_rect(cr,w,h,14)
|
||||
sidebar.shape = function(cr, w, h) --Rounded Corners
|
||||
gears.shape.rounded_rect(cr, w, h, 14)
|
||||
end
|
||||
-- Toggle function
|
||||
sidebar.toggle = function()
|
||||
if sidebar.visible then
|
||||
-- aa.timer:stop() -- Stops to Update the Player Signal
|
||||
if sidebar.visible then
|
||||
-- aa.timer:stop() -- Stops to Update the Player Signal
|
||||
slide.target = awful.screen.focused().geometry.x - sidebar.width
|
||||
sidebar.timer:start()
|
||||
else
|
||||
-- awesome.emit_signal("widget::update_player") -- Updates it before the Timer so it doesn't Jump the Length
|
||||
-- awesome.emit_signal("widget::update_player") -- Updates it before the Timer so it doesn't Jump the Length
|
||||
awesome.emit_signal("widget::update_uptime")
|
||||
-- aa.timer:start()
|
||||
-- aa.timer:start()
|
||||
slide.target = awful.screen.focused().geometry.x + dpi(20)
|
||||
sidebar.visible = not sidebar.visible
|
||||
end
|
||||
|
|
|
@ -75,7 +75,7 @@ local function volume_control()
|
|||
})
|
||||
|
||||
-- Update bar
|
||||
local function set_slider_value(self, volume)
|
||||
local function set_slider_value(_, volume)
|
||||
volume_bar.value = volume * 100
|
||||
end
|
||||
|
||||
|
@ -109,27 +109,27 @@ local function volume_control()
|
|||
end
|
||||
-- Player's Button
|
||||
local toggle = wibox.widget.textbox()
|
||||
toggle.font = beautiful.font_name.."26"
|
||||
toggle.font = beautiful.font_name .. "26"
|
||||
|
||||
toggle:buttons(gears.table.join(
|
||||
awful.button({}, 1, function() playerctl_daemon:play_pause() end)
|
||||
))
|
||||
toggle:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
playerctl_daemon:play_pause()
|
||||
end)))
|
||||
|
||||
local next = wibox.widget.textbox()
|
||||
next.font = beautiful.font_name.."26"
|
||||
next.font = beautiful.font_name .. "26"
|
||||
next.markup = "怜"
|
||||
|
||||
next:buttons(gears.table.join(
|
||||
awful.button({}, 1, function() playerctl_daemon:next() end)
|
||||
))
|
||||
next:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
playerctl_daemon:next()
|
||||
end)))
|
||||
|
||||
local back = wibox.widget.textbox()
|
||||
back.font = beautiful.font_name.."26"
|
||||
back.font = beautiful.font_name .. "26"
|
||||
back.markup = "玲"
|
||||
|
||||
back:buttons(gears.table.join(
|
||||
awful.button({}, 1, function() playerctl_daemon:previous() end)
|
||||
))
|
||||
back:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
playerctl_daemon:previous()
|
||||
end)))
|
||||
|
||||
local function music()
|
||||
return wibox.widget({
|
||||
|
@ -223,7 +223,7 @@ local music_widget = wibox.widget({
|
|||
|
||||
--- playerctl
|
||||
--- -------------
|
||||
playerctl_daemon:connect_signal("metadata", function(_, title, artist, album_path, __, ___, ____)
|
||||
playerctl_daemon:connect_signal("metadata", function(_, title, artist, album_path, _, _, _)
|
||||
if title == "" then
|
||||
title = "Nothing Playing"
|
||||
end
|
||||
|
@ -239,13 +239,13 @@ playerctl_daemon:connect_signal("metadata", function(_, title, artist, album_pat
|
|||
music_artist:set_markup_silently(helpers.ui.colorize_text(artist, beautiful.xcolor2))
|
||||
end)
|
||||
|
||||
playerctl_daemon:connect_signal("playback_status", function(_, playing, __)
|
||||
playerctl_daemon:connect_signal("playback_status", function(_, playing, _)
|
||||
if playing then
|
||||
music_text:set_markup_silently(helpers.ui.colorize_text("Now Playing", beautiful.xcolorO0 )) --"#666c79"
|
||||
toggle.markup = helpers.ui.colorize_text("", beautiful.xcolor2 )
|
||||
music_text:set_markup_silently(helpers.ui.colorize_text("Now Playing", beautiful.xcolorO0)) --"#666c79"
|
||||
toggle.markup = helpers.ui.colorize_text("", beautiful.xcolor2)
|
||||
else
|
||||
music_text:set_markup_silently(helpers.ui.colorize_text("Music", beautiful.xcolorO0 ))
|
||||
toggle.markup = helpers.ui.colorize_text("契", beautiful.xcolor2 )
|
||||
music_text:set_markup_silently(helpers.ui.colorize_text("Music", beautiful.xcolorO0))
|
||||
toggle.markup = helpers.ui.colorize_text("", beautiful.xcolor2)
|
||||
end
|
||||
end)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local wibox = require "wibox"
|
||||
local beautiful = require "beautiful"
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
-- Make Widgets
|
||||
|
@ -9,59 +9,57 @@ local dpi = beautiful.xresources.apply_dpi
|
|||
|
||||
-- Song's Title
|
||||
local title = wibox.widget.textbox()
|
||||
title.font = beautiful.font_name.."Medium 16"
|
||||
title.font = beautiful.font_name .. "Medium 16"
|
||||
title.align = "left"
|
||||
title.valign = "bottom"
|
||||
|
||||
-- Song's Artist
|
||||
local artist = wibox.widget.textbox()
|
||||
artist.font = beautiful.font_name.."Regular 16"
|
||||
artist.font = beautiful.font_name .. "Regular 16"
|
||||
artist.align = "left"
|
||||
artist.valign = "bottom"
|
||||
|
||||
-- Song's Length
|
||||
local length = wibox.widget.textbox()
|
||||
length.font = beautiful.font_name.."Regular 14"
|
||||
length.font = beautiful.font_name .. "Regular 14"
|
||||
length.align = "center"
|
||||
length.valign = "center"
|
||||
|
||||
-- Player's Button
|
||||
local toggle = wibox.widget.textbox()
|
||||
toggle.font = beautiful.font_name.."26"
|
||||
toggle.font = beautiful.font_name .. "26"
|
||||
|
||||
toggle:buttons(gears.table.join(
|
||||
awful.button({}, 1, function()
|
||||
awful.spawn("mpc toggle", false)
|
||||
if toggle.markup:match("") then
|
||||
toggle.markup = "契"
|
||||
else
|
||||
toggle.markup = ""
|
||||
end
|
||||
end)
|
||||
))
|
||||
toggle:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
awful.spawn("mpc toggle", false)
|
||||
if toggle.markup:match("") then
|
||||
toggle.markup = ""
|
||||
else
|
||||
toggle.markup = ""
|
||||
end
|
||||
end)))
|
||||
|
||||
local next = wibox.widget.textbox()
|
||||
next.font = beautiful.font_name.."26"
|
||||
next.markup = "怜"
|
||||
next.font = beautiful.font_name .. "26"
|
||||
next.markup = ""
|
||||
|
||||
next:buttons(gears.table.join(
|
||||
awful.button({}, 1, function() awful.spawn("mpc next", false) end)
|
||||
))
|
||||
next:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
awful.spawn("mpc next", false)
|
||||
end)))
|
||||
|
||||
local back = wibox.widget.textbox()
|
||||
back.font = beautiful.font_name.."26"
|
||||
back.markup = "玲"
|
||||
back.font = beautiful.font_name .. "26"
|
||||
back.markup = ""
|
||||
|
||||
back:buttons(gears.table.join(
|
||||
awful.button({}, 1, function() awful.spawn("mpc prev", false) end)
|
||||
))
|
||||
back:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
awful.spawn("mpc prev", false)
|
||||
end)))
|
||||
|
||||
-- Get data
|
||||
awesome.connect_signal("signal::player", function(t, a, l, s)
|
||||
if not s:match("playing") then
|
||||
toggle.markup = "契"
|
||||
toggle.markup = ""
|
||||
else
|
||||
toggle.markup = ""
|
||||
toggle.markup = ""
|
||||
end
|
||||
|
||||
title.markup = t
|
||||
|
@ -72,15 +70,15 @@ end)
|
|||
-- Grouping Widgets
|
||||
---------------------
|
||||
|
||||
local buttons = wibox.widget {
|
||||
local buttons = wibox.widget({
|
||||
back,
|
||||
toggle,
|
||||
next,
|
||||
spacing = dpi(11),
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}
|
||||
})
|
||||
|
||||
return wibox.widget {
|
||||
return wibox.widget({
|
||||
{
|
||||
nil,
|
||||
{
|
||||
|
@ -89,7 +87,7 @@ return wibox.widget {
|
|||
spacing = dpi(12),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
expand = 'none',
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.vertical,
|
||||
},
|
||||
{
|
||||
|
@ -100,7 +98,7 @@ return wibox.widget {
|
|||
{
|
||||
nil,
|
||||
buttons,
|
||||
expand = 'none',
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
spacing = dpi(6),
|
||||
|
@ -109,7 +107,6 @@ return wibox.widget {
|
|||
top = 30,
|
||||
bottom = 0,
|
||||
layout = wibox.container.margin,
|
||||
--layout = wibox.layout.align.vertical,
|
||||
},
|
||||
layout = wibox.layout.flex.horizontal,
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
local awful = require "awful"
|
||||
local wibox = require "wibox"
|
||||
local gears = require "gears"
|
||||
local beautiful = require "beautiful"
|
||||
local helpers = require "helpers"
|
||||
local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
local gears = require("gears")
|
||||
local beautiful = require("beautiful")
|
||||
local helpers = require("helpers")
|
||||
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
local user1 = os.getenv('USER')
|
||||
|
||||
local user1 = os.getenv("USER")
|
||||
|
||||
-- Create Widgets
|
||||
-------------------
|
||||
|
@ -20,76 +19,74 @@ pfp.forced_height = dpi(130)
|
|||
|
||||
-- User
|
||||
local user = wibox.widget.textbox()
|
||||
user.font = beautiful.font_name.."SemiBold 18"
|
||||
user.align = 'left'
|
||||
user.markup = "<span foreground='"..beautiful.fg_normal.."'>"..user1.."</span>"
|
||||
user.font = beautiful.font_name .. "SemiBold 18"
|
||||
user.align = "left"
|
||||
user.markup = "<span foreground='" .. beautiful.fg_normal .. "'>" .. user1 .. "</span>"
|
||||
|
||||
-- Hostname
|
||||
local hostname = wibox.widget.textbox()
|
||||
hostname.font = beautiful.font_name.."Regular 14"
|
||||
hostname.align = 'left'
|
||||
hostname.font = beautiful.font_name .. "Regular 14"
|
||||
hostname.align = "left"
|
||||
|
||||
awful.spawn.easy_async_with_shell("echo $HOST", function(stdout)
|
||||
hostname.markup = "<span foreground='"..beautiful.xcolor1.."'>".."@"..tostring(stdout).."</span>"
|
||||
hostname.markup = "<span foreground='" .. beautiful.xcolor1 .. "'>" .. "@" .. tostring(stdout) .. "</span>"
|
||||
end)
|
||||
|
||||
-- Battery
|
||||
local uptimeosd = wibox.widget.textbox()
|
||||
uptimeosd.font = beautiful.font_name.."12"
|
||||
uptimeosd.font = beautiful.font_name .. "12"
|
||||
uptimeosd.align = "center"
|
||||
|
||||
|
||||
-- Get data 4 widgets!
|
||||
awesome.connect_signal("signal::uptime", function(uptime)
|
||||
uptimeosd.markup = "<span foreground='"..beautiful.fg_normal.."'>".."up "..uptime.."</span>"
|
||||
uptimeosd.markup = "<span foreground='" .. beautiful.fg_normal .. "'>" .. "up " .. uptime .. "</span>"
|
||||
end)
|
||||
|
||||
|
||||
-- Spacing horizontally
|
||||
local space = wibox.widget {
|
||||
local space = wibox.widget({
|
||||
forced_height = dpi(6),
|
||||
layout = wibox.layout.align.horizontal
|
||||
}
|
||||
local shutdown = wibox.widget {
|
||||
layout = wibox.layout.align.horizontal,
|
||||
})
|
||||
local shutdown = wibox.widget({
|
||||
{
|
||||
{
|
||||
font = beautiful.font_name.."30",
|
||||
markup = "<span foreground='"..beautiful.xcolor10.."'>".."".."</span>",
|
||||
align = center,
|
||||
valign = center,
|
||||
widget = wibox.widget.textbox,
|
||||
font = beautiful.font_name .. "30",
|
||||
markup = "<span foreground='" .. beautiful.xcolor10 .. "'>" .. "" .. "</span>",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
top = dpi(9),
|
||||
bottom = dpi(9),
|
||||
left = dpi(11),
|
||||
right = dpi(11),
|
||||
widget = wibox.container.margin,
|
||||
top = dpi(9),
|
||||
bottom = dpi(9),
|
||||
left = dpi(11),
|
||||
right = dpi(11),
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
bg = beautiful.xcolorS1,
|
||||
shape = helpers.ui.rrect(8),
|
||||
widget = wibox.container.background,
|
||||
}
|
||||
})
|
||||
|
||||
local reboot = wibox.widget {
|
||||
local reboot = wibox.widget({
|
||||
{
|
||||
{
|
||||
font = beautiful.font_name.."30",
|
||||
markup = "<span foreground='"..beautiful.xcolor2.."'>".."".."</span>",
|
||||
align = center,
|
||||
valign = center,
|
||||
widget = wibox.widget.textbox,
|
||||
font = beautiful.font_name .. "30",
|
||||
markup = "<span foreground='" .. beautiful.xcolor2 .. "'>" .. "" .. "</span>",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
top = dpi(9),
|
||||
bottom = dpi(9),
|
||||
left = dpi(11),
|
||||
right = dpi(11),
|
||||
widget = wibox.container.margin,
|
||||
top = dpi(9),
|
||||
bottom = dpi(9),
|
||||
left = dpi(11),
|
||||
right = dpi(11),
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
bg = beautiful.xcolorS1,
|
||||
shape = helpers.ui.rrect(8),
|
||||
widget = wibox.container.background,
|
||||
}
|
||||
shutdown:connect_signal("mouse::enter", function()
|
||||
})
|
||||
shutdown:connect_signal("mouse::enter", function()
|
||||
shutdown.bg = beautiful.xcolorS2
|
||||
end)
|
||||
|
||||
|
@ -97,7 +94,7 @@ shutdown:connect_signal("mouse::leave", function()
|
|||
shutdown.bg = beautiful.xcolorS1
|
||||
end)
|
||||
|
||||
reboot:connect_signal("mouse::enter", function()
|
||||
reboot:connect_signal("mouse::enter", function()
|
||||
reboot.bg = beautiful.xcolorS2
|
||||
end)
|
||||
|
||||
|
@ -105,68 +102,60 @@ reboot:connect_signal("mouse::leave", function()
|
|||
reboot.bg = beautiful.xcolorS1
|
||||
end)
|
||||
|
||||
shutdown:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
awesome.emit_signal("module::exit_screen:show")
|
||||
end)
|
||||
))
|
||||
shutdown:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
awesome.emit_signal("module::exit_screen:show")
|
||||
end)))
|
||||
|
||||
reboot:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
awful.spawn.with_shell("loginctl reboot")
|
||||
end)
|
||||
))
|
||||
reboot:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
awful.spawn.with_shell("loginctl reboot")
|
||||
end)))
|
||||
|
||||
-- Grouping widgets
|
||||
---------------------
|
||||
local buttons = wibox.widget {
|
||||
local buttons = wibox.widget({
|
||||
{
|
||||
reboot,
|
||||
shutdown,
|
||||
spacing = dpi(8),
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
reboot,
|
||||
shutdown,
|
||||
spacing = dpi(8),
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
top = 10,
|
||||
left = 57,
|
||||
widget = wibox.container.margin,
|
||||
}
|
||||
})
|
||||
|
||||
local name = wibox.widget {
|
||||
local name = wibox.widget({
|
||||
{
|
||||
user,
|
||||
hostname,
|
||||
spacing = dpi(4),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
user,
|
||||
hostname,
|
||||
spacing = dpi(4),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
left = 0,
|
||||
widget = wibox.container.margin,
|
||||
}
|
||||
local uptimebox = wibox.widget {
|
||||
})
|
||||
local uptimebox = wibox.widget({
|
||||
{
|
||||
{
|
||||
uptimeosd,
|
||||
spacing = dpi(2),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
uptimeosd,
|
||||
spacing = dpi(2),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
top = 3,
|
||||
bottom = 3,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
-- bg = beautiful.xcolorS1,
|
||||
bg = beautiful.xcolorS0,
|
||||
shape = helpers.ui.rrect(7),
|
||||
widget = wibox.container.background,
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
-- The Profile Widget
|
||||
return wibox.widget {
|
||||
return wibox.widget({
|
||||
{
|
||||
{
|
||||
pfp,
|
||||
uptimebox,
|
||||
--battery,
|
||||
spacing = dpi(20),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
|
@ -174,13 +163,13 @@ return wibox.widget {
|
|||
},
|
||||
{
|
||||
{
|
||||
name,
|
||||
buttons,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
name,
|
||||
buttons,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
top = 30,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
spacing = dpi(30),
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}
|
||||
})
|
||||
|
|
|
@ -170,7 +170,7 @@ local coordinates = user_vars.widget.weather.coordinates
|
|||
|
||||
local show_hourly_forecast = true
|
||||
local show_daily_forecast = true
|
||||
local units = "metric"
|
||||
local units = "imperial"
|
||||
|
||||
local url = (
|
||||
"https://api.openweathermap.org/data/2.5/onecall"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require "ui.popups"
|
||||
require "ui.notif-panel"
|
||||
require "ui.info-panel"
|
||||
require "ui.top-panel"
|
||||
require "ui.titlebar"
|
||||
require("ui.popups")
|
||||
require("ui.notif-panel")
|
||||
require("ui.info-panel")
|
||||
require("ui.top-panel")
|
||||
require("ui.titlebar")
|
||||
|
|
|
@ -7,283 +7,255 @@ local naughty = require("naughty")
|
|||
local rubato = require("lib.rubato")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
local notifs_text = wibox.widget {
|
||||
font = beautiful.font .. " Bold 20",
|
||||
markup = "Notifications",
|
||||
halign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
}
|
||||
local notifs_text = wibox.widget({
|
||||
font = beautiful.font .. " Bold 20",
|
||||
markup = "Notifications",
|
||||
halign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
})
|
||||
|
||||
local notifs_clear = wibox.widget {
|
||||
markup = "<span foreground='" .. beautiful.xcolor10 .. "'> </span>",
|
||||
font = beautiful.font_name .. " Bold 21",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
}
|
||||
local notifs_clear = wibox.widget({
|
||||
markup = "<span foreground='" .. beautiful.xcolor10 .. "'> </span>",
|
||||
font = beautiful.font_name .. " Bold 21",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
})
|
||||
|
||||
notifs_clear:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
_G.notif_center_reset_notifs_container()
|
||||
_G.Notif_center_reset_notifs_container()
|
||||
end)))
|
||||
helpers.ui.add_hover_cursor(notifs_clear, "hand2")
|
||||
|
||||
local notifs_empty = wibox.widget {
|
||||
{
|
||||
nil,
|
||||
{
|
||||
nil,
|
||||
{
|
||||
markup = "<span foreground='" .. beautiful.xcolorT2 .. "'>Nothing Here!</span>",
|
||||
font = beautiful.font .. " Bold 17",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
layout = wibox.layout.align.vertical,
|
||||
},
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
forced_height = 730,
|
||||
widget = wibox.container.background,
|
||||
bg = beautiful.xcolorS0,
|
||||
shape = helpers.ui.rrect(8),
|
||||
}
|
||||
local notifs_empty = wibox.widget({
|
||||
{
|
||||
nil,
|
||||
{
|
||||
nil,
|
||||
{
|
||||
markup = "<span foreground='" .. beautiful.xcolorT2 .. "'>Nothing Here!</span>",
|
||||
font = beautiful.font .. " Bold 17",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
layout = wibox.layout.align.vertical,
|
||||
},
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
forced_height = 730,
|
||||
widget = wibox.container.background,
|
||||
bg = beautiful.xcolorS0,
|
||||
shape = helpers.ui.rrect(8),
|
||||
})
|
||||
|
||||
local notifs_container = wibox.widget {
|
||||
spacing = 10,
|
||||
spacing_widget = {
|
||||
{
|
||||
shape = helpers.ui.rrect(8),
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 6,
|
||||
right = 6,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
forced_width = 320,
|
||||
forced_height = 730, --430, --Use it like in notifs_empty else it will look weird
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
}
|
||||
local notifs_container = wibox.widget({
|
||||
spacing = 10,
|
||||
spacing_widget = {
|
||||
{
|
||||
shape = helpers.ui.rrect(8),
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
left = 6,
|
||||
right = 6,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
forced_width = 320,
|
||||
forced_height = 730, --Use it like in notifs_empty else it will look weird
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
})
|
||||
|
||||
local remove_notifs_empty = true
|
||||
|
||||
notif_center_reset_notifs_container = function()
|
||||
notifs_container:reset(notifs_container)
|
||||
notifs_container:insert(1, notifs_empty)
|
||||
remove_notifs_empty = true
|
||||
Notif_center_reset_notifs_container = function()
|
||||
notifs_container:reset(notifs_container)
|
||||
notifs_container:insert(1, notifs_empty)
|
||||
remove_notifs_empty = true
|
||||
end
|
||||
|
||||
notif_center_remove_notif = function(box)
|
||||
notifs_container:remove_widgets(box)
|
||||
Notif_center_remove_notif = function(box)
|
||||
notifs_container:remove_widgets(box)
|
||||
|
||||
if #notifs_container.children == 0 then
|
||||
notifs_container:insert(1, notifs_empty)
|
||||
remove_notifs_empty = true
|
||||
end
|
||||
if #notifs_container.children == 0 then
|
||||
notifs_container:insert(1, notifs_empty)
|
||||
remove_notifs_empty = true
|
||||
end
|
||||
end
|
||||
|
||||
local create_notif = function(icon, n, width)
|
||||
local time = os.date "%H:%M"
|
||||
local box = {}
|
||||
local create_notif = function(icon, n)
|
||||
local time = os.date("%H:%M")
|
||||
local box = {}
|
||||
|
||||
box = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
{
|
||||
image = icon,
|
||||
resize = true,
|
||||
clip_shape = helpers.ui.rrect(8),
|
||||
halign = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.imagebox,
|
||||
},
|
||||
strategy = "exact",
|
||||
height = 50,
|
||||
width = 50,
|
||||
widget = wibox.container.constraint,
|
||||
},
|
||||
{
|
||||
{
|
||||
nil,
|
||||
{
|
||||
{
|
||||
{
|
||||
step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth,
|
||||
speed = 50,
|
||||
{
|
||||
markup = n.title,
|
||||
font = beautiful.font .. " Bold 9",
|
||||
align = "left",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
forced_width = 140,
|
||||
widget = wibox.container.scroll.horizontal,
|
||||
},
|
||||
nil,
|
||||
{
|
||||
markup = "<span foreground='" .. beautiful.xcolorT2 .. "'>" .. time .. "</span>",
|
||||
align = "right",
|
||||
valign = "bottom",
|
||||
font = beautiful.font .. " Bold 10",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
{
|
||||
step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth,
|
||||
speed = 50,
|
||||
{
|
||||
markup = n.message,
|
||||
align = "left",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
forced_width = 165,
|
||||
widget = wibox.container.scroll.horizontal,
|
||||
},
|
||||
spacing = 3,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.vertical,
|
||||
},
|
||||
left = 17,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
margins = 15,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
forced_height = 85,
|
||||
widget = wibox.container.background,
|
||||
bg = beautiful.xcolorS0,
|
||||
shape = helpers.ui.rrect(8),
|
||||
}
|
||||
box = wibox.widget({
|
||||
{
|
||||
{
|
||||
{
|
||||
{
|
||||
image = icon,
|
||||
resize = true,
|
||||
clip_shape = helpers.ui.rrect(8),
|
||||
halign = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.imagebox,
|
||||
},
|
||||
strategy = "exact",
|
||||
height = 50,
|
||||
width = 50,
|
||||
widget = wibox.container.constraint,
|
||||
},
|
||||
{
|
||||
{
|
||||
nil,
|
||||
{
|
||||
{
|
||||
{
|
||||
step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth,
|
||||
speed = 50,
|
||||
{
|
||||
markup = n.title,
|
||||
font = beautiful.font .. " Bold 9",
|
||||
align = "left",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
forced_width = 140,
|
||||
widget = wibox.container.scroll.horizontal,
|
||||
},
|
||||
nil,
|
||||
{
|
||||
markup = "<span foreground='" .. beautiful.xcolorT2 .. "'>" .. time .. "</span>",
|
||||
align = "right",
|
||||
valign = "bottom",
|
||||
font = beautiful.font .. " Bold 10",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
{
|
||||
step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth,
|
||||
speed = 50,
|
||||
{
|
||||
markup = n.message,
|
||||
align = "left",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
forced_width = 165,
|
||||
widget = wibox.container.scroll.horizontal,
|
||||
},
|
||||
spacing = 3,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.vertical,
|
||||
},
|
||||
left = 17,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
margins = 15,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
forced_height = 85,
|
||||
widget = wibox.container.background,
|
||||
bg = beautiful.xcolorS0,
|
||||
shape = helpers.ui.rrect(8),
|
||||
})
|
||||
|
||||
box:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
_G.notif_center_remove_notif(box)
|
||||
end)))
|
||||
box:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
_G.Notif_center_remove_notif(box)
|
||||
end)))
|
||||
|
||||
return box
|
||||
return box
|
||||
end
|
||||
|
||||
notifs_container:buttons(gears.table.join(
|
||||
awful.button({}, 4, nil, function()
|
||||
if #notifs_container.children == 1 then
|
||||
return
|
||||
end
|
||||
notifs_container:insert(1, notifs_container.children[#notifs_container.children])
|
||||
notifs_container:remove(#notifs_container.children)
|
||||
end),
|
||||
awful.button({}, 4, nil, function()
|
||||
if #notifs_container.children == 1 then
|
||||
return
|
||||
end
|
||||
notifs_container:insert(1, notifs_container.children[#notifs_container.children])
|
||||
notifs_container:remove(#notifs_container.children)
|
||||
end),
|
||||
|
||||
awful.button({}, 5, nil, function()
|
||||
if #notifs_container.children == 1 then
|
||||
return
|
||||
end
|
||||
notifs_container:insert(#notifs_container.children + 1, notifs_container.children[1])
|
||||
notifs_container:remove(1)
|
||||
end)
|
||||
awful.button({}, 5, nil, function()
|
||||
if #notifs_container.children == 1 then
|
||||
return
|
||||
end
|
||||
notifs_container:insert(#notifs_container.children + 1, notifs_container.children[1])
|
||||
notifs_container:remove(1)
|
||||
end)
|
||||
))
|
||||
|
||||
notifs_container:insert(1, notifs_empty)
|
||||
|
||||
naughty.connect_signal("request::display", function(n)
|
||||
if #notifs_container.children == 1 and remove_notifs_empty then
|
||||
notifs_container:reset(notifs_container)
|
||||
remove_notifs_empty = false
|
||||
end
|
||||
if #notifs_container.children == 1 and remove_notifs_empty then
|
||||
notifs_container:reset(notifs_container)
|
||||
remove_notifs_empty = false
|
||||
end
|
||||
|
||||
local appicon = n.icon or n.app_icon
|
||||
if not appicon then
|
||||
appicon = beautiful.pfp --notification_icon
|
||||
end
|
||||
local appicon = n.icon or n.app_icon
|
||||
if not appicon then
|
||||
appicon = beautiful.pfp --notification_icon
|
||||
end
|
||||
|
||||
notifs_container:insert(1, create_notif(appicon, n, width))
|
||||
notifs_container:insert(1, create_notif(appicon, n))
|
||||
end)
|
||||
|
||||
local notifs = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
nil,
|
||||
notifs_text,
|
||||
notifs_clear,
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
left = 5,
|
||||
right = 5,
|
||||
top = 7,
|
||||
bottom = 7,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
widget = wibox.container.background,
|
||||
bg = beautiful.xcolorS0,
|
||||
shape = helpers.ui.rrect(8),
|
||||
},
|
||||
notifs_container,
|
||||
spacing = 20,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
}
|
||||
local notifs = wibox.widget({
|
||||
{
|
||||
{
|
||||
{
|
||||
nil,
|
||||
notifs_text,
|
||||
notifs_clear,
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.horizontal,
|
||||
},
|
||||
left = 5,
|
||||
right = 5,
|
||||
top = 7,
|
||||
bottom = 7,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
widget = wibox.container.background,
|
||||
bg = beautiful.xcolorS0,
|
||||
shape = helpers.ui.rrect(8),
|
||||
},
|
||||
notifs_container,
|
||||
spacing = 20,
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
})
|
||||
|
||||
local actions = wibox.widget {
|
||||
{
|
||||
{
|
||||
-- {
|
||||
{
|
||||
widget = require "ui.notif-panel.widgets.vol_slider",
|
||||
},
|
||||
{
|
||||
widget = require "ui.notif-panel.widgets.mic_slider",
|
||||
},
|
||||
layout = wibox.layout.flex.vertical,
|
||||
spacing = 1,
|
||||
-- },
|
||||
-- {
|
||||
-- { widget = require "ui.widgets.wifi" },
|
||||
-- layout = wibox.layout.flex.horizontal,
|
||||
-- spacing = 15,
|
||||
-- },
|
||||
-- layout = wibox.layout.flex.vertical,
|
||||
-- spacing = 30,
|
||||
},
|
||||
widget = wibox.container.margin,
|
||||
top = 20,
|
||||
bottom = 20,
|
||||
left = 35,
|
||||
right = 35,
|
||||
},
|
||||
forced_height = 120,
|
||||
widget = wibox.container.background,
|
||||
bg = beautiful.xcolorS0,
|
||||
shape = helpers.ui.rrect(8),
|
||||
}
|
||||
|
||||
--local action = awful.popup { -- Replacing it with A wibar
|
||||
-- widget = {
|
||||
-- widget = wibox.container.margin,
|
||||
-- margins = 30,
|
||||
-- forced_width = 355,
|
||||
-- forced_height = 690,
|
||||
-- {
|
||||
-- layout = wibox.layout.fixed.vertical,
|
||||
-- notifs,
|
||||
-- actions,
|
||||
-- },
|
||||
-- },
|
||||
-- placement = function(c)
|
||||
-- (awful.placement.left)(c, { margins = { bottom = 250, right = 60 } })
|
||||
-- end,
|
||||
-- ontop = true,
|
||||
-- visible = false,
|
||||
-- bg = beautiful.bg_normal,
|
||||
--}
|
||||
local actions = wibox.widget({
|
||||
{
|
||||
{
|
||||
{
|
||||
widget = require("ui.notif-panel.widgets.vol_slider"),
|
||||
},
|
||||
{
|
||||
widget = require("ui.notif-panel.widgets.mic_slider"),
|
||||
},
|
||||
layout = wibox.layout.flex.vertical,
|
||||
spacing = 1,
|
||||
},
|
||||
widget = wibox.container.margin,
|
||||
top = 20,
|
||||
bottom = 20,
|
||||
left = 35,
|
||||
right = 35,
|
||||
},
|
||||
forced_height = 120,
|
||||
widget = wibox.container.background,
|
||||
bg = beautiful.xcolorS0,
|
||||
shape = helpers.ui.rrect(8),
|
||||
})
|
||||
--
|
||||
-- Sidebar
|
||||
local action = wibox {
|
||||
local action = wibox({
|
||||
visible = false,
|
||||
ontop = true,
|
||||
width = dpi(410),
|
||||
|
@ -292,53 +264,54 @@ local action = wibox {
|
|||
bg = beautiful.bg_normal,
|
||||
border_width = dpi(3),
|
||||
border_color = beautiful.xcolorS0,
|
||||
}
|
||||
})
|
||||
|
||||
-- Sidebar widget setup
|
||||
action : setup {
|
||||
action:setup({
|
||||
{
|
||||
notifs,
|
||||
actions,
|
||||
notifs,
|
||||
actions,
|
||||
spacing = dpi(20),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
margins = { top = dpi(20), bottom = dpi(20), left = dpi(20), right = dpi(20)},
|
||||
margins = { top = dpi(20), bottom = dpi(20), left = dpi(20), right = dpi(20) },
|
||||
widget = wibox.container.margin,
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
-- Slide animation
|
||||
local slide = rubato.timed {
|
||||
pos = awful.screen.focused().geometry.x - awful.screen.focused().geometry.width, --dpi (1900),
|
||||
local slide = rubato.timed({
|
||||
pos = awful.screen.focused().geometry.x - awful.screen.focused().geometry.width,
|
||||
rate = 60,
|
||||
intro = 0.2,
|
||||
duration = 0.4,
|
||||
subscribed = function(pos)
|
||||
subscribed = function(pos)
|
||||
action.x = awful.screen.focused().geometry.x - pos
|
||||
end
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
-- Timer of action's death
|
||||
action.timer = gears.timer {
|
||||
-- Timer of action's death
|
||||
action.timer = gears.timer({
|
||||
timeout = 0.5,
|
||||
single_shot = true,
|
||||
callback = function()
|
||||
callback = function()
|
||||
action.visible = not action.visible
|
||||
end
|
||||
}
|
||||
action.shape = function(cr,w,h) --Rounded Corners
|
||||
gears.shape.rounded_rect(cr,w,h,14)
|
||||
end,
|
||||
})
|
||||
action.shape = function(cr, w, h) --Rounded Corners
|
||||
gears.shape.rounded_rect(cr, w, h, 14)
|
||||
end
|
||||
-- Toggle function
|
||||
action.toggle = function()
|
||||
if action.visible then
|
||||
--awesome.emit_signal("widget::update_vol")
|
||||
if action.visible then
|
||||
slide.target = awful.screen.focused().geometry.x - awful.screen.focused().geometry.width
|
||||
action.timer:start()
|
||||
else
|
||||
awesome.emit_signal("widget::update_vol")
|
||||
awesome.emit_signal("widget::update_mic")
|
||||
slide.target = awful.screen.focused().geometry.x - awful.screen.focused().geometry.width + action.width + dpi(25) --dpi(1465)
|
||||
awesome.emit_signal("widget::update_vol")
|
||||
awesome.emit_signal("widget::update_mic")
|
||||
slide.target = awful.screen.focused().geometry.x
|
||||
- awful.screen.focused().geometry.width
|
||||
+ action.width
|
||||
+ dpi(25)
|
||||
action.visible = not action.visible
|
||||
end
|
||||
end
|
||||
|
@ -349,5 +322,3 @@ awesome.connect_signal("action::toggle", function()
|
|||
end)
|
||||
|
||||
return action
|
||||
|
||||
|
||||
|
|
|
@ -4,32 +4,32 @@ local wibox = require("wibox")
|
|||
local beautiful = require("beautiful")
|
||||
local helpers = require("helpers")
|
||||
|
||||
local slider = wibox.widget {
|
||||
bar_shape = helpers.ui.rrect(9),
|
||||
bar_height = 6,
|
||||
bar_color = beautiful.bg_focus,
|
||||
bar_active_color = beautiful.xcolor7,
|
||||
handle_shape = gears.shape.circle,
|
||||
handle_color = beautiful.xcolor7,
|
||||
handle_width = 12,
|
||||
value = 25,
|
||||
widget = wibox.widget.slider,
|
||||
}
|
||||
local slider = wibox.widget({
|
||||
bar_shape = helpers.ui.rrect(9),
|
||||
bar_height = 6,
|
||||
bar_color = beautiful.bg_focus,
|
||||
bar_active_color = beautiful.xcolor7,
|
||||
handle_shape = gears.shape.circle,
|
||||
handle_color = beautiful.xcolor7,
|
||||
handle_width = 12,
|
||||
value = 25,
|
||||
widget = wibox.widget.slider,
|
||||
})
|
||||
|
||||
helpers.ui.add_hover_cursor(slider, "hand1")
|
||||
|
||||
local bri_slider = wibox.widget {
|
||||
{
|
||||
markup = helpers.ui.colorize_text(" ", beautiful.xcolor7),
|
||||
font = beautiful.font .. " 14",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox(),
|
||||
},
|
||||
slider,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
spacing = 0,
|
||||
}
|
||||
local bri_slider = wibox.widget({
|
||||
{
|
||||
markup = helpers.ui.colorize_text(" ", beautiful.xcolor7),
|
||||
font = beautiful.font .. " 14",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox(),
|
||||
},
|
||||
slider,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
spacing = 0,
|
||||
})
|
||||
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"brightnessctl | grep -i 'current' | awk '{ print $4}' | tr -d \"(%)\"",
|
||||
|
|
|
@ -5,60 +5,60 @@ local beautiful = require("beautiful")
|
|||
local helpers = require("helpers")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
local user_vars = require "user_variables"
|
||||
local user_vars = require("user_variables")
|
||||
local microphone = user_vars.widget.mic.name
|
||||
|
||||
local slider = wibox.widget {
|
||||
bar_shape = helpers.ui.rrect(9),
|
||||
bar_height = 6,
|
||||
bar_color = beautiful.xcolorbase,
|
||||
bar_active_color = beautiful.xcolor2,
|
||||
handle_shape = gears.shape.circle,
|
||||
handle_color = beautiful.xcolor2,
|
||||
handle_width = 12,
|
||||
value = 75,
|
||||
forced_width = dpi(239),
|
||||
widget = wibox.widget.slider,
|
||||
}
|
||||
local slider = wibox.widget({
|
||||
bar_shape = helpers.ui.rrect(9),
|
||||
bar_height = 6,
|
||||
bar_color = beautiful.xcolorbase,
|
||||
bar_active_color = beautiful.xcolor2,
|
||||
handle_shape = gears.shape.circle,
|
||||
handle_color = beautiful.xcolor2,
|
||||
handle_width = 12,
|
||||
value = 75,
|
||||
forced_width = dpi(239),
|
||||
widget = wibox.widget.slider,
|
||||
})
|
||||
|
||||
local osd_value = wibox.widget {
|
||||
text = "0%",
|
||||
font = beautiful.font_name.."10",
|
||||
widget = wibox.widget.textbox(),
|
||||
}
|
||||
local icon = wibox.widget {
|
||||
markup = helpers.ui.colorize_text("", beautiful.xcolor2),
|
||||
font = beautiful.font_name.."14",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox(),
|
||||
}
|
||||
local osd_value = wibox.widget({
|
||||
text = "0%",
|
||||
font = beautiful.font_name .. "10",
|
||||
widget = wibox.widget.textbox(),
|
||||
})
|
||||
local icon = wibox.widget({
|
||||
markup = helpers.ui.colorize_text("", beautiful.xcolor2),
|
||||
font = beautiful.font_name .. "14",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox(),
|
||||
})
|
||||
|
||||
local function get_val()
|
||||
awesome.connect_signal("signal::mic", function(vol, muted)
|
||||
if muted then icon.markup = "<span foreground='"..beautiful.xcolor2.."'></span>" icon.font = beautiful.font_name.."14" else
|
||||
--v_slider.color = beautiful.xcolor2
|
||||
icon.markup = "<span foreground='"..beautiful.xcolor2.."'></span>" icon.font = beautiful.font_name.."17"
|
||||
awesome.connect_signal("signal::mic", function(_, muted)
|
||||
if muted then
|
||||
icon.markup = "<span foreground='" .. beautiful.xcolor2 .. "'></span>"
|
||||
icon.font = beautiful.font_name .. "14"
|
||||
else
|
||||
icon.markup = "<span foreground='" .. beautiful.xcolor2 .. "'></span>"
|
||||
icon.font = beautiful.font_name .. "17"
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
get_val()
|
||||
|
||||
icon:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
local script = [[
|
||||
pamixer --source ]] ..microphone.. [[ -t
|
||||
icon:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
local script = [[
|
||||
pamixer --source ]] .. microphone .. [[ -t
|
||||
]]
|
||||
|
||||
awful.spawn(script, false)
|
||||
awesome.emit_signal("widget::update_mic")
|
||||
end)
|
||||
))
|
||||
|
||||
awful.spawn(script, false)
|
||||
awesome.emit_signal("widget::update_mic")
|
||||
end)))
|
||||
|
||||
slider:buttons(gears.table.join(
|
||||
awful.button({}, 4, nil, function()
|
||||
awful.button({}, 4, nil, function()
|
||||
if slider:get_value() > 100 then
|
||||
slider:set_value(100)
|
||||
return
|
||||
|
@ -77,58 +77,46 @@ slider:buttons(gears.table.join(
|
|||
helpers.ui.add_hover_cursor(slider, "hand1")
|
||||
helpers.ui.add_hover_cursor(icon, "hand2")
|
||||
|
||||
local mic_slider = wibox.widget {
|
||||
{
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
icon,
|
||||
},
|
||||
left = 0,
|
||||
right = dpi(14),
|
||||
top = 5,
|
||||
bottom = 5,
|
||||
layout = wibox.container.margin
|
||||
},
|
||||
slider,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
{
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
osd_value,
|
||||
},
|
||||
left = dpi(3),
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
layout = wibox.container.margin
|
||||
},
|
||||
-- layout = wibox.layout.fixed.horizontal,
|
||||
-- spacing = 0,
|
||||
}
|
||||
local mic_slider = wibox.widget({
|
||||
{
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
icon,
|
||||
},
|
||||
left = 0,
|
||||
right = dpi(14),
|
||||
top = 5,
|
||||
bottom = 5,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
slider,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
{
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
osd_value,
|
||||
},
|
||||
left = dpi(3),
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
})
|
||||
|
||||
local update_microphone = function() -- Sets the Volume Correct
|
||||
awful.spawn.easy_async_with_shell("pamixer --source " ..microphone.. " --get-volume", function(stdout)
|
||||
local update_microphone = function() -- Sets the Volume Correct
|
||||
awful.spawn.easy_async_with_shell("pamixer --source " .. microphone .. " --get-volume", function(stdout)
|
||||
slider.value = tonumber(stdout:match("%d+"))
|
||||
end)
|
||||
end
|
||||
|
||||
awesome.connect_signal("widget::update_mic", function()
|
||||
update_microphone()
|
||||
update_microphone()
|
||||
end)
|
||||
|
||||
--slider:connect_signal("property::value", function(_, vol)
|
||||
-- awful.spawn("pamixer --set-volume ".. vol, false)
|
||||
--end)
|
||||
|
||||
--awful.spawn.easy_async_with_shell("pamixer --get-volume", function(stdout)
|
||||
-- local value = string.gsub(stdout, "^%s*(.-)%s*$", "%1")
|
||||
-- vol_slider.value = tonumber(value)
|
||||
--end)
|
||||
|
||||
slider:connect_signal("property::value", function(_, new_value)
|
||||
-- vol_slider.value = new_value
|
||||
awful.spawn("pamixer --source " ..microphone.. " --set-volume " .. new_value, false)
|
||||
local volume_level = slider:get_value()
|
||||
osd_value.text = volume_level .. "%"
|
||||
awful.spawn("pamixer --source " .. microphone .. " --set-volume " .. new_value, false)
|
||||
local volume_level = slider:get_value()
|
||||
osd_value.text = volume_level .. "%"
|
||||
end)
|
||||
return mic_slider
|
||||
|
|
|
@ -5,57 +5,55 @@ local beautiful = require("beautiful")
|
|||
local helpers = require("helpers")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
local slider = wibox.widget {
|
||||
bar_shape = helpers.ui.rrect(9),
|
||||
bar_height = 6,
|
||||
bar_color = beautiful.xcolorbase,
|
||||
bar_active_color = beautiful.xcolor2,
|
||||
handle_shape = gears.shape.circle,
|
||||
handle_color = beautiful.xcolor2,
|
||||
handle_width = 12,
|
||||
value = 75,
|
||||
forced_width = dpi(239),
|
||||
widget = wibox.widget.slider,
|
||||
}
|
||||
local slider = wibox.widget({
|
||||
bar_shape = helpers.ui.rrect(9),
|
||||
bar_height = 6,
|
||||
bar_color = beautiful.xcolorbase,
|
||||
bar_active_color = beautiful.xcolor2,
|
||||
handle_shape = gears.shape.circle,
|
||||
handle_color = beautiful.xcolor2,
|
||||
handle_width = 12,
|
||||
value = 75,
|
||||
forced_width = dpi(239),
|
||||
widget = wibox.widget.slider,
|
||||
})
|
||||
|
||||
local osd_value = wibox.widget {
|
||||
text = "0%",
|
||||
font = beautiful.font_name.."10",
|
||||
widget = wibox.widget.textbox(),
|
||||
}
|
||||
local icon = wibox.widget {
|
||||
markup = helpers.ui.colorize_text("墳 ", beautiful.xcolor2),
|
||||
font = beautiful.font_name.."14",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox(),
|
||||
}
|
||||
local osd_value = wibox.widget({
|
||||
text = "0%",
|
||||
font = beautiful.font_name .. "10",
|
||||
widget = wibox.widget.textbox(),
|
||||
})
|
||||
local icon = wibox.widget({
|
||||
markup = helpers.ui.colorize_text(" ", beautiful.xcolor2),
|
||||
font = beautiful.font_name .. "14",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox(),
|
||||
})
|
||||
|
||||
local function get_val()
|
||||
awesome.connect_signal("signal::volume", function(vol, muted)
|
||||
if muted then icon.markup = "<span foreground='"..beautiful.xcolor2.."'>婢</span>" else
|
||||
--v_slider.color = beautiful.xcolor2
|
||||
icon.markup = "<span foreground='"..beautiful.xcolor2.."'>墳</span>"
|
||||
awesome.connect_signal("signal::volume", function(_, muted)
|
||||
if muted then
|
||||
icon.markup = "<span foreground='" .. beautiful.xcolor2 .. "'></span>"
|
||||
else
|
||||
icon.markup = "<span foreground='" .. beautiful.xcolor2 .. "'></span>"
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
get_val()
|
||||
|
||||
icon:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
local script = [[
|
||||
icon:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
local script = [[
|
||||
pamixer -t
|
||||
]]
|
||||
|
||||
awful.spawn(script, false)
|
||||
awesome.emit_signal("widget::update_vol")
|
||||
end)
|
||||
))
|
||||
|
||||
awful.spawn(script, false)
|
||||
awesome.emit_signal("widget::update_vol")
|
||||
end)))
|
||||
|
||||
slider:buttons(gears.table.join(
|
||||
awful.button({}, 4, nil, function()
|
||||
awful.button({}, 4, nil, function()
|
||||
if slider:get_value() > 100 then
|
||||
slider:set_value(100)
|
||||
return
|
||||
|
@ -74,64 +72,51 @@ slider:buttons(gears.table.join(
|
|||
helpers.ui.add_hover_cursor(slider, "hand1")
|
||||
helpers.ui.add_hover_cursor(icon, "hand2")
|
||||
|
||||
local vol_slider = wibox.widget {
|
||||
{
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
icon,
|
||||
},
|
||||
left = 0,
|
||||
right = dpi(14),
|
||||
top = 5,
|
||||
bottom = 5,
|
||||
layout = wibox.container.margin
|
||||
},
|
||||
slider,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
{
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
osd_value,
|
||||
},
|
||||
left = dpi(3),
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
layout = wibox.container.margin
|
||||
},
|
||||
-- layout = wibox.layout.fixed.horizontal,
|
||||
-- spacing = 0,
|
||||
}
|
||||
local vol_slider = wibox.widget({
|
||||
{
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
icon,
|
||||
},
|
||||
left = 0,
|
||||
right = dpi(14),
|
||||
top = 5,
|
||||
bottom = 5,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
slider,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
{
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
osd_value,
|
||||
},
|
||||
left = dpi(3),
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
})
|
||||
|
||||
local update_volume = function() -- Sets the Volume Correct
|
||||
awful.spawn.easy_async_with_shell("pamixer --get-volume", function(stdout)
|
||||
local update_volume = function() -- Sets the Volume Correct
|
||||
awful.spawn.easy_async_with_shell("pamixer --get-volume", function(stdout)
|
||||
slider.value = tonumber(stdout:match("%d+"))
|
||||
end)
|
||||
end
|
||||
|
||||
awesome.connect_signal("widget::update_vol", function()
|
||||
update_volume()
|
||||
update_volume()
|
||||
end)
|
||||
|
||||
|
||||
awesome.connect_signal("widget::update_vol_slider", function(volume_level)
|
||||
slider:set_value(volume_level)
|
||||
slider:set_value(volume_level)
|
||||
end)
|
||||
|
||||
--slider:connect_signal("property::value", function(_, vol)
|
||||
-- awful.spawn("pamixer --set-volume ".. vol, false)
|
||||
--end)
|
||||
|
||||
--awful.spawn.easy_async_with_shell("pamixer --get-volume", function(stdout)
|
||||
-- local value = string.gsub(stdout, "^%s*(.-)%s*$", "%1")
|
||||
-- vol_slider.value = tonumber(value)
|
||||
--end)
|
||||
|
||||
slider:connect_signal("property::value", function(_, new_value)
|
||||
-- vol_slider.value = new_value
|
||||
awful.spawn("pamixer --set-volume " .. new_value, false)
|
||||
awesome.emit_signal("widget::update_vol_pulse") -- update_vol_pulse doesn't Update Volume Signal
|
||||
local volume_level = slider:get_value()
|
||||
osd_value.text = volume_level .. "%"
|
||||
awesome.emit_signal("widget::update_vol_pulse") -- update_vol_pulse doesn't Update Volume Signal
|
||||
local volume_level = slider:get_value()
|
||||
osd_value.text = volume_level .. "%"
|
||||
end)
|
||||
return vol_slider
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require (... .. ".layout")
|
||||
require (... .. ".notifications")
|
||||
require (... .. ".scratchpad")
|
||||
require (... .. ".volume")
|
||||
require(... .. ".layout")
|
||||
require(... .. ".notifications")
|
||||
require(... .. ".scratchpad")
|
||||
require(... .. ".volume")
|
||||
|
|
|
@ -1,119 +1,134 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local beautiful = require "beautiful"
|
||||
local wibox = require "wibox"
|
||||
local hotkeys_popup = require "awful.hotkeys_popup"
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local beautiful = require("beautiful")
|
||||
local wibox = require("wibox")
|
||||
|
||||
local ll = awful.widget.layoutlist {
|
||||
base_layout = wibox.widget {
|
||||
spacing = 5,
|
||||
forced_num_cols = 4,
|
||||
layout = wibox.layout.grid.vertical,
|
||||
},
|
||||
widget_template = {
|
||||
{
|
||||
{
|
||||
id = 'icon_role',
|
||||
forced_height = 1,
|
||||
forced_width = 1,
|
||||
widget = wibox.widget.imagebox,
|
||||
},
|
||||
margins = 15,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
id = 'background_role',
|
||||
forced_width = 70,
|
||||
forced_height = 70,
|
||||
shape = gears.shape.rounded_rect,
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
}
|
||||
local keys = require("config").keys
|
||||
|
||||
local layout_popup = awful.popup {
|
||||
widget = wibox.widget {
|
||||
ll,
|
||||
margins = 4, --border margins (padding)
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
border_color = beautiful.border_normal,
|
||||
bg = beautiful.bg_normal,
|
||||
border_width = beautiful.border_width,
|
||||
placement = awful.placement.centered,
|
||||
ontop = true,
|
||||
visible = false,
|
||||
shape = gears.shape.rounded_rect
|
||||
}
|
||||
function gears.table.iterate_value(t, value, step_size, filter, start_at)
|
||||
local k = gears.table.hasitem(t, value, true, start_at)
|
||||
if not k then
|
||||
return
|
||||
end
|
||||
local ll = awful.widget.layoutlist({
|
||||
base_layout = wibox.widget({
|
||||
spacing = 5,
|
||||
forced_num_cols = 4,
|
||||
layout = wibox.layout.grid.vertical,
|
||||
}),
|
||||
widget_template = {
|
||||
{
|
||||
{
|
||||
id = "icon_role",
|
||||
forced_height = 1,
|
||||
forced_width = 1,
|
||||
widget = wibox.widget.imagebox,
|
||||
},
|
||||
margins = 15,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
id = "background_role",
|
||||
forced_width = 70,
|
||||
forced_height = 70,
|
||||
shape = gears.shape.rounded_rect,
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
})
|
||||
|
||||
step_size = step_size or 1
|
||||
local new_key = gears.math.cycle(#t, k + step_size)
|
||||
local layout_popup = awful.popup({
|
||||
widget = wibox.widget({
|
||||
ll,
|
||||
margins = 4, --border margins (padding)
|
||||
widget = wibox.container.margin,
|
||||
}),
|
||||
border_color = beautiful.border_normal,
|
||||
bg = beautiful.bg_normal,
|
||||
border_width = beautiful.border_width,
|
||||
placement = awful.placement.centered,
|
||||
ontop = true,
|
||||
visible = false,
|
||||
shape = gears.shape.rounded_rect,
|
||||
})
|
||||
function gears.table.iterate_value(t, value, step_size, filter, _)
|
||||
local k = gears.table.hasitem(t, value)
|
||||
if not k then
|
||||
return
|
||||
end
|
||||
|
||||
if filter and not filter(t[new_key]) then
|
||||
for i = 1, #t do
|
||||
local k2 = gears.math.cycle(#t, new_key + i)
|
||||
if filter(t[k2]) then
|
||||
return t[k2], k2
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
step_size = step_size or 1
|
||||
local new_key = gears.math.cycle(#t, k + step_size)
|
||||
|
||||
return t[new_key], new_key
|
||||
if filter and not filter(t[new_key]) then
|
||||
for i = 1, #t do
|
||||
local k2 = gears.math.cycle(#t, new_key + i)
|
||||
if filter(t[k2]) then
|
||||
return t[k2], k2
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
return t[new_key], new_key
|
||||
end
|
||||
|
||||
-- Timer for Death of PopUp
|
||||
layout_popup.timer = gears.timer {
|
||||
layout_popup.timer = gears.timer({
|
||||
timeout = 0.8,
|
||||
--autostart = true,
|
||||
single_shot = true,
|
||||
callback = function()
|
||||
callback = function()
|
||||
layout_popup.visible = false
|
||||
end
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
function layout_popup.changed()
|
||||
layout_popup.visible = true
|
||||
if not layout_popup.visible then layout_popup.timer:start() else
|
||||
if not layout_popup.visible then
|
||||
layout_popup.timer:start()
|
||||
else
|
||||
layout_popup.timer:again()
|
||||
end
|
||||
end
|
||||
-- Mouse Support -- Disable if not Wanted --
|
||||
layout_popup:connect_signal("mouse::enter", function() layout_popup.timer:stop() end)
|
||||
layout_popup:connect_signal("mouse::leave", function() layout_popup.timer:start() end)
|
||||
layout_popup:connect_signal("mouse::enter", function()
|
||||
layout_popup.timer:stop()
|
||||
end)
|
||||
layout_popup:connect_signal("mouse::leave", function()
|
||||
layout_popup.timer:start()
|
||||
end)
|
||||
-- Make sure you remove the default Mod4+Space and Mod4+Shift+Space
|
||||
-- keybindings before adding this.
|
||||
|
||||
awful.keygrabber {
|
||||
start_callback = function() layout_popup.visible = true end,
|
||||
stop_callback = function() layout_popup.visible = false end,
|
||||
export_keybindings = true,
|
||||
release_event = 'release',
|
||||
stop_key = {'Escape', 'Super_L', 'Super_R'},
|
||||
keybindings = {
|
||||
{{ modkey } , ' ' , function()
|
||||
--layout_popup.timer:again()
|
||||
awful.layout.set(
|
||||
gears.table.iterate_value(ll.layouts, ll.current_layout, 1),
|
||||
--layout_popup.timer:start()
|
||||
layout_popup.changed()
|
||||
)
|
||||
awful.keygrabber({
|
||||
start_callback = function()
|
||||
layout_popup.visible = true
|
||||
end,
|
||||
stop_callback = function()
|
||||
layout_popup.visible = false
|
||||
end,
|
||||
export_keybindings = true,
|
||||
release_event = "release",
|
||||
stop_key = { "Escape", "Super_L", "Super_R" },
|
||||
keybindings = {
|
||||
{
|
||||
{ keys.mod },
|
||||
" ",
|
||||
function()
|
||||
--layout_popup.timer:again()
|
||||
awful.layout.set(
|
||||
gears.table.iterate_value(ll.layouts, ll.current_layout, 1),
|
||||
--layout_popup.timer:start()
|
||||
layout_popup.changed()
|
||||
)
|
||||
end,
|
||||
},
|
||||
|
||||
end},
|
||||
|
||||
{{ modkey, 'Shift' } , ' ' , function()
|
||||
--layout_popup.timer:again()
|
||||
awful.layout.set(
|
||||
gears.table.iterate_value(ll.layouts, ll.current_layout, -1),
|
||||
--layout_popup.timer:start()
|
||||
layout_popup.changed()
|
||||
)
|
||||
|
||||
end},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
{ keys.mod, "Shift" },
|
||||
" ",
|
||||
function()
|
||||
--layout_popup.timer:again()
|
||||
awful.layout.set(
|
||||
gears.table.iterate_value(ll.layouts, ll.current_layout, -1),
|
||||
--layout_popup.timer:start()
|
||||
layout_popup.changed()
|
||||
)
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
@ -55,9 +55,9 @@ naughty.connect_signal("request::display", function(n)
|
|||
--- table of icons
|
||||
local app_icons = {
|
||||
["firefox"] = { icon = "" },
|
||||
["discord"] = { icon = "ﭮ" },
|
||||
["music"] = { icon = "ﱘ" },
|
||||
["screenshot tool"] = { icon = "" },
|
||||
["discord"] = { icon = "" },
|
||||
["music"] = { icon = "" },
|
||||
["screenshot tool"] = { icon = "" },
|
||||
}
|
||||
|
||||
local app_icon = nil
|
||||
|
@ -66,7 +66,7 @@ naughty.connect_signal("request::display", function(n)
|
|||
if app_icons[tolow(n.app_name)] then
|
||||
app_icon = app_icons[tolow(n.app_name)].icon
|
||||
else
|
||||
app_icon = ""
|
||||
app_icon = ""
|
||||
end
|
||||
|
||||
local app_icon_n = wibox.widget({
|
||||
|
@ -121,30 +121,27 @@ naughty.connect_signal("request::display", function(n)
|
|||
layout = wibox.layout.stack,
|
||||
})
|
||||
|
||||
local app_name = wibox.widget {
|
||||
font = beautiful.font_name.."Bold 12",
|
||||
local app_name = wibox.widget({
|
||||
font = beautiful.font_name .. "Bold 12",
|
||||
text = n.app_name:gsub("^%l", string.upper),
|
||||
widget = wibox.widget.textbox,
|
||||
}
|
||||
})
|
||||
|
||||
local dismiss = wibox.widget {
|
||||
local dismiss = wibox.widget({
|
||||
{
|
||||
font = beautiful.font_name.."Bold 10",
|
||||
markup = helpers.ui.colorize_text("", beautiful.xcolor2),
|
||||
widget = wibox.widget.textbox,
|
||||
valign = center,
|
||||
align = center,
|
||||
font = beautiful.font_name .. "Bold 10",
|
||||
markup = helpers.ui.colorize_text("", beautiful.xcolor2),
|
||||
widget = wibox.widget.textbox,
|
||||
valign = "center",
|
||||
align = "center",
|
||||
},
|
||||
margins = dpi(4),
|
||||
widget = wibox.container.margin,
|
||||
}
|
||||
|
||||
dismiss:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
n:destroy(naughty.notification_closed_reason.dismissed_by_user)
|
||||
end)
|
||||
))
|
||||
})
|
||||
|
||||
dismiss:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
n:destroy(naughty.notification_closed_reason.dismissed_by_user)
|
||||
end)))
|
||||
|
||||
local timeout_arc = wibox.widget({
|
||||
widget = wibox.container.arcchart,
|
||||
|
@ -173,7 +170,7 @@ naughty.connect_signal("request::display", function(n)
|
|||
dismiss,
|
||||
})
|
||||
local title2 = wibox.widget.textbox()
|
||||
title2.font = beautiful.font_name.."Bold 11"
|
||||
title2.font = beautiful.font_name .. "Bold 11"
|
||||
title2.text = n.title
|
||||
|
||||
local title = wibox.widget({
|
||||
|
@ -185,7 +182,7 @@ naughty.connect_signal("request::display", function(n)
|
|||
})
|
||||
|
||||
local message2 = wibox.widget.textbox()
|
||||
message2.font = beautiful.font_name.."11"
|
||||
message2.font = beautiful.font_name .. "11"
|
||||
message2.text = n.message
|
||||
|
||||
local message = wibox.widget({
|
||||
|
@ -207,7 +204,7 @@ naughty.connect_signal("request::display", function(n)
|
|||
{
|
||||
{
|
||||
id = "text_role",
|
||||
font = "FiraCode Nerd Font 10",
|
||||
font = beautiful.font_name .. "10",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
left = dpi(6),
|
||||
|
@ -232,8 +229,6 @@ naughty.connect_signal("request::display", function(n)
|
|||
notification = n,
|
||||
type = "notification",
|
||||
cursor = "hand2",
|
||||
--- For antialiasing: The real shape is set in widget_template
|
||||
--shape = gears.shape.rectangle,
|
||||
shape = helpers.ui.rrect(12),
|
||||
border_color = beautiful.xcolorS0,
|
||||
border_width = dpi(3),
|
||||
|
@ -299,7 +294,7 @@ naughty.connect_signal("request::display", function(n)
|
|||
})
|
||||
|
||||
--- Don't destroy the notification on click ---
|
||||
widget.buttons = {}
|
||||
widget.buttons = {}
|
||||
|
||||
--- Disables Hand Cursor in Whole wibox ---
|
||||
helpers.ui.add_hover_cursor(widget, "left_ptr")
|
||||
|
@ -307,13 +302,12 @@ naughty.connect_signal("request::display", function(n)
|
|||
--- Adds Close Cursor on Close Sign ---
|
||||
helpers.ui.add_hover_cursor(dismiss, "hand2")
|
||||
|
||||
|
||||
local anim = animation:new({
|
||||
duration = n.timeout,
|
||||
target = 100,
|
||||
easing = animation.easing.linear,
|
||||
easing = animation.easing.linear,
|
||||
reset_on_stop = false,
|
||||
update = function(self, pos)
|
||||
update = function(_, pos)
|
||||
timeout_arc.value = pos
|
||||
end,
|
||||
})
|
||||
|
@ -331,7 +325,7 @@ naughty.connect_signal("request::display", function(n)
|
|||
widget:connect_signal("mouse::leave", function()
|
||||
anim:start()
|
||||
end)
|
||||
|
||||
|
||||
local notification_height = widget.height + beautiful.notification_spacing
|
||||
local total_notifications_height = #naughty.active * notification_height
|
||||
|
||||
|
@ -342,10 +336,10 @@ naughty.connect_signal("request::display", function(n)
|
|||
anim:start()
|
||||
|
||||
--- Destroy popups notifs if dont_disturb mode is on
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
if _G.dnd_state then
|
||||
naughty.destroy_all_notifications(nil, 1)
|
||||
end
|
||||
end)
|
||||
|
||||
require(... .. ".error")
|
||||
--require(... .. ".playerctl")
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
local naughty = require("naughty")
|
||||
local playerctl_daemon = require("signals.playerctl")
|
||||
local beautiful = require("beautiful")
|
||||
playerctl_daemon:connect_signal("metadata", function(_, title, artist, album_path, album, new, player_name)
|
||||
|
||||
playerctl_daemon:connect_signal("metadata", function(_, title, artist, album_path, _, new, _)
|
||||
if album_path == "" then -- Sets Image for Notification --
|
||||
album_path = beautiful.music
|
||||
end
|
||||
|
|
|
@ -3,35 +3,35 @@ local rubato = require("lib.rubato") -- Totally optional, only required if you a
|
|||
|
||||
-- These are example rubato tables. You can use one for just y, just x, or both.
|
||||
-- The duration and easing is up to you. Please check out the rubato docs to learn more.
|
||||
local anim_y = rubato.timed {
|
||||
pos = -1000,
|
||||
rate = 60,
|
||||
--easing = rubato.quadratic,
|
||||
intro = 0.2,
|
||||
duration = 0.4,
|
||||
awestore_compat = true -- This option must be set to true.
|
||||
}
|
||||
local anim_y = rubato.timed({
|
||||
pos = -1000,
|
||||
rate = 60,
|
||||
--easing = rubato.quadratic,
|
||||
intro = 0.2,
|
||||
duration = 0.4,
|
||||
awestore_compat = true, -- This option must be set to true.
|
||||
})
|
||||
|
||||
local anim_x = rubato.timed {
|
||||
pos = 1720,
|
||||
rate = 60,
|
||||
easing = rubato.quadratic,
|
||||
intro = 0.1,
|
||||
duration = 0.3,
|
||||
awestore_compat = true -- This option must be set to true.
|
||||
}
|
||||
local anim_x = rubato.timed({
|
||||
pos = 1720,
|
||||
rate = 60,
|
||||
easing = rubato.quadratic,
|
||||
intro = 0.1,
|
||||
duration = 0.3,
|
||||
awestore_compat = true, -- This option must be set to true.
|
||||
})
|
||||
|
||||
local term_scratch = bling.module.scratchpad {
|
||||
command = "alacritty --class spad", -- How to spawn the scratchpad
|
||||
rule = { instance = "spad" }, -- The rule that the scratchpad will be searched by
|
||||
sticky = true, -- Whether the scratchpad should be sticky
|
||||
autoclose = true, -- Whether it should hide itself when losing focus
|
||||
floating = true, -- Whether it should be floating (MUST BE TRUE FOR ANIMATIONS)
|
||||
geometry = {x=456, y=33, height=600, width=1000}, -- The geometry in a floating state
|
||||
reapply = true, -- Whether all those properties should be reapplied on every new opening of the scratchpad (MUST BE TRUE FOR ANIMATIONS)
|
||||
dont_focus_before_close = false, -- When set to true, the scratchpad will be closed by the toggle function regardless of whether its focused or not. When set to false, the toggle function will first bring the scratchpad into focus and only close it on a second call
|
||||
rubato = {y = anim_y} -- Optional. This is how you can pass in the rubato tables for animations. If you don't want animations, you can ignore this option.
|
||||
}
|
||||
local term_scratch = bling.module.scratchpad({
|
||||
command = "alacritty --class spad", -- How to spawn the scratchpad
|
||||
rule = { instance = "spad" }, -- The rule that the scratchpad will be searched by
|
||||
sticky = true, -- Whether the scratchpad should be sticky
|
||||
autoclose = true, -- Whether it should hide itself when losing focus
|
||||
floating = true, -- Whether it should be floating (MUST BE TRUE FOR ANIMATIONS)
|
||||
geometry = { x = 456, y = 33, height = 600, width = 1000 }, -- The geometry in a floating state
|
||||
reapply = true, -- Whether all those properties should be reapplied on every new opening of the scratchpad (MUST BE TRUE FOR ANIMATIONS)
|
||||
dont_focus_before_close = false, -- When set to true, the scratchpad will be closed by the toggle function regardless of whether its focused or not. When set to false, the toggle function will first bring the scratchpad into focus and only close it on a second call
|
||||
rubato = { y = anim_y }, -- Optional. This is how you can pass in the rubato tables for animations. If you don't want animations, you can ignore this option.
|
||||
})
|
||||
awesome.connect_signal("scratchpad::toggle", function()
|
||||
term_scratch:toggle()
|
||||
term_scratch:toggle()
|
||||
end)
|
||||
|
|
|
@ -4,13 +4,13 @@ local beautiful = require("beautiful")
|
|||
local xresources = require("beautiful.xresources")
|
||||
local dpi = xresources.apply_dpi
|
||||
local wibox = require("wibox")
|
||||
local helpers = require ("helpers")
|
||||
local helpers = require("helpers")
|
||||
|
||||
--- Volume OSD
|
||||
--- ~~~~~~~~~~
|
||||
local icon = wibox.widget({
|
||||
{
|
||||
id = 'icon2',
|
||||
id = "icon2",
|
||||
image = beautiful.volume_on,
|
||||
resize = true,
|
||||
widget = wibox.widget.imagebox,
|
||||
|
@ -61,7 +61,7 @@ local slider_osd = wibox.widget({
|
|||
|
||||
local vol_osd_slider = slider_osd.vol_osd_slider
|
||||
vol_osd_slider:buttons(gears.table.join(
|
||||
awful.button({}, 4, nil, function()
|
||||
awful.button({}, 4, nil, function()
|
||||
if vol_osd_slider:get_value() > 100 then
|
||||
vol_osd_slider:set_value(100)
|
||||
return
|
||||
|
@ -79,15 +79,15 @@ vol_osd_slider:buttons(gears.table.join(
|
|||
|
||||
helpers.ui.add_hover_cursor(vol_osd_slider, "hand1")
|
||||
|
||||
local update_volume = function() -- Sets the Volume Correct
|
||||
awful.spawn.easy_async_with_shell("pamixer --get-volume", function(stdout)
|
||||
local update_volume = function() -- Sets the Volume Correct
|
||||
awful.spawn.easy_async_with_shell("pamixer --get-volume", function(stdout)
|
||||
vol_osd_slider.value = tonumber(stdout:match("%d+"))
|
||||
end)
|
||||
end
|
||||
awesome.connect_signal("widget::update_vol", function()
|
||||
update_volume()
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
update_volume()
|
||||
vol_osd_slider:connect_signal("property::value", function(_, new_value)
|
||||
local volume_level = vol_osd_slider:get_value()
|
||||
|
@ -121,7 +121,7 @@ local volume_osd_height = dpi(250)
|
|||
local volume_osd_width = dpi(250)
|
||||
|
||||
screen.connect_signal("request::desktop_decoration", function(s)
|
||||
local s = s or {}
|
||||
s = s or {}
|
||||
s.show_vol_osd = false
|
||||
|
||||
s.volume_osd_overlay = awful.popup({
|
||||
|
@ -209,20 +209,30 @@ local placement_placer = function()
|
|||
end
|
||||
|
||||
-- Get Vol
|
||||
function get_vol()
|
||||
script = 'pamixer --get-volume'
|
||||
script2 = 'pamixer --get-mute'
|
||||
awful.spawn.easy_async_with_shell(script, function(vol)
|
||||
awful.spawn.easy_async_with_shell(script2, function(is_mute)
|
||||
if is_mute:match("true") then muted = true else
|
||||
muted = false
|
||||
end
|
||||
local function get_vol()
|
||||
local script = "pamixer --get-volume"
|
||||
local script2 = "pamixer --get-mute"
|
||||
awful.spawn.easy_async_with_shell(script, function()
|
||||
awful.spawn.easy_async_with_shell(script2, function(is_mute)
|
||||
local muted
|
||||
|
||||
if muted then vol_osd_slider.bar_active_color = beautiful.xcolor10 vol_osd_slider.handle_color = beautiful.xcolor10 icon3.image = beautiful.volume_off else
|
||||
vol_osd_slider.bar_active_color = beautiful.xcolor2 vol_osd_slider.handle_color = beautiful.xcolor2 icon3.image = beautiful.volume_on
|
||||
end
|
||||
end)
|
||||
end)
|
||||
if is_mute:match("true") then
|
||||
muted = true
|
||||
else
|
||||
muted = false
|
||||
end
|
||||
|
||||
if muted then
|
||||
vol_osd_slider.bar_active_color = beautiful.xcolor10
|
||||
vol_osd_slider.handle_color = beautiful.xcolor10
|
||||
icon3.image = beautiful.volume_off
|
||||
else
|
||||
vol_osd_slider.bar_active_color = beautiful.xcolor2
|
||||
vol_osd_slider.handle_color = beautiful.xcolor2
|
||||
icon3.image = beautiful.volume_on
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
awesome.connect_signal("module::volume_osd:show", function(bool)
|
||||
|
@ -266,4 +276,3 @@ volume.mute = function()
|
|||
end
|
||||
|
||||
return volume
|
||||
|
||||
|
|
|
@ -1,82 +1,66 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local beautiful = require "beautiful"
|
||||
local wibox = require "wibox"
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
|
||||
--- Rounded Corners Client Side ---
|
||||
-- Use Picom If you Can --
|
||||
-- Use Picom If you Can --
|
||||
local function shapemanager(c)
|
||||
c.shape = function(cr, w, h)
|
||||
if not c.fullscreen and not c.maximized then
|
||||
gears.shape.rounded_rect(cr, w, h, 15)
|
||||
else
|
||||
gears.shape.rounded_rect(cr, w, h, 0)
|
||||
end
|
||||
end
|
||||
c.shape = function(cr, w, h)
|
||||
if not c.fullscreen and not c.maximized then
|
||||
gears.shape.rounded_rect(cr, w, h, 15)
|
||||
else
|
||||
gears.shape.rounded_rect(cr, w, h, 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- Places every Floating Client in Middle ---
|
||||
-- if enabled lib.savefloats won't work --
|
||||
--local function floatmanager(c)
|
||||
-- if c.floating then
|
||||
-- awful.placement.centered(c)
|
||||
-- end
|
||||
--end
|
||||
|
||||
client.connect_signal("property::fullscreen", function(c) shapemanager(c) end)
|
||||
--client.connect_signal("property::floating", function(c) floatmanager(c) end)
|
||||
--client.connect_signal("request::geometry", function(c) shapemanager(c) end)
|
||||
--client.connect_signal("request::activate", function(c) shapemanager(c) end)
|
||||
client.connect_signal("property::fullscreen", function(c)
|
||||
shapemanager(c)
|
||||
end)
|
||||
|
||||
-- Add a titlebar if titlebars_enabled is set to true in the rules.
|
||||
client.connect_signal("request::titlebars", function(c)
|
||||
-- buttons for the titlebar
|
||||
local buttons = gears.table.join(
|
||||
awful.button({}, 1, function()
|
||||
c:activate {context = "titlebar", action = "mouse_move"}
|
||||
-- c:emit_signal("request::activate", "titlebar", {raise = true})
|
||||
-- awful.mouse.client.move(c)
|
||||
end),
|
||||
awful.button({}, 3, function()
|
||||
c:activate {context = "titlebar", action = "mouse_resize"}
|
||||
-- c:emit_signal("request::activate", "titlebar", {raise = true})
|
||||
--awful.mouse.client.resize(c)
|
||||
end)
|
||||
)
|
||||
-- buttons for the titlebar
|
||||
local buttons = gears.table.join(
|
||||
awful.button({}, 1, function()
|
||||
c:activate({ context = "titlebar", action = "mouse_move" })
|
||||
end),
|
||||
awful.button({}, 3, function()
|
||||
c:activate({ context = "titlebar", action = "mouse_resize" })
|
||||
end)
|
||||
)
|
||||
|
||||
local titlebar_top = awful.titlebar(c, {
|
||||
size = 30,
|
||||
expand = "none",
|
||||
})
|
||||
local left = {
|
||||
buttons = buttons,
|
||||
--awful.titlebar.widget.ontopbutton(c),
|
||||
layout = wibox.layout.fixed.horizontal()
|
||||
}
|
||||
local middle = {
|
||||
buttons = buttons,
|
||||
layout = wibox.layout.fixed.horizontal()
|
||||
}
|
||||
local right = {
|
||||
awful.titlebar.widget.maximizedbutton(c),
|
||||
awful.titlebar.widget.minimizebutton(c),
|
||||
awful.titlebar.widget.closebutton(c),
|
||||
spacing = 11.5,
|
||||
layout = wibox.layout.fixed.horizontal()
|
||||
}
|
||||
local titlebar_top = awful.titlebar(c, {
|
||||
size = 30,
|
||||
expand = "none",
|
||||
})
|
||||
local left = {
|
||||
buttons = buttons,
|
||||
layout = wibox.layout.fixed.horizontal(),
|
||||
}
|
||||
local middle = {
|
||||
buttons = buttons,
|
||||
layout = wibox.layout.fixed.horizontal(),
|
||||
}
|
||||
local right = {
|
||||
awful.titlebar.widget.maximizedbutton(c),
|
||||
awful.titlebar.widget.minimizebutton(c),
|
||||
awful.titlebar.widget.closebutton(c),
|
||||
spacing = 11.5,
|
||||
layout = wibox.layout.fixed.horizontal(),
|
||||
}
|
||||
|
||||
titlebar_top : setup {
|
||||
{
|
||||
left,
|
||||
middle,
|
||||
right,
|
||||
layout = wibox.layout.align.horizontal()
|
||||
},
|
||||
left = 13.5,
|
||||
right = 13.5,
|
||||
top = 7.4,
|
||||
bottom = 7.4,
|
||||
-- layout = wibox.layout.align.horizontal
|
||||
layout = wibox.container.margin
|
||||
}
|
||||
titlebar_top:setup({
|
||||
{
|
||||
left,
|
||||
middle,
|
||||
right,
|
||||
layout = wibox.layout.align.horizontal(),
|
||||
},
|
||||
left = 13.5,
|
||||
right = 13.5,
|
||||
top = 7.4,
|
||||
bottom = 7.4,
|
||||
layout = wibox.container.margin,
|
||||
})
|
||||
end)
|
||||
|
|
|
@ -1,20 +1,11 @@
|
|||
-- Standard awesome library --
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
|
||||
local widgets = require ("ui.top-panel.widgets")
|
||||
local bling = require ("lib.bling")
|
||||
local helpers = require "helpers"
|
||||
|
||||
local widgets = require("ui.top-panel.widgets")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
local menubar = require("menubar")
|
||||
local hotkeys_popup = require("awful.hotkeys_popup")
|
||||
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
|
||||
local clock = widgets.clock
|
||||
local date = widgets.date
|
||||
local cpu = widgets.cpu
|
||||
|
@ -23,126 +14,107 @@ local keyboard = widgets.keyboard
|
|||
local mem = widgets.mem
|
||||
local menu = widgets.menu
|
||||
local systray = widgets.systray
|
||||
local promptbox = widgets.promptbox
|
||||
local audio = widgets.audio
|
||||
local seperator = widgets.seperator
|
||||
local taglist = widgets.taglist
|
||||
local tasklist = widgets.tasklist
|
||||
local layoutbox = widgets.layoutbox
|
||||
local power = widgets.power
|
||||
|
||||
|
||||
local function create_icon(i, c) --Icon Creation
|
||||
local widget = {
|
||||
{
|
||||
font = beautiful.font_name.."12.5",
|
||||
text = ' ' .. i,
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
fg = c,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
return widget
|
||||
end
|
||||
local widget = {
|
||||
{
|
||||
font = beautiful.font_name .. "12.5",
|
||||
text = " " .. i,
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
fg = c,
|
||||
widget = wibox.container.background,
|
||||
}
|
||||
return widget
|
||||
end
|
||||
|
||||
-- Create Icons with Color --
|
||||
local calendar_icon = create_icon('', beautiful.xcolor5)
|
||||
local clock_icon = create_icon('', beautiful.xcolor12)
|
||||
local keyboard_icon = create_icon('', beautiful.xcolor4)
|
||||
local calendar_icon = create_icon("", beautiful.xcolor5)
|
||||
local clock_icon = create_icon("", beautiful.xcolor12)
|
||||
local keyboard_icon = create_icon("", beautiful.xcolor4)
|
||||
|
||||
screen.connect_signal("request::desktop_decoration", function(s)
|
||||
-- Create Clock with Colerfull Widget --
|
||||
local clockdate = wibox.widget {
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
calendar_icon,
|
||||
date,
|
||||
clock_icon,
|
||||
clock, -- Middle widget
|
||||
-- Create Clock with Colerfull Widget --
|
||||
local clockdate = wibox.widget({
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
calendar_icon,
|
||||
date,
|
||||
clock_icon,
|
||||
clock, -- Middle widget
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
local tasklist = wibox.widget {
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
s.tasklist, -- needs to be here (under the screen.connect_signal) bc of the s
|
||||
},
|
||||
forced_width = 300,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
|
||||
}
|
||||
local tasklist = wibox.widget({
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
s.tasklist, -- needs to be here (under the screen.connect_signal) bc of the s
|
||||
},
|
||||
forced_width = 300,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
})
|
||||
|
||||
-- Create the wibox
|
||||
s.mywibox = awful.wibar({
|
||||
position = "top",
|
||||
screen = s,
|
||||
|
||||
|
||||
|
||||
-- Create the wibox
|
||||
s.mywibox = awful.wibar {
|
||||
position = "top",
|
||||
screen = s,
|
||||
|
||||
widget = {
|
||||
layout = wibox.layout.align.horizontal,
|
||||
expand = "none",
|
||||
{
|
||||
{-- Left widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
menu,
|
||||
--launcher,
|
||||
seperator,
|
||||
s.taglist,
|
||||
seperator,
|
||||
-- s.tasklist,
|
||||
tasklist,
|
||||
},
|
||||
left = 5, --Padding
|
||||
right = 0,
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
{
|
||||
layout = wibox.layout.align.horizontal,
|
||||
clockdate,
|
||||
},
|
||||
left = 0,
|
||||
right = 0,
|
||||
top = 1,
|
||||
bottom = 1,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{ -- Right widgets
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
--temp.text,
|
||||
systray,
|
||||
seperator,
|
||||
audio,
|
||||
mem,
|
||||
cpu,
|
||||
disk,
|
||||
keyboard_icon,
|
||||
keyboard,
|
||||
--awful.widget.systray(),
|
||||
--power,
|
||||
layoutbox,
|
||||
--pacing = 2,
|
||||
},
|
||||
left = 0,
|
||||
right = 2,
|
||||
top = 1,
|
||||
bottom = 1,
|
||||
layout = wibox.container.margin
|
||||
},
|
||||
|
||||
}
|
||||
widget = {
|
||||
layout = wibox.layout.align.horizontal,
|
||||
expand = "none",
|
||||
{
|
||||
{ -- Left widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
menu,
|
||||
seperator,
|
||||
s.taglist,
|
||||
seperator,
|
||||
tasklist,
|
||||
},
|
||||
left = 5, --Padding
|
||||
right = 0,
|
||||
top = 2,
|
||||
bottom = 2,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
{
|
||||
layout = wibox.layout.align.horizontal,
|
||||
clockdate,
|
||||
},
|
||||
left = 0,
|
||||
right = 0,
|
||||
top = 1,
|
||||
bottom = 1,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
{ -- Right widgets
|
||||
{
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
systray,
|
||||
seperator,
|
||||
audio,
|
||||
mem,
|
||||
cpu,
|
||||
disk,
|
||||
keyboard_icon,
|
||||
keyboard,
|
||||
layoutbox,
|
||||
},
|
||||
left = 0,
|
||||
right = 2,
|
||||
top = 1,
|
||||
bottom = 1,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
},
|
||||
})
|
||||
s.border2 = awful.wibar({
|
||||
position = "top",
|
||||
screen = s,
|
||||
bg = beautiful.xcolorS0,
|
||||
height = dpi(2),
|
||||
})
|
||||
end)
|
||||
|
||||
}
|
||||
s.border2 = awful.wibar {
|
||||
position = "top",
|
||||
screen = s,
|
||||
bg = "#313244",
|
||||
height = dpi(2),
|
||||
}
|
||||
|
||||
end)
|
|
@ -1,31 +1,19 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local wibox = require "wibox"
|
||||
local beautiful = require "beautiful"
|
||||
local naughty = require "naughty"
|
||||
local menubar = require "menubar"
|
||||
local hotkeys_popup = require "awful.hotkeys_popup"
|
||||
require "awful.hotkeys_popup.keys"
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
require("awful.hotkeys_popup.keys")
|
||||
|
||||
-- Clock
|
||||
|
||||
local clock = wibox.widget.textbox()
|
||||
clock.font = beautiful.font_name.."11"
|
||||
gears.timer {
|
||||
clock.font = beautiful.font_name .. "11"
|
||||
gears.timer({
|
||||
timeout = 60,
|
||||
autostart = true,
|
||||
call_now = true,
|
||||
callback = function()
|
||||
clock.markup = os.date(" %H:%M")
|
||||
end
|
||||
}
|
||||
|
||||
--local month_calendar = awful.widget.calendar_popup.month()
|
||||
--month_calendar.position =
|
||||
--month_calendar:attach( clock, "tm" )
|
||||
--clock:connect_signal("button::release",
|
||||
--function()
|
||||
-- month_calendar.position = 'tm',
|
||||
-- month_calendar:toggle()
|
||||
--end)
|
||||
clock.markup = os.date(" %I:%M %p")
|
||||
end,
|
||||
})
|
||||
|
||||
return clock
|
||||
|
|
|
@ -1,46 +1,40 @@
|
|||
local awful = require "awful"
|
||||
local wibox = require "wibox"
|
||||
local gears = require "gears"
|
||||
local beautiful = require "beautiful"
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
local helpers = require "helpers"
|
||||
|
||||
-- Icon
|
||||
local icon = wibox.widget.textbox()
|
||||
icon.font = beautiful.font_name.."12.5"
|
||||
icon.align = 'center'
|
||||
icon.markup = "<span foreground='"..beautiful.xcolor9.."'></span>"
|
||||
icon.font = beautiful.font_name .. "12.5"
|
||||
icon.align = "center"
|
||||
icon.markup = "<span foreground='" .. beautiful.xcolor9 .. "'></span>"
|
||||
|
||||
-- Uptime
|
||||
local cpu = wibox.widget.textbox()
|
||||
cpu.font = beautiful.font_name.."10"
|
||||
cpu.align = 'center'
|
||||
|
||||
cpu.font = beautiful.font_name .. "10"
|
||||
cpu.align = "center"
|
||||
|
||||
local function get_val()
|
||||
awesome.connect_signal("signal::cpu", function(cpu_perc)
|
||||
cpu.markup = tonumber(cpu_perc).. "%"
|
||||
end)
|
||||
end
|
||||
cpu.markup = tonumber(cpu_perc) .. "%"
|
||||
end)
|
||||
end
|
||||
|
||||
get_val()
|
||||
|
||||
|
||||
local full = wibox.widget {
|
||||
local full = wibox.widget({
|
||||
{
|
||||
{
|
||||
icon,
|
||||
cpu,
|
||||
spacing = dpi(8),
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
icon,
|
||||
cpu,
|
||||
spacing = dpi(8),
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
left = 1,
|
||||
right = 0,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
forced_width = 73, -- Makes it fixed and not Moves Whole Bar
|
||||
forced_width = 73, -- Makes it fixed and not Moves Whole Bar
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
return full
|
||||
|
||||
|
|
|
@ -1,23 +1,19 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local wibox = require "wibox"
|
||||
local beautiful = require "beautiful"
|
||||
local naughty = require "naughty"
|
||||
local menubar = require "menubar"
|
||||
local hotkeys_popup = require "awful.hotkeys_popup"
|
||||
require "awful.hotkeys_popup.keys"
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
require("awful.hotkeys_popup.keys")
|
||||
|
||||
-- Clock
|
||||
|
||||
local date = wibox.widget.textbox()
|
||||
date.font = beautiful.font_name.."11"
|
||||
gears.timer {
|
||||
date.font = beautiful.font_name .. "11"
|
||||
gears.timer({
|
||||
timeout = 60,
|
||||
autostart = true,
|
||||
call_now = true,
|
||||
callback = function()
|
||||
date.markup = os.date(" %a %b %d")
|
||||
end
|
||||
}
|
||||
|
||||
end,
|
||||
})
|
||||
|
||||
return date
|
||||
|
|
|
@ -1,43 +1,36 @@
|
|||
local awful = require "awful"
|
||||
local wibox = require "wibox"
|
||||
local gears = require "gears"
|
||||
local beautiful = require "beautiful"
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
local helpers = require "helpers"
|
||||
|
||||
-- Icon
|
||||
local icon = wibox.widget.textbox()
|
||||
icon.font = beautiful.font_name.."12.5"
|
||||
icon.align = 'center'
|
||||
icon.markup = "<span foreground='"..beautiful.xcolor7.."'></span>"
|
||||
icon.font = beautiful.font_name .. "12.5"
|
||||
icon.align = "center"
|
||||
icon.markup = "<span foreground='" .. beautiful.xcolor7 .. "'></span>"
|
||||
|
||||
-- Uptime
|
||||
local disk = wibox.widget.textbox()
|
||||
disk.font = beautiful.font_name.."10"
|
||||
disk.align = 'center'
|
||||
|
||||
disk.font = beautiful.font_name .. "10"
|
||||
disk.align = "center"
|
||||
|
||||
local function get_val()
|
||||
awesome.connect_signal("signal::disk", function(disk_perc)
|
||||
disk.markup = tonumber(disk_perc).. "%"
|
||||
end)
|
||||
end
|
||||
|
||||
disk.markup = tonumber(disk_perc) .. "%"
|
||||
end)
|
||||
end
|
||||
|
||||
get_val()
|
||||
|
||||
|
||||
local full = wibox.widget {
|
||||
local full = wibox.widget({
|
||||
{
|
||||
icon,
|
||||
disk,
|
||||
spacing = dpi(8),
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
icon,
|
||||
disk,
|
||||
spacing = dpi(8),
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
left = 1,
|
||||
right = 8,
|
||||
layout = wibox.container.margin
|
||||
}
|
||||
|
||||
right = 8,
|
||||
layout = wibox.container.margin,
|
||||
})
|
||||
|
||||
return full
|
||||
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
return {
|
||||
clock = require (... .. ".clock"),
|
||||
cpu = require (... .. ".cpu"),
|
||||
date = require (... .. ".date"),
|
||||
disk = require (... .. ".disk"),
|
||||
keyboard = require (... .. ".keyboard"),
|
||||
layoutbox = require (... .. ".layoutbox"),
|
||||
mem = require (... .. ".mem"),
|
||||
menu = require (... .. ".menu"),
|
||||
systray = require (... .. ".systray"),
|
||||
promptbox = require (... .. ".promptbox"),
|
||||
audio = require (... .. ".pulseaudio"),
|
||||
seperator = require (... .. ".seperator"),
|
||||
taglist = require (... .. ".taglist"),
|
||||
tasklist = require (... .. ".tasklist"),
|
||||
power = require (... .. ".power"),
|
||||
clock = require(... .. ".clock"),
|
||||
cpu = require(... .. ".cpu"),
|
||||
date = require(... .. ".date"),
|
||||
disk = require(... .. ".disk"),
|
||||
keyboard = require(... .. ".keyboard"),
|
||||
layoutbox = require(... .. ".layoutbox"),
|
||||
mem = require(... .. ".mem"),
|
||||
menu = require(... .. ".menu"),
|
||||
systray = require(... .. ".systray"),
|
||||
promptbox = require(... .. ".promptbox"),
|
||||
audio = require(... .. ".pulseaudio"),
|
||||
seperator = require(... .. ".seperator"),
|
||||
taglist = require(... .. ".taglist"),
|
||||
tasklist = require(... .. ".tasklist"),
|
||||
power = require(... .. ".power"),
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local wibox = require "wibox"
|
||||
local beautiful = require "beautiful"
|
||||
local awful = require("awful")
|
||||
|
||||
-- Keyboard map indicator and switcher
|
||||
local keyboardlayout = awful.widget.keyboardlayout()
|
||||
|
||||
return keyboardlayout
|
||||
|
||||
return keyboardlayout
|
|
@ -1,7 +1,8 @@
|
|||
local awful = require "awful"
|
||||
local beautiful = require "beautiful"
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
local menu = require("main.menu")
|
||||
|
||||
local launcher = awful.widget.launcher({ image = beautiful.awesome_icon,
|
||||
menu = mymainmenu })
|
||||
local launcher = awful.widget.launcher({ image = beautiful.awesome_icon, menu = menu })
|
||||
|
||||
return launcher
|
||||
|
||||
return launcher
|
|
@ -1,13 +1,20 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local beautiful = require "beautiful"
|
||||
local awful = require("awful")
|
||||
|
||||
local layoutbox = awful.widget.layoutbox ({
|
||||
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),
|
||||
}
|
||||
local layoutbox = awful.widget.layoutbox({
|
||||
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),
|
||||
},
|
||||
})
|
||||
return layoutbox
|
||||
return layoutbox
|
||||
|
||||
|
|
|
@ -1,53 +1,40 @@
|
|||
local awful = require "awful"
|
||||
local wibox = require "wibox"
|
||||
local gears = require "gears"
|
||||
local beautiful = require "beautiful"
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
local helpers = require "helpers"
|
||||
|
||||
-- Icon
|
||||
local icon = wibox.widget.textbox()
|
||||
icon.font = beautiful.font_name.."12.5"
|
||||
icon.align = 'center'
|
||||
icon.markup = "<span foreground='"..beautiful.xcolor6.."'></span>"
|
||||
icon.font = beautiful.font_name .. "12.5"
|
||||
icon.align = "center"
|
||||
icon.markup = "<span foreground='" .. beautiful.xcolor6 .. "'></span>"
|
||||
|
||||
-- Uptime
|
||||
local mem = wibox.widget.textbox()
|
||||
mem.font = beautiful.font_name.."10"
|
||||
mem.align = 'center'
|
||||
|
||||
mem.font = beautiful.font_name .. "10"
|
||||
mem.align = "center"
|
||||
|
||||
local function get_val()
|
||||
awesome.connect_signal("signal::mem", function(mem_perc)
|
||||
mem.markup = tonumber(mem_perc).. "%"
|
||||
end)
|
||||
end
|
||||
mem.markup = tonumber(mem_perc) .. "%"
|
||||
end)
|
||||
end
|
||||
|
||||
get_val()
|
||||
--gears.timer {
|
||||
-- timeout = 2,
|
||||
-- autostart = true,
|
||||
-- call_now = true,
|
||||
-- callback = function()
|
||||
-- get_val()
|
||||
-- end
|
||||
--}
|
||||
|
||||
local full = wibox.widget {
|
||||
local full = wibox.widget({
|
||||
{
|
||||
{
|
||||
icon,
|
||||
mem,
|
||||
spacing = dpi(8),
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
icon,
|
||||
mem,
|
||||
spacing = dpi(8),
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
left = 1,
|
||||
right = 0,
|
||||
layout = wibox.container.margin,
|
||||
left = 1,
|
||||
right = 0,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
forced_width = 73,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
return full
|
||||
|
||||
|
|
|
@ -1,31 +1,24 @@
|
|||
local awful = require "awful"
|
||||
local wibox = require "wibox"
|
||||
local gears = require "gears"
|
||||
local beautiful = require "beautiful"
|
||||
local helpers = require "helpers"
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
local gears = require("gears")
|
||||
local beautiful = require("beautiful")
|
||||
local helpers = require("helpers")
|
||||
|
||||
-- Menu
|
||||
--local menu = wibox.widget.textbox()
|
||||
--menu.font = "FiraCode Nerd Font 16"
|
||||
--menu.markup = "ﰪ"
|
||||
local menu = wibox.widget {
|
||||
local menu = wibox.widget({
|
||||
{
|
||||
font = beautiful.font_name.."16",
|
||||
markup = "ﰪ",
|
||||
widget = wibox.widget.textbox(),
|
||||
font = beautiful.font_name .. "16",
|
||||
markup = "",
|
||||
widget = wibox.widget.textbox(),
|
||||
},
|
||||
bottom = 2,
|
||||
widget = wibox.container.margin,
|
||||
}
|
||||
})
|
||||
|
||||
helpers.ui.add_hover_cursor(menu, "hand2")
|
||||
|
||||
|
||||
menu:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
awesome.emit_signal("sidebar::toggle")
|
||||
end)
|
||||
))
|
||||
menu:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
awesome.emit_signal("sidebar::toggle")
|
||||
end)))
|
||||
|
||||
return menu
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
local awful = require "awful"
|
||||
local wibox = require "wibox"
|
||||
local gears = require "gears"
|
||||
local beautiful = require "beautiful"
|
||||
local helpers = require "helpers"
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
local gears = require("gears")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
-- Menu
|
||||
local menu = wibox.widget.textbox()
|
||||
menu.font = beautiful.font_name.."16"
|
||||
menu.markup = "<span foreground='"..beautiful.xcolor10.."'></span>"
|
||||
menu.font = beautiful.font_name .. "16"
|
||||
menu.markup = "<span foreground='" .. beautiful.xcolor10 .. "'></span>"
|
||||
|
||||
|
||||
menu:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
awesome.emit_signal("module::exit_screen:show")
|
||||
end)
|
||||
))
|
||||
menu:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
awesome.emit_signal("module::exit_screen:show")
|
||||
end)))
|
||||
|
||||
return menu
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
local awful = require "awful"
|
||||
local awful = require("awful")
|
||||
|
||||
local promptbox = awful.widget.prompt()
|
||||
return promptbox
|
||||
return promptbox
|
||||
|
||||
|
|
|
@ -1,70 +1,67 @@
|
|||
local awful = require "awful"
|
||||
local wibox = require "wibox"
|
||||
local gears = require "gears"
|
||||
local beautiful = require "beautiful"
|
||||
local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
local gears = require("gears")
|
||||
local beautiful = require("beautiful")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
local helpers = require "helpers"
|
||||
local helpers = require("helpers")
|
||||
|
||||
-- Icon
|
||||
local icon = wibox.widget.textbox()
|
||||
icon.font = beautiful.font_name.."12.5"
|
||||
icon.align = 'center'
|
||||
icon.markup = "<span foreground='"..beautiful.xcolor2.."'>墳</span>"
|
||||
icon.font = beautiful.font_name .. "12.5"
|
||||
icon.align = "center"
|
||||
icon.markup = "<span foreground='" .. beautiful.xcolor2 .. "'></span>"
|
||||
|
||||
-- Uptime
|
||||
local pulseaudio = wibox.widget.textbox()
|
||||
pulseaudio.font = beautiful.font_name.."10"
|
||||
pulseaudio.align = 'center'
|
||||
|
||||
pulseaudio.font = beautiful.font_name .. "10"
|
||||
pulseaudio.align = "center"
|
||||
|
||||
local function get_val()
|
||||
awesome.connect_signal("signal::volume", function(vol, muted)
|
||||
if muted then pulseaudio.markup = "muted" icon.markup = "<span foreground='"..beautiful.xcolor2.."'>婢</span>" else
|
||||
pulseaudio.markup = tonumber(vol).. "%"
|
||||
icon.markup = "<span foreground='"..beautiful.xcolor2.."'>墳</span>"
|
||||
if muted then
|
||||
pulseaudio.markup = "muted"
|
||||
icon.markup = "<span foreground='" .. beautiful.xcolor2 .. "'></span>"
|
||||
else
|
||||
pulseaudio.markup = tonumber(vol) .. "%"
|
||||
icon.markup = "<span foreground='" .. beautiful.xcolor2 .. "'></span>"
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
get_val()
|
||||
|
||||
local full = wibox.widget {
|
||||
local full = wibox.widget({
|
||||
{
|
||||
{
|
||||
icon,
|
||||
pulseaudio,
|
||||
spacing = dpi(8),
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
icon,
|
||||
pulseaudio,
|
||||
spacing = dpi(8),
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
left = dpi(5),
|
||||
right = 8,
|
||||
layout = wibox.container.margin,
|
||||
left = dpi(5),
|
||||
right = 8,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
forced_width = 73, --66,
|
||||
forced_width = 73,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}
|
||||
})
|
||||
|
||||
full:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
awesome.emit_signal("action::toggle")
|
||||
end)
|
||||
))
|
||||
full:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
awesome.emit_signal("action::toggle")
|
||||
end)))
|
||||
-- Update Function
|
||||
local update_volume = function() -- Sets the Volume Correct
|
||||
awful.spawn.easy_async_with_shell("pamixer --get-volume", function(stdout)
|
||||
pulseaudio.markup = tonumber(stdout:match("%d+")).. "%"
|
||||
|
||||
-- Uncomment this if you wan't dynamic Icons --
|
||||
-- if tonumber(stdout:match("%d+")) < 10 then
|
||||
-- icon.markup = "<span foreground='"..beautiful.xcolor2.."'>奄</span>"
|
||||
-- elseif tonumber(stdout:match("%d+")) < 50 then
|
||||
-- icon.markup = "<span foreground='"..beautiful.xcolor2.."'>奔</span>"
|
||||
-- elseif tonumber(stdout:match("%d+")) < 100 then
|
||||
-- icon.markup = "<span foreground='"..beautiful.xcolor2.."'>墳</span>"
|
||||
-- else
|
||||
-- end
|
||||
|
||||
local update_volume = function() -- Sets the Volume Correct
|
||||
awful.spawn.easy_async_with_shell("pamixer --get-volume", function(stdout)
|
||||
pulseaudio.markup = tonumber(stdout:match("%d+")) .. "%"
|
||||
|
||||
if tonumber(stdout:match("%d+")) < 10 then
|
||||
icon.markup = "<span foreground='" .. beautiful.xcolor2 .. "'></span>"
|
||||
elseif tonumber(stdout:match("%d+")) < 50 then
|
||||
icon.markup = "<span foreground='" .. beautiful.xcolor2 .. "'></span>"
|
||||
elseif tonumber(stdout:match("%d+")) < 100 then
|
||||
icon.markup = "<span foreground='" .. beautiful.xcolor2 .. "'></span>"
|
||||
else
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
@ -78,4 +75,3 @@ end)
|
|||
helpers.ui.add_hover_cursor(full, "hand2")
|
||||
|
||||
return full
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
local gears = require "gears"
|
||||
local awful = require "awful"
|
||||
local beautiful = require "beautiful"
|
||||
local wibox = require "wibox"
|
||||
local seperator = wibox.widget.textbox()
|
||||
local beautiful = require("beautiful")
|
||||
local wibox = require("wibox")
|
||||
|
||||
seperator.font = beautiful.font_name.."14"
|
||||
--seperator.text = "|"
|
||||
seperator.markup = "<span foreground='"..beautiful.xcolorT2.."'>|</span>"
|
||||
local seperator = wibox.widget.textbox()
|
||||
|
||||
seperator.font = beautiful.font_name .. "14"
|
||||
seperator.markup = "<span foreground='" .. beautiful.xcolorT2 .. "'>|</span>"
|
||||
|
||||
return seperator
|
||||
|
|
|
@ -1,83 +1,65 @@
|
|||
local awful = require "awful"
|
||||
local wibox = require "wibox"
|
||||
local gears = require "gears"
|
||||
local beautiful = require "beautiful"
|
||||
local rubato = require "lib.rubato"
|
||||
local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
local gears = require("gears")
|
||||
local beautiful = require("beautiful")
|
||||
local rubato = require("lib.rubato")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
|
||||
local arrow = wibox.widget.textbox()
|
||||
arrow.font = beautiful.font_name.."13"
|
||||
arrow.markup = "»"
|
||||
local arrow = wibox.widget.textbox()
|
||||
arrow.font = beautiful.font_name .. "13"
|
||||
arrow.markup = "»"
|
||||
|
||||
local mysystray = wibox.widget.systray()
|
||||
mysystray.visible = true
|
||||
beautiful.systray_icon_spacing = dpi(4)
|
||||
--mysystray.base_size = beautiful.systray_icon_size
|
||||
local mysystray = wibox.widget.systray()
|
||||
mysystray.visible = true
|
||||
beautiful.systray_icon_spacing = dpi(4)
|
||||
|
||||
local widget = wibox.widget({
|
||||
widget = wibox.container.constraint,
|
||||
strategy = "max",
|
||||
width = dpi(0),
|
||||
{
|
||||
widget = wibox.container.margin,
|
||||
margins = dpi(2),
|
||||
mysystray,
|
||||
},
|
||||
})
|
||||
widget.visible = true
|
||||
|
||||
local widget = wibox.widget({
|
||||
widget = wibox.container.constraint,
|
||||
strategy = "max",
|
||||
width = dpi(0),
|
||||
{
|
||||
widget = wibox.container.margin,
|
||||
margins = dpi(2),
|
||||
mysystray,
|
||||
},
|
||||
})
|
||||
widget.visible = true
|
||||
|
||||
local slide = rubato.timed {
|
||||
-- rate = 60,
|
||||
duration = 0.9,
|
||||
--easing = rubato.easing.linear,
|
||||
awestore_compat = true,
|
||||
subscribed = function(pos)
|
||||
widget.width = pos
|
||||
end,
|
||||
}
|
||||
|
||||
local slide = rubato.timed({
|
||||
duration = 0.9,
|
||||
awestore_compat = true,
|
||||
subscribed = function(pos)
|
||||
widget.width = pos
|
||||
end,
|
||||
})
|
||||
|
||||
local value = true
|
||||
|
||||
--slide.ended:subscribe(function()
|
||||
-- if value then
|
||||
-- -- widget.visible = false
|
||||
-- end
|
||||
-- end)
|
||||
arrow.toggle = function()
|
||||
if value == false then
|
||||
arrow.markup = "»"
|
||||
value = true
|
||||
slide:set(2)
|
||||
else
|
||||
arrow.markup = "«"
|
||||
slide:set(500)
|
||||
value = false
|
||||
end
|
||||
end
|
||||
|
||||
arrow.toggle = function()
|
||||
if value == false then
|
||||
arrow.markup = "»"
|
||||
value = true
|
||||
slide:set(2)
|
||||
else
|
||||
arrow.markup = "«"
|
||||
slide:set(500)
|
||||
--widget.visible = true
|
||||
value = false
|
||||
end
|
||||
end
|
||||
awesome.connect_signal("arrow::toggle", function()
|
||||
arrow.toggle()
|
||||
end)
|
||||
|
||||
--end)
|
||||
arrow:buttons(gears.table.join(awful.button({}, 1, function()
|
||||
awesome.emit_signal("arrow::toggle")
|
||||
end)))
|
||||
|
||||
awesome.connect_signal("arrow::toggle", function()
|
||||
arrow.toggle()
|
||||
end)
|
||||
|
||||
arrow:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
awesome.emit_signal("arrow::toggle")
|
||||
end)
|
||||
))
|
||||
|
||||
local sys = wibox.widget({
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
arrow,
|
||||
widget,
|
||||
spacing = dpi(2),
|
||||
})
|
||||
|
||||
|
||||
local sys = wibox.widget({
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
arrow,
|
||||
widget,
|
||||
spacing = dpi(2)
|
||||
})
|
||||
return sys
|
||||
|
|
|
@ -1,102 +1,100 @@
|
|||
local awful = require "awful"
|
||||
local gears = require "gears"
|
||||
local wibox = require "wibox"
|
||||
local beautiful = require "beautiful"
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
beautiful.init(gears.filesystem.get_configuration_dir() .. "themes/catppuccin/theme.lua")
|
||||
local bling = require "lib.bling"
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
local bling = require("lib.bling")
|
||||
|
||||
local keys = require("config").keys
|
||||
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
s.taglist = awful.widget.taglist {
|
||||
screen = s,
|
||||
filter = awful.widget.taglist.filter.all,
|
||||
widget_template = {
|
||||
{
|
||||
{
|
||||
{
|
||||
id = 'text_role',
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
left = 4,
|
||||
right = 4,
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
id = 'background_role',
|
||||
widget = wibox.container.background,
|
||||
-- Add support for hover colors and an index label
|
||||
create_callback = function(self, c3, index, objects) --luacheck: no unused args
|
||||
self:get_children_by_id('text_role')[1].markup = '<b> '..index..' </b>'
|
||||
self:connect_signal('mouse::enter', function()
|
||||
|
||||
-- BLING: Only show widget when there are clients in the tag
|
||||
if #c3:clients() > 0 then
|
||||
-- BLING: Update the widget with the new tag
|
||||
awesome.emit_signal("bling::tag_preview::update", c3)
|
||||
-- BLING: Show the widget
|
||||
awesome.emit_signal("bling::tag_preview::visibility", s, true)
|
||||
end
|
||||
end)
|
||||
self:connect_signal('mouse::leave', function()
|
||||
|
||||
-- BLING: Turn the widget off
|
||||
awesome.emit_signal("bling::tag_preview::visibility", s, false)
|
||||
|
||||
if self.has_backup then self.bg = self.backup end
|
||||
end)
|
||||
end,
|
||||
update_callback = function(self, c3, index, objects) --luacheck: no unused args
|
||||
self:get_children_by_id('text_role')[1].markup = '<b> '..index..' </b>'
|
||||
end,
|
||||
},
|
||||
buttons = {
|
||||
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),
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
||||
bling.widget.tag_preview.enable {
|
||||
show_client_content = true, -- Whether or not to show the client content
|
||||
x = 0, -- The x-coord of the popup
|
||||
y = 0, -- The y-coord of the popup
|
||||
scale = 0.2, -- The scale of the previews compared to the screen
|
||||
honor_padding = true, -- Honor padding when creating widget size
|
||||
honor_workarea = true, -- Honor work area when creating widget size
|
||||
placement_fn = function(c) -- Place the widget using awful.placement (this overrides x & y)
|
||||
awful.placement.top_left(c, {
|
||||
margins = {
|
||||
top = 31,
|
||||
left = 0,
|
||||
}
|
||||
})
|
||||
end,
|
||||
background_widget = wibox.widget { -- Set a background image (like a wallpaper) for the widget
|
||||
image = beautiful.wallpaper,
|
||||
horizontal_fit_policy = "fit",
|
||||
vertical_fit_policy = "fit",
|
||||
widget = wibox.widget.imagebox
|
||||
}
|
||||
}
|
||||
s.taglist = awful.widget.taglist({
|
||||
screen = s,
|
||||
filter = awful.widget.taglist.filter.all,
|
||||
widget_template = {
|
||||
{
|
||||
{
|
||||
{
|
||||
id = "text_role",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
left = 4,
|
||||
right = 4,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
id = "background_role",
|
||||
widget = wibox.container.background,
|
||||
-- Add support for hover colors and an index label
|
||||
create_callback = function(self, c3, index, _) --luacheck: no unused args
|
||||
self:get_children_by_id("text_role")[1].markup = "<b> " .. index .. " </b>"
|
||||
self:connect_signal("mouse::enter", function()
|
||||
-- BLING: Only show widget when there are clients in the tag
|
||||
if #c3:clients() > 0 then
|
||||
-- BLING: Update the widget with the new tag
|
||||
awesome.emit_signal("bling::tag_preview::update", c3)
|
||||
-- BLING: Show the widget
|
||||
awesome.emit_signal("bling::tag_preview::visibility", s, true)
|
||||
end
|
||||
end)
|
||||
self:connect_signal("mouse::leave", function()
|
||||
-- BLING: Turn the widget off
|
||||
awesome.emit_signal("bling::tag_preview::visibility", s, false)
|
||||
|
||||
if self.has_backup then
|
||||
self.bg = self.backup
|
||||
end
|
||||
end)
|
||||
end,
|
||||
update_callback = function(self, _, index, _)
|
||||
self:get_children_by_id("text_role")[1].markup = "<b> " .. index .. " </b>"
|
||||
end,
|
||||
},
|
||||
buttons = {
|
||||
awful.button({}, 1, function(t)
|
||||
t:view_only()
|
||||
end),
|
||||
awful.button({ keys.mod }, 1, function(t)
|
||||
if client.focus then
|
||||
client.focus:move_to_tag(t)
|
||||
end
|
||||
end),
|
||||
awful.button({}, 3, awful.tag.viewtoggle),
|
||||
awful.button({ keys.mod }, 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),
|
||||
},
|
||||
})
|
||||
|
||||
bling.widget.tag_preview.enable({
|
||||
show_client_content = true, -- Whether or not to show the client content
|
||||
x = 0, -- The x-coord of the popup
|
||||
y = 0, -- The y-coord of the popup
|
||||
scale = 0.2, -- The scale of the previews compared to the screen
|
||||
honor_padding = true, -- Honor padding when creating widget size
|
||||
honor_workarea = true, -- Honor work area when creating widget size
|
||||
placement_fn = function(c) -- Place the widget using awful.placement (this overrides x & y)
|
||||
awful.placement.top_left(c, {
|
||||
margins = {
|
||||
top = 31,
|
||||
left = 0,
|
||||
},
|
||||
})
|
||||
end,
|
||||
background_widget = wibox.widget({ -- Set a background image (like a wallpaper) for the widget
|
||||
image = beautiful.wallpaper,
|
||||
horizontal_fit_policy = "fit",
|
||||
vertical_fit_policy = "fit",
|
||||
widget = wibox.widget.imagebox,
|
||||
}),
|
||||
})
|
||||
end)
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,18 +1,8 @@
|
|||
local awful = require "awful"
|
||||
local beautiful = require "beautiful"
|
||||
local gears = require "gears"
|
||||
local awful = require("awful")
|
||||
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
|
||||
s.tasklist = awful.widget.tasklist {
|
||||
screen = s,
|
||||
filter = awful.widget.tasklist.filter.focused,
|
||||
-- buttons = {
|
||||
-- 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),
|
||||
}
|
||||
s.tasklist = awful.widget.tasklist({
|
||||
screen = s,
|
||||
filter = awful.widget.tasklist.filter.focused,
|
||||
})
|
||||
end)
|
||||
|
|
|
@ -26,9 +26,11 @@
|
|||
order: 0;
|
||||
width: calc(100% - 146px);
|
||||
}
|
||||
#PersonalToolbar {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
/* Shove bookmarks bar over for macOS titlebar buttons */
|
||||
/* #PersonalToolbar { */
|
||||
/* order: 2; */
|
||||
/* } */
|
||||
|
||||
/* Update - Hides the new Firefox home + tab dropdown. If you want to
|
||||
* keep/customize those buttons. remove the CSS below and adjust the widths above
|
||||
|
|
Loading…
Reference in a new issue