diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index b53aa13..12557d5 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -106,9 +106,12 @@ # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. lm_sensors brightnessctl - inotify-tools ]; + programs.light.enable = true; + + services.acpid.enable = true; + # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; diff --git a/hosts/default/home.nix b/hosts/default/home.nix index 09af357..e51ddda 100644 --- a/hosts/default/home.nix +++ b/hosts/default/home.nix @@ -22,20 +22,27 @@ # For funsies spotify vesktop - ncmpcpp - mpd - mpdris2 + # Other utility mullvad-vpn transmission_4-gtk imagemagick neofetch + maim + xclip + slop + swappy + inotify-tools ]; + # Clips + services.clipmenu.enable = true; + # Enable sound control services.easyeffects.enable = true; + # Enable playerctl daemon services.playerctld.enable = true; # Home Manager is pretty good at managing dotfiles. The primary way to manage diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index d9fc914..e74c904 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -28,7 +28,7 @@ # Utils corefonts noto-fonts - flameshot + maim ]; programs.firefox.enable = true; diff --git a/modules/home-manager/ricing/awesomewm/default.nix b/modules/home-manager/ricing/awesomewm/default.nix index 1fba72c..6c51440 100644 --- a/modules/home-manager/ricing/awesomewm/default.nix +++ b/modules/home-manager/ricing/awesomewm/default.nix @@ -3,6 +3,6 @@ { home.file.".config/awesome" = { recursive = true; - source = ./dotfiles; + source = ./gruv; }; } \ No newline at end of file diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/helpers.lua b/modules/home-manager/ricing/awesomewm/dotfiles/helpers.lua deleted file mode 100644 index 7b500ee..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/helpers.lua +++ /dev/null @@ -1,230 +0,0 @@ -local helpers = {} -local awful = require("awful") -local beautiful = require("beautiful") -local gears = require("gears") -local dpi = beautiful.xresources.apply_dpi -local cairo = require("lgi").cairo -local gmatrix = require("gears.matrix") -local json = require("mods.json") - -helpers.rrect = function(radius) - radius = radius or dpi(4) - return function(cr, width, height) - gears.shape.rounded_rect(cr, width, height, radius) - end -end - -helpers.addHover = function(element, bg, hbg) - element:connect_signal('mouse::enter', function(self) - self.bg = hbg - end) - element:connect_signal('mouse::leave', function(self) - self.bg = bg - end) -end - -helpers.placeWidget = function(widget) - if beautiful.barDir == 'left' then - awful.placement.bottom_left(widget, { honor_workarea = true, margins = beautiful.useless_gap * 2 }) - elseif beautiful.barDir == 'right' then - awful.placement.bottom_right(widget, { honor_workarea = true, margins = beautiful.useless_gap * 2 }) - elseif beautiful.barDir == 'bottom' then - awful.placement.bottom(widget, { honor_workarea = true, margins = beautiful.useless_gap * 2 }) - elseif beautiful.barDir == 'top' then - awful.placement.top(widget, { honor_workarea = true, margins = beautiful.useless_gap * 2 }) - end -end - -helpers.prect = function(tl, tr, br, bl, radius) - radius = radius or dpi(4) - return function(cr, width, height) - gears.shape.partially_rounded_rect(cr, width, height, tl, tr, br, bl, radius) - end -end - -helpers.clickKey = function(c, key) - awful.spawn.with_shell("xdotool type --window " .. tostring(c.window) .. " '" .. key .. "'") -end - -helpers.colorizeText = function(txt, fg) - if fg == "" then - fg = "#ffffff" - end - - return "" .. txt .. "" -end - -helpers.cropSurface = function(ratio, surf) - local old_w, old_h = gears.surface.get_size(surf) - local old_ratio = old_w / old_h - if old_ratio == ratio then return surf end - - local new_h = old_h - local new_w = old_w - local offset_h, offset_w = 0, 0 - -- quick mafs - if (old_ratio < ratio) then - new_h = math.ceil(old_w * (1 / ratio)) - offset_h = math.ceil((old_h - new_h) / 2) - else - new_w = math.ceil(old_h * ratio) - offset_w = math.ceil((old_w - new_w) / 2) - end - - local out_surf = cairo.ImageSurface(cairo.Format.ARGB32, new_w, new_h) - local cr = cairo.Context(out_surf) - cr:set_source_surface(surf, -offset_w, -offset_h) - cr.operator = cairo.Operator.SOURCE - cr:paint() - - return out_surf -end - -helpers.inTable = function(t, v) - for _, value in ipairs(t) do - if value == v then - return true - end - end - - return false -end - - -helpers.generateId = function() - local template = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' - return string.gsub(template, '[xy]', function(c) - local v = (c == 'x') and math.random(0, 0xf) or math.random(8, 0xb) - return string.format('%x', v) - end) -end - -helpers.find_last = function(haystack, needle) - -- Set the third arg to false to allow pattern matching - local found = haystack:reverse():find(needle:reverse(), nil, true) - if found then - return haystack:len() - needle:len() - found + 2 - else - return found - end -end - - - -helpers.addTables = function(a, b) - local result = {} - for _, v in pairs(a) do - table.insert(result, v) - end - for _, v in pairs(b) do - table.insert(result, v) - end - return result -end - -helpers.hasKey = function(set, key) - return set[key] ~= nil -end - -helpers.trim = function(string) - return string:gsub("^%s*(.-)%s*$", "%1") -end -helpers.indexOf = function(array, value) - for i, v in ipairs(array) do - if v == value then - return i - end - end - return nil -end - -helpers.split = function(inputstr, sep) - if sep == nil then - sep = "%s" - end - local t = {} - for str in string.gmatch(inputstr, "([^" .. sep .. "]+)") do - table.insert(t, str) - end - return t -end - -helpers.readFile = function(file) - local f = assert(io.open(file, "rb")) - local content = f:read("*all") - f:close() - return content -end - -helpers.file_exists = function(name) - local f = io.open(name, "r") - if f ~= nil then - io.close(f) - return true - else - return false - end -end - -local function get_widget_geometry(_hierarchy, widget) - local width, height = _hierarchy:get_size() - if _hierarchy:get_widget() == widget then - -- Get the extents of this widget in the device space - local x, y, w, h = gmatrix.transform_rectangle(_hierarchy:get_matrix_to_device(), 0, 0, width, height) - return { x = x, y = y, width = w, height = h, hierarchy = _hierarchy } - end - - for _, child in ipairs(_hierarchy:get_children()) do - local ret = get_widget_geometry(child, widget) - if ret then - return ret - end - end -end - -function helpers.get_widget_geometry(wibox, widget) - return get_widget_geometry(wibox._drawable._widget_hierarchy, widget) -end - -function helpers.randomColor() - local accents = { - beautiful.magenta, - beautiful.yellow, - beautiful.green, - beautiful.red, - beautiful.blue, - } - - local i = math.random(1, #accents) - return accents[i] -end - -helpers.readJson = function(DATA) - if helpers.file_exists(DATA) then - local f = assert(io.open(DATA, "rb")) - local lines = f:read("*all") - f:close() - local data = json.decode(lines) - return data - else - return {} - end -end - -helpers.writeJson = function(PATH, DATA) - local w = assert(io.open(PATH, "w")) - w:write(json.encode(DATA, nil, { pretty = true, indent = " ", align_keys = false, array_newline = true })) - w:close() -end - --- this stands for :get_children_by_id -helpers.gc = function(widget, id) - return widget:get_children_by_id(id)[1] -end - -helpers.beginsWith = function(str, pattern) - return str:find('^' .. pattern) ~= nil -end - - -return helpers \ No newline at end of file diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/lib/brightness.lua b/modules/home-manager/ricing/awesomewm/dotfiles/lib/brightness.lua deleted file mode 100644 index 19159c1..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/lib/brightness.lua +++ /dev/null @@ -1,21 +0,0 @@ -local awful = require "awful" - -local brightness = {} - -brightness.increase = function() - local script = [[ - brightnessctl set 3%+ - ]] - - awful.spawn.with_shell(script) -end - -brightness.decrease = function() - local script = [[ - brightnessctl set 3%- - ]] - - awful.spawn.with_shell(script) -end - -return brightness diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/lib/volume.lua b/modules/home-manager/ricing/awesomewm/dotfiles/lib/volume.lua deleted file mode 100644 index 15374ba..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/lib/volume.lua +++ /dev/null @@ -1,29 +0,0 @@ -local awful = require "awful" - -local volume = {} - -volume.increase = function() - local script = [[ - pamixer -i 3 - ]] - - awful.spawn.with_shell(script) -end - -volume.decrease = function() - local script = [[ - pamixer -d 3 - ]] - - awful.spawn.with_shell(script) -end - -volume.mute = function() - local script = [[ - pamixer -t - ]] - - awful.spawn.with_shell(script) -end - -return volume diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/main/apps.lua b/modules/home-manager/ricing/awesomewm/dotfiles/main/apps.lua deleted file mode 100644 index 44ca779..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/main/apps.lua +++ /dev/null @@ -1,8 +0,0 @@ -local apps = { - terminal = "wezterm", - launcher = "rofi -show drun", - browser = "firefox", - fileManager = "thunar", -} - -return apps diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/main/autorun.sh b/modules/home-manager/ricing/awesomewm/dotfiles/main/autorun.sh deleted file mode 100644 index 9f1bce9..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/main/autorun.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -mpDris2 & -xrdb -merge ~/.Xresources -picom --config $HOME/.config/picom/picom.conf -xss-lock lock -mkdir -p ~/.cache/awesome/json/ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/main/bindings/bindings.lua b/modules/home-manager/ricing/awesomewm/dotfiles/main/bindings/bindings.lua deleted file mode 100644 index be0fe18..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/main/bindings/bindings.lua +++ /dev/null @@ -1,230 +0,0 @@ -local awful = require "awful" -local gears = require "gears" -local naughty = require "naughty" -local beautiful = require "beautiful" - -local apps = require "main.apps" - -modkey = "Mod4" - --- 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, }, "Return", function() awful.spawn(apps.terminal) end, - { description = "open a terminal", group = "launcher" }), -}) - --- Tag bindings -awful.keyboard.append_global_keybindings({ - 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, }, "Escape", 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, - } -}) - --- Focus bindings -awful.keyboard.append_global_keybindings({ - awful.key({ modkey, }, "j", - function() - awful.client.focus.byidx(1) - end, - { description = "focus next by index", group = "client" } - ), - awful.key({ modkey, }, "k", - function() - awful.client.focus.byidx(-1) - end, - { description = "focus previous by index", group = "client" } - ), - awful.key({ modkey, }, "Tab", - 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" }), -}) - --- 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" }), -}) - --- 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, "Shift" }, "c", 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" }), - }) -end) - --- Mouse bindings -local menu = require("ui.rightclick") -awful.mouse.append_global_mousebindings({ - awful.button({}, 3, function() - menu.desktop:toggle() - return - end), -}) - -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), - }) -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/main/bindings/custom_bindings.lua b/modules/home-manager/ricing/awesomewm/dotfiles/main/bindings/custom_bindings.lua deleted file mode 100644 index 835cfab..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/main/bindings/custom_bindings.lua +++ /dev/null @@ -1,45 +0,0 @@ -local awful = require "awful" - -local volume = require "lib.volume" -local brightness = require "lib.brightness" - --- Volume -awful.keyboard.append_global_keybindings({ - awful.key({}, "XF86AudioRaiseVolume", function() - volume.increase() - awesome.emit_signal("open::osd") - end), - awful.key({}, "XF86AudioLowerVolume", function() - volume.decrease() - awesome.emit_signal("open::osd") - end), - awful.key({}, "XF86AudioMute", function() - volume.mute() - awesome.emit_signal("open::osd") - end) -}) - --- Brightness -awful.keyboard.append_global_keybindings({ - awful.key({}, "XF86MonBrightnessUp", function() - brightness.increase() - awesome.emit_signal("open::osdb") - end), - - awful.key({}, "XF86MonBrightnessDown", function() - brightness.decrease() - awesome.emit_signal("open::osdb") - end), - awful.key({ modkey, }, "a", - function(c) - awesome.emit_signal("toggle::launcher") - end), - awful.key({ modkey, }, "x", - function(c) - awesome.emit_signal("toggle::exit") - end), - awful.key({ modkey, }, "q", - function(c) - awesome.emit_signal("toggle::scrotter") - end), -}) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/main/error_handling.lua b/modules/home-manager/ricing/awesomewm/dotfiles/main/error_handling.lua deleted file mode 100644 index 8e2f91c..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/main/error_handling.lua +++ /dev/null @@ -1,9 +0,0 @@ -local naughty = require "naughty" - -naughty.connect_signal("request::display_error", function(message, startup) - naughty.notification { - urgency = "critical", - title = "Oops, an error happened"..(startup and " during startup!" or "!"), - message = message - } -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/main/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/main/init.lua deleted file mode 100644 index f1e86c9..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/main/init.lua +++ /dev/null @@ -1,10 +0,0 @@ --- init config -require "main.wallpaper" -require "main.layout" -require "main.rules" -require "main.bindings.bindings" -require "main.bindings.custom_bindings" -require "main.tags" -require "main.swallow" -require "main.error_handling" -require "main.scratch" diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/main/layout.lua b/modules/home-manager/ricing/awesomewm/dotfiles/main/layout.lua deleted file mode 100644 index fd9c661..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/main/layout.lua +++ /dev/null @@ -1,16 +0,0 @@ -local awful = require "awful" -local gears = require "gears" -local beautiful = require "beautiful" - -awful.layout.layouts = { - awful.layout.suit.tile, - awful.layout.suit.floating, -} - -client.connect_signal("mouse::enter", function(c) - c:activate { context = "mouse_enter", raise = false } -end) - -client.connect_signal("manage", function(c) - if awesome.startup then awful.client.setslave(c) end -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/main/rules.lua b/modules/home-manager/ricing/awesomewm/dotfiles/main/rules.lua deleted file mode 100644 index 0e7dd9f..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/main/rules.lua +++ /dev/null @@ -1,35 +0,0 @@ -local awful = require "awful" -local gears = require "gears" -local ruled = require "ruled" - -ruled.client.connect_signal("request::rules", function() - 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 = "desktop", - rule_any = { - class = { - "Nemo-desktop" - } - }, - properties = { sticky = true, tag = " " } - } -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/main/scratch.lua b/modules/home-manager/ricing/awesomewm/dotfiles/main/scratch.lua deleted file mode 100644 index fbd98da..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/main/scratch.lua +++ /dev/null @@ -1,162 +0,0 @@ -local awful = require("awful") -local gears = require("gears") -local beautiful = require("beautiful") -local ruled = require("ruled") - - -local Scratchpad = { mt = {} } -- scratch init - --- make a new instance of scratchpad -function Scratchpad:new(args) - local ret = gears.object {} - gears.table.crush(ret, Scratchpad) - gears.table.crush(ret, args) - return ret -end - -local findClient = function(rule) - local function matcher(c) - return awful.rules.match(c, rule) - end - local clients = client.get() - local findex = gears.table.hasitem(clients, client.focus) or 1 - local start = gears.math.cycle(#clients, findex + 1) - - local matches = {} - for c in awful.client.iterate(matcher, start) do - matches[#matches + 1] = c - end - - return matches -end - -function Scratchpad:find() - return findClient(self.rule) -end - -function Scratchpad:become(c) - if not c or not c.valid then return end - c.floating = true - c.sticky = false - c.fullscreen = false - c.maximised = false - c:geometry({ - x = (1920 - self.width) / 2, - y = (1080 - self.height) / 2, - width = self.width, - height = self.height - }) -end - -function on(c) - local current_tag = c.screen.selected_tag - ctags = { current_tag } - for k, tag in pairs(c:tags()) do - if tag ~= current_tag then - table.insert(ctags, tag) - end - end - c:tags(ctags) - c:raise() - client.focus = c -end - -function Scratchpad:on() - self.client = self:find()[1] - if not self.client then - local pid = awful.spawn.with_shell(self.command) - ruled.client.append_rule({ - id = "scratch", - rule = self.rule, - properties = { - tag = awful.screen.focused().selected_tag, - switch_to_tags = false, - hidden = true, - minimized = true, - }, - callback = function(c) - gears.timer({ - timeout = 0.1, - autostart = true, - single_shot = true, - callback = function() - self.client = c - self:become(c) - c.hidden = false - c.minimized = false - - c:activate({}) - self:emit_signal("inital_apply", c) - if c.name ~= "Discord Updater" then - ruled.client.remove_rule("scratch") - end - c:connect_signal("request::unmanage", function() - ruled.client.remove_rule("scratch") - end) - end - }) - end - }) - else - self.client:raise() - client.focus = self.client - on(self.client) - self:become(self.client) - end -end - -function turn_off(c) - current_tag = c.screen.selected_tag - local ctags = {} - for k, tag in pairs(c:tags()) do - if tag ~= current_tag then - table.insert(ctags, tag) - end - end - c:tags(ctags) - c.sticky = false -end - -function Scratchpad:off() - self.client = self:find()[1] - turn_off(self.client) -end - -function Scratchpad:toggle() - local is_turn_off = client.focus and awful.rules.match(client.focus, self.rule) - if is_turn_off then - self:off() - else - self:on() - end -end - -function Scratchpad.mt:__call(...) - return Scratchpad:new(...) -end - -local createScratch = function(command, width, height, k) - local scratch = Scratchpad:new { - --command = 'kitty' .. ' --class "' .. command .. 'pad" -e sh -c "' .. command .. '; $SHELL"', - command = 'wezterm start --class ' .. command .. 'pad -e sh -c "' .. command .. '; $SHELL"', - rule = { class = command .. 'pad' }, - height = height, - width = width, - } - awful.keyboard.append_global_keybindings { - awful.key { - modifiers = { "Mod4" }, - key = k, - description = 'show help', - group = 'awesome', - on_press = function() scratch:toggle() end, - }, - } - awesome.connect_signal("toggle::" .. command .. "pad", function() - scratch:toggle() - end) - return scratch -end - -local default = createScratch("clear", 1000, 650, 'v') -local ncmpcpp = createScratch("ncmpcpp", 800, 500, 'z') diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/main/swallow.lua b/modules/home-manager/ricing/awesomewm/dotfiles/main/swallow.lua deleted file mode 100644 index 8288b09..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/main/swallow.lua +++ /dev/null @@ -1,83 +0,0 @@ --- documenting my shit because someone thought i write good code -local awful = require("awful") -local helpers = require("helpers") -local dontSuckMe = {} -- this is for classes that you dont want to be swallowed --- eg local dontSuckMe = {"nemo", "firefox"} - -local checkForSucc = function(child, parent) - local canSuc = false - if not helpers.inTable(dontSuckMe, child) and parent == "org.wezfurlong.wezterm" and child ~= "org.wezfurlong.wezterm" then -- write the class of your terminal here - canSuc = true - end - return canSuc -end - --- get the terminal window that executed the command maybe -local getDaddy = function(child, cb) - awful.spawn.easy_async(string.format("pstree -p %s", child), function(output, _, _, _) - cb(nil, output) - end) -end - --- this function was straight out ripped from bling --- from what i understand this basically makes the window focused and on top -function on(c) - local current_tag = c.screen.selected_tag - ctags = { current_tag } - for k, tag in pairs(c:tags()) do - if tag ~= current_tag then - table.insert(ctags, tag) - end - end - c:tags(ctags) - c:raise() - client.focus = c -end - --- move the parent with the child -local sync = function(c, p) - if not c.valid or not p.valid then - return - end - if p.modal then - return - end - c.floating = p.floating - c.maximized = p.maximized - c.above = p.above - c.below = p.below - c:geometry(p:geometry()) -end - --- this does the opposite off on() and you guessed it, also copied from bling -function off(c) - current_tag = c.screen.selected_tag - local ctags = {} - for k, tag in pairs(c:tags()) do - if tag ~= current_tag then - table.insert(ctags, tag) - end - end - c:tags(ctags) - c.sticky = false -end - --- the main implementation -local handle = function(c) - local daddy = awful.client.focus.history.get(c.screen, 1) -- read the history to get the parent terminal - if not daddy or daddy.type == "dialog" or daddy.type == "splash" then return end - getDaddy(c.pid, function(e, pid) - if (tostring(pid):find("(" .. tostring(daddy.pid) .. ")")) and checkForSucc(c.class, daddy.class) then -- check if the parent exists and the window can be swallowed - c:connect_signal("unmanage", function() - if daddy then - on(daddy) - sync(c, daddy) - end - end) - - sync(c, daddy) - off(daddy) - end - end) -end -client.connect_signal("manage", handle) -- executing it diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/main/tags.lua b/modules/home-manager/ricing/awesomewm/dotfiles/main/tags.lua deleted file mode 100644 index 28c6b9c..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/main/tags.lua +++ /dev/null @@ -1,5 +0,0 @@ -local awful = require "awful" - -screen.connect_signal("request::desktop_decoration", function(s) - awful.tag({ "1", "2", "3", " " }, s, awful.layout.layouts[1]) -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/main/wallpaper.lua b/modules/home-manager/ricing/awesomewm/dotfiles/main/wallpaper.lua deleted file mode 100644 index 6a5eb64..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/main/wallpaper.lua +++ /dev/null @@ -1,17 +0,0 @@ -local gears = require "gears" -local beautiful = require "beautiful" -local helpeers = require "helpers" - - -local function set_wall(s) - local d = helpeers.readJson(gears.filesystem.get_cache_dir() .. 'json/settings.json') - if d.wallpaper == "colorful" then - gears.wallpaper.maximized(beautiful.wallpaper, s, beautiful.mbg) - else - gears.wallpaper.set(beautiful.bg3) - end -end - -screen.connect_signal("request::wallpaper", function(s) - set_wall(s) -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/misc/dings/base.lua b/modules/home-manager/ricing/awesomewm/dotfiles/misc/dings/base.lua deleted file mode 100644 index 61cedfb..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/misc/dings/base.lua +++ /dev/null @@ -1,285 +0,0 @@ --- Copyleft © 2022 Saimoomedits ---most stuff copied from guy above - - -local naughty = require("naughty") -local beautiful = require("beautiful") -local wibox = require("wibox") -local awful = require("awful") -local dpi = beautiful.xresources.apply_dpi -local helpers = require("helpers") -local ruled = require("ruled") -local menubar = require("menubar") -local animation = require("mods.animation") -local gears = require("gears") - - - -naughty.connect_signal("request::icon", function(n, context, hints) - if context ~= "app_icon" then return end - - local path = menubar.utils.lookup_icon(hints.app_icon) or menubar.utils.lookup_icon(hints.app_icon:lower()) - - if path then n.icon = path end -end) - - --- naughty config -naughty.config.defaults.ontop = true -naughty.config.defaults.screen = awful.screen.focused() -naughty.config.defaults.timeout = 10 -naughty.config.defaults.title = "Ding!" -naughty.config.defaults.position = "top_right" - - --- Timeouts -naughty.config.presets.low.timeout = 10 -naughty.config.presets.critical.timeout = 0 - --- ruled notification -ruled.notification.connect_signal("request::rules", function() - ruled.notification.append_rule { - rule = {}, - properties = { screen = awful.screen.preferred, implicit_timeout = 6 } - } -end) - - - --- connect to each display --------------------------- -naughty.connect_signal("request::display", function(n) - -- action widget - local action_widget = { - { - { - id = "text_role", - align = "center", - valign = "center", - font = beautiful.sans .. " 10", - widget = wibox.widget.textbox - }, - left = dpi(6), - right = dpi(6), - widget = wibox.container.margin - }, - bg = beautiful.mbg, - forced_height = dpi(30), - shape = helpers.rrect(2), - widget = wibox.container.background - } - - - -- actions - local actions = wibox.widget { - notification = n, - base_layout = wibox.widget { - spacing = dpi(8), - layout = wibox.layout.flex.horizontal - }, - widget_template = action_widget, - style = { underline_normal = false, underline_selected = true }, - widget = naughty.list.actions - } - - - - -- image - local image_n = wibox.widget { - { - { - opacity = 0.9, - image = n.icon and helpers.cropSurface(1, gears.surface.load_uncached(n.icon)) or - gears.filesystem.get_configuration_dir() .. "theme/assets/" .. "bell.png", - resize = true, - halign = "center", - valign = "center", - clip_shape = helpers.rrect(50), - widget = wibox.widget.imagebox, - }, - strategy = "exact", - height = dpi(50), - width = dpi(50), - widget = wibox.container.constraint, - }, - id = "arc", - widget = wibox.container.arcchart, - max_value = 100, - min_value = 0, - value = 100, - rounded_edge = true, - thickness = dpi(4), - start_angle = 4.71238898, - bg = beautiful.blue, - colors = { beautiful.fg }, - forced_width = dpi(80), - forced_height = dpi(80) - } - local anim = animation:new { - duration = 6, - target = 100, - reset_on_stop = false, - easing = animation.easing.linear, - update = function(_, pos) - image_n:get_children_by_id('arc')[1].value = pos - end, - } - anim:connect_signal("ended", function() - n:destroy() - end) - - -- title - local title_n = wibox.widget { - { - { - markup = n.title, - font = beautiful.sans .. " 12", - align = "right", - valign = "center", - widget = wibox.widget.textbox - }, - forced_width = dpi(240), - widget = wibox.container.scroll.horizontal, - step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth, - speed = 50 - }, - margins = { right = 15 }, - widget = wibox.container.margin - } - - - local message_n = wibox.widget { - { - { - markup = helpers.colorizeText("" .. n.message .. "", beautiful.fg .. "BF"), - font = beautiful.sans .. " 12", - align = "left", - valign = "center", - wrap = "char", - widget = wibox.widget.textbox - }, - forced_width = dpi(240), - layout = wibox.layout.fixed.horizontal - }, - margins = { right = 15 }, - widget = wibox.container.margin - } - - - -- app name - local aname = '' - if n.app_name ~= '' then - aname = n.app_name - else - aname = 'naughty' - end - local app_name_n = wibox.widget { - markup = helpers.colorizeText(aname, beautiful.fg .. "BF"), - font = beautiful.sans .. " 10", - align = "left", - valign = "center", - widget = wibox.widget.textbox - } - - local time_n = wibox.widget { - { - markup = helpers.colorizeText("now", beautiful.fg .. "BF"), - font = beautiful.sans .. " 10", - align = "right", - valign = "center", - widget = wibox.widget.textbox - }, - margins = { right = 20 }, - widget = wibox.container.margin - } - - local close = wibox.widget { - markup = helpers.colorizeText('󰝥', beautiful.red), - font = beautiful.icon .. " 12", - align = "ceneter", - valign = "center", - widget = wibox.widget.textbox - } - - close:buttons(gears.table.join( - awful.button({}, 1, function() n:destroy(naughty.notification_closed_reason.dismissed_by_user) end))) - - - -- extra info - local notif_info = wibox.widget { - app_name_n, - { - widget = wibox.widget.separator, - shape = gears.shape.circle, - forced_height = dpi(4), - forced_width = dpi(4), - color = beautiful.fg .. "BF" - }, - time_n, - layout = wibox.layout.fixed.horizontal, - spacing = dpi(7) - } - - - - - local widget = naughty.layout.box { - notification = n, - bg = beautiful.bg, - shape = helpers.rrect(8), - widget_template = { - { - { - -- top bit - { - { - { - close, - nil, - notif_info, - layout = wibox.layout.align.horizontal, - expand = "none" - }, - margins = { left = dpi(15), right = dpi(15), top = dpi(10), bottom = dpi(10) }, - widget = wibox.container.margin - }, - widget = wibox.container.background, - bg = beautiful.mbg, - }, - layout = wibox.layout.fixed.vertical - }, - { - -- body - { - { - title_n, - message_n, - layout = wibox.layout.fixed.vertical, - spacing = dpi(3) - }, - nil, - image_n, - layout = wibox.layout.align.horizontal, - expand = "none" - }, - margins = { left = dpi(15), top = dpi(10), right = dpi(10) }, - widget = wibox.container.margin - }, - { - -- foot - actions, - margins = dpi(10), - widget = wibox.container.margin - }, - layout = wibox.layout.fixed.vertical, - spacing = dpi(10) - }, - widget = wibox.container.background, - shape = helpers.rrect(8), - bg = beautiful.bg, - } - } - - widget.buttons = {} - anim:start() -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/misc/dings/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/misc/dings/init.lua deleted file mode 100644 index d6c181b..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/misc/dings/init.lua +++ /dev/null @@ -1 +0,0 @@ -require("misc.dings.base") diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/misc/dings/music.lua b/modules/home-manager/ricing/awesomewm/dotfiles/misc/dings/music.lua deleted file mode 100644 index 787ed00..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/misc/dings/music.lua +++ /dev/null @@ -1,10 +0,0 @@ -local naughty = require("naughty") -local bling = require("mods.playerctl") -local playerctl = bling.lib() - -playerctl:connect_signal("metadata", - function(_, title, artist, album_path, album, new, player_name) - if new == true then - naughty.notify({ title = 'New Song', text = title .. " by " .. artist, image = album_path }) - end - end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/misc/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/misc/init.lua deleted file mode 100644 index 2d2a72f..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/misc/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -require "misc.titlebar" -require "misc.music" -require "misc.dings" diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/misc/music.lua b/modules/home-manager/ricing/awesomewm/dotfiles/misc/music.lua deleted file mode 100644 index cf72e2b..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/misc/music.lua +++ /dev/null @@ -1,304 +0,0 @@ -local awful = require 'awful' -require 'awful.autofocus' -local wibox = require 'wibox' -local gears = require 'gears' -local beautiful = require("beautiful") -local ruled = require("ruled") -local helpers = require("helpers") -local playerctl = require("mods.playerctl").lib() -local dpi = beautiful.xresources.apply_dpi - -local art = wibox.widget { - image = helpers.cropSurface(1, gears.surface.load_uncached(beautiful.songdefpicture)), - clip_shape = helpers.rrect(10), - opacity = 0.75, - resize = true, - forced_height = dpi(60), - forced_width = dpi(60), - valign = 'center', - widget = wibox.widget.imagebox -} -local leftart = wibox.widget { - image = beautiful.songdefpicture, - clip_shape = helpers.rrect(10), - opacity = 0.75, - resize = true, - forced_height = dpi(250), - forced_width = dpi(250), - valign = 'center', - widget = wibox.widget.imagebox -} -local prev = wibox.widget { - align = 'center', - font = beautiful.icon .. " 24", - markup = helpers.colorizeText('󰒮', beautiful.fg), - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - playerctl:previous() - end) - }, -} -local next = wibox.widget { - align = 'center', - font = beautiful.icon .. " 24", - markup = helpers.colorizeText('󰒭', beautiful.fg), - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - playerctl:next() - end) - }, -} - -local play = wibox.widget { - align = 'center', - font = beautiful.icon .. " 24", - markup = helpers.colorizeText('󰐊', beautiful.blue), - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - playerctl:play_pause() - end) - }, -} -local shufflebtn = wibox.widget { - align = 'center', - font = beautiful.icon .. " 13", - markup = helpers.colorizeText('󰒝', beautiful.fg), - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - playerctl:cycle_shuffle() - end) - } -} -playerctl:connect_signal("shuffle", function(_, shuffle) - shufflebtn.markup = shuffle and helpers.colorizeText('󰒝', beautiful.blue) or helpers.colorizeText('󰒝', - beautiful.fg) -end) -local repeatt = wibox.widget { - align = 'center', - font = beautiful.icon .. " 13", - markup = helpers.colorizeText('󰑖', beautiful.fg), - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - playerctl:cycle_loop_status() - end) - } -} -playerctl:connect_signal("loop_status", function(_, loop_status) - if loop_status:match('none') then - repeatt.markup = helpers.colorizeText('󰑖', beautiful.fg) - elseif loop_status:match('track') then - repeatt.markup = helpers.colorizeText('󰑘', beautiful.magenta) - else - repeatt.markup = helpers.colorizeText('󰑖', beautiful.magenta) - end -end) - -local createHandle = function(width, height, tl, tr, br, bl, radius) - return function(cr) - gears.shape.partially_rounded_rect(cr, width, height, tl, tr, br, bl, radius) - end -end -local slider = wibox.widget { - bar_shape = helpers.rrect(0), - bar_height = 3, - handle_color = beautiful.blue, - bar_color = beautiful.blue .. '33', - bar_active_color = beautiful.blue, - handle_shape = createHandle(18, 3, false, false, false, false, 0), - handle_margins = { top = 3 }, - handle_width = 18, - forced_height = 10, - maximum = 100, - widget = wibox.widget.slider, -} - -local songname = wibox.widget { - markup = helpers.colorizeText('Nothing Playing', beautiful.fg), - align = 'left', - valign = 'center', - forced_width = dpi(40), - font = beautiful.sans .. " 12", - widget = wibox.widget.textbox -} -local leftname = wibox.widget { - markup = helpers.colorizeText('Nothing Playing', beautiful.fg), - valign = 'center', - align = 'center', - font = beautiful.sans .. " 16", - widget = wibox.widget.textbox -} -local artistname = wibox.widget { - markup = helpers.colorizeText('None', beautiful.fg), - align = 'left', - valign = 'center', - forced_height = dpi(20), - font = beautiful.sans .. " 11", - widget = wibox.widget.textbox -} -local leftartist = wibox.widget { - markup = helpers.colorizeText('None', beautiful.fg), - align = 'center', - valign = 'center', - forced_height = dpi(20), - font = beautiful.sans .. " 11", - widget = wibox.widget.textbox -} -local is_prog_hovered = false -slider:connect_signal('mouse::enter', function() - is_prog_hovered = true -end) -slider:connect_signal('mouse::leave', function() - is_prog_hovered = false -end) -slider:connect_signal('property::value', function(_, value) - if is_prog_hovered then - playerctl:set_position(value) - end -end) -playerctl:connect_signal("position", function(_, interval_sec, length_sec) - slider.maximum = length_sec or 100 - slider.value = interval_sec or 0 -end) - -playerctl:connect_signal("metadata", function(_, title, artist, album_path, album, new, player_name) - if player_name == "mpd" then - if album_path == "" then - album_path = beautiful.songdefpicture - end - if string.len(title) > 30 then - title = string.sub(title, 0, 30) .. "..." - end - if string.len(artist) > 22 then - artist = string.sub(artist, 0, 22) .. "..." - end - songname:set_markup_silently(helpers.colorizeText(title or "NO", beautiful.fg)) - leftname:set_markup_silently(helpers.colorizeText(title or "NO", beautiful.fg)) - leftartist:set_markup_silently(helpers.colorizeText(' ' .. artist or "WT" .. ' ', beautiful.fg)) - artistname:set_markup_silently(helpers.colorizeText(artist or "HM", beautiful.fg)) - art:set_image(gears.surface.load_uncached(album_path)) - leftart:set_image(gears.surface.load_uncached(album_path)) - end -end) - - -playerctl:connect_signal("playback_status", function(_, playing) - play.markup = playing and helpers.colorizeText("󰏤", beautiful.blue) or helpers.colorizeText("󰐊", beautiful.blue) -end) -local createTopButton = function(c, icon, click, color) - local widget = wibox.widget { - { - { - markup = helpers.colorizeText(icon, color), - valign = 'center', - forced_height = dpi(20), - font = beautiful.icon .. " 18", - widget = wibox.widget.textbox - }, - margins = { - left = 8, - right = 8 - }, - widget = wibox.container.margin, - }, - buttons = awful.button({}, 1, function() - helpers.clickKey(c, click) - end), - bg = beautiful.mbg, - widget = wibox.container.background - } - return widget -end - -local bottom = function(c) - local playtab = createTopButton(c, '󰲸', '1', beautiful.blue) - local vistab = createTopButton(c, '󰐰', '8', beautiful.blue) - vistab:add_button(awful.button({}, 3, function() - helpers.clickKey(c, '8 ') - end)) - awful.titlebar(c, { position = "bottom", size = dpi(100), bg = beautiful.mbg }):setup { - slider, - { - { - { - { - art, - { - { - songname, - artistname, - forced_width = 400, - layout = wibox.layout.fixed.vertical, - }, - align = 'center', - widget = wibox.container.place - }, - spacing = 13, - layout = wibox.layout.fixed.horizontal, - }, - margins = { - top = 15, - bottom = 15, - left = 10, - right = 10, - }, - widget = wibox.container.margin, - }, - { - { - shufflebtn, - prev, - { - { - play, - margins = 4, - widget = wibox.container.margin - }, - shape = helpers.rrect(3), - bg = beautiful.blue .. '11', - widget = wibox.container.background - }, - next, - repeatt, - spacing = 15, - layout = wibox.layout.fixed.horizontal, - }, - align = 'center', - widget = wibox.container.place, - }, - { - playtab, - vistab, - spacing = 10, - layout = wibox.layout.fixed.horizontal, - }, - expand = 'none', - layout = wibox.layout.align.horizontal, - }, - widget = wibox.container.margin, - left = 15, - right = 15 - }, - layout = wibox.layout.fixed.vertical, - } -end - -local final = function(c) - bottom(c) -end - - -ruled.client.connect_signal("request::rules", function() - ruled.client.append_rule { - id = "music", - rule_any = { - class = { "ncmpcpppad" }, - role = { "pop-up" }, - }, - callback = final - } -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/airplanemode b/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/airplanemode deleted file mode 100644 index 4266a3d..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/airplanemode +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -STATUS="$(rfkill list | sed -n 2p | awk '{print $3}')" - - -toggle() { - if [[ $STATUS == "no" ]]; then - getroot 'pkexec rfkill block all' - notify-send --urgency=normal "Airplane Mode" "Airplane mode has been turned on!" - else - getroot 'pkexec rfkill unblock all' - notify-send --urgency=normal "Airplane Mode" "Airplane mode has been turned off!" - fi -} - - -if [[ $1 == "--toggle" ]]; then - toggle -fi diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/bluetooth b/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/bluetooth deleted file mode 100644 index db76e39..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/bluetooth +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -toggle() { - STATUS="$(bluetoothctl show | grep Powered | awk '{print $2}')" - if [ $STATUS == "yes" ]; then - bluetoothctl power off - notify-send -a "Bluetooth" --urgency=normal "Bluetooth" "Bluetooth has been turned off." - else - bluetoothctl power on - notify-send -a "Bluetooth" --urgency=normal "Bluetooth" "Bluetooth has been turned on." - fi -} - - -if [[ $1 == "--toggle" ]]; then - toggle -fi diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/picom b/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/picom deleted file mode 100644 index 6c0cd21..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/picom +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -toggle(){ - if [[ ! `pidof picom` ]]; then - picom & - else - pkill -9 picom - fi -} - -if [[ $1 == "--toggle" ]]; then - toggle -fi - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/redshift b/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/redshift deleted file mode 100644 index 964fb56..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/redshift +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -is_active=$(cat ~/.cache/redshift) - -toggle() { - if [[ $is_active == *"true"* ]]; then - redshift -x && echo false > ~/.cache/redshift - else - redshift -O 4000 && echo true > ~/.cache/redshift - fi -} - -if [[ $1 == "--toggle" ]]; then - toggle -fi diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/wifi b/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/wifi deleted file mode 100644 index f02ad33..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/misc/scripts/wifi +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -STATUS=$(nmcli | grep wlan0 | awk 'FNR == 1 {print $2}') -SSID=$(iwgetid -r) -STRENGTH=$(awk 'NR==3 {printf("%.0f",$3*10/7)}' /proc/net/wireless) - -toggle() { - if [[ $STATUS == "connected" ]]; then - nmcli radio wifi off - notify-send -a "wifi" --urgency=normal "Wi-Fi" "Wi-Fi has been turned off!" - else - nmcli radio wifi on - notify-send -a "wifi" --urgency=normal "Wi-Fi" "Wi-Fi has been turned on, you are back online!" - fi -} - - -if [[ $1 == "--toggle" ]]; then - toggle -fi diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/misc/titlebar.lua b/modules/home-manager/ricing/awesomewm/dotfiles/misc/titlebar.lua deleted file mode 100644 index a997f3d..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/misc/titlebar.lua +++ /dev/null @@ -1,103 +0,0 @@ -local awful = require "awful" -local gears = require "gears" -local wibox = require "wibox" -local beautiful = require "beautiful" -local helpers = require "helpers" -local getIcon = require "mods.getIcon" -local dpi = beautiful.xresources.apply_dpi - ------ Titlebar -local get_titlebar = function(c) - -- Button - 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) - }) - - -- Titlebar's decorations - local left = wibox.widget { - { - { - awful.titlebar.widget.closebutton(c), - awful.titlebar.widget.maximizedbutton(c), - awful.titlebar.widget.minimizebutton(c), - spacing = dpi(5), - layout = wibox.layout.fixed.horizontal, - }, - widget = wibox.container.margin, - margins = 8 - }, - shape = helpers.rrect(5), - widget = wibox.container.background, - bg = beautiful.mbg - } - - local middle = wibox.widget { - buttons = buttons, - layout = wibox.layout.fixed.horizontal, - } - - local right = wibox.widget { - { - { - { - widget = wibox.widget.imagebox, - image = getIcon(c, c.class, c.class), - forced_width = 30, - clip_shape = helpers.rrect(100), - resize = true, - }, - widget = wibox.container.place, - halign = "center", - }, - margins = dpi(5), - widget = wibox.container.margin - }, - bg = beautiful.mbg, - shape = helpers.rrect(5), - widget = wibox.container.background - } - - local container = wibox.widget { - bg = beautiful.bar, - shape = function(cr, w, h) gears.shape.partially_rounded_rect(cr, w, h, true, true, false, false, 0) end, - widget = wibox.container.background, - } - - c:connect_signal("focus", function() container.bg = beautiful.bg end) - c:connect_signal("unfocus", function() container.bg = beautiful.bg end) - - return wibox.widget { - { - { - left, - middle, - right, - layout = wibox.layout.align.horizontal, - }, - margins = { top = dpi(5), bottom = dpi(5), left = dpi(5), right = dpi(5) }, - widget = wibox.container.margin, - }, - widget = container, - } -end - -local function top(c) - local titlebar = awful.titlebar(c, { - position = 'top', - size = dpi(50), - bg = beautiful.transparent - }) - - titlebar:setup { - widget = get_titlebar(c) - } -end - -client.connect_signal("request::titlebars", function(c) - top(c) -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/mods/animation/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/mods/animation/init.lua deleted file mode 100644 index df164af..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/mods/animation/init.lua +++ /dev/null @@ -1,239 +0,0 @@ -------------------------------------------- --- @author https://github.com/Kasper24 --- @copyright 2021-2022 Kasper24 -------------------------------------------- - -local GLib = require("lgi").GLib -local gobject = require("gears.object") -local gtable = require("gears.table") -local subscribable = require("mods.animation.subscribable") -local tween = require("mods.animation.tween") -local ipairs = ipairs -local table = table -local pairs = pairs - -local animation_manager = {} -animation_manager.easing = -{ - linear = "linear", - inQuad = "inQuad", - outQuad = "outQuad", - inOutQuad = "inOutQuad", - outInQuad = "outInQuad", - inCubic = "inCubic", - outCubic = "outCubic", - inOutCubic = "inOutCubic", - outInCubic = "outInCubic", - inQuart = "inQuart", - outQuart = "outQuart", - inOutQuart = "inOutQuart", - outInQuart = "outInQuart", - inQuint = "inQuint", - outQuint = "outQuint", - inOutQuint = "inOutQuint", - outInQuint = "outInQuint", - inSine = "inSine", - outSine = "outSine", - inOutSine = "inOutSine", - outInSine = "outInSine", - inExpo = "inExpo", - outExpo = "outExpo", - inOutExpo = "inOutExpo", - outInExpo = "outInExpo", - inCirc = "inCirc", - outCirc = "outCirc", - inOutCirc = "inOutCirc", - outInCirc = "outInCirc", - inElastic = "inElastic", - outElastic = "outElastic", - inOutElastic = "inOutElastic", - outInElastic = "outInElastic", - inBack = "inBack", - outBack = "outBack", - inOutBack = "inOutBack", - outInBack = "outInBack", - inBounce = "inBounce", - outBounce = "outBounce", - inOutBounce = "inOutBounce", - outInBounce = "outInBounce" -} - -local animation = {} - -local instance = nil - -local ANIMATION_FRAME_DELAY = 5 - -local function micro_to_milli(micro) - return micro / 1000 -end - -local function second_to_micro(sec) - return sec * 1000000 -end - -local function second_to_milli(sec) - return sec * 1000 -end - -function animation:start(args) - args = args or {} - - -- Awestoer/Rubbto compatibility - -- I'd rather this always be a table, but Awestoer/Rubbto - -- except the :set() method to have 1 number value parameter - -- used to set the target - local is_table = type(args) == "table" - local initial = is_table and (args.pos or self.pos) or self.pos - local subject = is_table and (args.subject or self.subject) or self.subject - local target = is_table and (args.target or self.target) or args - local duration = is_table and (args.duration or self.duration) or self.duration - local easing = is_table and (args.easing or self.easing) or self.easing - - duration = self._private.anim_manager._private.instant == true and 0.01 or duration - - if self.tween == nil or self.reset_on_stop == true then - self.tween = tween.new - { - initial = initial, - subject = subject, - target = target, - duration = second_to_micro(duration), - easing = easing - } - end - - if self._private.anim_manager._private.animations[self.index] == nil then - table.insert(self._private.anim_manager._private.animations, self) - end - - self.state = true - self.last_elapsed = GLib.get_monotonic_time() - - self.started:fire() - self:emit_signal("started") -end - -function animation:set(args) - self:start(args) - self:emit_signal("set") -end - -function animation:stop() - self.state = false - self:emit_signal("stopped") -end - -function animation:abort(reset) - animation:stop(reset) - self:emit_signal("aborted") -end - -function animation:initial() - return self._private.initial -end - -function animation_manager:set_instant(value) - self._private.instant = value -end - -function animation_manager:new(args) - args = args or {} - - args.pos = args.pos or 0 - args.subject = args.subject or nil - args.target = args.target or nil - args.duration = args.duration or 0 - args.easing = args.easing or nil - args.loop = args.loop or false - args.signals = args.signals or {} - args.update = args.update or nil - args.reset_on_stop = args.reset_on_stop == nil and true or args.reset_on_stop - - -- Awestoer/Rubbto compatibility - args.subscribed = args.subscribed or nil - local ret = subscribable() - ret.started = subscribable() - ret.ended = subscribable() - if args.subscribed ~= nil then - ret:subscribe(args.subscribed) - end - - for sig, sigfun in pairs(args.signals) do - ret:connect_signal(sig, sigfun) - end - if args.update ~= nil then - ret:connect_signal("update", args.update) - end - - gtable.crush(ret, args, true) - gtable.crush(ret, animation, true) - - ret._private = {} - ret._private.anim_manager = self - ret._private.initial = args.pos - - return ret -end - -local function new() - local ret = gobject {} - gtable.crush(ret, animation_manager, true) - - ret._private = {} - ret._private.animations = {} - ret._private.instant = false - - GLib.timeout_add - ( - GLib.PRIORITY_DEFAULT, - ANIMATION_FRAME_DELAY, - function() - for index, animation in ipairs(ret._private.animations) do - if animation.state == true then - -- compute delta time - local time = GLib.get_monotonic_time() - local delta = time - animation.last_elapsed - animation.last_elapsed = time - - -- If pos is true, the animation has ended - local pos = animation.tween:update(delta) - if pos == true then - -- Loop the animation, don't end it. - -- Useful for widgets like the spinning cicle - if animation.loop == true then - animation.tween:reset() - else - -- Snap to end - animation.pos = animation.tween.target - animation:fire(animation.pos) - animation:emit_signal("update", animation.pos) - - animation.state = false - animation.ended:fire(pos) - table.remove(ret._private.animations, index) - animation:emit_signal("ended", animation.pos) - end - -- Animation in process, keep updating - else - animation.pos = pos - animation:fire(animation.pos) - animation:emit_signal("update", animation.pos) - end - else - table.remove(ret._private.animations, index) - end - end - - -- call again the function after cooldown - return true - end - ) - - return ret -end - -if not instance then - instance = new() -end -return instance diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/mods/animation/subscribable.lua b/modules/home-manager/ricing/awesomewm/dotfiles/mods/animation/subscribable.lua deleted file mode 100644 index 642b787..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/mods/animation/subscribable.lua +++ /dev/null @@ -1,41 +0,0 @@ -------------------------------------------- --- @author https://github.com/Kasper24 --- @copyright 2021-2022 Kasper24 --- Adopted from rubato -------------------------------------------- - - -local gobject = require("gears.object") - --- Kidna copying awesotre's stores on a surface level for added compatibility -local function subscribable(args) - local ret = gobject {} - local subscribed = {} - - -- Subscrubes a function to the object so that it's called when `fire` is - -- Calls subscribe_callback if it exists as well - function ret:subscribe(func) - local id = tostring(func):gsub("function: ", "") - subscribed[id] = func - - if self.subscribe_callback then self.subscribe_callback(func) end - end - - -- Unsubscribes a function and calls unsubscribe_callback if it exists - function ret:unsubscribe(func) - if not func then - subscribed = {} - else - local id = tostring(func):gsub("function: ", "") - subscribed[id] = nil - end - - if self.unsubscribe_callback then self.unsubscribe_callback(func) end - end - - function ret:fire(...) for _, func in pairs(subscribed) do func(...) end end - - return ret -end - -return subscribable diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/mods/animation/tween.lua b/modules/home-manager/ricing/awesomewm/dotfiles/mods/animation/tween.lua deleted file mode 100644 index a31bfb5..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/mods/animation/tween.lua +++ /dev/null @@ -1,527 +0,0 @@ -------------------------------------------- --- @author https://github.com/Kasper24 --- @copyright 2021-2022 Kasper24 -------------------------------------------- - --- easing - --- Adapted from https://github.com/EmmanuelOga/easing. See LICENSE.txt for credits. --- For all easing functions: --- t = time == how much time has to pass for the tweening to complete --- b = begin == starting property value --- c = change == ending - beginning --- d = duration == running time. How much time has passed *right now* - -local gobject = require("gears.object") -local gtable = require("gears.table") - -local tween = { - _VERSION = 'tween 2.1.1', - _DESCRIPTION = 'tweening for lua', - _URL = 'https://github.com/kikito/tween.lua', - _LICENSE = [[ - MIT LICENSE - Copyright (c) 2014 Enrique García Cota, Yuichi Tateno, Emmanuel Oga - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ]] -} - -local pow, sin, cos, pi, sqrt, abs, asin = math.pow, math.sin, math.cos, math.pi, math.sqrt, math.abs, math.asin - --- linear -local function linear(t, b, c, d) - return c * t / d + b -end - --- quad -local function inQuad(t, b, c, d) - return c * pow(t / d, 2) + b -end - -local function outQuad(t, b, c, d) - t = t / d - return -c * t * (t - 2) + b -end - -local function inOutQuad(t, b, c, d) - t = t / d * 2 - if t < 1 then - return c / 2 * pow(t, 2) + b - end - return -c / 2 * ((t - 1) * (t - 3) - 1) + b -end - -local function outInQuad(t, b, c, d) - if t < d / 2 then - return outQuad(t * 2, b, c / 2, d) - end - return inQuad((t * 2) - d, b + c / 2, c / 2, d) -end - --- cubic -local function inCubic(t, b, c, d) - return c * pow(t / d, 3) + b -end - -local function outCubic(t, b, c, d) - return c * (pow(t / d - 1, 3) + 1) + b -end - -local function inOutCubic(t, b, c, d) - t = t / d * 2 - if t < 1 then - return c / 2 * t * t * t + b - end - t = t - 2 - return c / 2 * (t * t * t + 2) + b -end - -local function outInCubic(t, b, c, d) - if t < d / 2 then - return outCubic(t * 2, b, c / 2, d) - end - return inCubic((t * 2) - d, b + c / 2, c / 2, d) -end - --- quart -local function inQuart(t, b, c, d) - return c * pow(t / d, 4) + b -end - -local function outQuart(t, b, c, d) - return -c * (pow(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 - end - return -c / 2 * (pow(t - 2, 4) - 2) + b -end - -local function outInQuart(t, b, c, d) - if t < d / 2 then - return outQuart(t * 2, b, c / 2, d) - end - return inQuart((t * 2) - d, b + c / 2, c / 2, d) -end - --- quint -local function inQuint(t, b, c, d) - return c * pow(t / d, 5) + b -end - -local function outQuint(t, b, c, d) - return c * (pow(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 - end - return c / 2 * (pow(t - 2, 5) + 2) + b -end - -local function outInQuint(t, b, c, d) - if t < d / 2 then - return outQuint(t * 2, b, c / 2, d) - end - return inQuint((t * 2) - d, b + c / 2, c / 2, d) -end - --- sine -local function inSine(t, b, c, d) - return -c * cos(t / d * (pi / 2)) + c + b -end - -local function outSine(t, b, c, d) - return c * sin(t / d * (pi / 2)) + b -end - -local function inOutSine(t, b, c, d) - return -c / 2 * (cos(pi * t / d) - 1) + b -end - -local function outInSine(t, b, c, d) - if t < d / 2 then - return outSine(t * 2, b, c / 2, d) - end - return inSine((t * 2) - d, b + c / 2, c / 2, d) -end - --- expo -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 -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 -end - -local function inOutExpo(t, b, c, d) - if t == 0 then - return b - end - if t == d then - return b + c - end - t = t / d * 2 - if t < 1 then - return c / 2 * pow(2, 10 * (t - 1)) + b - c * 0.0005 - end - return c / 2 * 1.0005 * (-pow(2, -10 * (t - 1)) + 2) + b -end - -local function outInExpo(t, b, c, d) - if t < d / 2 then - return outExpo(t * 2, b, c / 2, d) - end - return inExpo((t * 2) - d, b + c / 2, c / 2, d) -end - --- circ -local function inCirc(t, b, c, d) - return (-c * (sqrt(1 - pow(t / d, 2)) - 1) + b) -end - -local function outCirc(t, b, c, d) - return (c * sqrt(1 - pow(t / d - 1, 2)) + b) -end - -local function inOutCirc(t, b, c, d) - t = t / d * 2 - if t < 1 then - return -c / 2 * (sqrt(1 - t * t) - 1) + b - end - t = t - 2 - return c / 2 * (sqrt(1 - t * t) + 1) + b -end - -local function outInCirc(t, b, c, d) - if t < d / 2 then - return outCirc(t * 2, b, c / 2, d) - end - return inCirc((t * 2) - d, b + c / 2, c / 2, d) -end - --- elastic -local function calculatePAS(p, a, c, d) - p, a = p or d * 0.3, a or 0 - if a < abs(c) then - return p, c, p / 4 - end -- p, a, s - return p, a, p / (2 * pi) * asin(c / a) -- p,a,s -end - -local function inElastic(t, b, c, d, a, p) - local s - if t == 0 then - return b - end - t = t / d - if t == 1 then - return b + c - 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 -end - -local function outElastic(t, b, c, d, a, p) - local s - if t == 0 then - return b - end - t = t / d - if t == 1 then - 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 -end - -local function inOutElastic(t, b, c, d, a, p) - local s - if t == 0 then - return b - end - t = t / d * 2 - if t == 2 then return b + c end - 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 - end - return a * pow(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 - return outElastic(t * 2, b, c / 2, d, a, p) - end - return inElastic((t * 2) - d, b + c / 2, c / 2, d, a, p) -end - --- back -local function inBack(t, b, c, d, s) - s = s or 1.70158 - t = t / d - return c * t * t * ((s + 1) * t - s) + b -end - -local function outBack(t, b, c, d, s) - s = s or 1.70158 - t = t / d - 1 - return c * (t * t * ((s + 1) * t + s) + 1) + b -end - -local function inOutBack(t, b, c, d, s) - s = (s or 1.70158) * 1.525 - t = t / d * 2 - if t < 1 then - return c / 2 * (t * t * ((s + 1) * t - s)) + b - end - t = t - 2 - return c / 2 * (t * t * ((s + 1) * t + s) + 2) + b -end - -local function outInBack(t, b, c, d, s) - if t < d / 2 then - return outBack(t * 2, b, c / 2, d, s) - end - return inBack((t * 2) - d, b + c / 2, c / 2, d, s) -end - --- bounce -local function outBounce(t, b, c, d) - t = t / d - if t < 1 / 2.75 then - return c * (7.5625 * t * t) + b - end - if t < 2 / 2.75 then - t = t - (1.5 / 2.75) - return c * (7.5625 * t * t + 0.75) + b - elseif t < 2.5 / 2.75 then - t = t - (2.25 / 2.75) - return c * (7.5625 * t * t + 0.9375) + b - end - t = t - (2.625 / 2.75) - return c * (7.5625 * t * t + 0.984375) + b -end - -local function inBounce(t, b, c, d) - return c - outBounce(d - t, 0, c, d) + b -end - -local function inOutBounce(t, b, c, d) - if t < d / 2 then - return inBounce(t * 2, 0, c, d) * 0.5 + b - end - return outBounce(t * 2 - d, 0, c, d) * 0.5 + c * .5 + b -end - -local function outInBounce(t, b, c, d) - if t < d / 2 then - return outBounce(t * 2, b, c / 2, d) - end - return inBounce((t * 2) - d, b + c / 2, c / 2, d) -end - -tween.easing = -{ - linear = linear, - inQuad = inQuad, outQuad = outQuad, inOutQuad = inOutQuad, outInQuad = outInQuad, - inCubic = inCubic, outCubic = outCubic, inOutCubic = inOutCubic, outInCubic = outInCubic, - inQuart = inQuart, outQuart = outQuart, inOutQuart = inOutQuart, outInQuart = outInQuart, - inQuint = inQuint, outQuint = outQuint, inOutQuint = inOutQuint, outInQuint = outInQuint, - inSine = inSine, outSine = outSine, inOutSine = inOutSine, outInSine = outInSine, - inExpo = inExpo, outExpo = outExpo, inOutExpo = inOutExpo, outInExpo = outInExpo, - inCirc = inCirc, outCirc = outCirc, inOutCirc = inOutCirc, outInCirc = outInCirc, - inElastic = inElastic, outElastic = outElastic, inOutElastic = inOutElastic, outInElastic = outInElastic, - inBack = inBack, outBack = outBack, inOutBack = inOutBack, outInBack = outInBack, - inBounce = inBounce, outBounce = outBounce, inOutBounce = inOutBounce, outInBounce = outInBounce -} - --- Private interface -local function copyTables(destination, keysTable, valuesTable) - valuesTable = valuesTable or keysTable - local mt = getmetatable(keysTable) - if mt and getmetatable(destination) == nil then - setmetatable(destination, mt) - end - - for k, v in pairs(keysTable) do - if type(v) == 'table' then - destination[k] = copyTables({}, v, valuesTable[k]) - else - destination[k] = valuesTable[k] - end - end - return destination -end - -local function checkSubjectAndTargetRecursively(subject, target, path) - path = path or {} - local targetType, newPath - for k, targetValue in pairs(target) do - targetType, newPath = type(targetValue), copyTables({}, path) - table.insert(newPath, tostring(k)) - if targetType == 'number' then - assert(type(subject[k]) == 'number', - "Parameter '" .. table.concat(newPath, '/') .. "' is missing from subject or isn't a number") - elseif targetType == 'table' then - checkSubjectAndTargetRecursively(subject[k], targetValue, newPath) - else - assert(targetType == 'number', - "Parameter '" .. table.concat(newPath, '/') .. "' must be a number or table of numbers") - end - end -end - -local function checkNewParams(initial, duration, 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)) - - if subject and target then - local tsubject = type(subject) - assert(tsubject == 'table' or tsubject == 'userdata', - "subject must be a table or userdata. Was " .. tostring(subject)) - assert(type(target) == 'table', "target must be a table. Was " .. tostring(target)) - checkSubjectAndTargetRecursively(subject, target) - end -end - -local function getEasingFunction(easing) - easing = easing or "linear" - if type(easing) == 'string' then - local name = easing - easing = tween.easing[name] - if type(easing) ~= 'function' then - error("The easing function name '" .. name .. "' is invalid") - end - end - return easing -end - -local function performEasingOnSubject(subject, target, initial, clock, duration, easing) - local t, b, c, d - for k, v in pairs(target) do - if type(v) == 'table' then - performEasingOnSubject(subject[k], v, initial[k], clock, duration, easing) - else - t, b, c, d = clock, initial[k], v - initial[k], duration - subject[k] = easing(t, b, c, d) - end - end -end - -local function performEasing(table, initial, target, clock, duration, easing) - if type(target) == "table" then - local t, b, c, d - for k, v in pairs(target) do - if type(v) == 'table' then - table[k] = {} - performEasing(table[k], initial[k], v, clock, duration, easing) - else - t, b, c, d = clock, initial[k], v - initial[k], duration - table[k] = easing(t, b, c, d) - end - end - - return table - else - local t, b, c, d = clock, initial, target - initial, duration - return easing(t, b, c, d) - end -end - --- Public interface -local Tween = {} - -function Tween:set(clock) - assert(type(clock) == 'number', "clock must be a positive number or 0") - - if self.subject and self.initial == 0 then - self.initial = copyTables({}, self.target, self.subject) - end - - self.clock = clock - - if self.clock <= 0 then - self.clock = 0 - if self.subject then - copyTables(self.subject, self.initial) - end - elseif self.clock >= self.duration then -- the tween has expired - self.clock = self.duration - - if self.subject then - copyTables(self.subject, self.target) - end - else - if self.subject then - performEasingOnSubject(self.subject, self.target, self.initial, self.clock, self.duration, self.easing) - else - local pos = {} - return performEasing(pos, self.initial, self.target, self.clock, self.duration, self.easing) - end - end - - return self.clock >= self.duration -end - -function Tween:update(dt) - assert(type(dt) == 'number', "dt must be a number") - return self:set(self.clock + dt) -end - -function Tween:reset() - return self:set(0) -end - -function tween.new(args) - args = args or {} - - args.initial = args.initial or 0 - args.subject = args.subject or nil - args.target = args.target or nil - args.duration = args.duration or 0 - args.easing = args.easing or nil - - args.easing = getEasingFunction(args.easing) - checkNewParams(args.initial, args.duration, args.subject, args.target, args.easing) - - local ret = gobject {} - ret.clock = 0 - - gtable.crush(ret, args, true) - gtable.crush(ret, Tween, true) - - return ret -end - -return tween diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/mods/getIcon.lua b/modules/home-manager/ricing/awesomewm/dotfiles/mods/getIcon.lua deleted file mode 100644 index 02ab395..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/mods/getIcon.lua +++ /dev/null @@ -1,103 +0,0 @@ -local gfs = require("gears.filesystem") -local gears = require("gears") -local theme_path = gfs.get_configuration_dir() .. "/theme/" -local icon_cache = {} -local helpers = require("helpers") -local t = helpers.readJson(gears.filesystem.get_cache_dir() .. "json/settings.json").iconTheme - - -local custom = { - { - name = "clearpad", - to = "terminal" - }, - { - name = "ncmpcpppad", - to = "deepin-music-player" - }, -} - -local function hasValue(str) - local f = false - local ind = 0 - for i, j in ipairs(custom) do - if j.name == str then - f = true - ind = i - break - end - end - return f, ind -end - - -local function Get_icon(client, program_string, class_string) - client = client or nil - program_string = program_string or nil - class_string = class_string or nil - - if (client or program_string or class_string) then - local clientName - local isCustom, pos = hasValue(class_string) - if isCustom == true then - clientName = custom[pos].to .. ".svg" - elseif client then - if client.class then - clientName = string.lower(client.class:gsub(" ", "")) .. ".svg" - elseif client.name then - clientName = string.lower(client.name:gsub(" ", "")) .. ".svg" - else - if client.icon then - return client.icon - else - return t .. "/apps/default-application.svg" - end - end - else - if program_string then - clientName = program_string .. ".svg" - else - clientName = class_string .. ".svg" - end - end - - for index, icon in ipairs(icon_cache) do - if icon:match(clientName) then - return icon - end - end - - local iconDir = t .. "/apps/" - local ioStream = io.open(iconDir .. clientName, "r") - if ioStream ~= nil then - icon_cache[#icon_cache + 1] = iconDir .. clientName - return iconDir .. clientName - else - clientName = clientName:gsub("^%l", string.upper) - iconDir = t .. "/apps//" - ioStream = io.open(iconDir .. clientName, "r") - if ioStream ~= nil then - icon_cache[#icon_cache + 1] = iconDir .. clientName - return iconDir .. clientName - elseif not class_string then - return t .. "/apps/default-application.svg" - else - clientName = class_string .. ".svg" - iconDir = t .. "/apps/" - ioStream = io.open(iconDir .. clientName, "r") - if ioStream ~= nil then - icon_cache[#icon_cache + 1] = iconDir .. clientName - return iconDir .. clientName - else - return t .. "/apps/default-application.svg" - end - end - end - end - if client then - return t .. "/apps/default-application.svg" - end -end - - -return Get_icon diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/mods/inspect.lua b/modules/home-manager/ricing/awesomewm/dotfiles/mods/inspect.lua deleted file mode 100644 index 3ea22a9..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/mods/inspect.lua +++ /dev/null @@ -1,344 +0,0 @@ -local inspect = { - _VERSION = 'inspect.lua 3.1.0', - _URL = 'http://github.com/kikito/inspect.lua', - _DESCRIPTION = 'human-readable representations of tables', - _LICENSE = [[ - MIT LICENSE - Copyright (c) 2013 Enrique García Cota - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ]] -} - -local tostring = tostring - -inspect.KEY = setmetatable({}, { __tostring = function() return 'inspect.KEY' end }) -inspect.METATABLE = setmetatable({}, { __tostring = function() return 'inspect.METATABLE' end }) - -local function rawpairs(t) - return next, t, nil -end - --- Apostrophizes the string if it has quotes, but not aphostrophes --- Otherwise, it returns a regular quoted string -local function smartQuote(str) - if str:match('"') and not str:match("'") then - return "'" .. str .. "'" - end - return '"' .. str:gsub('"', '\\"') .. '"' -end - --- \a => '\\a', \0 => nil -local shortControlCharEscapes = { - ["\a"] = "\\a", - ["\b"] = "\\b", - ["\f"] = "\\f", - ["\n"] = "\\n", - ["\r"] = "\\r", - ["\t"] = "\\t", - ["\v"] = "\\v", - ["\127"] = "\\127", -} -local longControlCharEscapes = { ["\127"] = "\127" } -- \a => nil, \0 => \000, 31 => \031 -for i = 0, 31 do - local ch = string.char(i) - if not shortControlCharEscapes[ch] then - shortControlCharEscapes[ch] = "\\" .. i - longControlCharEscapes[ch] = string.format("\\%03d", i) - end -end ---longControlCharEscapes["\127"]="\\127" - -local function escape(str) - return (str:gsub("\\", "\\\\") - :gsub("(%c)%f[0-9]", longControlCharEscapes) - :gsub("%c", shortControlCharEscapes)) -end - -local function isIdentifier(str) - return type(str) == 'string' and str:match("^[_%a][_%a%d]*$") -end - -local function isSequenceKey(k, sequenceLength) - return type(k) == 'number' - and 1 <= k - and k <= sequenceLength - and math.floor(k) == k -end - -local defaultTypeOrders = { - ['number'] = 1, - ['boolean'] = 2, - ['string'] = 3, - ['table'] = 4, - ['function'] = 5, - ['userdata'] = 6, - ['thread'] = 7 -} - -local function sortKeys(a, b) - local ta, tb = type(a), type(b) - - -- strings and numbers are sorted numerically/alphabetically - if ta == tb and (ta == 'string' or ta == 'number') then return a < b end - - local dta, dtb = defaultTypeOrders[ta], defaultTypeOrders[tb] - -- Two default types are compared according to the defaultTypeOrders table - if dta and dtb then - return defaultTypeOrders[ta] < defaultTypeOrders[tb] - elseif dta then - return true -- default types before custom ones - elseif dtb then - return false -- custom types after default ones - end - - -- custom types are sorted out alphabetically - return ta < tb -end - --- For implementation reasons, the behavior of rawlen & # is "undefined" when --- tables aren't pure sequences. So we implement our own # operator. -local function getSequenceLength(t) - local len = 1 - local v = rawget(t, len) - while v ~= nil do - len = len + 1 - v = rawget(t, len) - end - return len - 1 -end - -local function getNonSequentialKeys(t) - local keys, keysLength = {}, 0 - local sequenceLength = getSequenceLength(t) - for k, _ in rawpairs(t) do - if not isSequenceKey(k, sequenceLength) then - keysLength = keysLength + 1 - keys[keysLength] = k - end - end - table.sort(keys, sortKeys) - return keys, keysLength, sequenceLength -end - -local function countTableAppearances(t, tableAppearances) - tableAppearances = tableAppearances or {} - - if type(t) == 'table' then - if not tableAppearances[t] then - tableAppearances[t] = 1 - for k, v in rawpairs(t) do - countTableAppearances(k, tableAppearances) - countTableAppearances(v, tableAppearances) - end - countTableAppearances(getmetatable(t), tableAppearances) - else - tableAppearances[t] = tableAppearances[t] + 1 - end - end - - return tableAppearances -end - -local copySequence = function(s) - local copy, len = {}, #s - for i = 1, len do copy[i] = s[i] end - return copy, len -end - -local function makePath(path, ...) - local keys = { ... } - local newPath, len = copySequence(path) - for i = 1, #keys do - newPath[len + i] = keys[i] - end - return newPath -end - -local function processRecursive(process, item, path, visited) - if item == nil then return nil end - if visited[item] then return visited[item] end - - local processed = process(item, path) - if type(processed) == 'table' then - local processedCopy = {} - visited[item] = processedCopy - local processedKey - - for k, v in rawpairs(processed) do - processedKey = processRecursive(process, k, makePath(path, k, inspect.KEY), visited) - if processedKey ~= nil then - processedCopy[processedKey] = processRecursive(process, v, makePath(path, processedKey), visited) - end - end - - local mt = processRecursive(process, getmetatable(processed), makePath(path, inspect.METATABLE), visited) - if type(mt) ~= 'table' then mt = nil end -- ignore not nil/table __metatable field - setmetatable(processedCopy, mt) - processed = processedCopy - end - return processed -end - - - -------------------------------------------------------------------- - -local Inspector = {} -local Inspector_mt = { __index = Inspector } - -function Inspector:puts(...) - local args = { ... } - local buffer = self.buffer - local len = #buffer - for i = 1, #args do - len = len + 1 - buffer[len] = args[i] - end -end - -function Inspector:down(f) - self.level = self.level + 1 - f() - self.level = self.level - 1 -end - -function Inspector:tabify() - self:puts(self.newline, string.rep(self.indent, self.level)) -end - -function Inspector:alreadyVisited(v) - return self.ids[v] ~= nil -end - -function Inspector:getId(v) - local id = self.ids[v] - if not id then - local tv = type(v) - id = (self.maxIds[tv] or 0) + 1 - self.maxIds[tv] = id - self.ids[v] = id - end - return tostring(id) -end - -function Inspector:putKey(k) - if isIdentifier(k) then return self:puts(k) end - self:puts("[") - self:putValue(k) - self:puts("]") -end - -function Inspector:putTable(t) - if t == inspect.KEY or t == inspect.METATABLE then - self:puts(tostring(t)) - elseif self:alreadyVisited(t) then - self:puts('') - elseif self.level >= self.depth then - self:puts('{...}') - else - if self.tableAppearances[t] > 1 then self:puts('<', self:getId(t), '>') end - - local nonSequentialKeys, nonSequentialKeysLength, sequenceLength = getNonSequentialKeys(t) - local mt = getmetatable(t) - - self:puts('{') - self:down(function() - local count = 0 - for i = 1, sequenceLength do - if count > 0 then self:puts(',') end - self:puts(' ') - self:putValue(t[i]) - count = count + 1 - end - - for i = 1, nonSequentialKeysLength do - local k = nonSequentialKeys[i] - if count > 0 then self:puts(',') end - self:tabify() - self:putKey(k) - self:puts(' = ') - self:putValue(t[k]) - count = count + 1 - end - - if type(mt) == 'table' then - if count > 0 then self:puts(',') end - self:tabify() - self:puts(' = ') - self:putValue(mt) - end - end) - - if nonSequentialKeysLength > 0 or type(mt) == 'table' then -- result is multi-lined. Justify closing } - self:tabify() - elseif sequenceLength > 0 then -- array tables have one extra space before closing } - self:puts(' ') - end - - self:puts('}') - end -end - -function Inspector:putValue(v) - local tv = type(v) - - if tv == 'string' then - self:puts(smartQuote(escape(v))) - elseif tv == 'number' or tv == 'boolean' or tv == 'nil' or - tv == 'cdata' or tv == 'ctype' then - self:puts(tostring(v)) - elseif tv == 'table' then - self:putTable(v) - else - self:puts('<', tv, ' ', self:getId(v), '>') - end -end - -------------------------------------------------------------------- - -function inspect.inspect(root, options) - options = options or {} - - local depth = options.depth or math.huge - local newline = options.newline or '\n' - local indent = options.indent or ' ' - local process = options.process - - if process then - root = processRecursive(process, root, {}, {}) - end - - local inspector = setmetatable({ - depth = depth, - level = 0, - buffer = {}, - ids = {}, - maxIds = {}, - newline = newline, - indent = indent, - tableAppearances = countTableAppearances(root) - }, Inspector_mt) - - inspector:putValue(root) - - return table.concat(inspector.buffer) -end - -setmetatable(inspect, { __call = function(_, ...) return inspect.inspect(...) end }) - -return inspect diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/mods/json.lua b/modules/home-manager/ricing/awesomewm/dotfiles/mods/json.lua deleted file mode 100644 index 9bdc02c..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/mods/json.lua +++ /dev/null @@ -1,383 +0,0 @@ --- --- json.lua --- --- Copyright (c) 2020 rxi --- --- Permission is hereby granted, free of charge, to any person obtaining a copy of --- this software and associated documentation files (the "Software"), to deal in --- the Software without restriction, including without limitation the rights to --- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies --- of the Software, and to permit persons to whom the Software is furnished to do --- so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in all --- copies or substantial portions of the Software. --- --- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --- SOFTWARE. --- - -local json = { _version = "0.1.2" } - -------------------------------------------------------------------------------- --- Encode -------------------------------------------------------------------------------- - -local encode - -local escape_char_map = { - ["\\"] = "\\", - ["\""] = "\"", - ["\b"] = "b", - ["\f"] = "f", - ["\n"] = "n", - ["\r"] = "r", - ["\t"] = "t", -} - -local escape_char_map_inv = { ["/"] = "/" } -for k, v in pairs(escape_char_map) do - escape_char_map_inv[v] = k -end - - -local function escape_char(c) - return "\\" .. (escape_char_map[c] or string.format("u%04x", c:byte())) -end - - -local function encode_nil(val) - return "null" -end - - -local function encode_table(val, stack) - local res = {} - stack = stack or {} - - -- Circular reference? - if stack[val] then error("circular reference") end - - 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 -end - - -local function encode_string(val) - 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) -end - - -local type_func_map = { - ["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 .. "'") -end - - -function json.encode(val) - return (encode(val)) -end - -------------------------------------------------------------------------------- --- Decode -------------------------------------------------------------------------------- - -local parse - -local function create_set(...) - 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 literal_map = { - ["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 -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)) -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)) -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 -end - - -local function parse_string(str, i) - local res = "" - local j = i + 1 - local k = j - - while j <= #str do - local x = str:byte(j) - - 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 - - j = j + 1 - end - - 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 -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 -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 -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 -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 = 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 .. "'") -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 -end - -return json diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/mods/menu.lua b/modules/home-manager/ricing/awesomewm/dotfiles/mods/menu.lua deleted file mode 100644 index 3dc767a..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/mods/menu.lua +++ /dev/null @@ -1,342 +0,0 @@ -local awful = require("awful") -local gtable = require("gears.table") -local gtimer = require("gears.timer") -local wibox = require("wibox") -local beautiful = require("beautiful") -local helpers = require("helpers") -local dpi = beautiful.xresources.apply_dpi -local setmetatable = setmetatable -local ipairs = ipairs -local capi = { awesome = awesome, mouse = mouse, tag = tag } - -local menu = { mt = {} } - -function menu:set_pos(args) - args = args or {} - - local coords = args.coords - local wibox = args.wibox - local widget = args.widget - local offset = args.offset or { x = 0, y = 0 } - - if offset.x == nil then - offset.x = 0 - end - if offset.y == nil then - offset.y = 0 - end - - local screen_workarea = awful.screen.focused().workarea - local screen_w = screen_workarea.x + screen_workarea.width - local screen_h = screen_workarea.y + screen_workarea.height - - if not coords and wibox and widget then - coords = helpers.get_widget_geometry(wibox, widget) - else - coords = args.coords or capi.mouse.coords() - end - - if coords.x + self.width > screen_w then - if self.parent_menu ~= nil then - self.x = coords.x - (self.width * 2) - offset.x - else - self.x = coords.x - self.width + offset.x - end - else - self.x = coords.x + offset.x - end - - if coords.y + self.height > screen_h then - self.y = screen_h - self.height + offset.y - else - self.y = coords.y + offset.y - end -end - -function menu:hide_parents_menus() - if self.parent_menu ~= nil then - self.parent_menu:hide(true) - end -end - -function menu:hide_children_menus() - if self.widget then - for _, button in ipairs(self.widget.children) do - if button.sub_menu ~= nil then - button.sub_menu:hide() - end - end - end -end - -function menu:hide(hide_parents) - if self.visible == false then - return - end - - -- Hide self - self.visible = false - - -- Hides all child menus - self:hide_children_menus() - - if hide_parents == true then - self:hide_parents_menus() - end -end - -function menu:show(args) - if self.visible == true then - return - end - - self.can_hide = false - - gtimer({ - timeout = 0.1, - autostart = true, - call_now = false, - single_shot = true, - callback = function() - self.can_hide = true - end, - }) - - -- Hide sub menus belonging to the menu of self - if self.parent_menu ~= nil then - for _, button in ipairs(self.parent_menu.widget.children) do - if button.sub_menu ~= nil and button.sub_menu ~= self then - button.sub_menu:hide() - end - end - end - - self:set_pos(args) - self.visible = true - - capi.awesome.emit_signal("menu::toggled_on", self) -end - -function menu:toggle(args) - if self.visible == true then - self:hide() - else - self:show(args) - end -end - -function menu:add(widget) - if widget.sub_menu then - widget.sub_menu.parent_menu = self - end - widget.menu = self - self.widget:add(widget) -end - -function menu:remove(widget) - self.widget:remove(widget) -end - -function menu:reset() - self.widget:reset() -end - -function menu.menu(widgets, width) - local widget = awful.popup({ - x = 32500, - type = "menu", - visible = false, - ontop = true, - minimum_width = width or dpi(300), - maximum_width = width or dpi(300), - shape = helpers.rrect(9), - bg = beautiful.main_menu_bg, - widget = wibox.layout.fixed.vertical, - }) - gtable.crush(widget, menu, true) - - awful.mouse.append_client_mousebinding(awful.button({ "Any" }, 1, function(c) - if widget.can_hide == true then - widget:hide(true) - end - end)) - - awful.mouse.append_client_mousebinding(awful.button({ "Any" }, 3, function(c) - if widget.can_hide == true then - widget:hide(true) - end - end)) - - awful.mouse.append_global_mousebinding(awful.button({ "Any" }, 1, function(c) - if widget.can_hide == true then - widget:hide(true) - end - end)) - - awful.mouse.append_global_mousebinding(awful.button({ "Any" }, 3, function(c) - if widget.can_hide == true then - widget:hide(true) - end - end)) - - capi.tag.connect_signal("property::selected", function(t) - widget:hide(true) - end) - - capi.awesome.connect_signal("menu::toggled_on", function(menu) - if menu ~= widget and menu.parent_menu == nil then - widget:hide(true) - end - end) - - for _, menu_widget in ipairs(widgets) do - widget:add(menu_widget) - end - - return widget -end - -function menu.sub_menu_button(args) - args = args or {} - - args.icon = args.icon or nil - args.icon_size = args.icon_size or 16 - args.text = args.text or "" - args.text_size = args.text_size or 12 - args.sub_menu = args.sub_menu or nil - - local icon = args.icon ~= nil - and wibox.widget { - font = args.icon.font .. " " .. args.icon_size, - markup = helpers.colorizeText(args.icon.icon, helpers.randomColor()), - widget = wibox.widget.textbox, - halign = "start", - forced_width = 40, - } or nil - - local widget = wibox.widget { - { - { - layout = wibox.layout.align.horizontal, - forced_width = dpi(270), - { - layout = wibox.layout.fixed.horizontal, - spacing = dpi(10), - icon, - { - font = beautiful.sans .. " " .. args.text_size, - markup = args.text, - widget = wibox.widget.textbox, - halign = "start" - }, - }, - nil, - { - font = beautiful.icon .. " " .. "18", - markup = "󰅂", - widget = wibox.widget.textbox, - halign = "start" - }, - }, - widget = wibox.container.margin, - margins = 10 - }, - bg = beautiful.bg, - forced_height = 48, - shape = helpers.rrect(9), - widget = wibox.container.background, - } - widget:connect_signal("mouse::enter", function(self) - local coords = helpers.get_widget_geometry(self.menu, self) - coords.x = coords.x + self.menu.x + self.menu.width - coords.y = coords.y + self.menu.y - args.sub_menu:show({ coords = coords, offset = { x = -5 } }) - end) - widget.sub_menu = args.sub_menu - - return widget -end - -function menu.button(args) - args = args or {} - - args.icon = args.icon or nil - args.icon_size = args.icon_size or 16 - args.image = args.image - args.text = args.text or "" - args.text_size = args.text_size or 12 - args.on_press = args.on_press or nil - - local icon = nil - - if args.icon ~= nil then - icon = wibox.widget { - font = args.icon.font .. " " .. args.icon_size, - markup = helpers.colorizeText(args.icon.icon, helpers.randomColor()), - widget = wibox.widget.textbox, - halign = "start" - } - elseif args.image ~= nil then - icon = wibox.widget({ - widget = wibox.widget.imagebox, - image = args.image, - }) - end - - local text_widget = wibox.widget { - font = beautiful.sans .. " " .. args.text_size, - markup = args.text, - widget = wibox.widget.textbox, - halign = "start" - } - - local widget = wibox.widget { - { - { - layout = wibox.layout.fixed.horizontal, - spacing = dpi(15), - icon, - text_widget, - }, - widget = wibox.container.margin, - margins = 10 - }, - bg = beautiful.bg, - forced_height = 48, - shape = helpers.rrect(9), - buttons = { - awful.button({}, 1, function() - args.on_press(menu, text_widget) - menu:hide(true) - end) - }, - widget = wibox.container.background, - } - widget:connect_signal("mouse::enter", function(self) - if self.menu.widget then self.menu:hide_children_menus() end - end) - return widget -end - -function menu.separator() - return wibox.widget({ - widget = wibox.container.margin, - top = 10, - bottom = 10, - left = 40, - right = 40, - { - widget = wibox.widget.separator, - forced_height = dpi(2), - orientation = "horizontal", - thickness = dpi(1), - color = beautiful.fg .. "29", - }, - }) -end - -function menu.mt:__call(...) - return menu.menu(...) -end - -return setmetatable(menu, menu.mt) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/mods/overflow.lua b/modules/home-manager/ricing/awesomewm/dotfiles/mods/overflow.lua deleted file mode 100644 index 079e0db..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/mods/overflow.lua +++ /dev/null @@ -1,534 +0,0 @@ -------------------------------------------- --- @author https://github.com/Kasper24 --- @copyright 2021-2022 Kasper24 -------------------------------------------- ---------------------------------------------------------------------------- --- A layout that allows its children to take more space than what's available --- in the surrounding container. If the content does exceed the available --- size, a scrollbar is added and scrolling behavior enabled. --- --- @DOC_wibox_layout_defaults_overflow_EXAMPLE@ --- @author Lucas Schwiderski --- @copyright 2021 Lucas Schwiderski --- @layoutmod wibox.layout.overflow --- @supermodule wibox.layout.fixed ---------------------------------------------------------------------------- -local base = require('wibox.widget.base') -local fixed = require('wibox.layout.fixed') -local separator = require('wibox.widget.separator') -local gtable = require('gears.table') -local gshape = require('gears.shape') -local gobject = require('gears.object') -local beautiful = require('beautiful') -local dpi = beautiful.xresources.apply_dpi -local mousegrabber = mousegrabber - -local overflow = { - mt = {} -} - --- Determine the required space to draw the layout's children and, if necessary, --- the scrollbar. -function overflow:fit(context, orig_width, orig_height) - local widgets = self._private.widgets - local num_widgets = #widgets - if num_widgets < 1 then - return 0, 0 - end - - local width, height = orig_width, orig_height - local scrollbar_width = self._private.scrollbar_width - local scrollbar_enabled = self._private.scrollbar_enabled - local used_in_dir, used_max = 0, 0 - local is_y = self._private.dir == "y" - local avail_in_dir = is_y and orig_height or orig_width - - -- Set the direction covered by scrolling to the maximum value - -- to allow widgets to take as much space as they want. - if is_y then - height = math.huge - else - width = math.huge - end - - -- First, determine widget sizes. - -- Only when the content doesn't fit and needs scrolling should - -- we reduce content size to make space for a scrollbar. - for _, widget in ipairs(widgets) do - local w, h = base.fit_widget(self, context, widget, width, height) - - if is_y then - used_max = math.max(used_max, w) - used_in_dir = used_in_dir + h - else - used_max = math.max(used_max, h) - used_in_dir = used_in_dir + w - end - end - - local spacing = self._private.spacing * (num_widgets - 1) - used_in_dir = used_in_dir + spacing - - local need_scrollbar = scrollbar_enabled and used_in_dir > avail_in_dir - - -- Even if `used_max == orig_(width|height)` already, `base.fit_widget` - -- will clamp return values, so we can "overextend" here. - if need_scrollbar then - used_max = used_max + scrollbar_width - end - - if is_y then - return used_max, used_in_dir - else - return used_in_dir, used_max - end -end - --- Layout children, scrollbar and spacing widgets. --- Only those widgets that are currently visible will be placed. -function overflow:layout(context, orig_width, orig_height) - local result = {} - local is_y = self._private.dir == "y" - local widgets = self._private.widgets - local avail_in_dir = is_y and orig_height or orig_width - local scrollbar_width = self._private.scrollbar_width - local scrollbar_enabled = self._private.scrollbar_enabled - local scrollbar_position = self._private.scrollbar_position - local width, height = orig_width, orig_height - local widget_x, widget_y = 0, 0 - local used_in_dir, used_max = 0, 0 - - -- Set the direction covered by scrolling to the maximum value - -- to allow widgets to take as much space as they want. - if is_y then - height = math.huge - else - width = math.huge - end - - -- First, determine widget sizes. - -- Only when the content doesn't fit and needs scrolling should - -- we reduce content size to make space for a scrollbar. - for _, widget in pairs(widgets) do - local w, h = base.fit_widget(self, context, widget, width, height) - - if is_y then - used_max = math.max(used_max, w) - used_in_dir = used_in_dir + h - else - used_max = math.max(used_max, h) - used_in_dir = used_in_dir + w - end - end - - used_in_dir = used_in_dir + self._private.spacing * (#widgets - 1) - - -- Save size for scrolling behavior - self._private.avail_in_dir = avail_in_dir - self._private.used_in_dir = used_in_dir - - local need_scrollbar = used_in_dir > avail_in_dir and scrollbar_enabled - - local scroll_position = self._private.scroll_factor - - if need_scrollbar then - local scrollbar_widget = self._private.scrollbar_widget - local bar_x, bar_y = 0, 0 - local bar_w, bar_h - -- The percentage of how much of the content can be visible within - -- the available space - local visible_percent = avail_in_dir / used_in_dir - -- Make scrollbar length reflect `visible_percent` - -- TODO: Apply a default minimum length - local bar_length = math.floor(visible_percent * avail_in_dir) - local bar_pos = (avail_in_dir - bar_length) * self._private.scroll_factor - - if is_y then - bar_w, bar_h = base.fit_widget(self, context, scrollbar_widget, scrollbar_width, bar_length) - bar_y = bar_pos - - if scrollbar_position == "left" then - widget_x = widget_x + bar_w - elseif scrollbar_position == "right" then - bar_x = orig_width - bar_w - end - - self._private.bar_length = bar_h - - width = width - bar_w - else - bar_w, bar_h = base.fit_widget(self, context, scrollbar_widget, bar_length, scrollbar_width) - bar_x = bar_pos - - if scrollbar_position == "top" then - widget_y = widget_y + bar_h - elseif scrollbar_position == "bottom" then - bar_y = orig_height - bar_h - end - - self._private.bar_length = bar_w - - height = height - bar_h - end - - table.insert(result, base.place_widget_at(scrollbar_widget, math.floor(bar_x), math.floor(bar_y), - math.floor(bar_w), math.floor(bar_h))) - end - - local pos, spacing = 0, self._private.spacing - local interval = used_in_dir - avail_in_dir - - local spacing_widget = self._private.spacing_widget - if spacing_widget then - if is_y then - local _ - _, spacing = base.fit_widget(self, context, spacing_widget, width, spacing) - else - spacing = base.fit_widget(self, context, spacing_widget, spacing, height) - end - end - - for i, w in ipairs(widgets) do - local content_x, content_y - local content_w, content_h = base.fit_widget(self, context, w, - need_scrollbar and width - self._private.scrollbar_spacing or width, height) - - -- When scrolling down, the content itself moves up -> substract - local scrolled_pos = pos - (scroll_position * interval) - - -- Stop processing completely once we're passed the visible portion - if scrolled_pos > avail_in_dir then - break - end - - if is_y then - content_x, content_y = widget_x, scrolled_pos - pos = pos + content_h + spacing - - if self._private.fill_space then - content_w = width - end - else - content_x, content_y = scrolled_pos, widget_y - pos = pos + content_w + spacing - - if self._private.fill_space then - content_h = height - end - end - - local is_in_view = is_y and (scrolled_pos + content_h > 0) or (scrolled_pos + content_w > 0) - - if is_in_view then - -- Add the spacing widget, but not before the first widget - if i > 1 and spacing_widget then - table.insert(result, - base.place_widget_at(spacing_widget, -- The way how spacing is added for regular widgets - -- and the `spacing_widget` is disconnected: - -- The offset for regular widgets is added to `pos` one - -- iteration _before_ the one where the widget is actually - -- placed. - -- Because of that, the placement for the spacing widget - -- needs to substract that offset to be placed right after - -- the previous regular widget. - math.floor(is_y and content_x or (content_x - spacing)), - math.floor(is_y and (content_y - spacing) or content_y), - math.floor(is_y and content_w or spacing), math.floor(is_y and spacing or content_h))) - end - table.insert(result, base.place_widget_at(w, math.floor(content_x), math.floor(content_y), - math.floor(need_scrollbar and content_w - self._private.scrollbar_spacing or content_w), - math.floor(content_h))) - end - end - - return result -end - -function overflow:before_draw_children(_, cr, width, height) - -- Clip drawing for children to the space we're allowed to draw in - cr:rectangle(0, 0, width, height) - cr:clip() -end - ---- The amount of units to advance per scroll event. --- --- This affects calls to `scroll` and the default mouse wheel handler. --- --- The default is `10`. --- --- @property step --- @tparam number step The step size. -function overflow:set_step(step) - self._private.step = step - -- We don't need to emit enything here, since changing step only really - -- takes effect the next time the user scrolls -end - ---- Scroll the layout's content by `amount * step`. --- --- A positive amount scroll down/right, a negative amount scrolls up/left. --- --- The amount of units scrolled is affected by `step`. --- --- @method overflow:scroll --- @tparam number amount The amount to scroll by. --- @emits property::overflow::scroll_factor --- @emitstparam property::overflow::scroll_factor number scroll_factor The new --- scroll factor. --- @emits widget::layout_changed --- @emits widget::redraw_needed -function overflow:scroll(amount) - if amount == 0 then - return - end - local interval = self._private.used_in_dir - local delta = self._private.step / interval - - local factor = self._private.scroll_factor + (delta * amount) - self:set_scroll_factor(factor) -end - ---- The scroll factor. --- --- The scroll factor represents how far the layout's content is currently --- scrolled. It is represented as a fraction from `0` to `1`, where `0` is the --- start of the content and `1` is the end. --- --- @property scroll_factor --- @tparam number scroll_factor The scroll factor. --- @propemits true false - -function overflow:set_scroll_factor(factor) - local current = self._private.scroll_factor - local interval = self._private.used_in_dir - self._private.avail_in_dir - if current == factor -- the content takes less space than what is available, i.e. everything - -- is already visible - or interval <= 0 -- the scroll factor is out of range - or (current <= 0 and factor < 0) or (current >= 1 and factor > 1) then - return - end - - self._private.scroll_factor = math.min(1, math.max(factor, 0)) - - self:emit_signal("widget::layout_changed") - self:emit_signal("property::scroll_factor", factor) -end - -function overflow:get_scroll_factor() - return self._private.scroll_factor -end - ---- The scrollbar width. --- --- For horizontal scrollbars, this is the scrollbar height --- --- The default is `5`. --- --- @DOC_wibox_layout_overflow_scrollbar_width_EXAMPLE@ --- --- @property scrollbar_width --- @tparam number scrollbar_width The scrollbar width. --- @propemits true false - -function overflow:set_scrollbar_width(width) - if self._private.scrollbar_width == width then - return - end - - self._private.scrollbar_width = width - - self:emit_signal("widget::layout_changed") - self:emit_signal("property::scrollbar_width", width) -end - ---- The scrollbar position. --- --- For horizontal scrollbars, this can be `"top"` or `"bottom"`, --- for vertical scrollbars this can be `"left"` or `"right"`. --- The default is `"right"`/`"bottom"`. --- --- @DOC_wibox_layout_overflow_scrollbar_position_EXAMPLE@ --- --- @property scrollbar_position --- @tparam string scrollbar_position The scrollbar position. --- @propemits true false - -function overflow:set_scrollbar_position(position) - if self._private.scrollbar_position == position then - return - end - - self._private.scrollbar_position = position - - self:emit_signal("widget::layout_changed") - self:emit_signal("property::scrollbar_position", position) -end - -function overflow:get_scrollbar_position() - return self._private.scrollbar_position -end - ---- The scrollbar visibility. --- --- If this is set to `false`, no scrollbar will be rendered, even if the layout's --- content overflows. Mouse wheel scrolling will work regardless. --- --- The default is `true`. --- --- @property scrollbar_enabled --- @tparam boolean scrollbar_enabled The scrollbar visibility. --- @propemits true false - -function overflow:set_scrollbar_enabled(enabled) - if self._private.scrollbar_enabled == enabled then - return - end - - self._private.scrollbar_enabled = enabled - - self:emit_signal("widget::layout_changed") - self:emit_signal("property::scrollbar_enabled", enabled) -end - -function overflow:get_scrollbar_enabled() - return self._private.scrollbar_enabled -end - --- Wraps a callback function for `mousegrabber` that is capable of --- updating the scroll factor. -local function build_grabber(container, initial_x, initial_y, geo) - local is_y = container._private.dir == "y" - local bar_interval = container._private.avail_in_dir - container._private.bar_length - local start_pos = container._private.scroll_factor * bar_interval - local start = is_y and initial_y or initial_x - - -- Calculate a matrix transforming from screen coordinates into widget - -- coordinates. - -- This is required for mouse movement to work when the widget has been - -- transformed by something like `wibox.container.rotate`. - local matrix_from_device = geo.hierarchy:get_matrix_from_device() - local wgeo = geo.drawable.drawable:geometry() - local matrix = matrix_from_device:translate( -wgeo.x, -wgeo.y) - - return function(mouse) - if not mouse.buttons[1] then - return false - end - - local x, y = matrix:transform_point(mouse.x, mouse.y) - local pos = is_y and y or x - container:set_scroll_factor((start_pos + (pos - start)) / bar_interval) - - return true - end -end - --- Applies a mouse button signal using `build_grabber` to a scrollbar widget. -local function apply_scrollbar_mouse_signal(container, w) - w:connect_signal('button::press', function(_, x, y, button_id, _, geo) - if button_id ~= 1 then - return - end - mousegrabber.run(build_grabber(container, x, y, geo), "fleur") - end) -end - ---- The scrollbar widget. --- This widget is rendered as the scrollbar element. --- --- The default is `wibox.widget.separator{ shape = gears.shape.rectangle }`. --- --- @DOC_wibox_layout_overflow_scrollbar_widget_EXAMPLE@ --- --- @property scrollbar_widget --- @tparam widget scrollbar_widget The scrollbar widget. --- @propemits true false - -function overflow:set_scrollbar_widget(widget) - local w = base.make_widget_from_value(widget) - - apply_scrollbar_mouse_signal(self, w) - - self._private.scrollbar_widget = w - - self:emit_signal("widget::layout_changed") - self:emit_signal("property::scrollbar_widget", widget) -end - -function overflow:get_scrollbar_widget() - return self._private.scrollbar_widget -end - -function overflow:set_scrollbar_spacing(spacing) - self._private.scrollbar_spacing = spacing - - self:emit_signal("widget::layout_changed") - self:emit_signal("property::scrollbar_spacing", spacing) -end - -function overflow:get_scrollbar_spacing() - return self._private.scrollbar_spacing -end - -local function new(dir, ...) - local ret = fixed[dir](...) - - gtable.crush(ret, overflow, true) - ret.widget_name = gobject.modulename(2) - -- Tell the widget system to prevent clicks outside the layout's extends - -- to register with child widgets, even if they actually extend that far. - -- This prevents triggering button presses on hidden/clipped widgets. - ret.clip_child_extends = true - - -- Manually set the scroll factor here. We don't know the bounding size yet. - ret._private.scroll_factor = 0 - - -- Apply defaults. Bypass setters to avoid signals. - ret._private.step = 10 - ret._private.fill_space = true - ret._private.scrollbar_width = 5 - ret._private.scrollbar_enabled = true - ret._private.scrollbar_position = dir == "vertical" and "right" or "bottom" - ret._private.scrollbar_spacing = dpi(15) - - local scrollbar_widget = separator({ - shape = gshape.rectangle - }) - apply_scrollbar_mouse_signal(ret, scrollbar_widget) - ret._private.scrollbar_widget = scrollbar_widget - - ret:connect_signal('button::press', function(self, _, _, button) - if button == 4 then - self:scroll( -1) - elseif button == 5 then - self:scroll(1) - end - end) - - return ret -end - ---- Returns a new horizontal overflow layout. --- Child widgets are placed similar to `wibox.layout.fixed`, except that --- they may take as much width as they want. If the total width of all child --- widgets exceeds the width available whithin the layout's outer container --- a scrollbar will be added and scrolling behavior enabled. --- @tparam widget ... Widgets that should be added to the layout. --- @constructorfct wibox.layout.overflow.horizontal -function overflow.horizontal(...) - return new("horizontal", ...) -end - ---- Returns a new vertical overflow layout. --- Child widgets are placed similar to `wibox.layout.fixed`, except that --- they may take as much height as they want. If the total height of all child --- widgets exceeds the height available whithin the layout's outer container --- a scrollbar will be added and scrolling behavior enabled. --- @tparam widget ... Widgets that should be added to the layout. --- @constructorfct wibox.layout.overflow.horizontal -function overflow.vertical(...) - return new("vertical", ...) -end - -return setmetatable(overflow, overflow.mt) - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/mods/playerctl/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/mods/playerctl/init.lua deleted file mode 100644 index e60d77d..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/mods/playerctl/init.lua +++ /dev/null @@ -1,46 +0,0 @@ -local awful = require("awful") -local gtimer = require("gears.timer") -local beautiful = require("beautiful") -local naughty = require("naughty") - --- Use CLI backend as default as it is supported on most if not all systems -local backend_config = beautiful.playerctl_backend or "playerctl_cli" -local backends = { - playerctl_cli = require(... .. ".playerctl_cli"), - playerctl_lib = require(... .. ".playerctl_lib"), -} - -local backend = nil - -local function enable_wrapper(args) - local open = naughty.action { name = "Open" } - - open:connect_signal("invoked", function() - awful.spawn("xdg-open https://blingcorp.github.io/bling/#/signals/pctl") - end) - - gtimer.delayed_call(function() - naughty.notify({ - title = "Bling Error", - text = "Global signals are deprecated! Please take a look at the playerctl documentation.", - app_name = "Bling Error", - app_icon = "system-error", - actions = { open } - }) - end) - - backend_config = (args and args.backend) or backend_config - backend = backends[backend_config](args) - return backend -end - -local function disable_wrapper() - backend:disable() -end - -return { - lib = backends.playerctl_lib, - cli = backends.playerctl_cli, - enable = enable_wrapper, - disable = disable_wrapper -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/mods/playerctl/playerctl_cli.lua b/modules/home-manager/ricing/awesomewm/dotfiles/mods/playerctl/playerctl_cli.lua deleted file mode 100644 index e220f53..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/mods/playerctl/playerctl_cli.lua +++ /dev/null @@ -1,355 +0,0 @@ --- Playerctl signals --- --- Provides: --- metadata --- title (string) --- artist (string) --- album_path (string) --- album (string) --- player_name (string) --- position --- interval_sec (number) --- length_sec (number) --- playback_status --- playing (boolean) --- volume --- volume (number) --- loop_status --- loop_status (string) --- shuffle --- shuffle (bool) --- no_players --- (No parameters) - -local awful = require("awful") -local gobject = require("gears.object") -local gtable = require("gears.table") -local gtimer = require("gears.timer") -local gstring = require("gears.string") -local beautiful = require("beautiful") -local setmetatable = setmetatable -local tonumber = tonumber -local ipairs = ipairs -local type = type -local capi = { awesome = awesome } - -local playerctl = { mt = {} } - -local function save_image_async_curl(url, filepath, callback) - awful.spawn.with_line_callback(string.format("curl -L -s %s -o %s", url, filepath), - { - exit = callback - }) -end - -function playerctl:disable() - self._private.metadata_timer:stop() - self._private.metadata_timer = nil - awful.spawn.with_shell("killall playerctl") -end - -function playerctl:pause(player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " pause") - else - awful.spawn.with_shell(self._private.cmd .. "pause") - end -end - -function playerctl:play(player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " play") - else - awful.spawn.with_shell(self._private.cmd .. "play") - end -end - -function playerctl:stop(player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " stop") - else - awful.spawn.with_shell(self._private.cmd .. "stop") - end -end - -function playerctl:play_pause(player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " play-pause") - else - awful.spawn.with_shell(self._private.cmd .. "play-pause") - end -end - -function playerctl:previous(player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " previous") - else - awful.spawn.with_shell(self._private.cmd .. "previous") - end -end - -function playerctl:next(player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " next") - else - awful.spawn.with_shell(self._private.cmd .. "next") - end -end - -function playerctl:set_loop_status(loop_status, player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " loop " .. loop_status) - else - awful.spawn.with_shell(self._private.cmd .. "loop " .. loop_status) - end -end - -function playerctl:cycle_loop_status(player) - local function set_loop_status(loop_status) - if loop_status == "None" then - self:set_loop_status("Track") - elseif loop_status == "Track" then - self:set_loop_status("Playlist") - elseif loop_status == "Playlist" then - self:set_loop_status("None") - end - end - - if player ~= nil then - awful.spawn.easy_async_with_shell("playerctl --player=" .. player .. " loop", function(stdout) - set_loop_status(stdout) - end) - else - set_loop_status(self._private.loop_status) - end -end - -function playerctl:set_position(position, player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " position " .. position) - else - awful.spawn.with_shell(self._private.cmd .. "position " .. position) - end -end - -function playerctl:set_shuffle(shuffle, player) - shuffle = shuffle and "on" or "off" - - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " shuffle " .. shuffle) - else - awful.spawn.with_shell(self._private.cmd .. "shuffle " .. shuffle) - end -end - -function playerctl:cycle_shuffle(player) - if player ~= nil then - awful.spawn.easy_async_with_shell("playerctl --player=" .. player .. " shuffle", function(stdout) - local shuffle = stdout == "on" and true or false - self:set_shuffle(not self._private.shuffle) - end) - else - self:set_shuffle(not self._private.shuffle) - end -end - -function playerctl:set_volume(volume, player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " volume " .. volume) - else - awful.spawn.with_shell(self._private.cmd .. "volume " .. volume) - end -end - -local function emit_player_metadata(self) - local metadata_cmd = self._private.cmd .. - "metadata --format 'title_{{title}}artist_{{artist}}art_url_{{mpris:artUrl}}player_name_{{playerName}}album_{{album}}' -F" - - awful.spawn.with_line_callback(metadata_cmd, { - stdout = function(line) - local title = gstring.xml_escape(line:match('title_(.*)artist_')) or "" - local artist = gstring.xml_escape(line:match('artist_(.*)art_url_')) or "" - local art_url = line:match('art_url_(.*)player_name_') or "" - local player_name = line:match('player_name_(.*)album_') or "" - local album = gstring.xml_escape(line:match('album_(.*)')) or "" - - art_url = art_url:gsub('%\n', '') - if player_name == "spotify" then - art_url = art_url:gsub("open.spotify.com", "i.scdn.co") - end - - if self._private.metadata_timer - and self._private.metadata_timer.started - then - self._private.metadata_timer:stop() - end - - self._private.metadata_timer = gtimer { - timeout = self.debounce_delay, - autostart = true, - single_shot = true, - callback = function() - if title and title ~= "" then - if art_url ~= "" then - local art_path = os.tmpname() - save_image_async_curl(art_url, art_path, function() - self:emit_signal("metadata", title, artist, art_path, album, player_name) - capi.awesome.emit_signal("bling::playerctl::title_artist_album", title, artist, art_path) - end) - else - self:emit_signal("metadata", title, artist, "", album, player_name) - capi.awesome.emit_signal("bling::playerctl::title_artist_album", title, artist, "") - end - else - self:emit_signal("no_players") - capi.awesome.emit_signal("bling::playerctl::no_players") - end - end - } - - collectgarbage("collect") - end, - }) -end - -local function emit_player_position(self) - local position_cmd = self._private.cmd .. "position" - local length_cmd = self._private.cmd .. "metadata mpris:length" - - awful.widget.watch(position_cmd, self.interval, function(_, interval) - awful.spawn.easy_async_with_shell(length_cmd, function(length) - local length_sec = tonumber(length) -- in microseconds - local interval_sec = tonumber(interval) -- in seconds - if length_sec and interval_sec then - if interval_sec >= 0 and length_sec > 0 then - self:emit_signal("position", interval_sec, length_sec / 1000000) - capi.awesome.emit_signal("bling::playerctl::position", interval_sec, length_sec / 1000000) - end - end - end) - collectgarbage("collect") - end) -end - -local function emit_player_playback_status(self) - local status_cmd = self._private.cmd .. "status -F" - - awful.spawn.with_line_callback(status_cmd, { - stdout = function(line) - if line:find("Playing") then - self:emit_signal("playback_status", true) - capi.awesome.emit_signal("bling::playerctl::status", true) - else - self:emit_signal("playback_status", false) - capi.awesome.emit_signal("bling::playerctl::status", false) - end - end, - }) -end - -local function emit_player_volume(self) - local volume_cmd = self._private.cmd .. "volume -F" - - awful.spawn.with_line_callback(volume_cmd, { - stdout = function(line) - self:emit_signal("volume", tonumber(line)) - end, - }) -end - -local function emit_player_loop_status(self) - local loop_status_cmd = self._private.cmd .. "loop -F" - - awful.spawn.with_line_callback(loop_status_cmd, { - stdout = function(line) - self._private.loop_status = line - self:emit_signal("loop_status", line:lower()) - end, - }) -end - -local function emit_player_shuffle(self) - local shuffle_cmd = self._private.cmd .. "shuffle -F" - - awful.spawn.with_line_callback(shuffle_cmd, { - stdout = function(line) - if line:find("On") then - self._private.shuffle = true - self:emit_signal("shuffle", true) - else - self._private.shuffle = false - self:emit_signal("shuffle", false) - end - end, - }) -end - -local function parse_args(self, args) - if args.player then - self._private.cmd = self._private.cmd .. "--player=" - - if type(args.player) == "string" then - self._private.cmd = self._private.cmd .. args.player .. " " - elseif type(args.player) == "table" then - for index, player in ipairs(args.player) do - self._private.cmd = self._private.cmd .. player - if index < #args.player then - self._private.cmd = self._private.cmd .. "," - else - self._private.cmd = self._private.cmd .. " " - end - end - end - end - - if args.ignore then - self._private.cmd = self._private.cmd .. "--ignore-player=" - - if type(args.ignore) == "string" then - self._private.cmd = self._private.cmd .. args.ignore .. " " - elseif type(args.ignore) == "table" then - for index, player in ipairs(args.ignore) do - self._private.cmd = self._private.cmd .. player - if index < #args.ignore then - self._private.cmd = self._private.cmd .. "," - else - self._private.cmd = self._private.cmd .. " " - end - end - end - end -end - -local function new(args) - args = args or {} - - local ret = gobject {} - gtable.crush(ret, playerctl, true) - - ret.interval = args.interval or beautiful.playerctl_position_update_interval or 1 - ret.debounce_delay = args.debounce_delay or beautiful.playerctl_debounce_delay or 0.35 - - ret._private = {} - ret._private.metadata_timer = nil - ret._private.cmd = "playerctl " - parse_args(ret, args) - - emit_player_metadata(ret) - emit_player_position(ret) - emit_player_playback_status(ret) - emit_player_volume(ret) - emit_player_loop_status(ret) - emit_player_shuffle(ret) - - return ret -end - -function playerctl.mt:__call(...) - return new(...) -end - --- On startup instead of on playerctl object init to make it --- possible to have more than one of these running -awful.spawn.with_shell("killall playerctl") - -return setmetatable(playerctl, playerctl.mt) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/mods/playerctl/playerctl_lib.lua b/modules/home-manager/ricing/awesomewm/dotfiles/mods/playerctl/playerctl_lib.lua deleted file mode 100644 index faf9a4c..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/mods/playerctl/playerctl_lib.lua +++ /dev/null @@ -1,569 +0,0 @@ --- Playerctl signals --- --- Provides: --- metadata --- title (string) --- artist (string) --- album_path (string) --- album (string) --- new (bool) --- player_name (string) --- position --- interval_sec (number) --- length_sec (number) --- player_name (string) --- playback_status --- playing (boolean) --- player_name (string) --- seeked --- position (number) --- player_name (string) --- volume --- volume (number) --- player_name (string) --- loop_status --- loop_status (string) --- player_name (string) --- shuffle --- shuffle (boolean) --- player_name (string) --- exit --- player_name (string) --- no_players --- (No parameters) - -local awful = require("awful") -local gobject = require("gears.object") -local gtable = require("gears.table") -local gtimer = require("gears.timer") -local gstring = require("gears.string") -local beautiful = require("beautiful") -local setmetatable = setmetatable -local ipairs = ipairs -local pairs = pairs -local type = type -local capi = { awesome = awesome } - -local playerctl = { mt = {} } - - -local function save_image_async_curl(url, filepath, callback) - awful.spawn.with_line_callback(string.format("curl -L -s %s -o %s", url, filepath), - { - exit = callback - }) -end - -function playerctl:disable() - -- Restore default settings - self.ignore = {} - self.priority = {} - self.update_on_activity = true - self.interval = 1 - self.debounce_delay = 0.35 - - -- Reset timers - self._private.manager = nil - self._private.metadata_timer:stop() - self._private.metadata_timer = nil - self._private.position_timer:stop() - self._private.position_timer = nil - - -- Reset default values - self._private.last_position = -1 - self._private.last_length = -1 - self._private.last_player = nil - self._private.last_title = "" - self._private.last_artist = "" - self._private.last_artUrl = "" -end - -function playerctl:pause(player) - player = player or self._private.manager.players[1] - if player then - player:pause() - end -end - -function playerctl:play(player) - player = player or self._private.manager.players[1] - if player then - player:play() - end -end - -function playerctl:stop(player) - player = player or self._private.manager.players[1] - if player then - player:stop() - end -end - -function playerctl:play_pause(player) - player = player or self._private.manager.players[1] - if player then - player:play_pause() - end -end - -function playerctl:previous(player) - player = player or self._private.manager.players[1] - if player then - player:previous() - end -end - -function playerctl:next(player) - player = player or self._private.manager.players[1] - if player then - player:next() - end -end - -function playerctl:set_loop_status(loop_status, player) - player = player or self._private.manager.players[1] - if player then - player:set_loop_status(loop_status) - end -end - -function playerctl:cycle_loop_status(player) - player = player or self._private.manager.players[1] - if player then - if player.loop_status == "NONE" then - player:set_loop_status("TRACK") - elseif player.loop_status == "TRACK" then - player:set_loop_status("PLAYLIST") - elseif player.loop_status == "PLAYLIST" then - player:set_loop_status("NONE") - end - end -end - -function playerctl:set_position(position, player) - player = player or self._private.manager.players[1] - if player then - player:set_position(position * 1000000) - end -end - -function playerctl:set_shuffle(shuffle, player) - player = player or self._private.manager.players[1] - if player then - player:set_shuffle(shuffle) - end -end - -function playerctl:cycle_shuffle(player) - player = player or self._private.manager.players[1] - if player then - player:set_shuffle(not player.shuffle) - end -end - -function playerctl:set_volume(volume, player) - player = player or self._private.manager.players[1] - if player then - player:set_volume(volume) - end -end - -function playerctl:get_manager() - return self._private.manager -end - -function playerctl:get_active_player() - return self._private.manager.players[1] -end - -function playerctl:get_player_of_name(name) - for _, player in ipairs(self._private.manager.players) do - if player.player_name == name then - return player - end - end - - return nil -end - -local function emit_metadata_signal(self, title, artist, artUrl, album, new, player_name) - title = gstring.xml_escape(title) - artist = gstring.xml_escape(artist) - album = gstring.xml_escape(album) - - -- Spotify client doesn't report its art URL's correctly... - if player_name == "spotify" then - artUrl = artUrl:gsub("open.spotify.com", "i.scdn.co") - end - - if artUrl ~= "" then - local art_path = os.tmpname() - save_image_async_curl(artUrl, art_path, function() - self:emit_signal("metadata", title, artist, art_path, album, new, player_name) - capi.awesome.emit_signal("bling::playerctl::title_artist_album", title, artist, art_path, player_name) - end) - else - capi.awesome.emit_signal("bling::playerctl::title_artist_album", title, artist, "", player_name) - self:emit_signal("metadata", title, artist, "", album, new, player_name) - end -end - -local function metadata_cb(self, player, metadata) - if self.update_on_activity then - self._private.manager:move_player_to_top(player) - end - - local data = metadata.value - - local title = data["xesam:title"] or "" - local artist = data["xesam:artist"][1] or "" - for i = 2, #data["xesam:artist"] do - artist = artist .. ", " .. data["xesam:artist"][i] - end - local artUrl = data["mpris:artUrl"] or "" - local album = data["xesam:album"] or "" - - if player == self._private.manager.players[1] then - self._private.active_player = player - - -- Callback can be called even though values we care about haven't - -- changed, so check to see if they have - if - player ~= self._private.last_player - or title ~= self._private.last_title - or artist ~= self._private.last_artist - or artUrl ~= self._private.last_artUrl - then - if (title == "" and artist == "" and artUrl == "") then return end - - if self._private.metadata_timer ~= nil and self._private.metadata_timer.started then - self._private.metadata_timer:stop() - end - - self._private.metadata_timer = gtimer { - timeout = self.debounce_delay, - autostart = true, - single_shot = true, - callback = function() - emit_metadata_signal(self, title, artist, artUrl, album, true, player.player_name) - end - } - - -- Re-sync with position timer when track changes - self._private.position_timer:again() - self._private.last_player = player - self._private.last_title = title - self._private.last_artist = artist - self._private.last_artUrl = artUrl - end - end -end - -local function position_cb(self) - local player = self._private.manager.players[1] - if player then - local position = player:get_position() / 1000000 - local length = (player.metadata.value["mpris:length"] or 0) / 1000000 - if position ~= self._private.last_position or length ~= self._private.last_length then - capi.awesome.emit_signal("bling::playerctl::position", position, length, player.player_name) - self:emit_signal("position", position, length, player.player_name) - self._private.last_position = position - self._private.last_length = length - end - end -end - -local function playback_status_cb(self, player, status) - if self.update_on_activity then - self._private.manager:move_player_to_top(player) - end - - if player == self._private.manager.players[1] then - self._private.active_player = player - - -- Reported as PLAYING, PAUSED, or STOPPED - if status == "PLAYING" then - self:emit_signal("playback_status", true, player.player_name) - capi.awesome.emit_signal("bling::playerctl::status", true, player.player_name) - else - self:emit_signal("playback_status", false, player.player_name) - capi.awesome.emit_signal("bling::playerctl::status", false, player.player_name) - end - end -end - -local function seeked_cb(self, player, position) - if self.update_on_activity then - self._private.manager:move_player_to_top(player) - end - - if player == self._private.manager.players[1] then - self._private.active_player = player - self:emit_signal("seeked", position / 1000000, player.player_name) - end -end - -local function volume_cb(self, player, volume) - if self.update_on_activity then - self._private.manager:move_player_to_top(player) - end - - if player == self._private.manager.players[1] then - self._private.active_player = player - self:emit_signal("volume", volume, player.player_name) - end -end - -local function loop_status_cb(self, player, loop_status) - if self.update_on_activity then - self._private.manager:move_player_to_top(player) - end - - if player == self._private.manager.players[1] then - self._private.active_player = player - self:emit_signal("loop_status", loop_status:lower(), player.player_name) - end -end - -local function shuffle_cb(self, player, shuffle) - if self.update_on_activity then - self._private.manager:move_player_to_top(player) - end - - if player == self._private.manager.players[1] then - self._private.active_player = player - self:emit_signal("shuffle", shuffle, player.player_name) - end -end - -local function exit_cb(self, player) - if player == self._private.manager.players[1] then - self:emit_signal("exit", player.player_name) - end -end - --- Determine if player should be managed -local function name_is_selected(self, name) - if self.ignore[name.name] then - return false - end - - if #self.priority > 0 then - for _, arg in pairs(self.priority) do - if arg == name.name or arg == "%any" then - return true - end - end - return false - end - - return true -end - --- Create new player and connect it to callbacks -local function init_player(self, name) - if name_is_selected(self, name) then - local player = self._private.lgi_Playerctl.Player.new_from_name(name) - self._private.manager:manage_player(player) - player.on_metadata = function(player, metadata) - metadata_cb(self, player, metadata) - end - player.on_playback_status = function(player, playback_status) - playback_status_cb(self, player, playback_status) - end - player.on_seeked = function(player, position) - seeked_cb(self, player, position) - end - player.on_volume = function(player, volume) - volume_cb(self, player, volume) - end - player.on_loop_status = function(player, loop_status) - loop_status_cb(self, player, loop_status) - end - player.on_shuffle = function(player, shuffle_status) - shuffle_cb(self, player, shuffle_status) - end - player.on_exit = function(player, shuffle_status) - exit_cb(self, player) - end - - -- Start position timer if its not already running - if not self._private.position_timer.started then - self._private.position_timer:again() - end - end -end - --- Determine if a player name comes before or after another according to the --- priority order -local function player_compare_name(self, name_a, name_b) - local any_index = math.huge - local a_match_index = nil - local b_match_index = nil - - if name_a == name_b then - return 0 - end - - for index, name in ipairs(self.priority) do - if name == "%any" then - any_index = (any_index == math.huge) and index or any_index - elseif name == name_a then - a_match_index = a_match_index or index - elseif name == name_b then - b_match_index = b_match_index or index - end - end - - if not a_match_index and not b_match_index then - return 0 - elseif not a_match_index then - return (b_match_index < any_index) and 1 or -1 - elseif not b_match_index then - return (a_match_index < any_index) and -1 or 1 - elseif a_match_index == b_match_index then - return 0 - else - return (a_match_index < b_match_index) and -1 or 1 - end -end - --- Sorting function used by manager if a priority order is specified -local function player_compare(self, a, b) - local player_a = self._private.lgi_Playerctl.Player(a) - local player_b = self._private.lgi_Playerctl.Player(b) - return player_compare_name(self, player_a.player_name, player_b.player_name) -end - -local function get_current_player_info(self, player) - local title = player:get_title() or "" - local artist = player:get_artist() or "" - local artUrl = player:print_metadata_prop("mpris:artUrl") or "" - local album = player:get_album() or "" - - emit_metadata_signal(self, title, artist, artUrl, album, false, player.player_name) - playback_status_cb(self, player, player.playback_status) - volume_cb(self, player, player.volume) - loop_status_cb(self, player, player.loop_status) - shuffle_cb(self, player, player.shuffle) -end - -local function start_manager(self) - self._private.manager = self._private.lgi_Playerctl.PlayerManager() - - if #self.priority > 0 then - self._private.manager:set_sort_func(function(a, b) - return player_compare(self, a, b) - end) - end - - -- Timer to update track position at specified interval - self._private.position_timer = gtimer { - timeout = self.interval, - callback = function() - position_cb(self) - end, - } - - -- Manage existing players on startup - for _, name in ipairs(self._private.manager.player_names) do - init_player(self, name) - end - - if self._private.manager.players[1] then - get_current_player_info(self, self._private.manager.players[1]) - end - - local _self = self - - -- Callback to manage new players - function self._private.manager:on_name_appeared(name) - init_player(_self, name) - end - - function self._private.manager:on_player_appeared(player) - if player == self.players[1] then - _self._private.active_player = player - end - end - - function self._private.manager:on_player_vanished(player) - if #self.players == 0 then - _self._private.metadata_timer:stop() - _self._private.position_timer:stop() - _self:emit_signal("no_players") - capi.awesome.emit_signal("bling::playerctl::no_players") - elseif player == _self._private.active_player then - _self._private.active_player = self.players[1] - get_current_player_info(_self, self.players[1]) - end - end -end - -local function parse_args(self, args) - self.ignore = {} - if type(args.ignore) == "string" then - self.ignore[args.ignore] = true - elseif type(args.ignore) == "table" then - for _, name in pairs(args.ignore) do - self.ignore[name] = true - end - end - - self.priority = {} - if type(args.player) == "string" then - self.priority[1] = args.player - elseif type(args.player) == "table" then - self.priority = args.player - end -end - -local function new(args) - args = args or {} - - local ret = gobject {} - gtable.crush(ret, playerctl, true) - - -- Grab settings from beautiful variables if not set explicitly - args.ignore = args.ignore or beautiful.playerctl_ignore - args.player = args.player or beautiful.playerctl_player - if args.update_on_activity ~= nil then - ret.update_on_activity = args.update_on_activity - else - ret.update_on_activity = beautiful.playerctl_update_on_activity ~= false - end - ret.interval = args.interval or beautiful.playerctl_position_update_interval or 1 - ret.debounce_delay = args.debounce_delay or beautiful.playerctl_debounce_delay or 0.35 - parse_args(ret, args) - - ret._private = {} - - -- Metadata callback for title, artist, and album art - ret._private.last_player = nil - ret._private.last_title = "" - ret._private.last_artist = "" - ret._private.last_artUrl = "" - - -- Track position callback - ret._private.last_position = -1 - ret._private.last_length = -1 - - -- Grab playerctl library - ret._private.lgi_Playerctl = require("lgi").Playerctl - ret._private.manager = nil - ret._private.metadata_timer = nil - ret._private.position_timer = nil - - -- Ensure main event loop has started before starting player manager - gtimer.delayed_call(function() - start_manager(ret) - end) - - return ret -end - -function playerctl.mt:__call(...) - return new(...) -end - -return setmetatable(playerctl, playerctl.mt) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/rc.lua b/modules/home-manager/ricing/awesomewm/dotfiles/rc.lua deleted file mode 100644 index 43fd25d..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/rc.lua +++ /dev/null @@ -1,29 +0,0 @@ -local awful = require "awful" -local gears = require "gears" -local beautiful = require "beautiful" - -awful.spawn.with_shell("bash ~/.config/awesome/main/autorun.sh") -require "setup":generate() - -beautiful.init(gears.filesystem.get_configuration_dir() .. "theme/init.lua") - -require "main" -require "awful.autofocus" - --- init widget -require "misc" -require "ui" -require "signal" - - -gears.timer { - timeout = 5, - autostart = true, - call_now = true, - callback = function() - collectgarbage "collect" - end, -} - -collectgarbage("setpause", 110) -collectgarbage("setstepmul", 1000) \ No newline at end of file diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/setup/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/setup/init.lua deleted file mode 100644 index 4de9033..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/setup/init.lua +++ /dev/null @@ -1,38 +0,0 @@ -local json = require("mods.json") -local helpers = require("helpers") -local gfs = require("gears.filesystem") - -local M = {} - -M.defaultData = { - colorscheme = "cat", - gaps = 10, - iconTheme = "~/.local/share/icons/hicolor/", - openWeatherApi = "KEY_HERE", - showDesktopIcons = true, - pfp = "/home/" .. string.gsub(os.getenv('USER'), '^%l', string.lower) .. "/.config/awesome/theme/assets/pfp.png", - wallpaper = "colorful", -} - -M.path = gfs.get_cache_dir() .. "json/settings.json" - -function M:generate() - if not helpers.file_exists(self.path) then - local w = assert(io.open(self.path, "w")) - w:write(json.encode(self.defaultData, nil, { pretty = true, indent = " ", align_keys = false, array_newline = true })) - w:close() - M.settings = self.defaultData - else - local r = assert(io.open(self.path, "rb")) - local t = r:read("*all") - r:close() - local settings = json.decode(t) - M.settings = settings - end - - if not helpers.file_exists(gfs.get_cache_dir() .. "lock/lock.jpg") then - os.execute("mkdir -p ~/.cache/awesome/lock") - end -end - -return M diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/connection/airplane.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/connection/airplane.lua deleted file mode 100644 index a6faf1e..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/connection/airplane.lua +++ /dev/null @@ -1,20 +0,0 @@ -local awful = require('awful') -local gears = require('gears') -local naughty = require("naughty") - -local function emit_airplane_status() - awful.spawn.easy_async_with_shell( - "bash -c \"rfkill list | sed -n 2p | awk '{print $3}'\" ", function(stdout) - local status = stdout:match("yes") -- boolean - awesome.emit_signal('signal::airplane', status) - end) -end - -gears.timer { - timeout = 2, - call_now = true, - autostart = true, - callback = function() - emit_airplane_status() - end -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/connection/bluetooth.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/connection/bluetooth.lua deleted file mode 100644 index 012f086..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/connection/bluetooth.lua +++ /dev/null @@ -1,21 +0,0 @@ -local awful = require('awful') -local gears = require('gears') - -local function emit_bluetooth_status() - awful.spawn.easy_async_with_shell( - "bash -c 'bluetoothctl show | grep -i powered:'", function(stdout) - local status = stdout:match("yes") -- boolean - awesome.emit_signal('signal::bluetooth', status) - end) -end - --- Refreshing -------------- -gears.timer { - timeout = 2, - call_now = true, - autostart = true, - callback = function() - emit_bluetooth_status() - end -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/connection/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/connection/init.lua deleted file mode 100644 index 9513aea..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/connection/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("signal.connection.wifi") -require("signal.connection.bluetooth") -require("signal.connection.airplane") diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/connection/wifi.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/connection/wifi.lua deleted file mode 100644 index 62eed53..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/connection/wifi.lua +++ /dev/null @@ -1,23 +0,0 @@ -local awful = require('awful') -local gears = require('gears') - --- Network Fetching and Signal Emitting ---------------------------------------- -local function emit_network_status() - awful.spawn.easy_async_with_shell( - "bash -c 'nmcli networking connectivity check'", function(stdout) - local status = not stdout:match("none") -- boolean - awesome.emit_signal('signal::network', status) - end) -end - --- Refreshing -------------- -gears.timer { - timeout = 2, - call_now = true, - autostart = true, - callback = function() - emit_network_status() - end -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/init.lua deleted file mode 100644 index 7f8dc6b..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("signal.system") -require("signal.connection") -require("signal.stats") diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/cpu.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/cpu.lua deleted file mode 100644 index 4e6e8b3..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/cpu.lua +++ /dev/null @@ -1,20 +0,0 @@ -local awful = require('awful') -local gears = require('gears') -local function emit_cpu_status() - awful.spawn.easy_async_with_shell( - "bash -c \"roundvalue $(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage}')\"" - , - function(stdout) - stdout = tonumber(stdout) - awesome.emit_signal('signal::cpu', stdout) - end) -end - -gears.timer { - timeout = 60, - call_now = true, - autostart = true, - callback = function() - emit_cpu_status() - end -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/disk.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/disk.lua deleted file mode 100644 index 5fc6fe9..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/disk.lua +++ /dev/null @@ -1,21 +0,0 @@ -local awful = require('awful') -local gears = require('gears') -local function emit_disk_status() - awful.spawn.easy_async_with_shell( - "bash -c \"df --output=pcent / | sed '1d;s/^ //;s/%//'\"" - , - function(stdout) - stdout = stdout:gsub("%s+", "") - stdout = tonumber(stdout) - awesome.emit_signal('signal::disk', stdout) - end) -end - -gears.timer { - timeout = 600, - call_now = true, - autostart = true, - callback = function() - emit_disk_status() - end -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/init.lua deleted file mode 100644 index 7ae2cc7..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/init.lua +++ /dev/null @@ -1,5 +0,0 @@ -require("signal.stats.weather") -require("signal.stats.uptime") -require("signal.stats.cpu") -require("signal.stats.disk") -require("signal.stats.memory") diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/memory.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/memory.lua deleted file mode 100644 index 351ae02..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/memory.lua +++ /dev/null @@ -1,20 +0,0 @@ -local awful = require('awful') -local gears = require('gears') -local function emit_mem_status() - awful.spawn.easy_async_with_shell( - "bash -c \"roundvalue $(free | grep Mem | awk '{print $3/$2 * 100.0}')\"" - , - function(stdout) - stdout = tonumber(stdout) - awesome.emit_signal('signal::memory', stdout) - end) -end - -gears.timer { - timeout = 60, - call_now = true, - autostart = true, - callback = function() - emit_mem_status() - end -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/uptime.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/uptime.lua deleted file mode 100644 index 4ceedfb..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/uptime.lua +++ /dev/null @@ -1,20 +0,0 @@ -local awful = require('awful') -local gears = require('gears') -local function emit_uptime_status() - awful.spawn.easy_async_with_shell( - "bash -c \"uptime --pretty | sed 's/up\\s*//g' | sed 's/\\s*days/d/g' | sed 's/\\s*hours/h/g' | sed 's/\\s*minutes/m/g'\"" - , - function(stdout) - stdout = stdout:gsub("%s+", "") - awesome.emit_signal('signal::uptime', stdout) - end) -end - -gears.timer { - timeout = 60, - call_now = true, - autostart = true, - callback = function() - emit_uptime_status() - end -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/weather.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/weather.lua deleted file mode 100644 index 95175d6..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/stats/weather.lua +++ /dev/null @@ -1,107 +0,0 @@ -local awful = require("awful") -local gears = require("gears") -local filesystem = gears.filesystem -local json = require("mods.json") -local helpers = require("helpers") -local icon_dir = filesystem.get_configuration_dir() .. "theme/assets/weather/icons/" -local thumb_dir = filesystem.get_configuration_dir() .. "theme/assets/weather/images/" - -local GET_FORECAST_CMD = [[bash -c "curl -s --show-error -X GET '%s'"]] - -local icon_map = { - ["01d"] = "weather-clear-sky", - ["02d"] = "weather-few-clouds", - ["04d"] = "weather-few-clouds", - ["03d"] = "weather-clouds", - ["09d"] = "weather-showers-scattered", - ["09n"] = "weather-showers-scattered", - ["10d"] = "weather-showers", - ["11d"] = "weather-strom", - ["13d"] = "weather-snow", - ["50d"] = "weather-fog", - ["01n"] = "weather-clear-night", - ["02n"] = "weather-few-clouds-night", - ["03n"] = "weather-clouds-night", - ["04n"] = "weather-clouds-night", - ["10n"] = "weather-showers", - ["11n"] = "weather-strom", - ["13n"] = "weather-snow", - ["50n"] = "weather-fog", -} - - -local image_map = { - ["01d"] = "weather-clear-sky", - ["02d"] = "weather-clouds", - ["04d"] = "weather-clouds", - ["03d"] = "weather-clouds", - ["09d"] = "weather-showers-scattered", - ["09n"] = "weather-showers-scattered", - ["10d"] = "weather-showers", - ["11d"] = "weather-strom", - ["13d"] = "weather-snow", - ["50d"] = "weather-fog", - ["01n"] = "weather-clear-night", - ["02n"] = "weather-clouds-night", - ["03n"] = "weather-clouds-night", - ["04n"] = "weather-clouds-night", - ["10n"] = "weather-showers", - ["11n"] = "weather-strom", - ["13n"] = "weather-snow", - ["50n"] = "weather-fog", -} - -local api_key = helpers.readJson(gears.filesystem.get_cache_dir() .. "json/settings.json").openWeatherApi -local coordinates = { "28.6446772", "77.320955" } - -local show_hourly_forecast = true -local show_daily_forecast = true -local units = "metric" - -local url = ( - "https://api.openweathermap.org/data/2.5/onecall" - .. "?lat=" - .. coordinates[1] - .. "&lon=" - .. coordinates[2] - .. "&appid=" - .. api_key - .. "&units=" - .. units - .. "&exclude=minutely" - .. (show_hourly_forecast == false and ",hourly" or "") - .. (show_daily_forecast == false and ",daily" or "") -) - - - - -awful.widget.watch(string.format(GET_FORECAST_CMD, url), 600, function(_, stdout, stderr) - local result = json.decode(stdout) - -- Current weather setup - local out = { - desc = result.current.weather[1].description:gsub("^%l", string.upper), - humidity = result.current.humidity, - temp = math.floor(result.current.temp), - feelsLike = math.floor(result.current.feels_like), - image = icon_dir .. icon_map[result.current.weather[1].icon] .. ".svg", - thumb = thumb_dir .. image_map[result.current.weather[1].icon] .. ".jpg", - hourly = { - result.hourly[1], - result.hourly[2], - result.hourly[3], - result.hourly[4], - result.hourly[5], - result.hourly[6], - }, - daily = { - result.daily[1], - result.daily[2], - result.daily[3], - result.daily[4], - result.daily[5], - result.daily[6], - } - } - awesome.emit_signal("signal::weather", out) -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/battery.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/battery.lua deleted file mode 100644 index 3761461..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/battery.lua +++ /dev/null @@ -1,34 +0,0 @@ -local awful = require('awful') -local gears = require('gears') -local gfs = gears.filesystem - --- Battery Fetching and Signal Emitting ---------------------------------------- --- Battery information script -local battery_script = -"bash -c 'echo $(cat /sys/class/power_supply/BAT0/capacity) echo $(cat /sys/class/power_supply/BAT0/status)'" - -local function battery_emit() - awful.spawn.easy_async_with_shell( - battery_script, function(stdout) - -- The battery level and status are saved as a string. Then the level - -- is stored separately as a string, then converted to int. The status - -- is stored as a bool, and also as an int for registering changes in - -- battery status. - local level = string.match(stdout:match('(%d+)'), '(%d+)') - local level_int = tonumber(level) -- integer - local power = not stdout:match('Discharging') -- boolean - awesome.emit_signal('signal::battery', level_int, power) - end) -end - --- Refreshing -------------- -gears.timer { - timeout = 20, - call_now = true, - autostart = true, - callback = function() - battery_emit() - end -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/brightness.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/brightness.lua deleted file mode 100644 index 423df13..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/brightness.lua +++ /dev/null @@ -1,24 +0,0 @@ -local awful = require('awful') -local gears = require('gears') - -local brightness_script = -"bash -c 'echo $(($(cat /sys/class/backlight/*/brightness) * 100 / $(cat /sys/class/backlight/*/max_brightness)))'" - -local function emit_brightness() - awful.spawn.easy_async_with_shell( - brightness_script, function(stdout) - local level_cur = tonumber(stdout) - awesome.emit_signal('signal::brightness', level_cur) - end) -end - --- Refreshing -------------- -gears.timer { - timeout = 1, - call_now = true, - autostart = true, - callback = function() - emit_brightness() - end -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/dnd.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/dnd.lua deleted file mode 100644 index 6348eb4..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/dnd.lua +++ /dev/null @@ -1,19 +0,0 @@ -local gears = require('gears') -local naughty = require("naughty") --- Network Fetching and Signal Emitting ---------------------------------------- -local function emit_dnd_status() - local status = naughty.is_suspended() - awesome.emit_signal('signal::dnd', status) -end - --- Refreshing -------------- -gears.timer { - timeout = 2, - call_now = true, - autostart = true, - callback = function() - emit_dnd_status() - end -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/init.lua deleted file mode 100644 index 676e8d7..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/init.lua +++ /dev/null @@ -1,5 +0,0 @@ -require("signal.system.dnd") -require("signal.system.brightness") -require("signal.system.volume") -require("signal.system.battery") -require("signal.system.redshift") diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/microphone.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/microphone.lua deleted file mode 100644 index 093d639..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/microphone.lua +++ /dev/null @@ -1,21 +0,0 @@ -local awful = require('awful') -local gears = require('gears') - -local function mic_emit() - awful.spawn.easy_async_with_shell( - "bash -c 'pamixer --source 1 --get-mute'", function(value) - local stringtoboolean = { ["true"] = false, ["false"] = true } - value = value:gsub("%s+", "") - value = stringtoboolean[value] - awesome.emit_signal('signal::mic', value) -- integer - end) -end - -gears.timer { - timeout = 1, - call_now = true, - autostart = true, - callback = function() - mic_emit() - end -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/redshift.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/redshift.lua deleted file mode 100644 index ff2d47a..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/redshift.lua +++ /dev/null @@ -1,22 +0,0 @@ -local awful = require('awful') -local gears = require('gears') - -local function light_emit() - awful.spawn.easy_async_with_shell( - "bash -c 'cat ~/.cache/redshift'", function(stdout) - local status = stdout:match("true") -- boolean - awesome.emit_signal('signal::redshift', status) - end) -end - --- Microphone Fetching and Signal Emitting --- Refreshing -------------- -gears.timer { - timeout = 2, - call_now = true, - autostart = true, - callback = function() - light_emit() - end -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/volume.lua b/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/volume.lua deleted file mode 100644 index f14c1c6..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/volume.lua +++ /dev/null @@ -1,22 +0,0 @@ -local awful = require('awful') -local gears = require('gears') - -local function volume_emit() - awful.spawn.easy_async_with_shell( - "bash -c 'pamixer --get-volume'", function(stdout) - local volume_int = tonumber(stdout) -- integer - awesome.emit_signal('signal::volume', volume_int) -- integer - end) -end - --- Microphone Fetching and Signal Emitting --- Refreshing -------------- -gears.timer { - timeout = 1, - call_now = true, - autostart = true, - callback = function() - volume_emit() - end -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/awesome.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/awesome.svg deleted file mode 100644 index 616fbcf..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/awesome.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/bell.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/bell.png deleted file mode 100644 index 49ac044..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/bell.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/defsong.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/defsong.jpg deleted file mode 100644 index a7a08f3..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/defsong.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/floating.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/floating.png deleted file mode 100644 index 1723575..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/floating.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/neofetch.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/neofetch.png deleted file mode 100644 index 3c965bb..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/neofetch.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/nix.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/nix.svg deleted file mode 100644 index 9a70a14..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/nix.svg +++ /dev/null @@ -1,513 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/nixos.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/nixos.png deleted file mode 100644 index 8ae430f..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/nixos.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/notif.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/notif.png deleted file mode 100644 index 204aeda..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/notif.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/pfp.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/pfp.png deleted file mode 100644 index 9984e6c..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/pfp.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/pomo.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/pomo.jpg deleted file mode 100644 index 97a97a5..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/pomo.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/systray.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/systray.png deleted file mode 100644 index 05fc45a..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/systray.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/tile.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/tile.png deleted file mode 100644 index 2d50939..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/tile.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/close_1.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/close_1.png deleted file mode 100644 index 772462b..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/close_1.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/close_2.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/close_2.png deleted file mode 100644 index 1f3db05..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/close_2.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/close_normal.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/close_normal.svg deleted file mode 100644 index acc2f7f..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/close_normal.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/minimize_1.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/minimize_1.png deleted file mode 100644 index 4f5a7f0..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/minimize_1.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/minimize_2.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/minimize_2.png deleted file mode 100644 index 400aba1..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/minimize_2.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/minimize_normal.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/minimize_normal.svg deleted file mode 100644 index 8d73698..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/titlebar/minimize_normal.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/tsukkisaidmetoaddthis.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/tsukkisaidmetoaddthis.png deleted file mode 100644 index ce38389..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/tsukkisaidmetoaddthis.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-clear-night.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-clear-night.svg deleted file mode 100644 index ecf451a..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-clear-night.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-clear-sky.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-clear-sky.svg deleted file mode 100644 index e84065c..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-clear-sky.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-clouds-night.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-clouds-night.svg deleted file mode 100644 index 1a00dff..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-clouds-night.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-clouds.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-clouds.svg deleted file mode 100644 index 1a00dff..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-clouds.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-few-clouds-night.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-few-clouds-night.svg deleted file mode 100644 index e8243ae..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-few-clouds-night.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-few-clouds.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-few-clouds.svg deleted file mode 100644 index 7279f9f..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-few-clouds.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-fog.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-fog.svg deleted file mode 100644 index 81d0a39..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-fog.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-freezing-rain.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-freezing-rain.svg deleted file mode 100644 index d83c93a..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-freezing-rain.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-overcast-symbolic.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-overcast-symbolic.svg deleted file mode 100644 index 8843c15..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-overcast-symbolic.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-overcast.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-overcast.svg deleted file mode 100644 index e85bb96..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-overcast.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-showers-scattered.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-showers-scattered.svg deleted file mode 100644 index 7749e85..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-showers-scattered.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-showers.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-showers.svg deleted file mode 100644 index b0f387f..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-showers.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-snow-rain.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-snow-rain.svg deleted file mode 100644 index 391fac5..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-snow-rain.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-snow-scattered.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-snow-scattered.svg deleted file mode 100644 index 9be2009..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-snow-scattered.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-snow.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-snow.svg deleted file mode 100644 index d1f7d1c..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-snow.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-storm.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-storm.svg deleted file mode 100644 index cb2cba6..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-storm.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-windy.svg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-windy.svg deleted file mode 100644 index 65bec4f..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/icons/weather-windy.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weathers-cloud.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weathers-cloud.jpg deleted file mode 100644 index 441dabd..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weathers-cloud.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/wedding-bells.png b/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/wedding-bells.png deleted file mode 100644 index ba0ab04..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/wedding-bells.png and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/biscuit.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/biscuit.lua deleted file mode 100644 index 7cc55a9..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/biscuit.lua +++ /dev/null @@ -1,17 +0,0 @@ -local m = {} -m.type = "dark" -m.name = 'biscuit' -m.ok = "#989F56" -m.warn = "#E46A3A" -m.err = "#CA3F3F" -m.dis = "#9F569A" -m.pri = "#629386" -m.bg = "#181515" -m.mbg = "#211b1b" -m.bg3 = "#2d2424" -m.bg4 = "#352a2a" -m.fg = "#ffe9c7" -m.fg3 = "#D5CAC3" -m.fg2 = "#E5D8CB" -m.fg4 = "#614f4f" -return m diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/cat.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/cat.lua deleted file mode 100644 index deb583a..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/cat.lua +++ /dev/null @@ -1,17 +0,0 @@ -local m = {} -m.type = "dark" -m.name = 'cat' -m.ok = "#7fd98f" -m.warn = "#efa17f" -m.err = "#e56e70" -m.dis = "#d476da" -m.pri = "#7c98e4" -m.mbg = "#11111b" -m.bg = "#0d0d15" -m.bg3 = "#161623" -m.bg4 = "#292c35" -m.fg = "#f5e0dc" -m.fg2 = "#e5e0dc" -m.fg3 = "#b5bfe2" -m.fg4 = "#83889a" -return m diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/decay.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/decay.lua deleted file mode 100644 index 8358d5b..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/decay.lua +++ /dev/null @@ -1,17 +0,0 @@ -local m = {} -m.type = "dark" -m.name = 'decay' -m.ok = "#78DBA9" -m.warn = "#e9a180" -m.err = "#e26c7c" -m.dis = "#b47fd7" -m.pri = "#7297d9" -m.mbg = "#1b1f25" -m.bg = "#13161a" -m.bg3 = "#1b1f25" -m.bg4 = "#21262e" -m.fg = "#dee1e6" -m.fg2 = "#e5e0dc" -m.fg3 = "#BFBFBF" -m.fg4 = "#485263" -return m diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/everblush.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/everblush.lua deleted file mode 100644 index 4217dd1..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/everblush.lua +++ /dev/null @@ -1,17 +0,0 @@ -local m = {} -m.type = "dark" -m.name = 'everblush' -m.ok = "#6faf7f" -m.warn = "#e59063" -m.err = "#e86b6b" -m.pri = "#6fa4cc" -m.dis = "#ce89df" -m.bg = "#151a1c" -m.mbg = "#1d2326" -m.bg3 = "#22292d" -m.bg4 = "#2e383d" -m.fg = "#dad0bc" -m.fg2 = "#d4d5d5" -m.fg3 = "#d3c6aa" -m.fg4 = "#5a5858" -return m diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/forest.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/forest.lua deleted file mode 100644 index 1a1fde7..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/forest.lua +++ /dev/null @@ -1,17 +0,0 @@ -local M = {} -M.type = "dark" -M.name = 'forest' -M.pri = "#7fbbb3" -M.warn = "#d29571" -M.err = "#e76365" -M.ok = "#7cc277" -M.dis = "#d491b1" -M.bg = "#0c1012" -M.mbg = "#101618" -M.bg3 = "#1c2121" -M.bg4 = "#232a2d" -M.fg2 = "#dadada" -M.fg = "#dedada" -M.fg3 = "#bdc3c2" -M.fg4 = "#404749" -return M diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/fovere.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/fovere.lua deleted file mode 100644 index 8e3c611..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/fovere.lua +++ /dev/null @@ -1,17 +0,0 @@ -local M = {} -M.type = "dark" -M.name = 'fovere' -M.pri = "#c297d5" -M.warn = "#fcc48c" -M.err = "#cf5555" -M.ok = "#6dc383" -M.dis = "#a7b3fb" -M.bg = "#111012" -M.mbg = "#1d1a1f" -M.bg3 = "#221d23" -M.bg4 = "#252027" -M.fg2 = "#e6e6e6" -M.fg = "#dadada" -M.fg3 = "#c9c9c9" -M.fg4 = "#6f6f6f" -return M diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/fullerene.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/fullerene.lua deleted file mode 100644 index eb66db2..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/fullerene.lua +++ /dev/null @@ -1,17 +0,0 @@ -local M = {} -M.type = "dark" -M.name = 'fullerene' -M.pri = "#738be7" -M.warn = "#e1a36b" -M.err = "#c1374b" -M.ok = "#32ae80" -M.dis = "#9e7ad5" -M.bg = "#0c0c0c" -M.mbg = "#161616" -M.bg3 = "#1f1f1f" -M.bg4 = "#222222" -M.fg2 = "#f4f4f4" -M.fg = "#e0e0e0" -M.fg3 = "#c6c6c6" -M.fg4 = "#6f6f6f" -return M diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/kizu.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/kizu.lua deleted file mode 100644 index bf3eb71..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/kizu.lua +++ /dev/null @@ -1,17 +0,0 @@ -local m = {} -m.type = "dark" -m.name = 'kizu' -m.ok = "#7cd39f" -m.warn = "#de876d" -m.err = "#ee6a70" -m.dis = "#bc85e1" -m.pri = "#7ba5dd" -m.bg = "#080c0d" -m.mbg = "#0f1415" -m.bg3 = "#131718" -m.bg4 = "#151a1c" -m.fg = "#C5C8C9" -m.fg3 = "#c4c4c4" -m.fg2 = "#b7b8b8" -m.fg4 = "#6e7071" -return m diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/nirvana.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/nirvana.lua deleted file mode 100644 index 17d2ed3..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/nirvana.lua +++ /dev/null @@ -1,17 +0,0 @@ -local m = {} -m.type = "dark" -m.name = 'nirvana' -m.ok = "#8fa176" -m.err = "#af575b" -m.warn = "#d8b170" -m.dis = "#a07ea7" -m.pri = "#7d95ae" -m.bg = "#121111" -m.mbg = "#191919" -m.bg3 = "#1b1b1b" -m.bg4 = "#272727" -m.fg = "#dfdddd" -m.fg3 = "#cfdddd" -m.fg2 = "#b7b7b7" -m.fg4 = "#5a5858" -return m diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/oxo.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/oxo.lua deleted file mode 100644 index 8f8e3eb..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/oxo.lua +++ /dev/null @@ -1,17 +0,0 @@ -local m = {} -m.type = "dark" -m.name = 'oxo' -m.pri = "#78a9ff" -m.warn = "#ff7eb6" -m.err = "#ee5396" -m.dis = "#3ddbd9" -m.ok = "#42be65" -m.bg = "#111111" -m.mbg = "#181818" -m.bg3 = "#1d1d1d" -m.bg4 = "#252525" -m.fg = "#dadada" -m.fg3 = "#b3b9b8" -m.fg2 = "#bdc3c2" -m.fg4 = "#696969" -return m diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/rose.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/rose.lua deleted file mode 100644 index 85f8292..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/rose.lua +++ /dev/null @@ -1,17 +0,0 @@ -local m = {} -m.type = "dark" -m.name = 'rose' -m.ok = "#449ec2" -m.warn = "#f09670" -m.err = "#ee5c85" -m.dis = "#bd97eb" -m.pri = "#89cdd9" -m.bg = "#191724" -m.mbg = "#1f1c2c" -m.bg3 = "#221f31" -m.bg4 = "#29253b" -m.fg = "#e0def4" -m.fg2 = "#cecde1" -m.fg3 = "#c0bfd2" -m.fg4 = "#83889a" -return m diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/solarized.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/solarized.lua deleted file mode 100644 index 855e355..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/solarized.lua +++ /dev/null @@ -1,17 +0,0 @@ -local m = {} -m.type = "dark" -m.name = 'solarized' -m.pri = "#387098" -m.warn = "#b86229" -m.err = "#b03a38" -m.dis = "#9751aa" -m.ok = "#7b9524" -m.bg = "#021a20" -m.mbg = "#022028" -m.bg3 = "#00252f" -m.bg4 = "#002d39" -m.fg = "#fdf6e3" -m.fg3 = "#eee8d5" -m.fg2 = "#e5dfcd" -m.fg4 = "#657b83" -return m diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/stardewnight.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/stardewnight.lua deleted file mode 100644 index 2bccbb1..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/stardewnight.lua +++ /dev/null @@ -1,17 +0,0 @@ -local M = {} -M.type = "dark" -M.name = 'stardewnight' -M.ok = "#55b682" -M.warn = "#ff9c6a" -M.err = "#f25c5c" -M.pri = "#7aaaff" -M.dis = "#f17ac6" -M.bg = "#16161a" -M.mbg = "#212126" -M.bg3 = "#2a2a30" -M.bg4 = "#373740" -M.fg = "#e9ecf2" -M.fg2 = "#d9ecf2" -M.fg3 = "#DCDFE4" -M.fg4 = "#676778" -return M diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/swamp.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/swamp.lua deleted file mode 100644 index 74b73a6..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/swamp.lua +++ /dev/null @@ -1,17 +0,0 @@ -local m = {} -m.type = "dark" -m.name = 'swamp' -m.ok = "#736f4e" -m.warn = "#db930d" -m.err = "#96294d" -m.dis = "#508991" -m.pri = "#91506c" -m.bg = "#1d1a11" -m.mbg = "#242015" -m.bg3 = "#242115" -m.bg4 = "#292518" -m.fg = "#ebe0bb" -m.fg3 = "#ebe0bb" -m.fg2 = "#e1d6b3" -m.fg4 = "#8b815e" -return m diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/sweetpastel.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/sweetpastel.lua deleted file mode 100644 index bf4d5f9..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/sweetpastel.lua +++ /dev/null @@ -1,17 +0,0 @@ -local M = {} -M.type = "dark" -M.name = 'sweetpastel' -M.ok = "#b4e3ad" -M.warn = "#f1c192" -M.err = "#e5a3a1" -M.pri = "#a3bbe7" -M.dis = "#ceace8" -M.bg = "#15181b" -M.mbg = "#1b1f23" -M.bg3 = "#222629" -M.bg4 = "#262b30" -M.fg = "#F8F9FA" -M.fg2 = "#e8F9FA" -M.fg3 = "#eeeff0" -M.fg4 = "#515c68" -return M diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/verdant.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/verdant.lua deleted file mode 100644 index 9d1c708..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/verdant.lua +++ /dev/null @@ -1,17 +0,0 @@ -local M = {} -M.type = "dark" -M.name = 'verdant' -M.ok = "#56966e" -M.warn = "#dc8c61" -M.err = "#c14d53" -M.pri = "#6e95bd" -M.dis = "#a56db1" -M.bg = "#0c0c0c" -M.mbg = "#131313" -M.bg3 = "#1b1b1b" -M.bg4 = "#272727" -M.fg = "#dfdddd" -M.fg2 = "#b7b7b7" -M.fg3 = "#a4b5b5" -M.fg4 = "#5a5858" -return M diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/vixima.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/vixima.lua deleted file mode 100644 index c4b7b1b..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/colors/vixima.lua +++ /dev/null @@ -1,17 +0,0 @@ -local m = {} -m.type = "dark" -m.name = 'vixima' -m.ok = "#65DB3D" -m.warn = "#F57F3D" -m.err = "#FA3867" -m.dis = "#A771EF" -m.pri = "#4CB2E5" -m.bg = "#17181C" -m.mbg = "#1E1F24" -m.bg3 = "#26272B" -m.bg4 = "#333438" -m.fg = "#e4e5e7" -m.fg3 = "#CBCCCE" -m.fg2 = "#B0B1B4" -m.fg4 = "#8f9093" -return m diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/theme/init.lua deleted file mode 100644 index 5bdda93..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/theme/init.lua +++ /dev/null @@ -1,141 +0,0 @@ -local xresources = require "beautiful.xresources" -local rnotification = require "ruled.notification" -local dpi = xresources.apply_dpi -local gears = require "gears" -local gfs = require "gears.filesystem" -local helpers = require "helpers" -local settings = require "setup".settings --- Var -local themes_path = gfs.get_configuration_dir() .. "theme/" -local home = os.getenv 'HOME' - -local theme = {} - -local data = helpers.readJson(gears.filesystem.get_cache_dir() .. "json/settings.json") - - - ------ User Preferences ----- - - -theme.pfp = data.pfp -theme.user = string.gsub(os.getenv('USER'), '^%l', string.upper) -theme.hostname = os.getenv('HOST') ------ Font ----- -local themeName = settings.colorscheme -local colors = require("theme.colors." .. themeName) - - -theme.wallpaper = themes_path .. "walls/" .. colors.name .. ".jpg" -theme.iconThemePath = settings.iconTheme -theme.scheme = themeName -theme.sans = "Rubik" -theme.mono = "Iosevka Nerd Font" -theme.icon = "Material Design Icons" -theme.font = "Rubik 12" -theme.prompt_font = theme.font ------ General/default Settings ----- - -theme.bg_normal = colors.bg -theme.bg_focus = colors.bg -theme.bg_urgent = colors.bg -theme.bg_minimize = colors.bg -theme.bg_systray = colors.mbg - -theme.style = colors.type - -theme.fg_normal = colors.fg -theme.fg_focus = theme.fg_normal -theme.fg_urgent = theme.fg_normal -theme.fg_minimize = theme.fg_normal - -theme.useless_gap = dpi(tonumber(data.gaps)) -theme.border_width = dpi(0) - --- Colors - -theme.blue = colors.pri -theme.yellow = colors.warn -theme.green = colors.ok -theme.red = colors.err -theme.magenta = colors.dis -theme.transparent = "#00000000" - -theme.fg = colors.fg - -theme.bg = colors.bg -theme.bg_alt = colors.mbg - -theme.mbg = colors.mbg -theme.bg3 = colors.bg3 -theme.bg4 = colors.bg4 - -theme.fg = colors.fg -theme.fg1 = colors.fg2 -theme.fg2 = colors.fg3 -theme.fg3 = colors.fg4 - --- Menu - -theme.menu_height = dpi(40) -theme.menu_width = dpi(200) -theme.menu_bg_focus = theme.bg -theme.menu_bg_normal = theme.bg -theme.submenu = ">" - - -theme.taglist_bg = theme.bg .. "00" -theme.taglist_bg_focus = theme.blue -theme.taglist_fg_focus = theme.fg -theme.taglist_bg_urgent = theme.red -theme.taglist_fg_urgent = theme.fg -theme.taglist_bg_occupied = colors.fg3 .. '33' -theme.taglist_fg_occupied = theme.fg -theme.taglist_bg_empty = colors.fg3 .. '33' -theme.taglist_fg_empty = colors.fg -theme.taglist_disable_icon = true - - -theme.tasklist_bg_normal = theme.bg -theme.tasklist_bg_focus = theme.bg2 -theme.tasklist_bg_minimize = theme.bg3 - --- titlebar's buttons -theme.titlebar_close_button_normal = gears.color.recolor_image(themes_path .. "assets/titlebar/close_1.png", - theme.bg3) -theme.titlebar_close_button_focus = gears.color.recolor_image(themes_path .. "assets/titlebar/close_2.png", - theme.red) - -theme.layout_floating = gears.color.recolor_image(themes_path .. "assets/floating.png", - theme.fg) -theme.layout_tile = gears.color.recolor_image(themes_path .. "assets/tile.png", - theme.fg) - -theme.nixos = themes_path .. "assets/nixos.png" -theme.titlebar_minimize_button_normal = gears.color.recolor_image( - themes_path .. "assets/titlebar/minimize_1.png", theme.bg3) -theme.titlebar_minimize_button_focus = gears.color.recolor_image( - themes_path .. "assets/titlebar/minimize_2.png", theme.green) - -theme.titlebar_maximized_button_normal_inactive = gears.color.recolor_image(themes_path .. "assets/titlebar/close_1.png", - theme.bg3) -theme.titlebar_maximized_button_focus_inactive = gears.color.recolor_image(themes_path .. "assets/titlebar/close_1.png", - theme.yellow) -theme.titlebar_maximized_button_normal_active = gears.color.recolor_image(themes_path .. "assets/titlebar/close_1.png", - theme.bg3) -theme.titlebar_maximized_button_focus_active = gears.color.recolor_image(themes_path .. "assets/titlebar/close_1.png", - theme.yellow) - -theme.icon_theme = "Reversal" - - -theme.songdefpicture = themes_path .. "/assets/defsong.jpg" - -rnotification.connect_signal('request::rules', function() - rnotification.append_rule { - rule = { urgency = 'critical' }, - properties = { bg = '#ff0000', fg = '#ffffff' } - } -end) - -return theme diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/biscuit.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/biscuit.jpg deleted file mode 100644 index 41e963c..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/biscuit.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/cat.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/cat.jpg deleted file mode 100644 index 6fe4808..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/cat.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/decay.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/decay.jpg deleted file mode 100644 index 0518901..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/decay.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/everblush.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/everblush.jpg deleted file mode 100644 index 0b45b58..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/everblush.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/forest.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/forest.jpg deleted file mode 100644 index 2aae176..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/forest.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/fovere.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/fovere.jpg deleted file mode 100644 index 50644a7..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/fovere.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/fullerene.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/fullerene.jpg deleted file mode 100644 index f608185..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/fullerene.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/ghost.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/ghost.jpg deleted file mode 100644 index d6926f2..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/ghost.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/groove.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/groove.jpg deleted file mode 100644 index 4c4f0c6..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/groove.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/kizu.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/kizu.jpg deleted file mode 100644 index 8ee0160..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/kizu.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/nirvana.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/nirvana.jpg deleted file mode 100644 index 9c31851..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/nirvana.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/oxo.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/oxo.jpg deleted file mode 100644 index da7f8e8..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/oxo.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/rose.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/rose.jpg deleted file mode 100644 index 21148f8..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/rose.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/solarized.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/solarized.jpg deleted file mode 100644 index 892ace7..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/solarized.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/stardewnight.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/stardewnight.jpg deleted file mode 100644 index 0b1332d..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/stardewnight.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/swamp.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/swamp.jpg deleted file mode 100644 index 2f320b0..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/swamp.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/sweetpastel.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/sweetpastel.jpg deleted file mode 100644 index 3d669ae..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/sweetpastel.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/verdant.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/verdant.jpg deleted file mode 100644 index f600f2b..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/verdant.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/vixima.jpg b/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/vixima.jpg deleted file mode 100644 index 8a255ad..0000000 Binary files a/modules/home-manager/ricing/awesomewm/dotfiles/theme/walls/vixima.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/init.lua deleted file mode 100644 index 176fd30..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/init.lua +++ /dev/null @@ -1,174 +0,0 @@ -local awful = require("awful") -local wibox = require("wibox") -local beautiful = require("beautiful") -local dpi = require("beautiful").xresources.apply_dpi -local helpers = require('helpers') - -local profile = require("ui.bar.mods.profile") -local tags = require("ui.bar.mods.tags") -local task = require("ui.bar.mods.task") -local battery = require("ui.bar.mods.battery") -local wifi = require("ui.bar.mods.wifi") -local bluetooth = require("ui.bar.mods.bluetooth") -local music = require("ui.bar.mods.music") -local hourminutes = require("ui.bar.mods.time") -local layout = require("ui.bar.mods.layout") -local systray = require("ui.bar.mods.systray") - -local function init(s) - local wibar = awful.wibar { - position = "bottom", - height = 60, - ontop = false, - width = 1920, - bg = beautiful.bg, - fg = beautiful.fg1, - screen = s, - widget = { - - { - { - { - profile, - layout, - { - { - { - align = 'center', - font = beautiful.icon .. " 16", - markup = helpers.colorizeText('󱓟', beautiful.fg), - widget = wibox.widget.textbox, - }, - widget = wibox.container.margin, - top = 10, - bottom = 10, - left = 10, - right = 10 - }, - widget = wibox.container.background, - shape = helpers.rrect(5), - bg = beautiful.mbg, - buttons = { - awful.button({}, 1, function() - awesome.emit_signal('toggle::dash') - end) - }, - }, - { - { - tags(s), - widget = wibox.container.margin, - left = 15, - right = 15, - }, - shape = helpers.rrect(5), - widget = wibox.container.background, - bg = beautiful.mbg, - }, - spacing = 15, - layout = wibox.layout.fixed.horizontal - }, - widget = wibox.container.place, - valign = "center" - }, - widget = wibox.container.margin, - left = 15, - }, - { - { - { - task.widget, - widget = wibox.container.margin, - }, - widget = wibox.container.place, - valign = "center", - halign = "left", - }, - widget = wibox.container.margin, - }, - { - { - { - systray, - music, - { - { - { - battery, - wifi, - bluetooth, - spacing = 15, - layout = wibox.layout.fixed.horizontal - }, - widget = wibox.container.margin, - top = 10, - bottom = 10, - left = 10, - right = 10 - }, - widget = wibox.container.background, - shape = helpers.rrect(5), - bg = beautiful.mbg, - buttons = { - awful.button({}, 1, function() - awesome.emit_signal('toggle::control') - end) - }, - }, - hourminutes, - { - { - { - { - align = 'center', - font = beautiful.icon .. " 16", - markup = helpers.colorizeText('󰂜', beautiful.fg), - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - awesome.emit_signal('toggle::notify') - end) - }, - }, - { - align = 'center', - font = beautiful.icon .. " 16", - markup = helpers.colorizeText('󰐥', beautiful.red), - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - awesome.emit_signal('toggle::exit') - end) - }, - }, - spacing = 20, - layout = wibox.layout.fixed.horizontal - }, - widget = wibox.container.margin, - top = 10, - bottom = 10, - left = 10, - right = 10 - }, - widget = wibox.container.background, - shape = helpers.rrect(5), - bg = beautiful.mbg, - }, - layout = wibox.layout.fixed.horizontal, - spacing = 10, - }, - widget = wibox.container.place, - valign = "center", - }, - widget = wibox.container.margin, - right = 10, - }, - layout = wibox.layout.align.horizontal, - } - } - return wibar -end - -screen.connect_signal('request::desktop_decoration', function(s) - s.wibox = init(s) -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/battery.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/battery.lua deleted file mode 100644 index 6768d28..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/battery.lua +++ /dev/null @@ -1,48 +0,0 @@ -local wibox = require("wibox") -local helpers = require("helpers") -local beautiful = require("beautiful") -local awful = require("awful") - -local battery = wibox.widget { - { - max_value = 100, - value = 69, - id = "prog", - forced_height = 22, - forced_width = 45, - paddings = 3, - border_color = beautiful.fg .. "99", - background_color = beautiful.mbg, - bar_shape = helpers.rrect(3), - color = beautiful.blue, - border_width = 1.25, - shape = helpers.rrect(5), - widget = wibox.widget.progressbar - }, - { - { - bg = beautiful.fg .. "99", - forced_height = 10, - forced_width = 2, - shape = helpers.rrect(10), - widget = wibox.container.background, - }, - widget = wibox.container.place, - valign = "center", - }, - spacing = 3, - layout = wibox.layout.fixed.horizontal -} -awesome.connect_signal("signal::battery", function(value) - local b = battery:get_children_by_id("prog")[1] - b.value = value - if value > 80 then - b.color = beautiful.green - elseif value > 20 then - b.color = beautiful.blue - else - b.color = beautiful.red - end -end) - -return battery diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/bluetooth.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/bluetooth.lua deleted file mode 100644 index 538bce4..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/bluetooth.lua +++ /dev/null @@ -1,23 +0,0 @@ -local awful = require("awful") -local wibox = require("wibox") -local beautiful = require("beautiful") -local dpi = require("beautiful").xresources.apply_dpi -local helpers = require("helpers") - -local blue = wibox.widget { - font = beautiful.icon .. " 16", - markup = helpers.colorizeText("󰂯", beautiful.fg), - widget = wibox.widget.textbox, - valign = "center", - align = "center" -} - -awesome.connect_signal("signal::bluetooth", function(value) - if value then - blue.markup = helpers.colorizeText("󰂯", beautiful.blue) - else - blue.markup = helpers.colorizeText("󰂲", beautiful.fg2 .. "99") - end -end) - -return blue diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/layout.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/layout.lua deleted file mode 100644 index 3df5ee8..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/layout.lua +++ /dev/null @@ -1,44 +0,0 @@ -local awful = require("awful") -local wibox = require("wibox") -local beautiful = require("beautiful") -local helpers = require('helpers') -local layouts = awful.widget.layoutbox { - buttons = { - awful.button { - modifiers = {}, - button = 1, - on_press = function() awful.layout.inc(1) end, - }, - awful.button { - modifiers = {}, - button = 3, - on_press = function() awful.layout.inc(-1) end, - }, - awful.button { - modifiers = {}, - button = 4, - on_press = function() awful.layout.inc(-1) end, - }, - awful.button { - modifiers = {}, - button = 5, - on_press = function() awful.layout.inc(1) end, - }, - } -} -local widget = { - { - { - layouts, - clip_shape = helpers.rrect(3), - widget = wibox.container.margin - }, - margins = 10, - widget = wibox.container.margin - }, - bg = beautiful.mbg, - forced_height = 30, - shape = helpers.rrect(5), - widget = wibox.container.background -} -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/music.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/music.lua deleted file mode 100644 index e15aa1f..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/music.lua +++ /dev/null @@ -1,95 +0,0 @@ -local wibox = require("wibox") -local awful = require("awful") -local beautiful = require("beautiful") -local dpi = require("beautiful").xresources.apply_dpi -local gears = require("gears") -local pctl = require("mods.playerctl") -local helpers = require("helpers") -local playerctl = pctl.lib() -local art = wibox.widget { - image = helpers.cropSurface(5.8, gears.surface.load_uncached(beautiful.songdefpicture)), - opacity = 0.3, - forced_height = dpi(36), - shape = helpers.rrect(5), - forced_width = dpi(240), - widget = wibox.widget.imagebox -} -playerctl:connect_signal("metadata", function(_, title, artist, album_path, album, new, player_name) - -- Set art widget - art.image = helpers.cropSurface(5.8, gears.surface.load_uncached(album_path)) -end) -local next = wibox.widget { - align = 'center', - font = beautiful.icon .. " 18", - text = '󰒭', - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - playerctl:next() - end) - }, -} - -local prev = wibox.widget { - align = 'center', - font = beautiful.icon .. " 18", - text = '󰒮', - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - playerctl:previous() - end) - }, -} -local play = wibox.widget { - align = 'center', - font = beautiful.icon .. " 20", - markup = helpers.colorizeText('󰐊', beautiful.fg), - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - playerctl:play_pause() - end) - }, -} -playerctl:connect_signal("playback_status", function(_, playing, player_name) - play.markup = playing and helpers.colorizeText("󰏤", beautiful.fg) or helpers.colorizeText("󰐊", beautiful.fg) -end) -local finalwidget = wibox.widget { - { - art, - { - { - widget = wibox.widget.textbox, - }, - bg = { - type = "linear", - from = { 0, 0 }, - to = { 250, 0 }, - stops = { { 0, beautiful.bg .. "00" }, { 1, beautiful.mbg } } - }, - widget = wibox.container.background, - }, - { - { - { - align = 'center', - font = beautiful.icon .. " 18", - markup = helpers.colorizeText('󰋎', beautiful.fg), - widget = wibox.widget.textbox, - }, - nil, - { prev, play, next, spacing = 8, layout = wibox.layout.fixed.horizontal }, - layout = wibox.layout.align.horizontal, - }, - widget = wibox.container.margin, - left = 6, - right = 6, - }, - layout = wibox.layout.stack, - }, - widget = wibox.container.background, - shape = helpers.rrect(5), -} - -return finalwidget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/profile.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/profile.lua deleted file mode 100644 index 00d75cf..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/profile.lua +++ /dev/null @@ -1,20 +0,0 @@ -local wibox = require("wibox") -local helpers = require("helpers") -local beautiful = require("beautiful") -local awful = require("awful") - -local profile = wibox.widget { - widget = wibox.widget.imagebox, - image = beautiful.pfp, - forced_height = 40, - forced_width = 40, - clip_shape = helpers.rrect(40), - resize = true, - buttons = { - awful.button({}, 1, function() - awesome.emit_signal('toggle::launcher') - end) - }, -} - -return profile diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/systray.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/systray.lua deleted file mode 100644 index efbd5c2..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/systray.lua +++ /dev/null @@ -1,63 +0,0 @@ -local awful = require("awful") -local beautiful = require("beautiful") -local helpers = require("helpers") -local wibox = require("wibox") -local dpi = require("beautiful").xresources.apply_dpi - --- TOGGLER - -local togglertext = wibox.widget { - font = beautiful.icon .. " 20", - text = "󰅁", - valign = "center", - align = "center", - buttons = { - awful.button({}, 1, function() - awesome.emit_signal('systray::toggle') - end) - }, - widget = wibox.widget.textbox, -} - --- TRAY - -local systray = wibox.widget { - { - { - base_size = 18, - widget = wibox.widget.systray, - }, - widget = wibox.container.place, - valign = "center", - }, - visible = false, - left = 10, - right = 8, - widget = wibox.container.margin -} - -awesome.connect_signal('systray::toggle', function() - if systray.visible then - systray.visible = false - togglertext.text = '󰅁' - else - systray.visible = true - togglertext.text = '󰅂' - end -end) - -local widget = wibox.widget { - { - { - systray, - togglertext, - layout = wibox.layout.fixed.horizontal, - }, - shape = helpers.rrect(2), - bg = beautiful.mbg, - widget = wibox.container.background, - }, - margins = 0, - widget = wibox.container.margin, -} -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/tags.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/tags.lua deleted file mode 100644 index 426c33d..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/tags.lua +++ /dev/null @@ -1,68 +0,0 @@ -local awful = require("awful") -local wibox = require("wibox") -local gears = require("gears") -local helpers = require("helpers") -local animation = require("mods.animation") -local beautiful = require("beautiful") -return function(s) - local taglist = awful.widget.taglist { - layout = { - spacing = 8, - layout = wibox.layout.fixed.horizontal, - }, - style = { - shape = helpers.rrect(9) - }, - screen = s, - filter = awful.widget.taglist.filter.all, - buttons = { - awful.button({}, 1, function(t) t:view_only() end), - awful.button({}, 4, function(t) - awful.tag.viewprev(t.screen) - end), - awful.button({}, 5, function(t) - awful.tag.viewnext(t.screen) - end) - }, - widget_template = { - { - { - markup = '', - shape = helpers.rrect(3), - widget = wibox.widget.textbox, - }, - valign = 'center', - id = 'background_role', - shape = helpers.rrect(1), - widget = wibox.container.background, - forced_width = 40, - forced_height = 14, - }, - widget = wibox.container.place, - create_callback = function(self, tag) - self.taganim = animation:new({ - duration = 0.25, - easing = animation.easing.linear, - update = function(_, pos) - self:get_children_by_id('background_role')[1].forced_width = pos - end, - }) - self.update = function() - if tag.selected then - self.taganim:set(60) - elseif #tag:clients() > 0 then - self.taganim:set(40) - else - self.taganim:set(20) - end - end - - self.update() - end, - update_callback = function(self) - self.update() - end, - } - } - return taglist -end diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/task.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/task.lua deleted file mode 100644 index 9b198ec..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/task.lua +++ /dev/null @@ -1,397 +0,0 @@ -local awful = require("awful") -local dpi = require("beautiful").xresources.apply_dpi -local wibox = require("wibox") -local gears = require("gears") -local Gio = require("lgi").Gio -local helpers = require("helpers") -local beautiful = require("beautiful") -local getIcon = require("mods.getIcon") - -local layout = wibox.layout.fixed.horizontal -local flexlayout = wibox.layout.flex.horizontal - -local inspect = require("mods.inspect") -local M = { - metadata = { - { - count = 0, - pinned = true, - icon = getIcon(nil, "firefox", "firefox"), - id = 1, - clients = {}, - class = "firefox", - exec = "firefox", - name = "firefox", - }, - { - count = 0, - pinned = true, - icon = getIcon(nil, "org.wezfurlong.wezterm", "org.wezfurlong.wezterm"), - id = 2, - clients = {}, - class = "org.wezfurlong.wezterm", - exec = "wezterm", - name = "wezterm", - }, - { - count = 0, - pinned = true, - icon = getIcon(nil, "discord", "discord"), - id = 3, - clients = {}, - class = "discord", - exec = "discord", - name = "discord", - }, - { - count = 0, - pinned = true, - icon = getIcon(nil, "spotify", "spotify"), - id = 4, - clients = {}, - class = "spotify", - exec = "spotify", - name = "spotify", - }, - { - count = 0, - pinned = true, - icon = getIcon(nil, "steam", "steam"), - id = 4, - clients = {}, - class = "steam", - exec = "steam", - name = "steam", - }, - }, - entries = {}, - classes = { "firefox", "org.wezfurlong.wezterm", "discord", "spotify", "steam" } -} - -M.widget = wibox.widget { - layout = layout, - spacing = 10, -} - -M.popupWidget = wibox.widget { - layout = wibox.layout.fixed.vertical, - spacing = 10, -} - -M.popup = awful.popup { - minimum_width = 240, - widget = wibox.container.background, - visible = false, - shape = helpers.rrect(5), - ontop = true, - bg = beautiful.bg -} - -M.popup:setup { - widget = wibox.container.margin, - margins = 10, - M.popupWidget, -} - -local removeDup = function(arr) - local hash = {} - local res = {} - - for _, v in ipairs(arr) do - if (not hash[v]) then - res[#res + 1] = v -- you could print here instead of saving to result table if you wanted - hash[v] = true - end - end - - return res -end - - -function M:getExecutable(class) - local class_1 = class:gsub("[%-]", "") - local class_2 = class:gsub("[%-]", ".") - - local class_3 = class:match("(.-)-") or class - class_3 = class_3:match("(.-)%.") or class_3 - class_3 = class_3:match("(.-)%s+") or class_3 - local apps = Gio.AppInfo.get_all() - local possible_icon_names = { class, class_3, class_2, class_1 } - for _, app in ipairs(apps) do - local id = app:get_id():lower() - for _, possible_icon_name in ipairs(possible_icon_names) do - if id and id:find(possible_icon_name, 1, true) then - return app:get_executable() - end - end - end - return class:lower() -end - -function M:showMenu(data) - local clients = data.clients - self.popup.x = mouse.coords().x - 80 - self.popup.y = 1080 - 70 - (50 * (#clients + 2)) - self.popupWidget:reset() - for i, j in ipairs(clients) do - local widget = wibox.widget { - { - { - { - { - markup = j.name, - font = beautiful.font .. " 12", - height = 16, - widget = wibox.widget.textbox, - }, - widget = wibox.container.constraint, - width = 180, - height = 16, - }, - nil, - { - markup = helpers.colorizeText("󰅖", beautiful.red), - font = beautiful.icon .. " 16", - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - j:kill() - self.popup.visible = false - end) - }, - }, - layout = wibox.layout.align.horizontal - }, - widget = wibox.container.margin, - margins = 7, - }, - buttons = { - awful.button({}, 1, function() - if j.minimized then - j.minimized = false - client.focus = j - else - j.minimized = true - end - self.popup.visible = false - end) - }, - widget = wibox.container.background, - shape = helpers.rrect(4), - bg = j.minimized and beautiful.fg .. '22' or beautiful.mbg - } - M.popupWidget:connect_signal("mouse::leave", function() - self.popup.visible = false - end) - self.popupWidget:add(widget) - end - local addNew = wibox.widget { - { - { - { - { - markup = "Open New Window", - font = beautiful.font .. " 12", - widget = wibox.widget.textbox, - }, - widget = wibox.container.constraint, - width = 180, - }, - nil, - nil, - layout = wibox.layout.align.horizontal - }, - widget = wibox.container.margin, - margins = 7, - }, - buttons = { - awful.button({}, 1, function() - awful.spawn.with_shell(data.exec) - end) - }, - widget = wibox.container.background, - shape = helpers.rrect(4), - bg = beautiful.mbg - } - local closeAll = wibox.widget { - { - { - { - { - markup = "Close All", - font = beautiful.font .. " 12", - widget = wibox.widget.textbox, - }, - widget = wibox.container.constraint, - width = 180, - }, - nil, - nil, - layout = wibox.layout.align.horizontal - }, - widget = wibox.container.margin, - margins = 7, - }, - buttons = { - awful.button({}, 1, function() - for i, j in ipairs(clients) do - j:kill() - end - end) - }, - widget = wibox.container.background, - shape = helpers.rrect(4), - bg = beautiful.mbg - } - self.popupWidget:add(addNew) - self.popupWidget:add(closeAll) - self.popup.visible = true -end - -function M:genMetadata() - local clients = mouse.screen.selected_tag and mouse.screen.selected_tag:clients() or {} - - for _, j in pairs(self.metadata) do - j.count = 0 - j.clients = {} - end - for _, c in ipairs(clients) do - local icon = getIcon(c, c.class, c.class) - local class = string.lower(c.class or "default") - local exe = self:getExecutable(c.class) - if helpers.inTable(self.classes, class) then - for _, j in pairs(self.metadata) do - if j.class:lower() == class:lower() then - table.insert(j.clients, c) - j.count = j.count + 1 - end - end - else - table.insert(self.classes, class) - local toInsert = { - count = 1, - pinned = false, - icon = icon, - id = #self.classes + 1, - clients = { c }, - class = class, - exec = exe, - name = c.name, - } - table.insert(self.metadata, toInsert) - end - for _, j in pairs(self.metadata) do - j.clients = removeDup(j.clients) - end - end - table.sort(self.metadata, function(a, b) return a.id < b.id end) -end - -local function getMinimized(clients) - local a = 0 - for i, j in ipairs(clients) do - if j.minimized then - a = a + 1 - end - end - return a -end - -function M:genIcons() - self:genMetadata() - self.widget:reset() - print(inspect(self.metadata)) - for i, j in ipairs(self.metadata) do - if j.pinned == true or j.count > 0 then - local minimized = getMinimized(j.clients) - local bg = beautiful.bg - if client.focus then - if client.focus.class:lower() == j.class then - bg = beautiful.fg .. "22" - elseif j.count > 0 then - bg = beautiful.fg .. "33" - end - elseif minimized > 0 then - bg = beautiful.fg .. "33" - end - local widget = wibox.widget { - { - { - widget = wibox.widget.imagebox, - image = j.icon, - forced_height = 35, - forced_width = 35, - clip_shape = helpers.rrect(100), - resize = true, - }, - widget = wibox.container.margin, - margins = 3, - }, - shape = helpers.rrect(10), - widget = wibox.container.background, - bg = bg, - - } - widget:buttons(gears.table.join( - awful.button({}, 1, function() - if j.count == 0 then - awful.spawn.with_shell(j.exec) - elseif j.count == 1 then - if j.clients[j.count].minimized then - j.clients[j.count].minimized = false - client.focus = j.clients[j.count] - else - j.clients[j.count].minimized = true - end - else - self:showMenu(j) - end - end), - awful.button({}, 3, function() - self:showMenu(j) - end) - )) - self.widget:add(widget) - end - end -end - -client.connect_signal( - "focus", - function() - M:genIcons() - end -) -client.connect_signal( - "property::minimized", - function() - M:genIcons() - end -) -client.connect_signal( - "property::maximized", - function() - M:genIcons() - end -) -client.connect_signal( - "manage", - function() - M:genIcons() - M.popup.visible = false - end -) -client.connect_signal( - "unmanage", - function() - M:genIcons() - M.popup.visible = false - end -) -tag.connect_signal("property::selected", function() - M:genIcons() - M.popup.visible = false -end) -M:genIcons() - -return M diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/time.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/time.lua deleted file mode 100644 index 857d112..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/time.lua +++ /dev/null @@ -1,47 +0,0 @@ -local awful = require("awful") -local wibox = require("wibox") -local beautiful = require("beautiful") -local dpi = require("beautiful").xresources.apply_dpi -local helpers = require("helpers") -local hourminutes = wibox.widget { - { - { - { - { - font = beautiful.sans .. " 15", - format = "%I : %M", - align = "center", - valign = "center", - widget = wibox.widget.textclock - }, - widget = wibox.container.place, - valign = "center" - }, - { - { - font = beautiful.sans .. " 12", - format = "%d %B", - align = "center", - valign = "center", - widget = wibox.widget.textclock - }, - widget = wibox.container.place, - valign = "center" - }, - layout = wibox.layout.fixed.horizontal, - spacing = 20 - }, - margins = { left = dpi(10), right = dpi(10) }, - widget = wibox.container.margin - }, - bg = beautiful.mbg, - buttons = { - awful.button({}, 1, function() - awesome.emit_signal('toggle::moment') - end) - }, - widget = wibox.container.background, - shape = helpers.rrect(2), -} - -return hourminutes diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/wifi.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/wifi.lua deleted file mode 100644 index 11b0774..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/bar/mods/wifi.lua +++ /dev/null @@ -1,23 +0,0 @@ -local awful = require("awful") -local wibox = require("wibox") -local beautiful = require("beautiful") -local dpi = require("beautiful").xresources.apply_dpi -local helpers = require("helpers") - -local wifi = wibox.widget { - font = beautiful.icon .. " 16", - markup = helpers.colorizeText("󰤨", beautiful.fg), - widget = wibox.widget.textbox, - valign = "center", - align = "center" -} - -awesome.connect_signal("signal::network", function(value) - if value then - wifi.markup = "󰤨" - else - wifi.markup = helpers.colorizeText("󰤮", beautiful.fg2 .. "99") - end -end) - -return wifi diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/init.lua deleted file mode 100644 index ec7fe77..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/init.lua +++ /dev/null @@ -1,117 +0,0 @@ -local awful = require("awful") -local beautiful = require("beautiful") -local dpi = beautiful.xresources.apply_dpi -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") - -local buttons = require("ui.control.mods.buttons") -local moosic = require("ui.control.mods.music") -local sliders = require("ui.control.mods.slider") -local footer = require("ui.control.mods.footer") - -awful.screen.connect_for_each_screen(function(s) - local control = wibox({ - shape = helpers.rrect(8), - screen = s, - width = 520, - height = 760, - bg = beautiful.bg .. "00", - ontop = true, - visible = false, - }) - - control:setup { - { - { - moosic, - forced_height = 270, - widget = wibox.container.background, - bg = beautiful.bg, - shape = helpers.rrect(12), - }, - widget = wibox.container.margin, - bottom = 20, - }, - { - { - { - { - - { - layout = wibox.layout.align.horizontal, - { - { - widget = wibox.widget.imagebox, - image = beautiful.pfp, - forced_height = 50, - opacity = 0.7, - forced_width = 50, - clip_shape = helpers.rrect(8), - resize = true, - }, - { - { - { - footer, - widget = wibox.container.place, - valign = "center", - }, - widget = wibox.container.margin, - left = 10, - right = 10, - }, - widget = wibox.container.background, - shape = helpers.rrect(5), - bg = beautiful.mbg - }, - layout = wibox.layout.fixed.horizontal, - spacing = 20, - }, - nil, - { - { - { - font = beautiful.icon .. " 14", - markup = helpers.colorizeText("󰐱", beautiful.fg), - widget = wibox.widget.textbox, - valign = "center", - align = "center" - }, - widget = wibox.container.margin, - margins = 15 - }, - widget = wibox.container.background, - shape = helpers.rrect(6), - buttons = { - awful.button({}, 1, function() - awesome.emit_signal('toggle::setup') - end) - }, - bg = beautiful.mbg - }, - }, - widget = wibox.container.margin, - top = 18, - }, - sliders, - buttons, - layout = wibox.layout.fixed.vertical, - spacing = 25, - }, - widget = wibox.container.margin, - left = 20, - right = 20, - }, - widget = wibox.container.background, - bg = beautiful.bg, - shape = helpers.rrect(12), - }, - nil, - layout = wibox.layout.align.vertical, - } - awful.placement.bottom_right(control, { honor_workarea = true, margins = 20 }) - awesome.connect_signal("toggle::control", function() - control.visible = not control.visible - end) -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/mods/buttons.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/mods/buttons.lua deleted file mode 100644 index 26e6528..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/mods/buttons.lua +++ /dev/null @@ -1,106 +0,0 @@ -local awful = require("awful") -local wibox = require("wibox") -local helpers = require("helpers") -local beautiful = require("beautiful") - -local createButton = function(cmd, icon, name, labelConnected, labelDisconnected, signal) - local widget = wibox.widget { - { - { - { - { - markup = icon, - id = "icon", - font = beautiful.icon .. " 18", - widget = wibox.widget.textbox, - }, - { - { - markup = name, - id = "name", - font = beautiful.sans .. " 11", - widget = wibox.widget.textbox, - }, - { - markup = labelConnected, - id = "label", - font = beautiful.sans .. " 10", - widget = wibox.widget.textbox, - }, - layout = wibox.layout.fixed.vertical, - spacing = 0 - }, - layout = wibox.layout.fixed.horizontal, - spacing = 10 - }, - nil, - { - markup = "󰅂", - font = beautiful.icon .. " 20", - id = "arr", - widget = wibox.widget.textbox, - }, - layout = wibox.layout.align.horizontal, - }, - widget = wibox.container.margin, - top = 15, - bottom = 15, - left = 18, - right = 18 - }, - widget = wibox.container.background, - id = "back", - shape = helpers.rrect(8), - bg = beautiful.mbg, - buttons = { awful.button({}, 1, function() - awful.spawn.with_shell(cmd) - end) } - } - awesome.connect_signal('signal::' .. signal, function(status) - if status then - widget:get_children_by_id("back")[1].bg = beautiful.blue - widget:get_children_by_id("arr")[1].markup = helpers.colorizeText("󰅂", beautiful.bg) - widget:get_children_by_id("name")[1].markup = helpers.colorizeText(name, beautiful.bg) - widget:get_children_by_id("icon")[1].markup = helpers.colorizeText(icon, beautiful.bg) - widget:get_children_by_id("label")[1].markup = helpers.colorizeText(labelConnected, beautiful.bg) - else - widget:get_children_by_id("back")[1].bg = beautiful.mbg .. 'aa' - widget:get_children_by_id("arr")[1].markup = helpers.colorizeText("󰅂", beautiful.fg .. 'cc') - widget:get_children_by_id("name")[1].markup = helpers.colorizeText(name, beautiful.fg .. 'cc') - widget:get_children_by_id("icon")[1].markup = helpers.colorizeText(icon, beautiful.fg .. 'cc') - widget:get_children_by_id("label")[1].markup = helpers.colorizeText(labelDisconnected, beautiful.fg .. 'cc') - end - end) - return widget -end - -local widget = wibox.widget { - { - createButton("~/.config/awesome/misc/scripts/wifi --toggle", "󰤨", "Network", "Connected", "Disconnected", - "network"), - createButton("~/.config/awesome/misc/scripts/bluetooth --toggle", "󰂯", "Bluetooth", "Connected", "Disconnected", - "bluetooth"), - spacing = 20, - layout = wibox.layout.flex.horizontal - }, - { - createButton("~/.config/awesome/misc/scripts/airplanemode --toggle", "󰀝", "Airplane Mode", "Now In Flight Mode", - "Turned Off", "airplane"), - createButton('awesome-client \'naughty = require("naughty") naughty.toggle()\'', "󰍶", "Do Not Disturb", - "Turned On", "Turned Off", "dnd"), - spacing = 20, - layout = wibox.layout.flex.horizontal - }, - { - createButton("~/.config/awesome/misc/scripts/redshift --toggle", "󰛨", "Redshift", "Your Eyes Are Safe", - "Night Light Is Off", "redshift"), - createButton('pamixer --source 1 -t', "󰍬", "Microphone", - "Its Muted", "It is turned on", "mic"), - spacing = 20, - layout = wibox.layout.flex.horizontal - }, - layout = wibox.layout.fixed.vertical, - spacing = 20 -} - -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/mods/footer.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/mods/footer.lua deleted file mode 100644 index 2fbd78c..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/mods/footer.lua +++ /dev/null @@ -1,62 +0,0 @@ -local wibox = require("wibox") -local helpers = require("helpers") -local beautiful = require("beautiful") -local awful = require("awful") - -local widget = wibox.widget { - { - { - max_value = 100, - value = 69, - id = "prog", - forced_height = 20, - forced_width = 40, - paddings = 3, - border_color = beautiful.fg .. "99", - background_color = beautiful.mbg, - bar_shape = helpers.rrect(2), - color = beautiful.blue, - border_width = 1.25, - shape = helpers.rrect(5), - widget = wibox.widget.progressbar - }, - { - { - bg = beautiful.fg .. "99", - forced_height = 10, - forced_width = 2, - shape = helpers.rrect(10), - widget = wibox.container.background, - }, - widget = wibox.container.place, - valign = "center", - }, - spacing = 3, - layout = wibox.layout.fixed.horizontal - - }, - { - font = beautiful.sans .. " 12", - markup = helpers.colorizeText("25%", beautiful.fg), - valign = "center", - id = "batvalue", - widget = wibox.widget.textbox, - }, - layout = wibox.layout.fixed.horizontal, - spacing = 10 -} -awesome.connect_signal("signal::battery", function(value) - local b = widget:get_children_by_id("prog")[1] - local v = widget:get_children_by_id("batvalue")[1] - v.markup = helpers.colorizeText(value .. "%", beautiful.fg) - b.value = value - if value > 80 then - b.color = beautiful.green - elseif value > 20 then - b.color = beautiful.blue - else - b.color = beautiful.red - end -end) - -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/mods/music.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/mods/music.lua deleted file mode 100644 index be47b82..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/mods/music.lua +++ /dev/null @@ -1,148 +0,0 @@ -local wibox = require("wibox") -local awful = require("awful") -local beautiful = require("beautiful") -local dpi = require("beautiful").xresources.apply_dpi -local gears = require("gears") -local pctl = require("mods.playerctl") -local helpers = require("helpers") -local playerctl = pctl.lib() -local art = wibox.widget { - image = helpers.cropSurface(1.71, gears.surface.load_uncached(beautiful.songdefpicture)), - opacity = 0.3, - resize = true, - clip_shape = helpers.rrect(12), - widget = wibox.widget.imagebox -} -local next = wibox.widget { - align = 'center', - font = beautiful.icon .. " 22", - text = '󰒭', - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - playerctl:next() - end) - }, -} - -local prev = wibox.widget { - align = 'center', - font = beautiful.icon .. " 22", - text = '󰒮', - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - playerctl:previous() - end) - }, -} -local play = wibox.widget { - align = 'center', - font = beautiful.icon .. " 22", - markup = helpers.colorizeText('󰐍', beautiful.fg), - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - playerctl:play_pause() - end) - }, -} -playerctl:connect_signal("playback_status", function(_, playing, player_name) - play.markup = playing and helpers.colorizeText("󰏦", beautiful.fg) or helpers.colorizeText("󰐍", beautiful.fg) -end) -local finalwidget = wibox.widget { - - { - nil, - { - art, - { - { - widget = wibox.widget.textbox, - }, - bg = { - type = "linear", - from = { 0, 0 }, - to = { 250, 0 }, - stops = { { 0, beautiful.bg .. "ff" }, { 1, beautiful.mbg .. '55' } } - }, - shape = helpers.rrect(12), - widget = wibox.container.background, - }, - { - { - { - { - id = "songname", - font = beautiful.sans .. " 14", - markup = helpers.colorizeText('Song Name', beautiful.fg), - widget = wibox.widget.textbox, - }, - { - id = "artist", - font = beautiful.sans .. " 12", - markup = helpers.colorizeText('Artist Name', beautiful.fg), - widget = wibox.widget.textbox, - }, - spacing = 8, - layout = wibox.layout.fixed.vertical, - }, - nil, - { - id = "player", - font = beautiful.sans .. " 12", - markup = helpers.colorizeText('Playing Via Spotify', beautiful.fg), - widget = wibox.widget.textbox, - }, - layout = wibox.layout.align.vertical - }, - widget = wibox.container.margin, - margins = 20 - }, - layout = wibox.layout.stack, - }, - { - { - { - { - prev, - play, - next, - layout = wibox.layout.align.vertical, - }, - widget = wibox.container.margin, - top = 25, - bottom = 25, - left = 20, - right = 20, - }, - shape = helpers.rrect(12), - widget = wibox.container.background, - bg = beautiful.mbg, - }, - widget = wibox.container.margin, - left = 20, - }, - layout = wibox.layout.align.horizontal, - }, - widget = wibox.container.margin, - margins = 20, -} - -playerctl:connect_signal("metadata", function(_, title, artist, album_path, album, new, player_name) - if album_path == "" then - album_path = beautiful.songdefpicture - end - if string.len(title) > 30 then - title = string.sub(title, 0, 30) .. "..." - end - if string.len(artist) > 22 then - artist = string.sub(artist, 0, 22) .. "..." - end - art.image = helpers.cropSurface(1.71, gears.surface.load_uncached(album_path)) - helpers.gc(finalwidget, "songname"):set_markup_silently(helpers.colorizeText(title or "NO", beautiful.fg)) - helpers.gc(finalwidget, "artist"):set_markup_silently(helpers.colorizeText(artist or "HM", beautiful.fg)) - helpers.gc(finalwidget, "player"):set_markup_silently(helpers.colorizeText("Playing Via: " .. player_name or "", - beautiful.fg)) -end) -return finalwidget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/mods/slider.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/mods/slider.lua deleted file mode 100644 index da6fb76..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/control/mods/slider.lua +++ /dev/null @@ -1,106 +0,0 @@ -local wibox = require("wibox") -local awful = require("awful") -local beautiful = require("beautiful") -local dpi = require("beautiful").xresources.apply_dpi -local gears = require("gears") -local helpers = require("helpers") - -local createHandle = function() - return function(cr) - gears.shape.rounded_rect(cr, 20, 20, 15) - end -end - -local createSlider = function(icon, signal, command) - local slidSlider = wibox.widget { - bar_shape = helpers.rrect(15), - bar_height = 3, - handle_color = beautiful.bg, - bar_color = beautiful.bg .. '00', - bar_active_color = beautiful.fg, - handle_shape = createHandle(), - handle_border_width = 2, - handle_width = dpi(20), - handle_margins = { top = 5.9 }, - handle_border_color = beautiful.fg, - value = 25, - forced_height = 35, - maximum = 100, - widget = wibox.widget.slider, - } - - local slidLabel = wibox.widget { - - font = beautiful.sans .. " Bold 12", - markup = "86" .. "%", - valign = "center", - widget = wibox.widget.textbox, - } - - - local slidLabelBox = wibox.widget { - slidLabel, - widget = wibox.container.margin, - margins = { - left = dpi(16), - } - } - - local slidIcon = wibox.widget { - { - font = beautiful.icon .. " 15", - markup = helpers.colorizeText(icon, beautiful.fg), - valign = "center", - widget = wibox.widget.textbox, - }, - widget = wibox.container.margin, - } - - local slidScale = wibox.widget { - nil, - { - { - slidIcon, - widget = wibox.container.place, - valign = "center", - halign = "left" - }, - { - { - { - widget = wibox.container.background, - forced_height = 2, - shape = helpers.rrect(10), - bg = beautiful.mbg - }, - widget = wibox.container.place, - content_fill_horizontal = true, - valign = "center", - }, - slidSlider, - layout = wibox.layout.stack, - }, - layout = wibox.layout.fixed.horizontal, - spacing = 20 - }, - nil, - layout = wibox.layout.align.horizontal, - } - - awesome.connect_signal('signal::' .. signal, function(value) - slidSlider.value = value - end) - slidSlider:connect_signal("property::value", function(_, new_value) - awful.spawn.with_shell(string.format(command, new_value)) - end) - return slidScale -end - -local widget = wibox.widget { - createSlider("󰃟", "brightness", "brightnessctl s %d%%"), - createSlider("󰓃", "volume", "pamixer --set-volume %d"), - layout = wibox.layout.fixed.vertical, - spacing = 25, -} - -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/init.lua deleted file mode 100644 index 4a87303..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/init.lua +++ /dev/null @@ -1,61 +0,0 @@ -local awful = require("awful") -local beautiful = require("beautiful") -local dpi = beautiful.xresources.apply_dpi -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") - -local profile = require("ui.dash.mods.profile") -local pomo = require("ui.dash.mods.pomo") -local quote = require("ui.dash.mods.quote") - -local song = require("ui.dash.mods.song") -local todo = require("ui.dash.mods.todo") - -local time = require("ui.dash.mods.time") -local nf = require("ui.dash.mods.nf") -local weather = require("ui.dash.mods.weather") - -awful.screen.connect_for_each_screen(function(s) - local dash = wibox({ - shape = helpers.rrect(12), - screen = s, - width = 1350, - height = 790, - bg = beautiful.bg, - ontop = true, - visible = false, - }) - - dash:setup { - { - { - profile, - pomo, - quote, - layout = wibox.layout.align.vertical, - }, - { - nil, - todo, - song, - layout = wibox.layout.align.vertical, - }, - { - time, - nf, - weather, - spacing = 20, - layout = wibox.layout.fixed.vertical, - }, - spacing = 20, - layout = wibox.layout.flex.horizontal, - }, - widget = wibox.container.margin, - margins = 20, - } - awful.placement.centered(dash, { honor_workarea = true, margins = 20 }) - awesome.connect_signal("toggle::dash", function() - dash.visible = not dash.visible - end) -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/nf.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/nf.lua deleted file mode 100644 index c1d78e8..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/nf.lua +++ /dev/null @@ -1,141 +0,0 @@ -local awful = require("awful") -local wibox = require("wibox") -local beautiful = require("beautiful") -local dpi = require("beautiful").xresources.apply_dpi -local helpers = require("helpers") - - -local widget = wibox.widget { - { - { - { - { - { - { - { - font = beautiful.mono .. " 14", - markup = helpers.colorizeText('>', beautiful.bg), - widget = wibox.widget.textbox, - }, - widget = wibox.container.margin, - top = 5, - bottom = 5, - left = 10, - right = 10, - }, - widget = wibox.container.background, - bg = beautiful.blue - }, - { - { - font = beautiful.mono .. " 14", - markup = helpers.colorizeText('fetch.sh', beautiful.fg), - widget = wibox.widget.textbox, - }, - widget = wibox.container.place, - valign = "center", - }, - spacing = 15, - layout = wibox.layout.fixed.horizontal, - }, - nil, - nil, - layout = wibox.layout.align.horizontal, - }, - { - { - widget = wibox.widget.imagebox, - image = beautiful.nixos, - forced_height = 140, - forced_width = 140, - resize = true, - }, - { - { - font = beautiful.mono .. " 14", - markup = helpers.colorizeText('OS : NixOS 24.05', beautiful.fg), - widget = wibox.widget.textbox, - }, - { - font = beautiful.mono .. " 14", - markup = helpers.colorizeText('WM : Awesome', beautiful.fg), - widget = wibox.widget.textbox, - }, - { - font = beautiful.mono .. " 14", - markup = helpers.colorizeText('USER: ' .. beautiful.user, beautiful.fg), - widget = wibox.widget.textbox, - }, - { - font = beautiful.mono .. " 14", - markup = helpers.colorizeText('SH : ZSH', beautiful.fg), - widget = wibox.widget.textbox, - }, - spacing = 8, - layout = wibox.layout.fixed.vertical, - }, - spacing = 20, - layout = wibox.layout.fixed.horizontal, - }, - { - { - { - widget = wibox.container.background, - bg = beautiful.bg3, - forced_height = 20, - shape = helpers.rrect(5), - forced_width = 20, - }, - { - widget = wibox.container.background, - bg = beautiful.red, - forced_height = 20, - shape = helpers.rrect(5), - forced_width = 20, - }, - { - widget = wibox.container.background, - bg = beautiful.green, - forced_height = 20, - shape = helpers.rrect(5), - forced_width = 20, - }, - { - widget = wibox.container.background, - bg = beautiful.yellow, - forced_height = 20, - shape = helpers.rrect(5), - forced_width = 20, - }, - { - widget = wibox.container.background, - bg = beautiful.blue, - forced_height = 20, - shape = helpers.rrect(5), - forced_width = 20, - }, - { - widget = wibox.container.background, - bg = beautiful.magenta, - forced_height = 20, - shape = helpers.rrect(5), - forced_width = 20, - }, - spacing = 12, - layout = wibox.layout.fixed.horizontal, - }, - widget = wibox.container.place, - halign = "center" - }, - spacing = 20, - layout = wibox.layout.fixed.vertical, - }, - widget = wibox.container.margin, - margins = 40 - }, - widget = wibox.container.background, - bg = beautiful.mbg, - shape = helpers.rrect(20) -} - -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/pomo.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/pomo.lua deleted file mode 100644 index 2a64197..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/pomo.lua +++ /dev/null @@ -1,252 +0,0 @@ -local gears = require("gears") -local wibox = require("wibox") -local awful = require("awful") -local beautiful = require("beautiful") -local helpers = require("helpers") - -local timer = { defaultTime = 25 * 60 } - - -function timer:stop() - self.clock:stop() -end - -function timer:pause() - self.paused = true - self.pausedTime = os.time() -end - -function timer:resume() - self.paused = false - self.clock:again() - if self.pausedTime then - self.pausedTime = nil - end -end - -function timer:new() - self.timeRemaining = self.defaultTime - self.paused = true - self.pausedTime = nil - - self.widget = wibox.widget { - { - id = "image", - image = helpers.cropSurface(1.42, gears.surface.load_uncached(gears.filesystem.get_configuration_dir() .. "/theme/assets/pomo.jpg")), - widget = wibox.widget.imagebox, - clip_shape = helpers.rrect(20), - opacity = 0.9, - resize = true, - horizontal_fit_policy = "fit" - }, - { - { - widget = wibox.widget.textbox, - }, - bg = { - type = "linear", - from = { 0, 0 }, - to = { 200, 0 }, - stops = { { 0, beautiful.mbg .. "aa" }, { 1, beautiful.bg .. 'dd' } } - }, - shape = helpers.rrect(20), - widget = wibox.container.background, - }, - { - { - { - { - { - { - id = "timer", - font = beautiful.sans .. " 48", - markup = "00:00", - valign = "center", - align = "start", - widget = wibox.widget.textbox, - }, - widget = wibox.container.place, - halign = 'center' - }, - { - { - { - { - { - id = "reset", - font = beautiful.icon .. " 20", - markup = helpers.colorizeText("󰍴", beautiful.fg), - valign = "center", - align = "start", - widget = wibox.widget.textbox, - }, - widget = wibox.container.margin, - margins = 12, - }, - widget = wibox.container.background, - shape = helpers.rrect(50), - buttons = { - awful.button({}, 1, function() - if self.defaultTime > 5 * 60 then - self.paused = true - self.defaultTime = self.defaultTime - 5 * 60 - self.timeRemaining = self.defaultTime - self.timeRemaining = self.defaultTime - self.pausedTime = self.defaultTime - self.clock:stop() - self:update() - end - end) - }, - }, - { - { - { - id = "resume", - font = beautiful.icon .. " 20", - markup = helpers.colorizeText("󰐎", beautiful.blue), - valign = "center", - align = "start", - widget = wibox.widget.textbox, - }, - widget = wibox.container.margin, - margins = 12, - }, - widget = wibox.container.background, - shape = helpers.rrect(10), - buttons = { - awful.button({}, 1, function() - if self.paused == false then - self:pause() - else - self:resume() - end - end) - }, - bg = beautiful.blue .. '11' - }, - { - { - { - id = "reset", - font = beautiful.icon .. " 20", - markup = helpers.colorizeText("󰦛", beautiful.red), - valign = "center", - align = "start", - widget = wibox.widget.textbox, - }, - widget = wibox.container.margin, - margins = 12, - }, - widget = wibox.container.background, - shape = helpers.rrect(10), - buttons = { - awful.button({}, 1, function() - self.paused = true - self.timeRemaining = self.defaultTime - self.pausedTime = self.defaultTime - self.clock:stop() - self:update() - end) - }, - bg = beautiful.red .. '11' - }, - { - { - { - id = "increasetime", - font = beautiful.icon .. " 20", - markup = helpers.colorizeText("󰐕", beautiful.fg), - valign = "center", - align = "start", - widget = wibox.widget.textbox, - }, - widget = wibox.container.margin, - margins = 12, - }, - widget = wibox.container.background, - shape = helpers.rrect(50), - buttons = { - awful.button({}, 1, function() - self.paused = true - self.defaultTime = self.defaultTime + 5 * 60 - self.timeRemaining = self.defaultTime - self.timeRemaining = self.defaultTime - self.pausedTime = self.defaultTime - self.clock:stop() - self:update() - end) - }, - }, - layout = wibox.layout.fixed.horizontal, - spacing = 20, - }, - widget = wibox.container.place, - halign = 'center', - }, - layout = wibox.layout.fixed.vertical, - spacing = 40, - }, - widget = wibox.container.margin, - margins = 25, - }, - widget = wibox.container.place, - valign = 'center', - }, - shape = helpers.rrect(20), - widget = wibox.container.background, - }, - { - { - nil, - { - id = "prog", - max_value = 100, - value = 0, - forced_height = 20, - bar_shape = helpers.prect(false, false, true, true, 20), - shape = helpers.prect(false, false, true, true, 20), - color = beautiful.green, - background_color = beautiful.green .. '11', - paddings = 1, - border_width = 1, - widget = wibox.widget.progressbar, - }, - nil, - layout = wibox.layout.align.vertical, - }, - widget = wibox.container.place, - valign = "bottom" - }, - layout = wibox.layout.stack, - } - - function self:update() - local percent = math.floor((self.timeRemaining / self.defaultTime) * 100) - self.widget:get_children_by_id("timer")[1].markup = string.format("%02d:%02d", self.timeRemaining / 60, - self.timeRemaining % 60) - self.widget:get_children_by_id('prog')[1].value = percent - if self.timeRemaining == 0 then - awful.spawn.with_shell("notify-send 'Time is up!' 'Get some rest'") - end - end - - local tick = function() - if not self.paused then - self.timeRemaining = self.timeRemaining - 1 - self:update() - end - end - self.clock = gears.timer({ - timeout = 1, - call_now = true, - autostart = false, - callback = tick - }) - - - self:update() - return self.widget -end - -return timer:new() diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/profile.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/profile.lua deleted file mode 100644 index 856c8ae..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/profile.lua +++ /dev/null @@ -1,54 +0,0 @@ -local awful = require("awful") -local beautiful = require("beautiful") -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") - -local widget = wibox.widget { - { - { - { - { - { - widget = wibox.widget.imagebox, - image = beautiful.pfp, - forced_height = 140, - forced_width = 140, - clip_shape = helpers.rrect(100), - resize = true, - }, - widget = wibox.container.place, - halign = "center" - }, - { - markup = helpers.colorizeText("Welcome, " .. beautiful.user .. "!", beautiful.fg), - align = 'center', - font = beautiful.sans .. " 18", - widget = wibox.widget.textbox - }, - { - id = "uptime", - markup = helpers.colorizeText("Running since ", beautiful.fg), - align = 'center', - font = beautiful.sans .. " 14", - widget = wibox.widget.textbox - }, - spacing = 10, - layout = wibox.layout.fixed.vertical - }, - widget = wibox.container.margin, - margins = 30, - }, - shape = helpers.rrect(20), - widget = wibox.container.background, - bg = beautiful.mbg, - }, - widget = wibox.container.margin, - bottom = 20 -} -awesome.connect_signal("signal::uptime", function(v) - helpers.gc(widget, "uptime").markup = helpers.colorizeText(v, beautiful.fg2 .. "99") -end) - - -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/quote.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/quote.lua deleted file mode 100644 index c2ae656..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/quote.lua +++ /dev/null @@ -1,41 +0,0 @@ -local helpers = require("helpers") -local beautiful = require("beautiful") -local gears = require("gears") -local dpi = beautiful.xresources.apply_dpi -local awful = require("awful") -local wibox = require("wibox") - -local widget = wibox.widget { - { - { - { - { - font = beautiful.sans .. " 16", - markup = helpers.colorizeText("All our dreams can come true if we have the courage to pursue them", beautiful.fg), - widget = wibox.widget.textbox, - valign = "start", - align = "center" - }, - { - - font = beautiful.sans .. " Bold 12", - markup = helpers.colorizeText("Walt Disney", beautiful.magenta), - widget = wibox.widget.textbox, - valign = "start", - align = "center" - }, - spacing = 20, - layout = wibox.layout.fixed.vertical, - }, - widget = wibox.container.margin, - margins = 30 - }, - widget = wibox.container.background, - bg = beautiful.mbg, - shape = helpers.rrect(20), - }, - widget = wibox.container.margin, - top = 20 -} - -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/song.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/song.lua deleted file mode 100644 index 28fea37..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/song.lua +++ /dev/null @@ -1,85 +0,0 @@ -local wibox = require("wibox") -local awful = require("awful") -local beautiful = require("beautiful") -local dpi = require("beautiful").xresources.apply_dpi -local gears = require("gears") -local pctl = require("mods.playerctl") -local helpers = require("helpers") -local playerctl = pctl.lib() - -local art = wibox.widget { - image = helpers.cropSurface(1.71, gears.surface.load_uncached(beautiful.songdefpicture)), - opacity = 0.3, - resize = true, - height = 300, - clip_shape = helpers.rrect(20), - widget = wibox.widget.imagebox -} - -local widget = wibox.widget { - { - art, - { - { - widget = wibox.widget.textbox, - }, - bg = { - type = "linear", - from = { 0, 0 }, - to = { 200, 0 }, - stops = { { 0, beautiful.mbg .. "88" }, { 1, beautiful.bg .. '33' } } - }, - shape = helpers.rrect(20), - widget = wibox.container.background, - }, - { - { - { - { - font = beautiful.sans .. " 12", - markup = helpers.colorizeText('Now Playing', beautiful.fg), - widget = wibox.widget.textbox, - }, - { - id = "songname", - font = beautiful.sans .. " SemiBold 16", - markup = helpers.colorizeText('Song Name', beautiful.fg), - widget = wibox.widget.textbox, - }, - { - id = "artist", - font = beautiful.sans .. " 14", - markup = helpers.colorizeText('Artist Name', beautiful.fg), - widget = wibox.widget.textbox, - }, - spacing = 8, - layout = wibox.layout.fixed.vertical, - }, - widget = wibox.container.place, - halign = "left", - valign = "top" - }, - widget = wibox.container.margin, - margins = 20, - }, - layout = wibox.layout.stack, - }, - widget = wibox.container.margin, - top = 20, -} - -playerctl:connect_signal("metadata", function(_, title, artist, album_path, album, new, player_name) - if album_path == "" then - album_path = beautiful.songdefpicture - end - if string.len(title) > 30 then - title = string.sub(title, 0, 30) .. "..." - end - if string.len(artist) > 22 then - artist = string.sub(artist, 0, 22) .. "..." - end - art.image = helpers.cropSurface(1.71, gears.surface.load_uncached(album_path)) - helpers.gc(widget, "songname"):set_markup_silently(helpers.colorizeText(title or "NO", beautiful.fg)) - helpers.gc(widget, "artist"):set_markup_silently(helpers.colorizeText(artist or "HM", beautiful.fg)) -end) -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/time.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/time.lua deleted file mode 100644 index c5a8ad7..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/time.lua +++ /dev/null @@ -1,42 +0,0 @@ -local awful = require("awful") -local beautiful = require("beautiful") -local dpi = beautiful.xresources.apply_dpi -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") - -local widget = wibox.widget { - { - { - { - { - font = beautiful.sans .. " SemiBold 42", - format = helpers.colorizeText("%I : %M", beautiful.fg), - align = "center", - valign = "center", - widget = wibox.widget.textclock - }, - { - font = beautiful.sans .. " 16", - format = helpers.colorizeText("%A, %d %B", beautiful.fg2 .. '99'), - align = "center", - valign = "center", - widget = wibox.widget.textclock - }, - spacing = 8, - layout = wibox.layout.fixed.vertical, - }, - widget = wibox.container.place, - halign = "center", - valign = "center" - }, - widget = wibox.container.margin, - margin = 30, - }, - shape = helpers.rrect(20), - forced_height = 200, - widget = wibox.container.background, - bg = beautiful.mbg -} - -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/todo.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/todo.lua deleted file mode 100644 index a3f5187..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/todo.lua +++ /dev/null @@ -1,322 +0,0 @@ -local gears = require("gears") -local json = require "mods.json" -local wibox = require("wibox") -local awful = require("awful") -local beautiful = require("beautiful") -local helpers = require("helpers") - -local DATA = gears.filesystem.get_cache_dir() .. 'json/todos.json' - -local elems = wibox.widget { - layout = require("mods.overflow").vertical, - scrollbar_enabled = false, - forced_height = 300, -} - -local check_exits = function(path) - local file = io.open(path, "rb") - if file then file:close() end - return file ~= nil -end - -local getData = function() - if check_exits(DATA) then - local f = assert(io.open(DATA, "rb")) - local lines = f:read("*all") - f:close() - local data = json.decode(lines) - return data - else - return {} - end -end - -local writeData = function(d) - os.execute('truncate -s 0 ' .. DATA) - local f = assert(io.open(DATA, "wb")) - local write = json.encode(d) - f:write(write) - f:flush() - f:close() -end - -local grabber = {} -function grabber:init(finalWidget, fn, cl) - local exclude = { - "Shift_R", - "Shift_L", - "Tab", - "Alt_R", - "Alt_L", - "Ctrl_L", - "Ctrl_R", - "CapsLock", - "Home" - } - - local function has_value(tab, val) - for _, value in ipairs(tab) do - if value == val then - return true - end - end - - return false - end - grabber.main = awful.keygrabber({ - auto_start = true, - stop_event = "release", - keypressed_callback = function(_, _, key, _) - local addition = '' - if key == "Escape" or key == "Super_L" then - grabber:stop() - cl() - elseif key == "BackSpace" then - finalWidget:get_children_by_id('input')[1].markup = finalWidget:get_children_by_id('input')[1].markup:sub(1, -2) - elseif key == "Return" then - if string.len(finalWidget:get_children_by_id('input')[1].markup) > 0 then - fn(finalWidget:get_children_by_id('input')[1].markup) - finalWidget:get_children_by_id('input')[1].markup = '' - grabber:stop() - end - elseif has_value(exclude, key) then - addition = '' - else - addition = key - end - finalWidget:get_children_by_id('input')[1].markup = finalWidget:get_children_by_id('input')[1].markup .. addition - end, - }) -end - -function grabber:start() - grabber.main:start() -end - -function grabber:stop() - grabber.main:stop() -end - -local function getPop(tit) - local pop = wibox({ - type = "dock", - height = 90, - width = 400, - ontop = true, - visible = true, - bg = beautiful.bg - }) - awful.placement.centered(pop) - local widget = wibox.widget { - { - font = beautiful.sans .. " 12", - markup = tit, - valign = "center", - align = "start", - widget = wibox.widget.textbox, - }, - { - { - { - id = "input", - font = beautiful.sans .. " 12", - markup = "", - forced_height = 18, - valign = "center", - align = "start", - widget = wibox.widget.textbox, - }, - widget = wibox.container.margin, - margins = 10 - }, - widget = wibox.container.background, - bg = beautiful.mbg - }, - spacing = 10, - layout = wibox.layout.fixed.vertical - } - pop:setup { - widget, - widget = wibox.container.margin, - margins = 10 - } - return widget, pop -end - -local function makeElement(i, n) - awful.screen.connect_for_each_screen(function(s) - local widget = wibox.widget { - { - { - { - id = "input", - font = beautiful.sans .. " 14", - markup = i.completed and "" .. i.name .. "" or i.name, - valign = "center", - align = "center", - widget = wibox.widget.textbox, - }, - widget = wibox.container.constraint, - width = 300, - }, - nil, - { - { - font = beautiful.icon .. " 16", - markup = helpers.colorizeText("󰸞", beautiful.green), - valign = "center", - align = "center", - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - local new = { - completed = not i.completed, - name = i.name - } - local data = getData() - table.remove(data, n) - table.insert(data, n, new) - writeData(data) - elems:reset() - for k, l in ipairs(data) do - makeElement(l, k) - end - end), - }, - }, - { - font = beautiful.icon .. " 16", - markup = helpers.colorizeText("󰩹", beautiful.red), - valign = "center", - align = "center", - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - local data = getData() - table.remove(data, n) - writeData(data) - elems:reset() - for k, l in ipairs(data) do - makeElement(l, k) - end - end), - }, - }, - spacing = 18, - layout = wibox.layout.fixed.horizontal - }, - layout = wibox.layout.align.horizontal - }, - widget = wibox.container.background, - forced_height = 45, - forced_width = 400, - data = i - } - widget:get_children_by_id('input')[1]:add_button(awful.button({}, 1, function() - local w, pop = getPop('Enter New Name') - grabber:init(w, function(string) - pop.visible = false - local new = { - completed = i.completed, - name = string - } - local data = getData() - table.remove(data, n) - table.insert(data, n, new) - writeData(data) - elems:reset() - for k, l in ipairs(data) do - makeElement(l, k) - end - end, function() - pop.visible = false - end) - grabber:start() - end)) - elems:add(widget) - end) -end - -local makeData = function(d) - local data = getData() - table.insert(data, d) - writeData(data) -end - -local function refresh() - elems:reset() - local data = getData() - for i, j in ipairs(data) do - makeElement(j, i) - end -end - -local empV - -local finalwidget = wibox.widget { - { - { - { - { - font = beautiful.sans .. " 14", - markup = "To-Dos", - valign = "center", - align = "center", - widget = wibox.widget.textbox, - }, - nil, - { - { - font = beautiful.icon .. " 20", - markup = helpers.colorizeText("󰐕", beautiful.blue), - valign = "center", - align = "center", - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - local data = { - completed = false, - name = "New Todo! Click to change name" - } - makeData(data) - refresh() - end), - }, - }, - { - font = beautiful.icon .. " 20", - markup = helpers.colorizeText("󰅖", beautiful.red), - valign = "center", - align = "center", - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - os.execute("rm " .. DATA) - refresh() - end), - }, - }, - spacing = 20, - layout = wibox.layout.fixed.horizontal - }, - layout = wibox.layout.align.horizontal - }, - { - elems, - widget = wibox.container.place, - valign = 'top' - }, - spacing = 18, - layout = wibox.layout.fixed.vertical - }, - widget = wibox.container.margin, - margins = 18 - }, - forced_width = 460, - shape = helpers.rrect(8), - widget = wibox.container.background, - bg = beautiful.mbg -} - -refresh() -return finalwidget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/weather.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/weather.lua deleted file mode 100644 index 7d0ea1c..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/dash/mods/weather.lua +++ /dev/null @@ -1,59 +0,0 @@ -local wibox = require("wibox") -local awful = require("awful") -local beautiful = require "beautiful" -local gears = require("gears") -local helpers = require "helpers" - -local widget = wibox.widget { - { - { - { - { - id = "icon", - image = gears.filesystem.get_configuration_dir() .. "theme/assets/weather/icons/weather-fog.svg", - opacity = 0.9, - clip_shape = helpers.rrect(4), - forced_height = 100, - forced_width = 100, - valign = "center", - widget = wibox.widget.imagebox - }, - { - { - id = "temp", - font = beautiful.sans .. " 36", - markup = "31 C", - valign = "center", - widget = wibox.widget.textbox, - }, - { - id = "desc", - font = beautiful.sans .. " 14", - markup = "Scattered Clouds", - valign = "center", - widget = wibox.widget.textbox, - }, - spacing = 8, - layout = wibox.layout.fixed.vertical, - }, - spacing = 120, - layout = wibox.layout.fixed.horizontal, - }, - widget = wibox.container.place, - valign = "center", - }, - widget = wibox.container.margin, - margins = 25, - }, - widget = wibox.container.background, - bg = beautiful.mbg, - shape = helpers.rrect(20), - forced_height = 195, -} - -awesome.connect_signal("signal::weather", function(out) - helpers.gc(widget, "icon").image = out.image - helpers.gc(widget, "temp").markup = out.temp .. "°C" - helpers.gc(widget, "desc").markup = out.desc -end) -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/desktop/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/desktop/init.lua deleted file mode 100644 index 8eec10d..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/desktop/init.lua +++ /dev/null @@ -1,455 +0,0 @@ -local awful = require("awful") -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") -local popup = require("ui.desktop.popup") -local json = require("mods.json") -local beautiful = require("beautiful") - - -local data = helpers.readJson(gears.filesystem.get_cache_dir() .. "json/settings.json") -local inspect = require("mods.inspect") -local dpi = beautiful.xresources.apply_dpi -local appicons = helpers.readJson(gears.filesystem.get_cache_dir() .. "json/settings.json").iconTheme .. "/" -local foldericons = helpers.readJson(gears.filesystem.get_cache_dir() .. "json/settings.json").iconTheme .."/places/" - -local grid = wibox.widget { - forced_num_rows = 14, - forced_num_cols = 19, - orientation = "horizontal", - layout = wibox.layout.grid -} - -local manual = wibox.layout { - layout = wibox.layout.manual -} - -local icons = { - ["lua"] = "lua", - ["py"] = "python", - ["rs"] = "rust", - ["html"] = "html", - ["c"] = "c", - ["c++"] = "c++", - ["js"] = "javascript", - ["hs"] = "haskell", - ['go'] = "go", - ["php"] = "php", - ["rb"] = "ruby", - ["md"] = "markdown", - ["ts"] = "typescript", - ["scss"] = "sass", - ["sass"] = "sass", - ["java"] = "java", -} - -local desktopdisplay = wibox { - visible = data.showDesktopIcons, - ontop = false, - bg = beautiful.bg .. '00', - type = "desktop", - screen = s, - widget = wibox.widget { - { - grid, - margins = dpi(20), - widget = wibox.container.margin - }, - manual, - layout = wibox.layout.stack - } -} - -awful.placement.maximize(desktopdisplay) - -local function gen() - local shortcuts = {} - local folders = {} - local files = {} - local entries = {} - - table.insert(entries, - { icon = appicons .. "places/trashcan_empty.svg", label = "Trash", exec = "nemo trash:/", type = "general" }) - -- table.insert(entries, - -- { - -- icon = gears.filesystem.get_configuration_dir() .. "theme/assets/tsukkisaidmetoaddthis.png", - -- label = beautiful.user:lower(), - -- exec = "nemo /home/" .. beautiful.user:lower(), - -- type = "general" - -- }) - for entry in io.popen([[ls ~/Desktop | sed '']]):lines() do - local label = entry - local exec = nil - local icon = appicons .. "mimetypes/text-x-generic.svg" - local ext = label:match("^.+(%..+)$") - - if ext == ".desktop" then - for line in io.popen("cat ~/Desktop/'" .. entry .. "'"):lines() do - if line:match("Name=") and label == entry then - label = line:gsub("Name=", "") - end - if line:match("Exec=") and exec == nil then - local cmd = line:gsub("Exec=", "") - exec = cmd - end - if line:match("CustomIcon=") then - icon = line:gsub("CustomIcon=", "") - elseif line:match("Icon=") then - icon = appicons .. "apps/" .. line:gsub("Icon=", "") .. ".svg" - end - end - table.insert(entries, { icon = icon, label = label, exec = exec, type = "shortcut" }) - elseif os.execute("cd ~/Desktop/'" .. entry .. "'") then - icon = foldericons .. "/folder.svg" - exec = "nemo" .. " Desktop/'" .. entry .. "'" - table.insert(entries, { icon = icon, label = label, exec = exec, type = "folder" }) - elseif os.execute("wc -c < ~/Desktop/'" .. entry .. "'") then - icon = appicons .. "mimetypes/application-x-zerosize.svg" - exec = "wezterm -e nvim" .. " ~/Desktop/'" .. entry .. "'" - if string.match(entry, "%.") then - local extenstion = helpers.split(entry, ".") - extenstion = extenstion[#extenstion] - if extenstion == "jpg" or extenstion == "jpeg" or extenstion == "tiff" or extenstion == "png" or extenstion == "webp" or extenstion == "svg" then - if extenstion == "jpg" then - icon = appicons .. "mimetypes/jpg.svg" - else - icon = appicons .. "mimetypes/image-" .. extenstion .. ".svg" - end - exec = "feh '~/Desktop/" .. entry .. "'" - elseif extenstion == "mp4" or extenstion == "avif" or extenstion == "webm" or extenstion == "mkv" or extenstion == "mov" then - icon = appicons .. "mimetypes/media-video.svg" - elseif extenstion == "mp3" or extenstion == "wav" or extenstion == "flac" or extenstion == "aiff" then - icon = appicons .. "mimetypes/media-audio.svg" - elseif icons[extenstion] ~= nil then - icon = appicons .. "mimetypes/text-x-" .. icons[extenstion] .. ".svg" - end - end - table.insert(entries, { icon = icon, label = label, exec = exec, type = 'file' }) - else - exec = "xdg-open " .. os.getenv("HOME") .. "/Desktop/'" .. label .. "'" - table.insert(entries, { icon = icon, label = label, exec = exec, type = 'file' }) - end - end - return entries -end - -local function save() - layout = {} - - for i, widget in ipairs(grid.children) do - local pos = grid:get_widget_position(widget) - - layout[i] = { - row = pos.row, - col = pos.col, - widget = { - icon = widget.icon, - label = widget.label, - exec = widget.exec, - type = widget.type, - } - } - end - - local w = assert(io.open(".cache/awesome/json/desktop.json", "w")) - w:write(json.encode(layout, nil, { pretty = true, indent = " ", align_keys = false, array_newline = true })) - w:close() -end - -local function gridindexat(y, x) - local margin = dpi(30) - local cellwidth, cellheight = dpi(115), dpi(105) - - local row = math.ceil((y - margin) / cellheight) - row = math.min(row, 8) - row = math.max(row, 1) - - local col = math.ceil((x - margin) / cellwidth) - col = math.min(col, 16) - col = math.max(col, 1) - - return row, col -end - -local function createicon(icon, label, exec, ty) - local widget = wibox.widget { - { - { - { - image = icon, - halign = "center", - widget = wibox.widget.imagebox - }, - strategy = "exact", - width = dpi(50), - height = dpi(40), - widget = wibox.container.constraint - }, - { - { - { - markup = helpers.colorizeText(label, beautiful.fg), - valign = "top", - font = beautiful.sans .. " 11", - align = "center", - widget = wibox.widget.textbox - }, - margins = dpi(5), - widget = wibox.container.margin - }, - strategy = "max", - width = dpi(100), - height = dpi(50), - widget = wibox.container.constraint - }, - spacing = dpi(5), - layout = wibox.layout.fixed.vertical - }, - icon = icon, - label = label, - exec = exec, - type = ty, - forced_width = dpi(115), - forced_height = dpi(105), - margins = dpi(10), - widget = wibox.container.margin - } - - local iconmenu = awful.menu({ - items = { - { "Open", exec }, - { "Delete", function() - awful.spawn.with_shell("rm -rf " .. os.getenv("HOME") .. "/Desktop/'" .. label .. "'") - end }, - } - }) - - awesome.connect_signal("iconmenu::hide", function() - iconmenu:hide() - end) - - widget:connect_signal("button::press", function(_, _, _, button) - if not mousegrabber.isrunning() then - local heldwidget = wibox.widget { - { - { - image = icon, - opacity = 0.5, - halign = "center", - widget = wibox.widget.imagebox - }, - strategy = "exact", - width = dpi(50), - height = dpi(50), - widget = wibox.container.constraint - }, - { - { - { - text = label, - opacity = 0.5, - valign = "top", - align = "center", - widget = wibox.widget.textbox - }, - margins = dpi(5), - widget = wibox.container.margin - }, - strategy = "max", - width = dpi(100), - height = dpi(50), - widget = wibox.container.constraint - }, - forced_height = dpi(105), - forced_width = dpi(100), - spacing = dpi(5), - visible = false, - layout = wibox.layout.fixed.vertical - } - - local startpos = mouse.coords() - heldwidget.point = { x = startpos.x, y = startpos.y } - local oldpos = grid:get_widget_position(widget) - manual:add(heldwidget) - - mousegrabber.run(function(mouse) - if (math.abs(mouse.x - startpos.x) > 10 or - math.abs(mouse.y - startpos.y) > 10) and - mouse.buttons[1] then - grid:remove(widget) - heldwidget.visible = true - - manual:move_widget(heldwidget, { - x = mouse.x - dpi(50), - y = mouse.y - dpi(50) - }) - end - - if not mouse.buttons[1] then - if button == 1 then - if heldwidget.visible then - heldwidget.visible = false - - local newrow, newcol = gridindexat( - mouse.y, - mouse.x - ) - if not grid:get_widgets_at(newrow, newcol) then - grid:add_widget_at(widget, newrow, newcol) - save() - else - local d = helpers.readJson(gears.filesystem.get_cache_dir() .. "json/desktop.json") - local elem - for _, j in ipairs(d) do - if j.row == newrow and j.col == newcol then - elem = j - break - end - end - if elem.widget.exec:find("nemo Desktop") then - if exec ~= "Trash" then - os.execute("mv ~/Desktop/'" .. label .. "' ~/Desktop/'" .. elem.widget.label .. "'/'" .. label .. "'") - end - elseif elem.widget.exec:find("nemo trash:/") then - if exec ~= "Trash" then - os.execute("trash ~/Desktop/'" .. label .. "'") - end - else - grid:add_widget_at(widget, oldpos.row, oldpos.col) - end - end - else - awful.spawn.with_shell(exec) - manual:reset() - end - mousegrabber.stop() - elseif button == 3 then - awesome.emit_signal("iconmenu::hide") - iconmenu:toggle() - mousegrabber.stop() - end - end - return mouse.buttons[1] - end, "hand2") - end - end) - - return widget -end - -local function load() - local layoutfile = gears.filesystem.get_cache_dir() .. 'json/desktop.json' - if not gears.filesystem.file_readable(layoutfile) then - local entries = gen() - for _, entry in ipairs(entries) do - grid:add(createicon(entry.icon, entry.label, entry.exec, entry.type)) - end - save() - return - end - - local awmmenu = { - { "Restart", awesome.restart } - } - - local createmenu = { - { "File", function() - local filename = "New File" - local filepath = os.getenv("HOME") .. "/Desktop/" .. filename - local i = 1 - while gears.filesystem.file_readable(filepath) do - filename = "New File " .. "(" .. i .. ")" - filepath = os.getenv("HOME") .. "/Desktop/" .. filename - i = i + 1 - end - awful.spawn.with_shell("touch '" .. filepath .. "'") - end }, - { "Folder", function() - local foldername = "New Folder" - local folderpath = os.getenv("HOME") .. "/Desktop/" .. foldername - local i = 1 - while gears.filesystem.dir_readable(folderpath) do - foldername = "New Folder " .. "(" .. i .. ")" - folderpath = os.getenv("HOME") .. "/Desktop/" .. foldername - i = i + 1 - end - gears.filesystem.make_directories(folderpath) - end } - } - - - manual:buttons { - awful.button({}, 1, function() - awesome.emit_signal("iconmenu::hide") - awesome.emit_signal("close::menu") - end), - awful.button({}, 3, function() - if mouse.current_widgets[4] == manual then - awesome.emit_signal("iconmenu::hide") - awesome.emit_signal("toggle::menu") - end - end) - } - - local r = assert(io.open(".cache/awesome/json/desktop.json", "rb")) - local t = r:read("*all") - r:close() - local layout = json.decode(t) - - for _, entry in ipairs(layout) do - grid:add_widget_at(createicon(entry.widget.icon, entry.widget.label, entry.widget.exec, entry.type), entry.row, - entry.col) - end -end - -load() - -awesome.connect_signal("signal::desktop", function(type) - local entries = gen() - local check = false - - if type == add then - for _, entry in ipairs(entries) do - for _, widget in ipairs(grid.children) do - if entry.label == widget.label then - check = true - end - end - if check == false then - grid:add(createicon(entry.icon, entry.label, entry.exec, entry.type)) - end - check = false - end - end - - if type == remove then - for _, widget in ipairs(grid.children) do - for _, entry in ipairs(entries) do - if entry.label == widget.label then - check = true - end - end - if check == false then - grid:remove(widget) - end - check = false - end - end - - save() -end) - -local subscribe = [[ - bash -c " - while (inotifywait -m -e close_write -e delete -e create -e moved_from $HOME/Desktop/ -q) do echo; done -"]] - -awful.spawn.easy_async_with_shell( - "ps x | grep \"inotifywait -m -e close_write -e delete -e create -e moved_from $HOME/Desktop/ -q\" | awk '{print $1}' | xargs kill", - function() - awful.spawn.with_line_callback(subscribe, { - stdout = function(l) - awesome.emit_signal("signal::desktop") - end - }) - end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/desktop/popup.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/desktop/popup.lua deleted file mode 100644 index fd7e2ee..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/desktop/popup.lua +++ /dev/null @@ -1,222 +0,0 @@ -local awful = require("awful") -local wibox = require("wibox") -local beautiful = require("beautiful") -local inspect = require('mods.inspect') -local helpers = require("helpers") - -local popup = {} - -popup.widget = wibox({ - visible = false, - ontop = true, - height = 180, - width = 400, - shape = helpers.rrect(5), - widget = wibox.container.background -}) - -popup.label = "Rename A File" - - -popup.prompt = wibox.widget { - { - { - { - { - markup = "", - forced_height = 24, - id = "txt", - font = "Rubik 14", - widget = wibox.widget.textbox, - }, - { - markup = "Type Here...", - forced_height = 15, - id = "placeholder", - font = "Rubik 14", - widget = wibox.widget.textbox, - }, - layout = wibox.layout.stack - }, - widget = wibox.container.margin, - margins = 20, - }, - widget = wibox.container.background, - bg = beautiful.mbg - }, - forced_width = 470, - widget = wibox.container.margin, -} - -popup.name = wibox.widget { - markup = popup.label, - forced_height = 15, - id = "okay", - font = "Rubik 14", - widget = wibox.widget.textbox, -} - -popup.widget:setup({ - { - { - { - { - { - { - { - { - widget = wibox.container.background, - forced_width = 17, - forced_height = 17, - bg = beautiful.red, - shape = helpers.rrect(50), - buttons = { - awful.button({}, 1, function() - awesome.emit_signal('quit::popupgrabber') - awesome.emit_signal('quit::popup') - end) - }, - }, - layout = wibox.layout.fixed.horizontal - }, - widget = wibox.container.place, - valign = "center" - }, - nil, - nil, - layout = wibox.layout.align.horizontal - }, - widget = wibox.container.margin, - margins = 15 - }, - widget = wibox.container.background, - bg = beautiful.mbg - }, - { - { - popup.name, - popup.prompt, - spacing = 20, - layout = wibox.layout.fixed.vertical, - }, - widget = wibox.container.margin, - margins = 20 - }, - nil, - layout = wibox.layout.align.vertical - }, - widget = wibox.container.place, - valign = "center" - }, - widget = wibox.container.background, - bg = beautiful.bg -}) - -local exclude = { - "Shift_R", - "Shift_L", - "Super_R", - "Super_L", - "Tab", - "Alt_R", - "Alt_L", - "Ctrl_L", - "Ctrl_R", - "CapsLock", - "Home", - "Down", - "Up", - "Left", - "Right" -} -local function has_value(tab, val) - for _, value in ipairs(tab) do - if value == val then - return true - end - end - - return false -end - -popup.grabber = awful.keygrabber({ - auto_start = true, - stop_event = "release", - keypressed_callback = function(self, mod, key, command) - local addition = '' - if key == "Escape" then - awesome.emit_signal("quit::popup") - awesome.emit_signal("quit::popupgrabber") - elseif key == "BackSpace" then - popup.prompt:get_children_by_id('txt')[1].markup = popup.prompt:get_children_by_id('txt')[1].markup:sub(1, -2) - elseif key == "Return" then - popup.func(popup.prompt:get_children_by_id('txt')[1].markup) - awesome.emit_signal("quit::popup") - awesome.emit_signal("quit::popupgrabber") - awesome.emit_signal("signal::desktop") - elseif has_value(exclude, key) then - addition = '' - else - addition = key - end - popup.prompt:get_children_by_id('txt')[1].markup = popup.prompt:get_children_by_id('txt')[1].markup .. addition - if string.len(popup.prompt:get_children_by_id('txt')[1].markup) > 0 then - popup.prompt:get_children_by_id('placeholder')[1].markup = '' - else - popup.prompt:get_children_by_id('placeholder')[1].markup = 'Type Here...' - end - end, -}) - -popup.start = function(fn) - if fn == "create" then - popup.label = "Create A File" - popup.name.markup = popup.label - popup.func = function(name) - awful.spawn.with_shell("touch ~/Desktop/'" .. name .. "'") - end - elseif fn == "folder" then - popup.label = "Create A Folder" - popup.name.markup = popup.label - popup.func = function(name) - awful.spawn.with_shell("mkdir ~/Desktop/'" .. name .. "'") - end - else - awesome.emit_signal("close::filemenu") - popup.label = "Rename File" - popup.name.markup = popup.label - popup.func = function(name) - local n = helpers.split(fn, "`")[2] - awful.spawn.with_shell("mv ~/Desktop/'" .. n .. "' ~/Desktop/'" .. name .. "'") - end - end -end - -awesome.connect_signal("toggle::popupgrabber", function() - popup.grabber:start() -end) - -awesome.connect_signal("quit::popupgrabber", function() - popup.grabber:stop() - popup.prompt:get_children_by_id('txt')[1].markup = "" -end) - -awesome.connect_signal("quit::popup", function() - popup.widget.visible = false -end) - -awesome.connect_signal("toggle::popup", function(fn) - popup.start(fn) - if popup.widget.visible then - awesome.emit_signal("quit::popupgrabber") - else - awesome.emit_signal("toggle::popupgrabber") - end - popup.widget.visible = not popup.widget.visible - awful.placement.centered( - popup.widget, - { honor_workarea = true } - ) -end) - -return popup diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/init.lua deleted file mode 100644 index 974a8ba..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/init.lua +++ /dev/null @@ -1,178 +0,0 @@ -local wibox = require("wibox") -local helpers = require("helpers") -local awful = require("awful") -local beautiful = require("beautiful") -local dpi = beautiful.xresources.apply_dpi -local gears = require("gears") - -local music = require("ui.exit.mods.music") -local bat = require("ui.exit.mods.bat") -local weather = require("ui.exit.mods.weather") -local top = require("ui.exit.mods.topbar") - -awful.screen.connect_for_each_screen(function(s) - local exit = wibox({ - screen = s, - width = 1920, - height = 1080, - bg = beautiful.bg .. "00", - ontop = true, - visible = false, - }) - - - local back = wibox.widget { - id = "bg", - image = beautiful.wallpaper, - widget = wibox.widget.imagebox, - forced_height = 1080, - horizontal_fit_policy = "fit", - vertical_fit_policy = "fit", - forced_width = 1920, - } - - local big = wibox.widget { - { - { - id = "text", - markup = helpers.colorizeText("HELLO", beautiful.fg .. '33'), - font = beautiful.sans .. " Bold 250", - align = "center", - widget = wibox.widget.textbox, - }, - widget = wibox.container.background, - halign = "center", - valign = "center" - }, - widget = wibox.container.margin, - top = 0, - } - - local overlay = wibox.widget { - widget = wibox.container.background, - forced_height = 1080, - forced_width = 1920, - bg = beautiful.bg .. "d1" - } - local makeImage = function() - local cmd = 'convert ' .. - beautiful.wallpaper .. ' -filter Gaussian -blur 0x6 ~/.cache/awesome/exit.jpg' - awful.spawn.easy_async_with_shell(cmd, function() - local blurwall = gears.filesystem.get_cache_dir() .. "exit.jpg" - back.image = blurwall - end) - end - - makeImage() - - local createButton = function(icon, name, cmd, color) - local widget = wibox.widget { - { - { - { - id = "icon", - markup = helpers.colorizeText(icon, color), - font = beautiful.icon .. " 40", - align = "center", - widget = wibox.widget.textbox, - }, - widget = wibox.container.margin, - margins = 40, - }, - shape = helpers.rrect(15), - widget = wibox.container.background, - bg = beautiful.bg, - id = "bg", - shape_border_color = color, - shape_border_width = 2, - }, - buttons = { - awful.button({}, 1, function() - awesome.emit_signal("toggle::exit") - awful.spawn.with_shell(cmd) - end) - }, - spacing = 15, - layout = wibox.layout.fixed.vertical, - } - widget:connect_signal("mouse::enter", function() - helpers.gc(widget, "bg").bg = beautiful.mbg - end) - widget:connect_signal("mouse::leave", function() - helpers.gc(widget, "bg").bg = beautiful.bg - end) - return widget - end - - - local time = wibox.widget { - { - { - markup = helpers.colorizeText("󰀠", beautiful.blue), - font = beautiful.icon .. " 28", - align = "center", - valign = "center", - widget = wibox.widget.textbox, - }, - { - font = beautiful.sans .. " 16", - format = "%H:%M", - align = "center", - valign = "center", - widget = wibox.widget.textclock - }, - spacing = 10, - layout = wibox.layout.fixed.horizontal - }, - widget = wibox.container.place, - valign = "center" - } - - local down = wibox.widget { - { - { - music, - time, - bat, - weather, - layout = wibox.layout.fixed.horizontal, - spacing = 20, - }, - widget = wibox.container.place, - valign = "bottom", - halign = "center" - }, - widget = wibox.container.margin, - bottom = 40, - } - - local buttons = wibox.widget { - - { - createButton("󰐥", "Power", "poweroff", beautiful.red), - createButton("󰦛", "Reboot", "reboot", beautiful.green), - createButton("󰌾", "Lock", "lock", beautiful.blue), - createButton("󰖔", "Sleep", "systemctl suspend", beautiful.yellow), - createButton("󰈆", "Log Out", "loginctl kill-user $USER", beautiful.magenta), - layout = wibox.layout.fixed.horizontal, - spacing = 20, - }, - widget = wibox.container.place, - halign = "center", - valign = "center" - } - - exit:setup { - back, - - overlay, - top, - buttons, - down, - widget = wibox.layout.stack - } - awful.placement.centered(exit) - awesome.connect_signal("toggle::exit", function() - exit.visible = not exit.visible - end) -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/mods/bat.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/mods/bat.lua deleted file mode 100644 index a0fcdbc..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/mods/bat.lua +++ /dev/null @@ -1,44 +0,0 @@ -local wibox = require("wibox") -local helpers = require("helpers") -local beautiful = require("beautiful") -local widget = wibox.widget { - { - max_value = 100, - value = 69, - id = "prog", - forced_height = 35, - forced_width = 80, - paddings = 3, - border_color = beautiful.fg .. "99", - background_color = beautiful.mbg, - bar_shape = helpers.rrect(40), - color = beautiful.blue, - border_width = 0, - shape = helpers.rrect(30), - widget = wibox.widget.progressbar - }, - layout = wibox.layout.fixed.horizontal, - spacing = 10, - { - font = beautiful.sans .. " 16", - markup = helpers.colorizeText("25%", beautiful.fg), - valign = "center", - id = "batvalue", - widget = wibox.widget.textbox, - }, -} - -awesome.connect_signal("signal::battery", function(value) - local b = widget:get_children_by_id("prog")[1] - local v = widget:get_children_by_id("batvalue")[1] - v.markup = helpers.colorizeText(value .. "%", beautiful.fg) - b.value = value - if value > 80 then - b.color = beautiful.green - elseif value > 20 then - b.color = beautiful.blue - else - b.color = beautiful.red - end -end) -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/mods/music.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/mods/music.lua deleted file mode 100644 index 0f80c6b..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/mods/music.lua +++ /dev/null @@ -1,47 +0,0 @@ -local wibox = require("wibox") -local awful = require("awful") -local beautiful = require("beautiful") -local dpi = require("beautiful").xresources.apply_dpi -local gears = require("gears") -local pctl = require("mods.playerctl") -local helpers = require("helpers") -local playerctl = pctl.lib() - -local art = wibox.widget { - image = helpers.cropSurface(1, gears.surface.load_uncached(beautiful.songdefpicture)), - forced_height = dpi(40), - clip_shape = helpers.rrect(100), - forced_width = dpi(40), - widget = wibox.widget.imagebox -} - -local songname = wibox.widget { - markup = helpers.colorizeText('Nothing Playing', beautiful.fg), - align = 'left', - valign = 'center', - font = beautiful.sans .. " 16", - widget = wibox.widget.textbox -} - -local widget = wibox.widget { - art, - songname, - layout = wibox.layout.fixed.horizontal, - spacing = 10, -} - -playerctl:connect_signal("metadata", function(_, title, artist, album_path, album, new, player_name) - if album_path == "" then - album_path = beautiful.songdefpicture - end - if string.len(title) > 30 then - title = string.sub(title, 0, 30) .. "..." - end - if string.len(artist) > 22 then - artist = string.sub(artist, 0, 22) .. "..." - end - songname:set_markup_silently(helpers.colorizeText(title or "NO", beautiful.fg)) - art:set_image(helpers.cropSurface(1, gears.surface.load_uncached(album_path))) -end) - -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/mods/topbar.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/mods/topbar.lua deleted file mode 100644 index a2aa12f..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/mods/topbar.lua +++ /dev/null @@ -1,95 +0,0 @@ -local wibox = require("wibox") -local helpers = require("helpers") -local beautiful = require("beautiful") -local awful = require("awful") - -local widget = wibox.widget { - { - { - { - widget = wibox.widget.imagebox, - image = beautiful.pfp, - forced_height = 50, - forced_width = 50, - align = "center", - valign = "center", - clip_shape = helpers.rrect(40), - resize = true, - }, - nil, - { - { - { - { - font = beautiful.sans .. " 14", - format = "%a, %d %B", - align = "center", - valign = "center", - widget = wibox.widget.textclock - }, - widget = wibox.container.margin, - left = 25, - right = 25, - }, - shape = helpers.rrect(50), - bg = beautiful.mbg, - widget = wibox.container.background, - }, - { - { - { - font = beautiful.sans .. " 14", - id = "uptime", - markup = helpers.colorizeText("", beautiful.fg), - valign = "center", - widget = wibox.widget.textbox, - }, - widget = wibox.container.margin, - left = 25, - right = 25, - }, - shape = helpers.rrect(50), - bg = beautiful.mbg, - widget = wibox.container.background, - }, - { - { - { - font = beautiful.icon .. " 16", - markup = helpers.colorizeText("󰅖", beautiful.red), - valign = "center", - widget = wibox.widget.textbox, - }, - widget = wibox.container.margin, - margins = 20, - }, - buttons = { - awful.button({}, 1, function() - awesome.emit_signal("toggle::exit") - end) - }, - shape = helpers.rrect(50), - bg = beautiful.mbg, - widget = wibox.container.background, - }, - spacing = 20, - layout = wibox.layout.fixed.horizontal, - }, - layout = wibox.layout.align.horizontal, - }, - widget = wibox.container.place, - content_fill_horizontal = true, - halign = "center", - valign = "top", - }, - widget = wibox.container.margin, - top = 40, - left = 40, - right = 40, -} - -awesome.connect_signal("signal::uptime", function(v) - helpers.gc(widget, "uptime").markup = v -end) - -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/mods/weather.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/mods/weather.lua deleted file mode 100644 index 9c29dde..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/exit/mods/weather.lua +++ /dev/null @@ -1,35 +0,0 @@ -local wibox = require("wibox") -local helpers = require("helpers") -local awful = require("awful") -local beautiful = require("beautiful") -local gears = require("gears") - -local widget = wibox.widget { - { - id = "image", - image = gears.filesystem.get_configuration_dir() .. "theme/assets/weather/icons/weather-fog.svg", - opacity = 0.9, - clip_shape = helpers.rrect(4), - forced_height = 30, - forced_width = 30, - valign = "center", - widget = wibox.widget.imagebox - }, - { - id = "desc", - font = beautiful.sans .. " 16", - markup = "Scattered Clouds", - valign = "center", - align = "start", - widget = wibox.widget.textbox, - }, - layout = wibox.layout.fixed.horizontal, - spacing = 15, -} - -awesome.connect_signal("signal::weather", function(out) - helpers.gc(widget, "desc").markup = out.desc - helpers.gc(widget, "image").image = out.image -end) - -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/init.lua deleted file mode 100644 index 940eeac..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/init.lua +++ /dev/null @@ -1,11 +0,0 @@ -require "ui.desktop" -require "ui.bar" -require "ui.menu" -require "ui.control" -require "ui.moment" -require "ui.dash" -require "ui.notify" -require "ui.setup" -require "ui.lock" -require "ui.exit" -require "ui.popups" diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/lock/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/lock/init.lua deleted file mode 100644 index b2e3d2e..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/lock/init.lua +++ /dev/null @@ -1,249 +0,0 @@ -local wibox = require("wibox") -local helpers = require("helpers") -local awful = require("awful") -local beautiful = require("beautiful") -local dpi = beautiful.xresources.apply_dpi -local pam = require("liblua_pam") -local gears = require("gears") -local auth = function(password) - return pam.auth_current_user(password) -end - -local header = wibox.widget { - { - { - image = beautiful.pfp, - clip_shape = helpers.rrect(100), - forced_height = 180, - opacity = 1, - forced_width = 180, - halign = 'center', - widget = wibox.widget.imagebox - }, - id = "arc", - widget = wibox.container.arcchart, - max_value = 100, - min_value = 0, - value = 0, - rounded_edge = false, - thickness = dpi(8), - start_angle = 4.71238898, - bg = beautiful.fg, - colors = { beautiful.fg }, - forced_width = dpi(180), - forced_height = dpi(180) - }, - widget = wibox.container.place, - halign = 'center', -} -local label = wibox.widget { - markup = "Type The Password", - valign = "center", - halign = "center", - id = "name", - font = beautiful.sans .. " 14", - widget = wibox.widget.textbox, -} - - - -local check_caps = function() - awful.spawn.easy_async_with_shell( - 'xset q | grep Caps | cut -d: -f3 | cut -d0 -f1 | tr -d \' \'', - function(stdout) - if stdout:match('off') then - label.markup = "Type The Password Here" - else - label.markup = "HINT: Caps Lock Is ON" - end - end - ) -end - - -local promptbox = wibox { - width = dpi(900), - height = dpi(800), - bg = beautiful.mbg .. "00", - ontop = true, - shape = helpers.rrect(0), - visible = false -} - -local background = wibox({ - width = dpi(1920), - height = dpi(1080), - visible = false, - ontop = true, - type = "splash" -}) - - - -awful.placement.centered(background) - -local visible = function(v) - background.visible = v - promptbox.visible = v -end - -local reset = function(f) - header:get_children_by_id('arc')[1].value = not f and 100 or 0 - header:get_children_by_id('arc')[1].colors = { not f and beautiful.red or beautiful.fg } -end - -local getRandom = function() - local r = math.random(0, 628) - r = r / 100 - return r -end - -local input = "" -local function grab() - local grabber = awful.keygrabber { - auto_start = true, - stop_event = 'release', - mask_event_callback = true, - keybindings = { - awful.key { - modifiers = { 'Mod1', 'Mod4', 'Shift', 'Control' }, - key = 'Return', - on_press = function(_) - input = input - end - } - }, - keypressed_callback = function(_, _, key, _) - if key == 'Escape' then - input = "" - return - end - -- Accept only the single charactered key - -- Ignore 'Shift', 'Control', 'Return', 'F1', 'F2', etc., etc. - if #key == 1 then - header:get_children_by_id('arc')[1].colors = { beautiful.blue } - header:get_children_by_id('arc')[1].value = 20 - header:get_children_by_id('arc')[1].start_angle = getRandom() - if input == nil then - input = key - return - end - input = input .. key - elseif key == "BackSpace" then - header:get_children_by_id('arc')[1].colors = { beautiful.blue } - header:get_children_by_id('arc')[1].value = 20 - header:get_children_by_id('arc')[1].start_angle = getRandom() - input = input:sub(1, -2) - if #input == 0 then - header:get_children_by_id('arc')[1].colors = { beautiful.magenta } - header:get_children_by_id('arc')[1].value = 100 - end - end - end, - keyreleased_callback = function(self, _, key, _) - -- Validation - if key == 'Return' then - if auth(input) then - self:stop() - reset(true) - visible(false) - input = "" - else - header:get_children_by_id('arc')[1].colors = { beautiful.red } - reset(false) - grab() - input = "" - end - elseif key == 'Caps_Lock' then - check_caps() - end - end - } - grabber:start() -end - - -awesome.connect_signal("toggle::lock", function() - visible(true) - grab() -end) - -local back = wibox.widget { - id = "bg", - image = beautiful.wallpaper, - widget = wibox.widget.imagebox, - forced_height = 1080, - horizontal_fit_policy = "fit", - vertical_fit_policy = "fit", - forced_width = 1920, -} - -local makeImage = function() - local cmd = 'convert ' .. - beautiful.wallpaper .. ' -filter Gaussian -blur 0x6 ~/.cache/awesome/lock.jpg' - awful.spawn.easy_async_with_shell(cmd, function() - local blurwall = gears.filesystem.get_cache_dir() .. "lock.jpg" - back.image = blurwall - end) -end - -makeImage() - -local overlay = wibox.widget { - widget = wibox.container.background, - forced_height = 1080, - forced_width = 1920, - bg = beautiful.bg .. "c1" -} -background:setup { - back, - overlay, - layout = wibox.layout.stack -} - - -promptbox:setup { - { - { - { - { - { - font = beautiful.sans .. " Medium 110", - format = "%H:%M", - halign = "center", - valign = "center", - widget = wibox.widget.textclock - }, - { - font = beautiful.sans .. " Light 28", - format = "%a, %d %B", - halign = "center", - valign = "center", - widget = wibox.widget.textclock - }, - { - label, - widget = wibox.container.margin, - top = 50 - }, - spacing = 10, - layout = wibox.layout.fixed.vertical, - }, - widget = wibox.container.place, - valign = "center", - }, - nil, - header, - layout = wibox.layout.align.vertical - }, - margins = dpi(30), - widget = wibox.container.margin - }, - widget = wibox.container.background, - shape = helpers.rrect(20) -} -awful.placement.centered( - promptbox -) - -check_caps() diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/menu/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/menu/init.lua deleted file mode 100644 index 56c6c64..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/menu/init.lua +++ /dev/null @@ -1,379 +0,0 @@ -local wibox = require("wibox") -local awful = require("awful") -local gears = require("gears") -local Gio = require("lgi").Gio -local iconTheme = require("lgi").require("Gtk", "3.0").IconTheme.get_default() -local beautiful = require("beautiful") -local helpers = require("helpers") -local animation = require("mods.animation") -local dpi = beautiful.xresources.apply_dpi - - -awful.screen.connect_for_each_screen(function(s) - local launcherdisplay = wibox { - width = dpi(565), - shape = helpers.rrect(12), - height = dpi(620), - bg = beautiful.bg, - ontop = true, - visible = false - } - local prompt = wibox.widget { - { - image = helpers.cropSurface(3.42, gears.surface.load_uncached(beautiful.wallpaper)), - opacity = 0.9, - forced_height = dpi(140), - clip_shape = helpers.rrect(10), - forced_width = dpi(480), - widget = wibox.widget.imagebox - }, - { - { - { - { - { - markup = "", - forced_height = 15, - id = "txt", - font = "Rubik 14", - widget = wibox.widget.textbox, - }, - { - markup = "Search...", - forced_height = 15, - id = "placeholder", - font = "Rubik 14", - widget = wibox.widget.textbox, - }, - layout = wibox.layout.stack - }, - widget = wibox.container.margin, - margins = 20, - }, - forced_width = 300, - shape = helpers.rrect(8), - widget = wibox.container.background, - bg = beautiful.mbg - }, - widget = wibox.container.place, - halign = "center", - valgn = "center", - }, - layout = wibox.layout.stack - } - - local entries = wibox.widget { - homogeneous = false, - expand = false, - forced_num_cols = 1, - spacing = 4, - layout = wibox.layout.grid - } - local createPowerButton = function(icon, color, command) - return wibox.widget { - { - { - { - markup = helpers.colorizeText(icon, color), - align = "center", - font = beautiful.icon .. " 20", - widget = wibox.widget.textbox, - }, - margins = 14, - widget = wibox.container.margin - }, - widget = wibox.container.background, - bg = color .. '11', - shape = helpers.rrect(4) - }, - widget = wibox.container.place, - halign = "center", - buttons = { - awful.button({}, 1, function() - awesome.emit_signal("quit::search") - awesome.emit_signal("quit::launcher") - awful.spawn.with_shell(command) - end) - }, - } - end - launcherdisplay:setup { - { - { - { - { - { - widget = wibox.widget.imagebox, - image = beautiful.nixos, - forced_height = 40, - forced_width = 40, - resize = true, - }, - widget = wibox.container.place, - halign = "center" - }, - widget = wibox.container.margin, - top = 15 - }, - nil, - { - { - createPowerButton("󰐥", beautiful.red, "poweroff"), - createPowerButton("󰌾", beautiful.blue, "lock"), - createPowerButton("󰦛", beautiful.green, "reboot"), - spacing = 10, - layout = wibox.layout.fixed.vertical - }, - widget = wibox.container.margin, - margins = 10, - - }, - layout = wibox.layout.align.vertical - }, - widget = wibox.container.background, - bg = beautiful.mbg - }, - { - { - prompt, - spacing = 10, - entries, - layout = wibox.layout.fixed.vertical - }, - left = 10, - right = 10, - bottom = 10, - top = 10, - widget = wibox.container.margin - }, - nil, - spacing = 0, - layout = wibox.layout.align.horizontal - } - -- Functions - - local function next(entries) - if index_entry ~= #filtered then - index_entry = index_entry + 1 - if index_entry > index_start + 5 then - index_start = index_start + 1 - end - end - end - - local function back(entries) - if index_entry ~= 1 then - index_entry = index_entry - 1 - if index_entry < index_start then - index_start = index_start - 1 - end - end - end - - local function gen() - local entries = {} - for _, entry in ipairs(Gio.AppInfo.get_all()) do - if entry:should_show() then - local name = entry:get_name():gsub("&", "&"):gsub("<", "<"):gsub("'", "'") - local icon = entry:get_icon() - local path - if icon then - path = icon:to_string() - if not path:find("/") then - local icon_info = iconTheme:lookup_icon(path, dpi(48), 0) - local p = icon_info and icon_info:get_filename() - path = p - end - end - table.insert( - entries, - { name = name, appinfo = entry, icon = path or '' } - ) - end - end - return entries - end - - local function filter(cmd) - filtered = {} - regfiltered = {} - - -- Filter entries - - for _, entry in ipairs(unfiltered) do - if entry.name:lower():sub(1, cmd:len()) == cmd:lower() then - table.insert(filtered, entry) - elseif entry.name:lower():match(cmd:lower()) then - table.insert(regfiltered, entry) - end - end - - -- Sort entries - - table.sort(filtered, function(a, b) return a.name:lower() < b.name:lower() end) - table.sort(regfiltered, function(a, b) return a.name:lower() < b.name:lower() end) - - -- Merge entries - - for i = 1, #regfiltered do - filtered[#filtered + 1] = regfiltered[i] - end - - -- Clear entries - - entries:reset() - - -- Add filtered entries - - for i, entry in ipairs(filtered) do - local widget = wibox.widget { - { - { - { - image = entry.icon, - clip_shape = helpers.rrect(10), - forced_height = dpi(32), - forced_width = dpi(32), - valign = 'center', - widget = wibox.widget.imagebox - }, - { - markup = entry.name, - id = "name", - font = beautiful.sans .. " 12", - widget = wibox.widget.textbox - }, - spacing = 20, - layout = wibox.layout.fixed.horizontal, - }, - margins = dpi(15), - widget = wibox.container.margin - }, - forced_width = 470, - forced_height = 72, - widget = wibox.container.background - } - - if index_start <= i and i <= index_start + 5 then - entries:add(widget) - end - - if i == index_entry then - widget.bg = beautiful.blue .. "09" - widget:get_children_by_id("name")[1].markup = helpers.colorizeText(entry.name, beautiful.blue) - end - end - - -- Fix position - - if index_entry > #filtered then - index_entry, index_start = 1, 1 - elseif index_entry < 1 then - index_entry = 1 - end - - collectgarbage("collect") - end - - local exclude = { - "Shift_R", - "Shift_L", - "Super_R", - "Super_L", - "Tab", - "Alt_R", - "Alt_L", - "Ctrl_L", - "Ctrl_R", - "CapsLock", - "Home", - "Down", - "Up", - "Left", - "Right" - } - local function has_value(tab, val) - for _, value in ipairs(tab) do - if value == val then - return true - end - end - - return false - end - local prompt_grabber = awful.keygrabber({ - auto_start = true, - stop_event = "release", - keypressed_callback = function(self, mod, key, command) - local addition = '' - if key == "Escape" then - awesome.emit_signal("quit::search") - awesome.emit_signal("quit::launcher") - elseif key == "BackSpace" then - prompt:get_children_by_id('txt')[1].markup = prompt:get_children_by_id('txt')[1].markup:sub(1, -2) - filter(prompt:get_children_by_id('txt')[1].markup) - elseif key == "Return" then - local entry = filtered[index_entry] - if entry then - entry.appinfo:launch() - else - awful.spawn.with_shell(prompt:get_children_by_id('txt')[1].markup) - end - awesome.emit_signal("quit::search") - awesome.emit_signal("quit::launcher") - elseif key == "Up" then - back(entries) - elseif key == "Down" then - next(entries) - elseif has_value(exclude, key) then - addition = '' - else - addition = key - end - prompt:get_children_by_id('txt')[1].markup = prompt:get_children_by_id('txt')[1].markup .. addition - filter(prompt:get_children_by_id('txt')[1].markup) - if string.len(prompt:get_children_by_id('txt')[1].markup) > 0 then - prompt:get_children_by_id('placeholder')[1].markup = '' - else - prompt:get_children_by_id('placeholder')[1].markup = 'Search...' - end - end, - }) - awesome.connect_signal("toggle::search", function() - prompt_grabber:start() - end) - - awesome.connect_signal("quit::search", function() - prompt_grabber:stop() - prompt:get_children_by_id('txt')[1].markup = "" - end) - local function open() - -- Reset index and page - - index_start, index_entry = 1, 1 - - -- Get entries - - unfiltered = gen() - filter("") - - -- Prompt - awesome.emit_signal("toggle::search") - end - - - awesome.connect_signal("quit::launcher", function() - launcherdisplay.visible = false - end) - awesome.connect_signal("toggle::launcher", function() - open() - if launcherdisplay.visible then - awesome.emit_signal("quit::search") - end - launcherdisplay.visible = not launcherdisplay.visible - awful.placement.bottom_left( - launcherdisplay, - { honor_workarea = true, margins = { bottom = 20, left = 20 } } - ) - end) -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/moment/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/moment/init.lua deleted file mode 100644 index 17f612d..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/moment/init.lua +++ /dev/null @@ -1,66 +0,0 @@ -local awful = require("awful") -local beautiful = require("beautiful") -local dpi = beautiful.xresources.apply_dpi -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") - -local calendar = require("ui.moment.mods.calendar") -local weather = require("ui.moment.mods.weather") -local clock = require("ui.moment.mods.clock") - -awful.screen.connect_for_each_screen(function(s) - local moment = wibox({ - shape = helpers.rrect(12), - screen = s, - width = 500, - height = 1080 - 40 - 60, - bg = beautiful.bg, - ontop = true, - visible = false, - }) - - moment:setup { - { - { - { - { - { - markup = helpers.colorizeText("Time And Weather", beautiful.fg), - halign = 'center', - font = beautiful.sans .. " 14", - widget = wibox.widget.textbox - }, - nil, - nil, - widget = wibox.layout.align.horizontal, - }, - widget = wibox.container.margin, - margins = 20, - }, - widget = wibox.container.background, - bg = beautiful.mbg - }, - { - { - clock, - calendar(), - weather, - layout = wibox.layout.fixed.vertical, - spacing = 20, - }, - widget = wibox.container.margin, - margins = 20, - }, - nil, - layout = wibox.layout.align.vertical, - spacing = 20, - }, - widget = wibox.container.margin, - margins = 0, - } - awful.placement.bottom_right(moment, { honor_workarea = true, margins = 20 }) - awesome.connect_signal("toggle::moment", function() - moment.visible = not moment.visible - end) -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/moment/mods/calendar.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/moment/mods/calendar.lua deleted file mode 100644 index 4362673..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/moment/mods/calendar.lua +++ /dev/null @@ -1,177 +0,0 @@ -local wibox = require("wibox") -local awful = require("awful") -local beautiful = require "beautiful" -local gears = require("gears") -local helpers = require "helpers" -local dpi = beautiful.xresources.apply_dpi - -local datewidget = function(date, weekend, notIn) - weekend = weekend or false - if notIn then - return wibox.widget { - markup = helpers.colorizeText(date, beautiful.fg3), - halign = 'center', - font = beautiful.sans .. " 14", - widget = wibox.widget.textbox - } - else - return wibox.widget { - markup = weekend and helpers.colorizeText(date, beautiful.fg) or date, - halign = 'center', - font = beautiful.sans .. " 14", - widget = wibox.widget.textbox - } - end -end - -local daywidget = function(day, weekend, notIn) - weekend = weekend or false - return wibox.widget { - markup = weekend and helpers.colorizeText(day, beautiful.red) or day, - halign = 'center', - font = beautiful.sans .. " 14", - widget = wibox.widget.textbox - } -end -local currwidget = function(day) - return wibox.widget { - markup = helpers.colorizeText(day, beautiful.blue), - halign = 'center', - font = beautiful.sans .. " 14", - widget = wibox.widget.textbox - } -end - -local title = wibox.widget { - font = beautiful.sans .. " Bold 14", - widget = wibox.widget.textbox, - halign = 'center' -} - -local theGrid = wibox.widget { - forced_num_rows = 7, - forced_num_cols = 7, - vertical_spacing = dpi(10), - horizontal_spacing = dpi(10), - min_cols_size = dpi(30), - min_rows_size = dpi(30), - homogenous = true, - layout = wibox.layout.grid, -} - -local curr - -local updateCalendar = function(date) - title.text = os.date("%B %Y", os.time(date)) - theGrid:reset() - for _, w in ipairs { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" } do - if w == "Sun" or w == "Sat" then - theGrid:add(daywidget(w, true, false)) - else - theGrid:add(daywidget(w, false, false)) - end - end - local firstDate = os.date("*t", os.time({ day = 1, month = date.month, year = date.year })) - local lastDate = os.date("*t", os.time({ day = 0, month = date.month + 1, year = date.year })) - local days_to_add_at_month_start = firstDate.wday - 1 - local days_to_add_at_month_end = 42 - lastDate.day - days_to_add_at_month_start - - local previous_month_last_day = os.date("*t", os.time({ year = date.year, month = date.month, day = 0 })).day - local row = 2 - local col = firstDate.wday - - for day = previous_month_last_day - days_to_add_at_month_start, previous_month_last_day - 1, 1 do - theGrid:add(datewidget(day, false, true)) - end - - for day = 1, lastDate.day do - if day == date.day then - theGrid:add_widget_at(currwidget(day), row, col) - elseif col == 1 or col == 7 then - theGrid:add_widget_at(datewidget(day, true, false), row, col) - else - theGrid:add_widget_at(datewidget(day, false, false), row, col) - end - - if col == 7 then - col = 1 - row = row + 1 - else - col = col + 1 - end - end - - for day = 1, days_to_add_at_month_end do - theGrid:add(datewidget(day, false, true)) - end -end - -return function() - curr = os.date("*t") - updateCalendar(curr) - gears.timer { - timeout = 60, - call_now = true, - autostart = true, - callback = function() - curr = os.date("*t") - updateCalendar(curr) - end - } - return wibox.widget { - { - { - { - { - { - text = "󰁍", - font = beautiful.icofont, - widget = wibox.widget.textbox, - buttons = awful.button({}, 1, function() - curr = os.date("*t", os.time({ - day = curr.day, - month = curr.month - 1, - year = curr.year - })) - updateCalendar(curr) - end) - }, - widget = wibox.container.margin, - left = 38, - }, - title, - { - { - text = "󰁔", - font = beautiful.icofont, - widget = wibox.widget.textbox, - buttons = awful.button({}, 1, function() - curr = os.date("*t", os.time({ - day = curr.day, - month = curr.month + 1, - year = curr.year - })) - updateCalendar(curr) - end) - }, - widget = wibox.container.margin, - right = 38, - }, - layout = wibox.layout.align.horizontal - }, - { - theGrid, - widget = wibox.container.place, - halign = 'center', - }, - spacing = 17, - layout = wibox.layout.fixed.vertical - }, - widget = wibox.container.margin, - margins = 50 - }, - shape = helpers.rrect(10), - widget = wibox.container.background, - bg = beautiful.mbg - } -end diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/moment/mods/clock.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/moment/mods/clock.lua deleted file mode 100644 index 17c96ee..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/moment/mods/clock.lua +++ /dev/null @@ -1,90 +0,0 @@ -local awful = require("awful") -local beautiful = require("beautiful") -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") - -local widget = wibox.widget { - { - { - { - { - id = "hour", - widget = wibox.container.arcchart, - max_value = 24, - min_value = 0, - padding = 0, - value = 45, - rounded_edge = false, - thickness = 15, - start_angle = math.random(250, 870) * math.pi / 180, - colors = { beautiful.scheme == "oxo" and beautiful.red or beautiful.magenta }, - bg = beautiful.mbg .. '11', - forced_width = 85, - forced_height = 85 - }, - id = "minutes", - widget = wibox.container.arcchart, - max_value = 60, - min_value = 0, - padding = 0, - value = 12, - rounded_edge = false, - thickness = 15, - start_angle = math.random(250, 870) * math.pi / 180, - colors = { beautiful.blue }, - bg = beautiful.mbg .. '11', - forced_width = 100, - forced_height = 100 - }, - nil, - { - { - { - font = beautiful.sans .. " 36", - format = "%I : %M", - align = "center", - valign = "center", - widget = wibox.widget.textclock - }, - { - id = "uptime", - align = 'center', - font = beautiful.sans .. " 12", - text = '', - widget = wibox.widget.textbox, - }, - spacing = 10, - layout = wibox.layout.fixed.vertical, - }, - widget = wibox.container.place, - valign = "center" - }, - layout = wibox.layout.align.horizontal, - }, - widget = wibox.container.margin, - margins = 20, - }, - shape = helpers.rrect(10), - widget = wibox.container.background, - bg = beautiful.mbg, -} - -local updateTime = function() - local time = os.date("*t") - helpers.gc(widget, "hour").value = time.hour - helpers.gc(widget, "minutes").value = time.min -end -awesome.connect_signal("signal::uptime", function(v) - helpers.gc(widget, "uptime").markup = v -end) - -gears.timer { - timeout = 60, - call_now = true, - autostart = true, - callback = function() - updateTime() - end -} -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/moment/mods/weather.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/moment/mods/weather.lua deleted file mode 100644 index 1022399..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/moment/mods/weather.lua +++ /dev/null @@ -1,226 +0,0 @@ -local wibox = require("wibox") -local awful = require("awful") -local beautiful = require "beautiful" -local gears = require("gears") -local helpers = require "helpers" - -local filesystem = gears.filesystem -local icon_dir = filesystem.get_configuration_dir() .. "theme/assets/weather/icons/" - - -local icon_map = { - ["01d"] = "weather-clear-sky", - ["02d"] = "weather-few-clouds", - ["03d"] = "weather-clouds", - ["04d"] = "weather-few-clouds", - ["09d"] = "weather-showers-scattered", - ["10d"] = "weather-showers", - ["11d"] = "weather-strom", - ["13d"] = "weather-snow", - ["50d"] = "weather-fog", - ["01n"] = "weather-clear-night", - ["02n"] = "weather-few-clouds-night", - ["03n"] = "weather-clouds-night", - ["04n"] = "weather-clouds-night", - ["09n"] = "weather-showers-scattered", - ["10n"] = "weather-showers", - ["11n"] = "weather-strom", - ["13n"] = "weather-snow", - ["50n"] = "weather-fog", -} - -local dayWeather = function() - local widget = wibox.widget { - { - id = "day", - halign = 'center', - widget = wibox.widget.textbox, - font = beautiful.sans .. " 10", - }, - { - id = "icon", - resize = true, - opacity = 0.6, - halign = 'center', - forced_height = 40, - forced_width = 40, - widget = wibox.widget.imagebox, - }, - { - { - { - { - id = "max", - halign = 'center', - widget = wibox.widget.textbox, - font = beautiful.sans .. " 10", - }, - { - halign = 'center', - markup = helpers.colorizeText("/", beautiful.blue), - widget = wibox.widget.textbox, - font = beautiful.sans .. " 10", - }, - { - id = "min", - halign = 'center', - widget = wibox.widget.textbox, - font = beautiful.sans .. " 10", - }, - spacing = 8, - layout = wibox.layout.fixed.horizontal, - }, - widget = wibox.container.place, - halign = 'center', - }, - widget = wibox.container.margin, - bottom = 20, - }, - spacing = 10, - forced_width = 80, - layout = wibox.layout.fixed.vertical, - } - - widget.update = function(out, i) - local day = out.daily[i] - widget:get_children_by_id('icon')[1].image = icon_dir .. icon_map[day.weather[1].icon] .. ".svg" - widget:get_children_by_id('day')[1].text = os.date("%a", tonumber(day.dt)) - local getTemp = function(temp) - local sp = helpers.split(temp, '.')[1] - return sp - end - widget:get_children_by_id('min')[1].text = getTemp(day.temp.night) - widget:get_children_by_id('max')[1].text = getTemp(day.temp.day) - end - return widget -end - -local day1 = dayWeather() -local day2 = dayWeather() -local day3 = dayWeather() -local day5 = dayWeather() -local day6 = dayWeather() -local day4 = dayWeather() - -local daylist = { day1, day2, day3, day4, day5, day6 } - - -local widget = wibox.widget { - { - id = "image", - forced_height = 300, - forced_width = 460, - image = helpers.cropSurface(1.53, gears.surface.load_uncached(beautiful.songdefpicture)), - widget = wibox.widget.imagebox, - clip_shape = helpers.rrect(12), - opacity = 0.9, - resize = true, - horizontal_fit_policy = "fit" - }, - { - { - widget = wibox.widget.textbox, - }, - bg = { - type = "linear", - from = { 0, 0 }, - to = { 250, 0 }, - stops = { { 0, beautiful.bg .. "66" }, { 1, beautiful.bg .. 'dd' } } - }, - shape = helpers.rrect(12), - widget = wibox.container.background, - }, - { - { - { - { - { - id = "icon", - image = gears.filesystem.get_configuration_dir() .. "theme/assets/weather/icons/weather-fog.svg", - opacity = 0.9, - clip_shape = helpers.rrect(4), - forced_height = 80, - forced_width = 80, - valign = "center", - widget = wibox.widget.imagebox - }, - { - id = "desc", - font = beautiful.sans .. " 12", - markup = "Scattered Clouds", - valign = "center", - widget = wibox.widget.textbox, - }, - spacing = 10, - layout = wibox.layout.fixed.vertical, - }, - nil, - { - { - id = "temp", - font = beautiful.sans .. " 32", - markup = "31 C", - valign = "center", - widget = wibox.widget.textbox, - }, - { - id = "fl", - font = beautiful.sans .. " 12", - markup = "Feels Like 30 C", - valign = "center", - widget = wibox.widget.textbox, - }, - { - id = "humid", - font = beautiful.sans .. " 12", - markup = "Humidity: 30%", - valign = "center", - widget = wibox.widget.textbox, - }, - spacing = 10, - layout = wibox.layout.fixed.vertical, - }, - layout = wibox.layout.align.horizontal, - }, - nil, - { - { - day1, - day2, - day3, - day4, - day5, - day6, - spacing = 25, - layout = require("mods.overflow").horizontal, - scrollbar_width = 0, - }, - widget = wibox.container.margin, - top = 15, - }, - layout = wibox.layout.align.vertical, - }, - widget = wibox.container.margin, - margins = { - left = 30, - right = 30, - top = 20, - bottom = 20, - }, - }, - layout = wibox.layout.stack, -} - -awesome.connect_signal("signal::weather", function(out) - helpers.gc(widget, "image").image = helpers.cropSurface(1.53, gears.surface.load_uncached(out.thumb)) - helpers.gc(widget, "icon").image = out.image - helpers.gc(widget, "temp").markup = out.temp .. "°C" - helpers.gc(widget, "desc").markup = out.desc - helpers.gc(widget, "humid").markup = "Humidity: " .. out.humidity .. "%" - helpers.gc(widget, "fl").markup = "Feels Like " .. out.temp .. "°C" - for i, j in ipairs(daylist) do - j.update(out, i) - end -end) - -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/notify/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/notify/init.lua deleted file mode 100644 index 0a7911b..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/notify/init.lua +++ /dev/null @@ -1,112 +0,0 @@ -local awful = require("awful") -local beautiful = require("beautiful") -local naughty = require("naughty") -local dpi = beautiful.xresources.apply_dpi -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") -local empty = require("ui.notify.mods.empty") -local make = require("ui.notify.mods.make") -local progs = require("ui.notify.mods.progs") - -awful.screen.connect_for_each_screen(function(s) - local notify = wibox({ - shape = helpers.rrect(12), - screen = s, - width = 500, - height = 1080 - 40 - 60, - bg = beautiful.bg, - ontop = true, - visible = false, - }) - - - local finalcontent = wibox.widget { - layout = require('mods.overflow').vertical, - scrollbar_enabled = false, - spacing = 20, - } - finalcontent:insert(1, empty) - - local remove_notifs_empty = true - - notif_center_reset_notifs_container = function() - finalcontent:reset(finalcontent) - finalcontent:insert(1, empty) - remove_notifs_empty = true - end - - notif_center_remove_notif = function(box) - finalcontent:remove_widgets(box) - if #finalcontent.children == 0 then - finalcontent:insert(1, empty) - remove_notifs_empty = true - end - end - - - local clearButton = wibox.widget { - font = beautiful.icon .. " 26", - markup = helpers.colorizeText("󰎟", beautiful.red), - widget = wibox.widget.textbox, - valign = "center", - align = "center", - buttons = { - awful.button({}, 1, function() - notif_center_reset_notifs_container() - end) - } - } - naughty.connect_signal("request::display", function(n) - if #finalcontent.children == 1 and remove_notifs_empty then - finalcontent:reset(finalcontent) - remove_notifs_empty = false - end - - local appicon = n.icon or n.app_icon - if not appicon then - appicon = gears.filesystem.get_configuration_dir() .. "theme/assets/awesome.svg" - end - finalcontent:insert(1, make(appicon, n)) - end) - notify:setup { - { - { - { - { - { - markup = helpers.colorizeText("Notifications", beautiful.fg), - halign = 'center', - font = beautiful.sans .. " 14", - widget = wibox.widget.textbox - }, - nil, - clearButton, - widget = wibox.layout.align.horizontal, - }, - widget = wibox.container.margin, - margins = 20, - }, - widget = wibox.container.background, - bg = beautiful.mbg - }, - { - { - finalcontent, - widget = wibox.container.margin, - margins = 20, - }, - widget = wibox.container.background, - }, - progs, - layout = wibox.layout.align.vertical, - spacing = 20, - }, - widget = wibox.container.margin, - margins = 0, - } - awful.placement.bottom_right(notify, { honor_workarea = true, margins = 20 }) - awesome.connect_signal("toggle::notify", function() - notify.visible = not notify.visible - end) -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/notify/mods/empty.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/notify/mods/empty.lua deleted file mode 100644 index c4b99d7..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/notify/mods/empty.lua +++ /dev/null @@ -1,34 +0,0 @@ -local awful = require("awful") -local beautiful = require("beautiful") -local dpi = beautiful.xresources.apply_dpi -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") - -return wibox.widget { - { - { - { - widget = wibox.widget.textbox, - markup = helpers.colorizeText("No Notifications", beautiful.fg), - font = beautiful.sans .. " 14", - valign = "center", - align = "center" - }, - { - image = gears.filesystem.get_configuration_dir() .. "/theme/assets/wedding-bells.png", - resize = true, - forced_height = 250, - halign = "center", - valign = "center", - widget = wibox.widget.imagebox, - }, - spacing = 20, - layout = wibox.layout.fixed.vertical - }, - widget = wibox.container.place, - valign = 'center' - }, - widget = wibox.container.background, - forced_height = 600, -} diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/notify/mods/make.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/notify/mods/make.lua deleted file mode 100644 index f330b2d..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/notify/mods/make.lua +++ /dev/null @@ -1,95 +0,0 @@ --- the notification themselves -local helpers = require("helpers") -local beautiful = require("beautiful") -local gears = require("gears") -local dpi = beautiful.xresources.apply_dpi -local awful = require("awful") -local wibox = require("wibox") -local naughty = require("naughty") -return function(icon, n) - local time = os.date "%H:%M:%S" - - local icon_widget = wibox.widget { - widget = wibox.container.constraint, - { - widget = wibox.container.margin, - margins = 20, - { - widget = wibox.widget.imagebox, - image = helpers.cropSurface(1, gears.surface.load_uncached(icon)), - resize = true, - clip_shape = gears.shape.circle, - halign = "center", - valign = "center", - }, - }, - } - - local title_widget = wibox.widget { - widget = wibox.container.scroll.horizontal, - step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth, - speed = 50, - forced_width = 200, - { - widget = wibox.widget.textbox, - text = n.title, - align = "left", - forced_width = 200, - }, - } - - local time_widget = wibox.widget { - widget = wibox.container.margin, - margins = { right = 4 }, - { - widget = wibox.widget.textbox, - text = time, - align = "right", - valign = "bottom", - }, - } - - local text_notif = wibox.widget { - markup = n.message, - align = "left", - forced_width = 165, - widget = wibox.widget.textbox, - } - - - local box = wibox.widget { - widget = wibox.container.background, - forced_height = 120, - bg = beautiful.mbg, - { - layout = wibox.layout.align.horizontal, - icon_widget, - { - widget = wibox.container.margin, - margins = 10, - { - layout = wibox.layout.align.vertical, - { - layout = wibox.layout.fixed.vertical, - expand = "none", - spacing = 10, - { - layout = wibox.layout.align.horizontal, - title_widget, - nil, - time_widget, - }, - text_notif, - } - } - } - } - } - - - box:buttons(gears.table.join(awful.button({}, 1, function() - _G.notif_center_remove_notif(box) - end))) - - return box -end diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/notify/mods/progs.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/notify/mods/progs.lua deleted file mode 100644 index 5231f1d..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/notify/mods/progs.lua +++ /dev/null @@ -1,66 +0,0 @@ -local helpers = require("helpers") -local beautiful = require("beautiful") -local gears = require("gears") -local dpi = beautiful.xresources.apply_dpi -local awful = require("awful") -local wibox = require("wibox") - -local createProgress = function(col, label, signal) - local widget = wibox.widget { - { - { - { - font = beautiful.sans .. " Light 11", - markup = helpers.colorizeText(label, beautiful.fg), - widget = wibox.widget.textbox, - valign = "start", - align = "center" - }, - widget = wibox.container.background, - forced_width = 50, - }, - widget = wibox.container.margin, - right = 30, - }, - { - id = "pro", - max_value = 100, - value = 0, - forced_height = 20, - forced_width = 300, - bar_shape = helpers.rrect(5), - shape = helpers.rrect(5), - color = col, - background_color = col .. '11', - paddings = 1, - border_width = 1, - widget = wibox.widget.progressbar, - }, - nil, - layout = wibox.layout.align.horizontal, - } - - awesome.connect_signal('signal::' .. signal, function(val) - helpers.gc(widget, "pro").value = val - end) - - return widget -end - -local widget = { - { - { - createProgress(beautiful.red, "CPU", "cpu"), - createProgress(beautiful.blue, "MEM", "memory"), - createProgress(beautiful.magenta, "DIS", "disk"), - spacing = 30, - layout = wibox.layout.fixed.vertical, - }, - widget = wibox.container.margin, - margins = 30 - }, - widget = wibox.container.background, - bg = beautiful.mbg -} - -return widget diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/popups/brightness.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/popups/brightness.lua deleted file mode 100644 index d3a4a99..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/popups/brightness.lua +++ /dev/null @@ -1,105 +0,0 @@ -local gears = require("gears") -local awful = require("awful") -local wibox = require("wibox") -local beautiful = require("beautiful") -local animation = require("mods.animation") - --- osd -- - -local info = wibox.widget { - widget = wibox.container.margin, - margins = 20, - { - layout = wibox.layout.fixed.horizontal, - fill_space = true, - spacing = 8, - { - widget = wibox.widget.textbox, - id = "icon", - font = beautiful.icon .. " 14", - }, - { - widget = wibox.container.background, - forced_width = 36, - { - widget = wibox.widget.textbox, - id = "text", - halign = "center" - }, - }, - { - widget = wibox.widget.progressbar, - id = "progressbar", - max_value = 100, - forced_width = 380, - forced_height = 10, - background_color = beautiful.mbg, - color = beautiful.blue, - }, - } -} - -local osd = awful.popup { - visible = false, - ontop = true, - minimum_height = 60, - maximum_height = 60, - minimum_width = 290, - maximum_width = 290, - placement = function(d) - awful.placement.bottom(d, { margins = 20, honor_workarea = true, }) - end, - widget = info, -} - -local anim = animation:new { - duration = 0.3, - easing = animation.easing.linear, - update = function(self, pos) - info:get_children_by_id("progressbar")[1].value = pos - end, -} - --- volume -- - - --- bright -- - -awesome.connect_signal("signal::brightness", function(value) - anim:set(value) - info:get_children_by_id("text")[1].text = value - if value > 90 then - info:get_children_by_id("icon")[1].text = "󰃠" - elseif value > 60 then - info:get_children_by_id("icon")[1].text = "󰃟" - elseif value > 30 then - info:get_children_by_id("icon")[1].text = "󰃝" - elseif value > 10 then - info:get_children_by_id("icon")[1].text = "󰃞" - end -end) - --- function -- - -local function osd_hide() - osd.visible = false - osd_timer:stop() -end - -local osd_timer = gears.timer { - timeout = 4, - callback = osd_hide -} - -local function osd_toggle() - if not osd.visible then - osd.visible = true - osd_timer:start() - else - osd_timer:again() - end -end - -awesome.connect_signal("open::osdb", function() - osd_toggle() -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/popups/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/popups/init.lua deleted file mode 100644 index 0b3cda4..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/popups/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -require "ui.popups.scrotter" -require "ui.popups.brightness" -require "ui.popups.volume" diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/popups/scrotter.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/popups/scrotter.lua deleted file mode 100644 index d109220..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/popups/scrotter.lua +++ /dev/null @@ -1,164 +0,0 @@ -local wibox = require("wibox") -local helpers = require("helpers") -local awful = require("awful") -local beautiful = require("beautiful") -local gears = require("gears") -local lgi = require('lgi') -local Gtk = lgi.require('Gtk', '3.0') -local Gdk = lgi.require('Gdk', '3.0') -local GdkPixbuf = lgi.GdkPixbuf -local dpi = beautiful.xresources.apply_dpi - -local delay = tostring(1) .. " " - -local clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD) - - -local getName = function() - local string = "~/Pictures/Screenshots/" .. os.date("%d-%m-%Y-%H:%M:%S") .. ".jpg" - string = string:gsub("~", os.getenv("HOME")) - return string -end - -local defCommand = "maim " .. "-d " .. delay - -local copyScrot = function(path) - local image = GdkPixbuf.Pixbuf.new_from_file(path) - clipboard:set_image(image) - clipboard:store() -end - -local createButton = function(icon, name, fn, col) - return wibox.widget { - { - { - { - { - font = beautiful.icon .. " 38", - markup = helpers.colorizeText(icon, col), - valign = "center", - align = "center", - widget = wibox.widget.textbox, - }, - widget = wibox.container.margin, - margins = 23, - }, - shape = helpers.rrect(10), - widget = wibox.container.background, - bg = beautiful.mbg, - }, - { - font = beautiful.sans .. " 10", - markup = name, - valign = "center", - align = "center", - widget = wibox.widget.textbox, - }, - spacing = 10, - layout = wibox.layout.fixed.vertical, - }, - layout = wibox.layout.fixed.vertical, - buttons = awful.button({}, 1, function() - fn() - end), - } -end - - -awful.screen.connect_for_each_screen(function(s) - local scrotter = wibox { - width = dpi(410), - height = dpi(210), - shape = helpers.rrect(8), - bg = beautiful.bg, - ontop = true, - visible = false - } - - local close = function() - scrotter.visible = not scrotter.visible - end - - local fullscreen = createButton('󰍹', 'Fullscreen', function() - close() - local name = getName() - local cmd = defCommand .. name - awful.spawn.easy_async_with_shell(cmd, function() - copyScrot(name) - end) - end, beautiful.green) - - local selection = createButton('󰩭', 'Selection', function() - close() - local name = getName() - local cmd = "maim" .. " -s " .. name - awful.spawn.easy_async_with_shell(cmd, function() - copyScrot(name) - end) - end, beautiful.blue) - - local window = createButton('󰘔', 'Window', function() - close() - local name = getName() - local cmd = "maim" .. " -i " .. client.focus.window .. " " .. name - awful.spawn.with_shell(cmd) - awful.spawn.easy_async_with_shell(cmd, function() - copyScrot(name) - end) - end, beautiful.red) - - scrotter:setup { - { - { - { - { - { - font = beautiful.font .. " 14", - markup = "Screenshotter", - valign = "center", - align = "start", - widget = wibox.widget.textbox, - }, - nil, - { - font = beautiful.icon .. " 18", - markup = helpers.colorizeText("󰅖", beautiful.red), - valign = "center", - align = "start", - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - close() - end) - }, - }, - widget = wibox.layout.align.horizontal - }, - widget = wibox.container.margin, - margins = 10 - }, - widget = wibox.container.background, - }, - { - { - fullscreen, - selection, - window, - spacing = 25, - layout = wibox.layout.fixed.horizontal - }, - widget = wibox.container.place, - halign = "center" - }, - spacing = 10, - layout = wibox.layout.fixed.vertical, - }, - widget = wibox.container.margin, - margins = 10, - } - - awesome.connect_signal("toggle::scrotter", function() - scrotter.visible = not scrotter.visible - awful.placement.centered(scrotter) - end) -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/popups/volume.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/popups/volume.lua deleted file mode 100644 index f9efb6b..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/popups/volume.lua +++ /dev/null @@ -1,100 +0,0 @@ -local gears = require("gears") -local awful = require("awful") -local wibox = require("wibox") -local beautiful = require("beautiful") -local animation = require("mods.animation") - --- osd -- - -local info = wibox.widget { - widget = wibox.container.margin, - margins = 20, - { - layout = wibox.layout.fixed.horizontal, - fill_space = true, - spacing = 8, - { - widget = wibox.widget.textbox, - id = "icon", - font = beautiful.icon .. " 14", - }, - { - widget = wibox.container.background, - forced_width = 36, - { - widget = wibox.widget.textbox, - id = "text", - halign = "center" - }, - }, - { - widget = wibox.widget.progressbar, - id = "progressbar", - max_value = 100, - forced_width = 380, - forced_height = 10, - background_color = beautiful.mbg, - color = beautiful.blue, - }, - } -} - -local osd = awful.popup { - visible = false, - ontop = true, - minimum_height = 60, - maximum_height = 60, - minimum_width = 290, - maximum_width = 290, - placement = function(d) - awful.placement.bottom(d, { margins = 20, honor_workarea = true, }) - end, - widget = info, -} - -local anim = animation:new { - duration = 0.3, - easing = animation.easing.linear, - update = function(self, pos) - info:get_children_by_id("progressbar")[1].value = pos - end, -} - --- volume -- - -awesome.connect_signal("signal::volume", function(value) - anim:set(value) - info:get_children_by_id("text")[1].text = value - if value > 80 then - info:get_children_by_id("icon")[1].text = "󰕾" - elseif value > 50 then - info:get_children_by_id("icon")[1].text = "󰖀" - elseif value > 10 then - info:get_children_by_id("icon")[1].text = "󰕿" - end -end) - --- function -- - -local function osd_hide() - osd.visible = false - osd_timer:stop() -end - -local osd_timer = gears.timer { - timeout = 4, - callback = osd_hide -} - -local function osd_toggle() - if not osd.visible then - osd.visible = true - osd_timer:start() - else - osd_timer:again() - end -end - -awesome.connect_signal("open::osd", function() - osd_toggle() -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/rightclick.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/rightclick.lua deleted file mode 100644 index 9dfd35a..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/rightclick.lua +++ /dev/null @@ -1,169 +0,0 @@ -local awful = require("awful") -local menu = require("mods.menu") -local hotkeys_popup = require("awful.hotkeys_popup") -local focused = awful.screen.focused() - -local function awesome_menu() - return menu({ - menu.button({ - icon = { icon = "", font = "Material Design Icons " }, - text = "Show Help", - on_press = function() - hotkeys_popup.show_help(nil, awful.screen.focused()) - awesome.emit_signal("close::menu") - end, - }), - menu.button({ - icon = { icon = "", font = "Material Design Icons" }, - text = "Docs", - on_press = function() - awful.spawn.with_shell("firefox https://awesomewm.org/apidoc/documentation/07-my-first-awesome.md.html#") - awesome.emit_signal("close::menu") - end, - }), - menu.button({ - icon = { icon = "󰣕", font = "Material Design Icons" }, - text = "Edit Config", - on_press = function() - awful.spawn.with_shell("cd ~/.config/awesome && wezterm -e nvim" .. " " .. awesome.conffile) - awesome.emit_signal("close::menu") - end, - }), - menu.button({ - icon = { icon = "󰦛", font = "Material Design Icons" }, - text = "Restart", - on_press = function() - awesome.emit_signal("close::menu") - awesome.restart() - end, - }), - menu.button({ - icon = { icon = "󰈆", font = "Material Design Icons" }, - text = "Quit", - on_press = function() - awesome.quit() - awesome.emit_signal("close::menu") - end, - }), - }) -end - -local function desktopMenu() - return menu({ - menu.button({ - icon = { icon = "󱪞", font = "Material Design Icons " }, - text = "New File", - on_press = function() - awesome.emit_signal("toggle::popup", "create") - awesome.emit_signal("close::menu") - end, - }), - menu.button({ - icon = { icon = "󰮝", font = "Material Design Icons" }, - text = "New Folder", - on_press = function() - awesome.emit_signal("close::menu") - awesome.emit_signal("toggle::popup", "folder") - end, - }), - menu.button({ - icon = { icon = "󰦛", font = "Material Design Icons" }, - text = "Refresh Icons", - on_press = function() - awesome.emit_signal("signal::desktop") - awesome.emit_signal("close::menu") - end, - }), - menu.button({ - icon = { icon = "󰈈", font = "Material Design Icons" }, - text = "Toggle Icons", - on_press = function() - awesome.emit_signal("close::menu") - end, - }), - }) -end - -local function widget() - return menu({ - menu.button({ - icon = { icon = "󰍉", font = "Material Design Icons " }, - text = "Applications", - on_press = function() - awesome.emit_signal("toggle::launcher") - awesome.emit_signal("close::menu") - end, - }), - menu.button({ - icon = { icon = "󱃸", font = "Material Design Icons " }, - text = "Terminal", - on_press = function() - awful.spawn("wezterm", false) - end, - }), - menu.button({ - icon = { icon = "󰈹", font = "Material Design Icons " }, - text = "Web Browser", - on_press = function() - awful.spawn("firefox", false) - awesome.emit_signal("close::menu") - end, - }), - menu.button({ - icon = { icon = "󰉋", font = "Material Design Icons " }, - text = "File Manager", - on_press = function() - awful.spawn("nemo", false) - awesome.emit_signal("close::menu") - end, - }), - menu.button({ - icon = { icon = "󱇨", font = "Material Design Icons " }, - text = "Text Editor", - on_press = function() - awful.spawn("wezterm -e nvim", false) - awesome.emit_signal("close::menu") - end, - }), - menu.button({ - icon = { icon = "", font = "Material Design Icons " }, - text = "Music Player", - on_press = function() - awesome.emit_signal("toggle::ncmpcpppad") - awesome.emit_signal("close::menu") - end, - }), - menu.button({ - icon = { icon = "󰐱", font = "Material Design Icons" }, - text = "Configure", - on_press = function() - awesome.emit_signal("close::menu") - awesome.emit_signal("toggle::setup") - end, - }), - menu.separator(), - menu.sub_menu_button({ - icon = { icon = "󰖟", font = "Material Design Icons " }, - text = "AwesomeWM", - sub_menu = awesome_menu(), - }), - menu.sub_menu_button({ - icon = { icon = "󰟀", font = "Material Design Icons " }, - text = "Desktop", - sub_menu = desktopMenu(), - }), - }) -end - - -local themenu = widget() - - -awesome.connect_signal("close::menu", function() - themenu:hide(true) -end) -awesome.connect_signal("toggle::menu", function() - themenu:toggle() -end) - -return { desktop = themenu } diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/init.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/init.lua deleted file mode 100644 index 676923e..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/init.lua +++ /dev/null @@ -1,154 +0,0 @@ -local awful = require("awful") -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") -local json = require("mods.json") -local beautiful = require("beautiful") - -local inspect = require("mods.inspect") -local input = require("ui.setup.mods.input") -local pass = require("ui.setup.mods.pass") -local check = require("ui.setup.mods.check") -local intin = require("ui.setup.mods.intin") -local themer = require("ui.setup.mods.themer") - -local data = helpers.readJson(gears.filesystem.get_cache_dir() .. "json/settings.json") -local a1 = input("Profile Picture", true, data.pfp) -local a2 = input("Icon Theme Path", true, data.iconTheme) -local a3 = pass("OpenWeather API Key", data.openWeatherApi) - -local a4 = check("Image Wallpaper", "colorful", "plain", data.wallpaper) -local a5 = check("Desktop Icons", true, false, data.showDesktopIcons) -local a6 = intin("Gaps", tostring(data.gaps)) - -local function writeData() - local data = { - pfp = a1.value, - iconTheme = a2.value, - openWeatherApi = a3.value, - wallpaper = a4.value, - showDesktopIcons = a5.value, - gaps = tonumber(a6.value), - colorscheme = themer.current - } - local w = assert(io.open(gears.filesystem.get_cache_dir() .. "json/settings.json", "w")) - w:write(json.encode(data, nil, { pretty = true, indent = " ", align_keys = false, array_newline = true })) - w:close() - awesome.restart() -end - -awful.screen.connect_for_each_screen(function(s) - local setup = wibox({ - shape = helpers.rrect(12), - screen = s, - width = 560, - height = 670, - bg = beautiful.bg, - ontop = true, - visible = false, - }) - - awful.placement.centered(setup, { honor_workarea = true }) - awesome.connect_signal("toggle::setup", function() - setup.visible = not setup.visible - end) - - setup:setup { - { - { - { - font = beautiful.sans .. " 14", - markup = helpers.colorizeText("Configure", beautiful.fg), - widget = wibox.widget.textbox, - valign = "center", - align = "center" - }, - nil, - { - { - { - { - font = beautiful.sans .. " 10", - markup = helpers.colorizeText("Apply In Nix", beautiful.blue), - widget = wibox.widget.textbox, - valign = "center", - align = "center" - }, - widget = wibox.container.margin, - margins = 10 - }, - widget = wibox.container.background, - shape = helpers.rrect(6), - buttons = { - awful.button({}, 1, function() - awful.spawn.with_shell("setTheme " .. themer.current) - awesome.emit_signal('toggle::setup') - end) - }, - bg = beautiful.blue .. '11' - }, - { - { - { - font = beautiful.icon .. " 12", - markup = helpers.colorizeText("󰄬", beautiful.green), - widget = wibox.widget.textbox, - valign = "center", - align = "center" - }, - widget = wibox.container.margin, - margins = 10 - }, - widget = wibox.container.background, - shape = helpers.rrect(6), - buttons = { - awful.button({}, 1, function() - writeData() - awesome.emit_signal('toggle::setup') - end) - }, - bg = beautiful.green .. '11' - }, - { - { - { - font = beautiful.icon .. " 12", - markup = helpers.colorizeText("󰅖", beautiful.red), - widget = wibox.widget.textbox, - valign = "center", - align = "center" - }, - widget = wibox.container.margin, - margins = 10 - }, - widget = wibox.container.background, - shape = helpers.rrect(6), - buttons = { - awful.button({}, 1, function() - awesome.emit_signal('toggle::setup') - end) - }, - bg = beautiful.red .. '11' - }, - spacing = 20, - layout = wibox.layout.fixed.horizontal - }, - layout = wibox.layout.align.horizontal - }, - a1.widget, - a2.widget, - a3.widget, - { - a4.widget, - a5.widget, - a6.widget, - layout = wibox.layout.flex.horizontal - }, - themer.widget, - spacing = 25, - layout = wibox.layout.fixed.vertical - }, - widget = wibox.container.margin, - margins = 20, - } -end) diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/check.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/check.lua deleted file mode 100644 index 693f55b..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/check.lua +++ /dev/null @@ -1,78 +0,0 @@ -local awful = require("awful") -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") -local json = require("mods.json") -local beautiful = require("beautiful") - -local O = function(label, tv, fv, var) - local M = { label = label, value = var, def = var } - - M.box = wibox.widget { - bg = var == tv and beautiful.fg or beautiful.bg, - - shape = helpers.rrect(100), - widget = wibox.container.background, - forced_height = 12, - forced_width = 12, - } - - function M:refresh() - self.box.bg = self.value == tv and beautiful.fg or beautiful.bg - end - - function M:toggle() - if M.value == tv then - M.value = fv - else - M.value = tv - end - self:refresh() - end - - M.widget = wibox.widget { - { - { - { - { - bg = beautiful.bg, - shape = helpers.rrect(100), - shape_border_width = 2, - shape_border_color = beautiful.fg, - widget = wibox.container.background, - forced_height = 24, - forced_width = 24, - }, - widget = wibox.container.place, - valign = "center" - }, - { - M.box, - widget = wibox.container.place, - valign = "center" - }, - buttons = { - awful.button(nil, 1, function() - M:toggle() - end) - }, - widget = wibox.layout.stack - }, - widget = wibox.container.place, - valign = "center" - }, - { - font = beautiful.sans .. " Light 11", - markup = helpers.colorizeText(M.label, beautiful.fg), - widget = wibox.widget.textbox, - valign = "start", - align = "start" - }, - spacing = 12, - layout = wibox.layout.fixed.horizontal - } - - return M -end - -return O diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/input.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/input.lua deleted file mode 100644 index 62ff71b..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/input.lua +++ /dev/null @@ -1,77 +0,0 @@ -local awful = require("awful") -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") -local json = require("mods.json") -local beautiful = require("beautiful") - -local O = function(label, isPath, var) - local M = { label = label, isPath = isPath, value = var, def = var } - - M.textbox = wibox.widget { - font = beautiful.sans .. " 12", - markup = helpers.colorizeText(M.value, beautiful.fg), - widget = wibox.widget.textbox, - valign = "center", - align = "start" - } - - function M:getInput() - awful.prompt.run({ - textbox = M.textbox, - text = M.value, - bg_cursor = beautiful.fg .. '22', - exe_callback = function(input) - -- If no input is present, display old contents. - if not input or #input == 0 then - M.textbox.markup = helpers.colorizeText(M.def, beautiful.fg) - M.textbox.font = beautiful.sans .. " 12" - return - end - -- else update textbox and variable. - if input:match("~/") and self.isPath then - M.value = input:gsub("~/", "/home/" .. beautiful.user:lower() .. "/") - M.textbox.markup = helpers.colorizeText(input:gsub("~/", "/home/" .. beautiful.user:lower() .. "/"), beautiful - .fg) - else - M.value = input - M.textbox.markup = helpers.colorizeText(input, beautiful.fg) - end - end - }) - end - - M.widget = wibox.widget { - { - font = beautiful.sans .. " Light 11", - markup = helpers.colorizeText(M.label, beautiful.fg), - widget = wibox.widget.textbox, - valign = "start", - align = "start" - }, - { - { - M.textbox, - widget = wibox.container.margin, - top = 15, - bottom = 15, - left = 10, - right = 10, - }, - shape = helpers.rrect(10), - widget = wibox.container.background, - bg = beautiful.mbg, - buttons = { - awful.button(nil, 1, function() - M:getInput() - end) - } - }, - spacing = 2, - layout = wibox.layout.fixed.vertical - } - - return M -end - -return O diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/intin.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/intin.lua deleted file mode 100644 index 812e0e5..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/intin.lua +++ /dev/null @@ -1,76 +0,0 @@ -local awful = require("awful") -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") -local json = require("mods.json") -local beautiful = require("beautiful") - -local O = function(label, var) - local M = { label = label, value = var, def = var } - - M.textbox = wibox.widget { - font = beautiful.sans .. " 12", - markup = helpers.colorizeText(M.value, beautiful.fg), - widget = wibox.widget.textbox, - valign = "center", - align = "start", - forced_width = 75, - } - - function M:getInput() - awful.prompt.run({ - textbox = M.textbox, - text = M.value, - bg_cursor = beautiful.fg .. '22', - exe_callback = function(input) - -- If no input is present, display old contents. - if not input or #input == 0 then - M.textbox.markup = helpers.colorizeText(M.def, beautiful.fg) - return - end - -- else update textbox and variable. - if string.match(input, "[^%d%.]") ~= nil then - M.textbox.markup = helpers.colorizeText(M.def, beautiful.fg) - M.value = M.def - else - M.value = input - M.textbox.markup = helpers.colorizeText(input, beautiful.fg) - end - end - }) - end - - M.widget = wibox.widget { - { - { - M.textbox, - widget = wibox.container.margin, - top = 10, - bottom = 10, - left = 10, - right = 10, - }, - shape = helpers.rrect(10), - widget = wibox.container.background, - bg = beautiful.mbg, - buttons = { - awful.button(nil, 1, function() - M:getInput() - end) - } - }, - { - font = beautiful.sans .. " Light 11", - markup = helpers.colorizeText(M.label, beautiful.fg), - widget = wibox.widget.textbox, - valign = "start", - align = "start" - }, - spacing = 12, - layout = wibox.layout.fixed.horizontal - } - - return M -end - -return O diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/pass.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/pass.lua deleted file mode 100644 index 4260946..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/pass.lua +++ /dev/null @@ -1,110 +0,0 @@ -local awful = require("awful") -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") -local json = require("mods.json") -local beautiful = require("beautiful") - -local O = function(label, var) - local M = { label = label, hidden = true, value = var, def = var } - - M.textbox = wibox.widget { - font = beautiful.sans .. " 12", - markup = helpers.colorizeText(M.hidden and string.rep("*", #M.value) or M.value, beautiful.fg), - widget = wibox.widget.textbox, - valign = "center", - align = "start" - } - - function M:getInput() - awful.prompt.run({ - textbox = M.textbox, - text = M.value, - bg_cursor = beautiful.fg .. '22', - exe_callback = function(input) - -- If no input is present, display old contents. - if not input or #input == 0 then - M.textbox.markup = helpers.colorizeText(M.def, beautiful.fg) - M.textbox.font = beautiful.sans .. " 12" - return - end - -- else update textbox and variable. - M.value = input - if self.hidden then - M.textbox.markup = helpers.colorizeText(string.rep("*", #M.value), beautiful.fg) - else - M.textbox.markup = helpers.colorizeText(input, beautiful.fg) - end - end - }) - end - - M.widget = wibox.widget { - { - font = beautiful.sans .. " Light 11", - markup = helpers.colorizeText(M.label, beautiful.fg), - widget = wibox.widget.textbox, - valign = "start", - align = "start" - }, - { - nil, - { - { - M.textbox, - widget = wibox.container.margin, - top = 15, - bottom = 15, - left = 10, - right = 10, - }, - shape = helpers.rrect(10), - widget = wibox.container.background, - bg = beautiful.mbg, - buttons = { - awful.button(nil, 1, function() - M:getInput() - end) - } - }, - { - { - { - { - font = beautiful.icon .. " 14", - markup = helpers.colorizeText("󰈈", beautiful.fg), - widget = wibox.widget.textbox, - valign = "center", - align = "start" - }, - left = 15, - right = 15, - widget = wibox.container.margin, - }, - shape = helpers.rrect(10), - widget = wibox.container.background, - buttons = { - awful.button(nil, 1, function() - M.hidden = not M.hidden - if M.hidden then - M.textbox.markup = helpers.colorizeText(string.rep("*", #M.value), beautiful.fg) - else - M.textbox.markup = helpers.colorizeText(M.value, beautiful.fg) - end - end) - }, - bg = beautiful.mbg, - }, - left = 10, - widget = wibox.container.margin, - }, - layout = wibox.layout.align.horizontal, - }, - spacing = 2, - layout = wibox.layout.fixed.vertical - } - - return M -end - -return O diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/themer.lua b/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/themer.lua deleted file mode 100644 index 5b1b7cb..0000000 --- a/modules/home-manager/ricing/awesomewm/dotfiles/ui/setup/mods/themer.lua +++ /dev/null @@ -1,166 +0,0 @@ -local awful = require("awful") -local helpers = require("helpers") -local wibox = require("wibox") -local gears = require("gears") -local json = require("mods.json") -local beautiful = require("beautiful") - -local themes = { "biscuit", "cat", "decay", "everblush", "forest", "fovere", "fullerene", "kizu", "nirvana", "oxo", "rose","solarized", - "stardewnight", "swamp", - "sweetpastel", "verdant", "vixima" } - -local index = helpers.indexOf(themes, beautiful.scheme) - -local M = { - current = beautiful.scheme, - colors = { - red = beautiful.red, - green = beautiful.green, - yellow = beautiful.yellow, - blue = beautiful.blue, - magenta = beautiful.magenta, - bg = beautiful.bg, - fg = beautiful.fg - } -} - -function M:previous() - index = index - 1 - if index < 1 then - index = #themes - end - M:getColors(themes[index]) - M:setColors() -end - -function M:next() - index = index + 1 - if index > #themes then - index = 1 - end - M:getColors(themes[index]) - M:setColors() -end - -function M:getColors(scheme) - scheme = scheme or self.current - local colors = require("theme.colors." .. scheme) - self.colors = colors - self.current = scheme -end - -function M:setColors() - helpers.gc(self.widget, "red").bg = self.colors.err - helpers.gc(self.widget, "blue").bg = self.colors.pri - helpers.gc(self.widget, "green").bg = self.colors.ok - helpers.gc(self.widget, "yellow").bg = self.colors.warn - helpers.gc(self.widget, "magenta").bg = self.colors.dis - helpers.gc(self.widget, "fg").bg = self.colors.fg - helpers.gc(self.widget, "bg").bg = self.colors.mbg - helpers.gc(self.widget, "name").markup = self.current:gsub("^%l", string.upper) -end - -M.widget = wibox.widget { - { - { - { - { - id = "name", - markup = M.current, - font = beautiful.sans .. " 14", - widget = wibox.widget.textbox - }, - nil, - { - { - markup = "󰅁", - font = beautiful.icon .. " 18", - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - M:previous() - end) - }, - }, - { - markup = "󰅂", - font = beautiful.icon .. " 18", - widget = wibox.widget.textbox, - buttons = { - awful.button({}, 1, function() - M:next() - end) - }, - }, - layout = wibox.layout.fixed.horizontal - }, - layout = wibox.layout.align.horizontal - }, - { - { - { - id = "red", - widget = wibox.container.background, - forced_height = 60, - forced_width = 60, - bg = M.colors.red - }, - { - id = "green", - widget = wibox.container.background, - forced_height = 60, - forced_width = 60, - bg = M.colors.green - }, - { - id = "yellow", - widget = wibox.container.background, - forced_height = 60, - forced_width = 60, - bg = M.colors.yellow - }, - { - id = "blue", - widget = wibox.container.background, - forced_height = 60, - forced_width = 60, - bg = M.colors.blue - }, - { - id = "magenta", - widget = wibox.container.background, - forced_height = 60, - forced_width = 60, - bg = M.colors.magenta - }, - { - id = "fg", - widget = wibox.container.background, - forced_height = 60, - forced_width = 60, - bg = M.colors.fg - }, - spacing = 20, - layout = wibox.layout.fixed.horizontal, - }, - valign = "center", - halign = "center", - widget = wibox.container.place, - }, - nil, - layout = wibox.layout.align.vertical, - }, - widget = wibox.container.margin, - margins = 12 - }, - id = "bg", - forced_height = 200, - shape = helpers.rrect(10), - widget = wibox.container.background, - bg = M.colors.bg -} - -M:getColors(beautiful.scheme) -M:setColors() - -return M diff --git a/modules/home-manager/ricing/awesomewm/gruv/LICENSE b/modules/home-manager/ricing/awesomewm/gruv/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/modules/home-manager/ricing/awesomewm/gruv/evil/battery.lua b/modules/home-manager/ricing/awesomewm/gruv/evil/battery.lua new file mode 100644 index 0000000..281d9df --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/evil/battery.lua @@ -0,0 +1,67 @@ +-- Provides: +-- evil::battery +-- percentage (integer) +-- evil::charger +-- plugged (boolean) + +local awful = require("awful") + +local update_interval = 30 + +-- Subscribe to power supply status changes with acpi_listen +local charger_script = [[ + sh -c ' + acpi_listen | grep --line-buffered ac_adapter + ' +]] + +-- First get battery file path +-- If there are multiple, only get the first one +-- TODO support multiple batteries +awful.spawn.easy_async_with_shell( + 'sh -c \'out="$(find /sys/class/power_supply/BAT?/capacity)" && (echo "$out" | head -1) || false\' ', + function(battery_file, _, __, exit_code) + -- No battery file found + if not (exit_code == 0) then + return + end + -- Periodically get battery info + awful.widget.watch("cat " .. battery_file, update_interval, function(_, stdout) + awesome.emit_signal("evil::battery", tonumber(stdout)) + end) + end +) + +-- First get charger file path +awful.spawn.easy_async_with_shell( + 'sh -c \'out="$(find /sys/class/power_supply/*/online)" && (echo "$out" | head -1) || false\' ', + function(charger_file, _, __, exit_code) + -- No charger file found + if not (exit_code == 0) then + return + end + -- Then initialize function that emits charger info + local emit_charger_info = function() + awful.spawn.easy_async_with_shell("cat " .. charger_file, function(out) + local status = tonumber(out) == 1 + awesome.emit_signal("evil::charger", status) + end) + end + + -- Run once to initialize widgets + emit_charger_info() + + -- Kill old acpi_listen process + awful.spawn.easy_async_with_shell( + "ps x | grep \"acpi_listen\" | grep -v grep | awk '{print $1}' | xargs kill", + function() + -- Update charger status with each line printed + awful.spawn.with_line_callback(charger_script, { + stdout = function(_) + emit_charger_info() + end, + }) + end + ) + end +) diff --git a/modules/home-manager/ricing/awesomewm/gruv/evil/brightness.lua b/modules/home-manager/ricing/awesomewm/gruv/evil/brightness.lua new file mode 100644 index 0000000..907e535 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/evil/brightness.lua @@ -0,0 +1,33 @@ +-- Provides: +-- evil::brightness +-- value (integer) +local awful = require("awful") + +local function emit() + awful.spawn.with_line_callback('sh -c "light -G"', { + stdout = function(line) + local value = math.floor(tonumber(line)) + awesome.emit_signal("evil::brightness", value) + end, + }) +end + +-- Run once to initialize widgets +emit() + +-- Subscribe to backlight changes +-- Requires inotify-tools +local subscribe = [[ bash -c "while (inotifywait -e modify /sys/class/backlight/?*/brightness -qq) do echo; done"]] + +-- Kill old inotifywait process +awful.spawn.easy_async_with_shell( + "ps x | grep \"inotifywait -e modify /sys/class/backlight\" | grep -v grep | awk '{print $1}' | xargs kill", + function() + -- Update brightness status with each line printed + awful.spawn.with_line_callback(subscribe, { + stdout = function() + emit() + end, + }) + end +) diff --git a/modules/home-manager/ricing/awesomewm/gruv/evil/cpu.lua b/modules/home-manager/ricing/awesomewm/gruv/evil/cpu.lua new file mode 100644 index 0000000..8bcfe34 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/evil/cpu.lua @@ -0,0 +1,18 @@ +-- Provides: +-- evil::cpu +-- used percentage (integer) +local awful = require("awful") + +local update_interval = 5 +local cpu_idle_script = [[ + sh -c " + vmstat 1 2 | tail -1 | awk '{printf \"%d\", $15}' + "]] + +-- Periodically get cpu info +awful.widget.watch(cpu_idle_script, update_interval, function(widget, stdout) + -- local cpu_idle = stdout:match('+(.*)%.%d...(.*)%(') + local cpu_idle = stdout + cpu_idle = string.gsub(cpu_idle, "^%s*(.-)%s*$", "%1") + awesome.emit_signal("evil::cpu", 100 - tonumber(cpu_idle)) +end) diff --git a/modules/home-manager/ricing/awesomewm/gruv/evil/init.lua b/modules/home-manager/ricing/awesomewm/gruv/evil/init.lua new file mode 100644 index 0000000..da9747e --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/evil/init.lua @@ -0,0 +1,12 @@ +-- Monitoring +require("evil.cpu") +require("evil.ram") + +-- User controlled +require("evil.volume") +require("evil.playerctl") +-- require("evil.brightness") +-- require("evil.battery") + +-- Internet access required +require("evil.weather") diff --git a/modules/home-manager/ricing/awesomewm/gruv/evil/playerctl.lua b/modules/home-manager/ricing/awesomewm/gruv/evil/playerctl.lua new file mode 100644 index 0000000..7d8de87 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/evil/playerctl.lua @@ -0,0 +1,35 @@ +-- Provides: +-- evil::playerctl +-- artist (string) +-- song (string) +-- status (string) [playing | paused | stopped] +local awful = require("awful") + +local function emit_info(playerctl_output) + local artist = playerctl_output:match("artist_start(.*)title_start") + local title = playerctl_output:match("title_start(.*)status_start") + -- Use the lower case of status + local status = playerctl_output:match("status_start(.*)"):lower() + status = string.gsub(status, "^%s*(.-)%s*$", "%1") + + awesome.emit_signal("evil::playerctl", artist, title, status) +end + +-- Sleeps until playerctl changes state (pause/play/next/prev) +local playerctl_script = [[ + sh -c ' + playerctl metadata --format 'artist_start{{artist}}title_start{{title}}status_start{{status}}' --follow + ']] + +-- Kill old playerctl process +awful.spawn.easy_async_with_shell( + "ps x | grep \"playerctl metadata\" | grep -v grep | awk '{print $1}' | xargs kill", + function() + -- Emit song info with each line printed + awful.spawn.with_line_callback(playerctl_script, { + stdout = function(line) + emit_info(line) + end, + }) + end +) diff --git a/modules/home-manager/ricing/awesomewm/gruv/evil/ram.lua b/modules/home-manager/ricing/awesomewm/gruv/evil/ram.lua new file mode 100644 index 0000000..0b2bd28 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/evil/ram.lua @@ -0,0 +1,20 @@ +-- Provides: +-- evil::ram +-- used (integer - mega bytes) +-- total (integer - mega bytes) +local awful = require("awful") + +local update_interval = 20 +-- Returns the used amount of ram in percentage +local ram_script = [[ + sh -c " + free -m | grep 'Mem:' | awk '{printf \"%d@@%d@\", $7, $2}' + "]] + +-- Periodically get ram info +awful.widget.watch(ram_script, update_interval, function(widget, stdout) + local available = stdout:match("(.*)@@") + local total = stdout:match("@@(.*)@") + local used = tonumber(total) - tonumber(available) + awesome.emit_signal("evil::ram", used, tonumber(total)) +end) diff --git a/modules/home-manager/ricing/awesomewm/gruv/evil/volume.lua b/modules/home-manager/ricing/awesomewm/gruv/evil/volume.lua new file mode 100644 index 0000000..2616d62 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/evil/volume.lua @@ -0,0 +1,49 @@ +-- Provides: +-- evil::volume +-- volume +-- muted +local awful = require("awful") + +local volume_old = -1 +local muted_old = -1 +local function emit() + -- Requires wireplumber + awful.spawn.easy_async_with_shell("wpctl get-volume @DEFAULT_AUDIO_SINK@", function(out) + local volume = tonumber(string.match(out:match("(%d%.%d+)") * 100, "(%d+)")) + local muted = out:match("MUTED") + + local icon = "" + if muted or volume == 0 then + icon = "󰝟" + elseif volume <= 33 then + icon = "󰕿" + elseif volume <= 66 then + icon = "󰖀" + elseif volume <= 100 then + icon = "󰕾" + else + icon = "" + end + + if volume ~= volume_old or muted ~= muted_old then + awesome.emit_signal("evil::volume", volume, muted, icon) + volume_old = volume + muted_old = muted + end + end) +end + +-- Run once to initialize widgets +emit() + +-- Subscribe to pactl changes +local subscribe = [[ bash -c "LANG=C pactl subscribe 2> /dev/null | grep --line-buffered \"Event 'change' on sink\"" ]] + +-- Kill old pactl processes +awful.spawn.easy_async({ "pkill", "--full", "--uid", os.getenv("USER"), "^pactl subscribe" }, function() + awful.spawn.with_line_callback(subscribe, { + stdout = function() + emit() + end, + }) +end) diff --git a/modules/home-manager/ricing/awesomewm/gruv/evil/weather.lua b/modules/home-manager/ricing/awesomewm/gruv/evil/weather.lua new file mode 100644 index 0000000..eec1c66 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/evil/weather.lua @@ -0,0 +1,31 @@ +-- Provides: +-- evil::weather +-- result json (string) +local awful = require("awful") +local json = require("modules.json") + +local api_key = user.openweathermap_key +local coordinates = user.openweathermap_city_id +local units = user.openweathermap_weather_units + +local url = ( + "https://api.openweathermap.org/data/2.5/onecall" + .. "?lat=" + .. coordinates[1] + .. "&lon=" + .. coordinates[2] + .. "&appid=" + .. api_key + .. "&units=" + .. units + .. "&exclude=minutely" +) + +local GET_FORECAST_CMD = [[bash -c "curl -s --show-error -X GET '%s'"]] + +awful.widget.watch(string.format(GET_FORECAST_CMD, url), 600, function(_, stdout, stderr) + if stderr == "" then + local result = json.decode(stdout) + awesome.emit_signal("evil::weather", result) + end +end) diff --git a/modules/home-manager/ricing/awesomewm/gruv/helpers.lua b/modules/home-manager/ricing/awesomewm/gruv/helpers.lua new file mode 100644 index 0000000..5451331 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/helpers.lua @@ -0,0 +1,250 @@ +local beautiful = require("beautiful") +local xresources = require("beautiful.xresources") +local dpi = xresources.apply_dpi +local awful = require("awful") +local gears = require("gears") +local helpers = {} + +-- Mouse hover +-- =================================================================== +function helpers.add_hover_cursor(w, hover_cursor) + local original_cursor = "left_ptr" + + w:connect_signal("mouse::enter", function() + local w = _G.mouse.current_wibox + if w then + w.cursor = hover_cursor + end + end) + + w:connect_signal("mouse::leave", function() + local w = _G.mouse.current_wibox + if w then + w.cursor = original_cursor + end + end) +end + +-- Create rounded rectangle shape (in one line) +-- =================================================================== +function helpers.rrect(radius) + return function(cr, width, height) + gears.shape.rounded_rect(cr, width, height, radius) + end +end + +-- Raise or spawn +-- =================================================================== +function helpers.run_or_raise(match, move, spawn_cmd, spawn_args) + local matcher = function(c) + return awful.rules.match(c, match) + end + + -- Find and raise + local found = false + for c in awful.client.iterate(matcher) do + found = true + c.minimized = false + if move then + c:move_to_tag(mouse.screen.selected_tag) + client.focus = c + else + c:jump_to() + end + break + end + + -- Spawn if not found + if not found then + awful.spawn(spawn_cmd, spawn_args) + end +end + +-- Run raise or minimize a client (scratchpad style) +-- =================================================================== +function helpers.scratchpad(match, spawn_cmd, spawn_args) + local cf = client.focus + if cf and awful.rules.match(cf, match) then + cf.minimized = true + else + helpers.run_or_raise(match, true, spawn_cmd, spawn_args) + end +end + +-- Resize DWIM (Do What I Mean) +-- =================================================================== +-- Resize client or factor +-- Constants +local floating_resize_amount = dpi(20) +local tiling_resize_factor = 0.05 +--------------- +function helpers.resize_dwim(c, direction) + if c and c.floating then + if direction == "up" then + c:relative_move(0, 0, 0, -floating_resize_amount) + elseif direction == "down" then + c:relative_move(0, 0, 0, floating_resize_amount) + elseif direction == "left" then + c:relative_move(0, 0, -floating_resize_amount, 0) + elseif direction == "right" then + c:relative_move(0, 0, floating_resize_amount, 0) + end + elseif awful.layout.get(mouse.screen) ~= awful.layout.suit.floating then + if direction == "up" then + awful.client.incwfact(-tiling_resize_factor) + elseif direction == "down" then + awful.client.incwfact(tiling_resize_factor) + elseif direction == "left" then + awful.tag.incmwfact(-tiling_resize_factor) + elseif direction == "right" then + awful.tag.incmwfact(tiling_resize_factor) + end + end +end + +-- Change volume +-- =================================================================== +function helpers.volume_control(step) + local cmd + if step == 0 then + cmd = "pactl set-sink-mute @DEFAULT_SINK@ toggle" + else + sign = step > 0 and "+" or "" + cmd = "pactl set-sink-mute @DEFAULT_SINK@ 0 && pactl set-sink-volume @DEFAULT_SINK@ " + .. sign + .. tostring(step) + .. "%" + end + awful.spawn.with_shell(cmd) +end + +-- Quick markup +-- =================================================================== +function helpers.colorize_text(text, color) + return "" .. text .. "" +end + +-- Lighten or darken hex colors +-- =================================================================== +-- Rounds to whole number +local function round(num) + return math.floor(num + 0.5) +end +-- Rounds to hundredths +local function roundH(num) + return math.floor((num * 100) + 0.5) / 100 +end + +-- Converts hexadecimal color to HSL +-- Lightness (L) is changed based on amt +-- Converts HSL back to hex +-- amt (0-100) can be negative to darken or positive to lighten +-- The amt specified is added to the color's existing Lightness +-- e.g., (#000000, 25) L = 25 but (#404040, 25) L = 50 + +function helpers.lighten(hex_color, amt) + local r, g, b, a + local hex = hex_color:gsub("#", "") + if #hex < 6 then + local t = {} + for i = 1, #hex do + local char = hex:sub(i, i) + t[i] = char .. char + end + hex = table.concat(t) + end + r = tonumber(hex:sub(1, 2), 16) / 255 + g = tonumber(hex:sub(3, 4), 16) / 255 + b = tonumber(hex:sub(5, 6), 16) / 255 + if #hex ~= 6 then + a = roundH(tonumber(hex:sub(7, 8), 16) / 255) + end + + local max = math.max(r, g, b) + local min = math.min(r, g, b) + local c = max - min + + -- Hue + local h + if c == 0 then + h = 0 + elseif max == r then + h = ((g - b) / c) % 6 + elseif max == g then + h = ((b - r) / c) + 2 + elseif max == b then + h = ((r - g) / c) + 4 + end + h = h * 60 + + -- Luminance + local l = (max + min) * 0.5 + + -- Saturation + local s + if l == 0 then + s = 0 + elseif l <= 0.5 then + s = c / (l * 2) + elseif l > 0.5 then + s = c / (2 - (l * 2)) + end + + local H, S, L, A + H = round(h) / 360 + S = round(s * 100) / 100 + L = round(l * 100) / 100 + + amt = amt / 100 + if L + amt > 1 then + L = 1 + elseif L + amt < 0 then + L = 0 + else + L = L + amt + end + + local R, G, B + if S == 0 then + R, G, B = round(L * 255), round(L * 255), round(L * 255) + else + local function hue2rgb(p, q, t) + if t < 0 then + t = t + 1 + end + if t > 1 then + t = t - 1 + end + if t < 1 / 6 then + return p + (q - p) * (6 * t) + end + if t < 1 / 2 then + return q + end + if t < 2 / 3 then + return p + (q - p) * (2 / 3 - t) * 6 + end + return p + end + local q + if L < 0.5 then + q = L * (1 + S) + else + q = L + S - (L * S) + end + local p = 2 * L - q + R = round(hue2rgb(p, q, (H + 1 / 3)) * 255) + G = round(hue2rgb(p, q, H) * 255) + B = round(hue2rgb(p, q, (H - 1 / 3)) * 255) + end + + if a ~= nil then + A = round(a * 255) + return string.format("#" .. "%.2x%.2x%.2x%.2x", R, G, B, A) + else + return string.format("#" .. "%.2x%.2x%.2x", R, G, B) + end +end + +return helpers +-- EOF ------------------------------------------------------------------------ diff --git a/modules/home-manager/ricing/awesomewm/gruv/keys.lua b/modules/home-manager/ricing/awesomewm/gruv/keys.lua new file mode 100644 index 0000000..f189102 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/keys.lua @@ -0,0 +1,582 @@ +-- ░█░█░█▀▀░█░█░█▀▄░▀█▀░█▀█░█▀▄░█▀▀ +-- ░█▀▄░█▀▀░░█░░█▀▄░░█░░█░█░█░█░▀▀█ +-- ░▀░▀░▀▀▀░░▀░░▀▀░░▀▀▀░▀░▀░▀▀░░▀▀▀ + +local gears = require("gears") +local beautiful = require("beautiful") +local awful = require("awful") +local hotkeys_popup = require("awful.hotkeys_popup") +local helpers = require("helpers") +local awesome = awesome +local client = client +local root = root +local keys = {} + +local mod = "Mod4" +local alt = "Mod1" +local ctrl = "Control" +local shift = "Shift" + +-- Menu +-- ============================================= +local menu = {} +menu.awesome = { + { + "Hotkeys", + function() + hotkeys_popup.show_help(nil, awful.screen.focused()) + end, + }, + { + "Manual", + function() + awful.spawn(user.terminal .. " -e man awesome") + end, + }, + { + "Edit config", + function() + awful.spawn(user.editor .. " " .. awesome.conffile) + end, + }, + { + "Restart", + function() + awesome.restart() + end, + }, + { + "Quit", + function() + awesome.quit() + end, + }, +} + +menu.mainmenu = awful.menu({ + items = { + { " Terminal", user.terminal }, + { " Explorer", apps.file_manager }, + { " Browser", apps.browser }, + { " Editor", apps.editor }, + { "󰨞 GUI Editor", apps.visual_editor }, + { " AwesomeWM", menu.awesome }, + { + " Notifications", + function() + awesome.emit_signal("summon::notif_center") + end, + }, + }, +}) + +-- Mouse bindings on desktop +-- ============================================= +keys.desktopbuttons = gears.table.join( + awful.button({}, 1, function() + -- Single tap + awesome.emit_signal("summon::dismiss") + if menu.mainmenu then + menu.mainmenu:hide() + end + -- if sidebar_hide then + -- sidebar_hide() + -- end + end), + + -- Right click - Show app drawer + awful.button({}, 3, function() + menu.mainmenu:toggle() + end), + + -- Middle button - Toggle dashboard + -- awful.button({ }, 2, function() + -- if dashboard_show then + -- dashboard_show() + -- end + -- end), + + -- Scrolling - Switch tags + -- awful.button({ }, 4, awful.tag.viewprev), + -- awful.button({ }, 5, awful.tag.viewnext), + + -- Side buttons - Control volume + awful.button({}, 8, function() + helpers.volume_control(-5) + end), + awful.button({}, 9, function() + helpers.volume_control(5) + end) + + -- Side buttons - Minimize and restore minimized client + -- awful.button({}, 8, function() + -- if client.focus ~= nil then + -- client.focus.minimized = true + -- end + -- end), + -- awful.button({}, 9, function() + -- local c = awful.client.restore() + -- -- Focus restored client + -- if c then + -- client.focus = c + -- end + -- end) +) + +-- Global bindings +-- ============================================= +keys.globalkeys = gears.table.join( + awful.key({ + modifiers = { 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 = { mod, ctrl }, + 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 = { 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({ mod }, "space", function() + awful.layout.inc(1) + end, { description = "next layout", group = "tag" }), + awful.key({ mod, shift }, "space", function() + awful.layout.inc(-1) + end, { description = "previous layout", group = "tag" }), + + -- Tag switcher + awful.key({ mod }, "Tab", function() + awful.tag.viewnext() + end, { description = "next tag", group = "client" }), + awful.key({ mod, shift }, "Tab", function() + awful.tag.viewprev() + end, { description = "prev tag", group = "client" }), + + -- Focus client by direction (hjkl keys) + awful.key({ mod }, "j", function() + awful.client.focus.bydirection("down") + end, { description = "focus down", group = "client" }), + awful.key({ mod }, "k", function() + awful.client.focus.bydirection("up") + end, { description = "focus up", group = "client" }), + awful.key({ mod }, "h", function() + awful.client.focus.bydirection("left") + end, { description = "focus left", group = "client" }), + awful.key({ mod }, "l", function() + awful.client.focus.bydirection("right") + end, { description = "focus right", group = "client" }), + + -- Focus client by index (cycle through clients) + awful.key({ mod }, "z", function() + awful.client.focus.byidx(1) + end, { description = "focus next by index", group = "client" }), + awful.key({ mod, shift }, "z", function() + awful.client.focus.byidx(-1) + end, { description = "focus next by index", group = "client" }), + + -- Focus client by direction (arrow keys) + awful.key({ mod }, "Down", function() + awful.client.focus.bydirection("down") + end, { description = "focus down", group = "client" }), + awful.key({ mod }, "Up", function() + awful.client.focus.bydirection("up") + end, { description = "focus up", group = "client" }), + awful.key({ mod }, "Left", function() + awful.client.focus.bydirection("left") + end, { description = "focus left", group = "client" }), + awful.key({ mod }, "Right", function() + awful.client.focus.bydirection("right") + end, { description = "focus right", group = "client" }), + + -- Urgent or Undo: + -- Jump to urgent client or (if there is no such client) go back + -- to the last tag + awful.key({ mod }, "u", function() + uc = awful.client.urgent.get() + -- If there is no urgent client, go back to last tag + if uc == nil then + awful.tag.history.restore() + else + awful.client.urgent.jumpto() + end + end, { description = "jump to urgent client", group = "client" }), + + awful.key({ mod }, "x", function() + awful.tag.history.restore() + end, { description = "go back", group = "tag" }), + + -- Spawn terminal + awful.key({ mod }, "Return", function() + awful.spawn(user.terminal) + end, { description = "open a terminal", group = "launcher" }), + + -- Spawn floating terminal + awful.key({ mod, shift }, "Return", function() + awful.spawn(user.floating_terminal, { floating = true }) + end, { description = "spawn floating terminal", group = "launcher" }), + + -- Reload Awesome + awful.key({ mod, shift }, "r", function() + awesome.restart() + end, { description = "reload awesome", group = "awesome" }), + + -- Quit Awesome + awful.key({ mod, shift }, "q", function() + awesome.quit() + end, { description = "quit awesome", group = "awesome" }), + awful.key({ mod, shift }, "x", function() + awesome.quit() + -- exit_screen_show() + end, { description = "quit awesome", group = "awesome" }), + awful.key({}, "XF86PowerOff", function() + awesome.quit() + -- exit_screen_show() + end, { description = "quit awesome", group = "awesome" }), + + -- Resize focused client or layout factor + awful.key({ mod, ctrl }, "Down", function(c) + helpers.resize_dwim(client.focus, "down") + end), + awful.key({ mod, ctrl }, "Up", function(c) + helpers.resize_dwim(client.focus, "up") + end), + awful.key({ mod, ctrl }, "Left", function(c) + helpers.resize_dwim(client.focus, "left") + end), + awful.key({ mod, ctrl }, "Right", function(c) + helpers.resize_dwim(client.focus, "right") + end), + awful.key({ mod, ctrl }, "j", function(c) + helpers.resize_dwim(client.focus, "down") + end), + awful.key({ mod, ctrl }, "k", function(c) + helpers.resize_dwim(client.focus, "up") + end), + awful.key({ mod, ctrl }, "h", function(c) + helpers.resize_dwim(client.focus, "left") + end), + awful.key({ mod, ctrl }, "l", function(c) + helpers.resize_dwim(client.focus, "right") + end), + + -- Focus restored client + awful.key({ mod, shift }, "n", function() + local c = awful.client.restore() + if c then + client.focus = c + end + end, { description = "restore minimized", group = "client" }), + + -- Dismiss notifications and elements that connect to the dismiss signal + awful.key({ ctrl }, "space", function() + awesome.emit_signal("summon::dismiss") + end, { description = "dismiss notification", group = "notifications" }), + + -- Scratchpad terminal + awful.key({ mod }, "s", function() + helpers.scratchpad({ instance = "scratchpad" }, user.scratchpad_terminal, nil) + end, { description = "scratchpad", group = "launcher" }), + + -- Screen Shots/Vids + awful.key({}, "Print", apps.screenshot_full, { description = "screenshot gui", group = "awesome" }), + awful.key( + { shift }, + "Print", + apps.screenshot_clipboard, + { description = "screenshot to clipboard", group = "awesome" } + ), + + -- Prompt + awful.key({ mod }, "d", function() + awful.screen.focused().mypromptbox:run() + end, { description = "run prompt", group = "launcher" }), + --- App launcher + awful.key({ mod }, "a", function() + awful.spawn(user.app_launcher) + end, { description = "app launcher", group = "app" }), + --- Emoji picker + awful.key({ mod }, "e", apps.emoji_picker, { description = "emoji picker", group = "app" }), + --- Clipboard + awful.key({ mod }, "v", apps.clipboard, { description = "clipboard", group = "app" }), + + -- Hotkeys list + awful.key({ mod }, "F1", function() + hotkeys_popup.show_help() + end, { description = "show help", group = "awesome" }), + + -- Volume control with volume keys + awful.key({}, "XF86AudioMute", function() + helpers.volume_control(0) + end, { description = "(un)mute volume", group = "volume" }), + awful.key({}, "XF86AudioLowerVolume", function() + helpers.volume_control(-5) + awesome.emit_signal("summon::osd") + end, { description = "lower volume", group = "volume" }), + awful.key({}, "XF86AudioRaiseVolume", function() + helpers.volume_control(5) + awesome.emit_signal("summon::osd") + end, { description = "raise volume", group = "volume" }), + + -- Brightness control with brightness keys + awful.key({}, "XF86MonBrightnessUp", function() + awful.spawn("light -A 10") + awesome.emit_signal("summon::osd") + end, { description = "increase brightness", group = "brightness" }), + awful.key({}, "XF86MonBrightnessDown", function() + awful.spawn("light -U 10") + awesome.emit_signal("summon::osd") + end, { description = "decrease brightness", group = "brightness" }), + + -- Music + awful.key({}, "XF86AudioPlay", function() + awful.spawn.with_shell("playerctl play-pause") + end, { description = "play pause music", group = "volume" }), + awful.key({}, "XF86AudioPrev", function() + awful.spawn.with_shell("playerctl previous") + end, { description = "previous music", group = "volume" }), + awful.key({}, "XF86AudioNext", function() + awful.spawn.with_shell("playerctl next") + end, { description = "next music", group = "volume" }), + + -- Lockscreen + awful.key({ mod, alt }, "l", function() + awesome.emit_signal("summon::lock_screen") + end, { description = "lock screen", group = "hotkeys" }), + + -- Apps + -- Spawn browser + awful.key({ mod }, "F2", apps.browser, { description = "web browser", group = "launcher" }), + -- Spawn gui file manager + awful.key({ mod }, "F3", apps.file_manager, { description = "file manager", group = "launcher" }), + -- Terminal file manager + awful.key({ mod }, "F4", apps.term_filemanager, { description = "term filemanager", group = "launcher" }), + -- Primary editor + awful.key({ mod }, "F5", apps.editor, { description = "editor", group = "launcher" }), + -- Gui editor + awful.key({ mod }, "F6", apps.visual_editor, { description = "visual editor", group = "launcher" }), + -- Add more + awful.key({ mod }, "F7", apps.file_manager, { description = "file manager", group = "launcher" }), + awful.key({ mod }, "F8", apps.file_manager, { description = "file manager", group = "launcher" }), + awful.key({ mod }, "F9", apps.file_manager, { description = "file manager", group = "launcher" }), + awful.key({ mod }, "F10", apps.file_manager, { description = "file manager", group = "launcher" }), + -- Volume control + awful.key({ mod }, "F11", apps.volume, { description = "volume control", group = "launcher" }), + -- Process monitor + awful.key({ mod }, "F12", apps.process_monitor, { description = "process monitor", group = "launcher" }) +) + +-- Client related bindings +-- ============================================= +keys.clientkeys = gears.table.join( + -- Swap by direction + awful.key({ mod, shift }, "j", function() + awful.client.swap.bydirection("down") + end), + awful.key({ mod, shift }, "k", function() + awful.client.swap.bydirection("up") + end), + awful.key({ mod, shift }, "h", function() + awful.client.swap.bydirection("left") + end), + awful.key({ mod, shift }, "l", function() + awful.client.swap.bydirection("right") + end), + + -- Toggle fullscreen + awful.key({ mod }, "f", function(c) + c.fullscreen = not c.fullscreen + c:raise() + end, { description = "toggle fullscreen", group = "client" }), + + -- Close client + awful.key({ mod }, "q", function(c) + c:kill() + end, { description = "close", group = "client" }), + awful.key({ alt }, "F4", function(c) + c:kill() + end, { description = "close", group = "client" }), + + --- Center client + awful.key({ mod }, "c", function() + awful.placement.centered(c, { honor_workarea = true, honor_padding = true }) + end), + + -- Switch clients + awful.key({ alt }, "Tab", function() + awesome.emit_signal("window_switcher::turn_on") + -- awful.client.focus.byidx(1) + end, { description = "focus next by index", group = "client" }), + + -- Toggle floating + awful.key({ mod, ctrl }, "space", function(c) + local layout_is_floating = (awful.layout.get(mouse.screen) == awful.layout.suit.floating) + if not layout_is_floating then + awful.client.floating.toggle() + end + end, { description = "toggle floating", group = "client" }), + + -- Set master + awful.key({ mod, ctrl }, "Return", function(c) + c:swap(awful.client.getmaster()) + end, { description = "move to master", group = "client" }), + + -- P for pin: keep on top OR sticky + -- On top + awful.key({ mod, shift }, "p", function(c) + c.ontop = not c.ontop + end, { description = "toggle keep on top", group = "client" }), + -- Sticky + awful.key({ mod, ctrl }, "p", function(c) + c.sticky = not c.sticky + end, { description = "toggle sticky", group = "client" }), + + -- Minimize + awful.key({ mod }, "n", function(c) + c.minimized = true + end, { description = "minimize", group = "client" }), + + -- Maximize + awful.key({ mod }, "m", function(c) + c.maximized = not c.maximized + end, { description = "(un)maximize", group = "client" }), + awful.key({ mod, ctrl }, "m", function(c) + c.maximized_vertical = not c.maximized_vertical + c:raise() + end, { description = "(un)maximize vertically", group = "client" }), + awful.key({ mod, shift }, "m", function(c) + c.maximized_horizontal = not c.maximized_horizontal + c:raise() + end, { description = "(un)maximize horizontally", group = "client" }) +) + +-- Mouse buttons on the client (whole window, not just titlebar) +-- ============================================= +keys.clientbuttons = gears.table.join( + awful.button({}, 1, function(c) + client.focus = c + end), + awful.button({ mod }, 1, awful.mouse.client.move), + -- awful.button({ mod }, 2, function(c) c:kill() end), + awful.button({ mod }, 3, function(c) + client.focus = c + awful.mouse.client.resize(c) + -- awful.mouse.resize(c, nil, {jump_to_corner=true}) + end) + + -- Super + scroll = Change client opacity + -- awful.button({ mod }, 4, function(c) + -- c.opacity = c.opacity + 0.1 + -- end), + -- awful.button({ mod }, 5, function(c) + -- c.opacity = c.opacity - 0.1 + -- end) +) + +-- Mouse buttons on the tasklist +-- Use 'Any' modifier so that the same buttons can be used in the floating +-- tasklist displayed by the window switcher while the mod is pressed +-- ============================================= +keys.tasklist_buttons = gears.table.join( + awful.button({ "Any" }, 1, function(c) + if c == client.focus then + c.minimized = true + else + -- Without this, the following + -- :isvisible() makes no sense + c.minimized = false + if not c:isvisible() and c.first_tag then + c.first_tag:view_only() + end + -- This will also un-minimize + -- the client, if needed + client.focus = c + end + end), + -- Middle mouse button closes the window (on release) + awful.button({ "Any" }, 2, nil, function(c) + c:kill() + end), + awful.button({ "Any" }, 3, function(c) + c.minimized = true + end), + awful.button({ "Any" }, 4, function() + awful.client.focus.byidx(-1) + end), + awful.button({ "Any" }, 5, function() + awful.client.focus.byidx(1) + end), + + -- Side button up - toggle floating + awful.button({ "Any" }, 9, function(c) + c.floating = not c.floating + end), + -- Side button down - toggle ontop + awful.button({ "Any" }, 8, function(c) + c.ontop = not c.ontop + end) +) + +-- Mouse buttons on a tag of the taglist widget +-- ============================================= +keys.taglist_buttons = gears.table.join( + awful.button({}, 1, function(t) + t:view_only() + end), + awful.button({ mod }, 1, function(t) + if client.focus then + client.focus:move_to_tag(t) + end + end), + -- awful.button({ }, 3, awful.tag.viewtoggle), + awful.button({}, 3, function(t) + if client.focus then + client.focus:move_to_tag(t) + end + end), + awful.button({ 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) +) + +root.keys(keys.globalkeys) +root.buttons(keys.desktopbuttons) + +return keys +-- EOF ------------------------------------------------------------------------ diff --git a/modules/home-manager/ricing/awesomewm/gruv/modules/json.lua b/modules/home-manager/ricing/awesomewm/gruv/modules/json.lua new file mode 100644 index 0000000..3846152 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/modules/json.lua @@ -0,0 +1,373 @@ +-- +-- json.lua +-- +-- Copyright (c) 2020 rxi +-- +-- Permission is hereby granted, free of charge, to any person obtaining a copy of +-- this software and associated documentation files (the "Software"), to deal in +-- the Software without restriction, including without limitation the rights to +-- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +-- of the Software, and to permit persons to whom the Software is furnished to do +-- so, subject to the following conditions: +-- +-- The above copyright notice and this permission notice shall be included in all +-- copies or substantial portions of the Software. +-- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +-- SOFTWARE. +-- + +local json = { _version = "0.1.2" } + +------------------------------------------------------------------------------- +-- Encode +------------------------------------------------------------------------------- + +local encode + +local escape_char_map = { + ["\\"] = "\\", + ['"'] = '"', + ["\b"] = "b", + ["\f"] = "f", + ["\n"] = "n", + ["\r"] = "r", + ["\t"] = "t", +} + +local escape_char_map_inv = { ["/"] = "/" } +for k, v in pairs(escape_char_map) do + escape_char_map_inv[v] = k +end + +local function escape_char(c) + return "\\" .. (escape_char_map[c] or string.format("u%04x", c:byte())) +end + +local function encode_nil(val) + return "null" +end + +local function encode_table(val, stack) + local res = {} + stack = stack or {} + + -- Circular reference? + if stack[val] then + error("circular reference") + end + + 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 +end + +local function encode_string(val) + 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) +end + +local type_func_map = { + ["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 .. "'") +end + +function json.encode(val) + return (encode(val)) +end + +------------------------------------------------------------------------------- +-- Decode +------------------------------------------------------------------------------- + +local parse + +local function create_set(...) + 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 literal_map = { + ["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 +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)) +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)) +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 +end + +local function parse_string(str, i) + local res = "" + local j = i + 1 + local k = j + + while j <= #str do + local x = str:byte(j) + + 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 + + j = j + 1 + end + + 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 +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 +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 +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 +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 = 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 .. "'") +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 +end + +return json +-- EOF ------------------------------------------------------------------------ diff --git a/modules/home-manager/ricing/awesomewm/gruv/modules/lockscreen/init.lua b/modules/home-manager/ricing/awesomewm/gruv/modules/lockscreen/init.lua new file mode 100644 index 0000000..de1b8c8 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/modules/lockscreen/init.lua @@ -0,0 +1,32 @@ +local awful = require("awful") +local gfs = require("gears.filesystem") + +local lock_screen = {} + +local lua_pam_path = gfs.get_configuration_dir() .. "modules/lockscren/lib/liblua_pam.so" + +-- Initialize authentication method based on whether lua-pam has been +-- installed or not +awful.spawn.easy_async_with_shell("stat " .. lua_pam_path .. " >/dev/null 2>&1", function(_, __, ___, exitcode) + if exitcode == 0 then + local pam = require("liblua_pam") + -- lua-pam was installed. + -- Authenticate with PAM + -- TODO: setup lib-pam + lock_screen.authenticate = function(password) + return pam.auth_current_user(password) + end + else + -- lua-pam was NOT installed. + -- Authenticate with user.lock_screen_custom_password + lock_screen.authenticate = function(password) + return password == user.lock_screen_custom_password + end + end + + -- Load the lock_screen element + require("modules.lockscreen.lockscreen") +end) + +return lock_screen +-- EOF ------------------------------------------------------------------------ diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/liblua_pam.so b/modules/home-manager/ricing/awesomewm/gruv/modules/lockscreen/lib/liblua_pam.so similarity index 100% rename from modules/home-manager/ricing/awesomewm/dotfiles/liblua_pam.so rename to modules/home-manager/ricing/awesomewm/gruv/modules/lockscreen/lib/liblua_pam.so diff --git a/modules/home-manager/ricing/awesomewm/gruv/modules/lockscreen/lockscreen.lua b/modules/home-manager/ricing/awesomewm/gruv/modules/lockscreen/lockscreen.lua new file mode 100644 index 0000000..9a67225 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/modules/lockscreen/lockscreen.lua @@ -0,0 +1,404 @@ +local gears = require("gears") +local awful = require("awful") +local beautiful = require("beautiful") +local xresources = require("beautiful.xresources") +local dpi = xresources.apply_dpi +local wibox = require("wibox") +local lock_screen = require("modules.lockscreen") + +--- Word Clock Lock Screen +--- ~~~~~~~~~~~~~~~~~~~~~~ + +local lock_screen_symbol = "" +local lock_screen_fail_symbol = "" +local lock_animation_icon = wibox.widget({ + --- Set forced size to prevent flickering when the icon rotates + forced_height = dpi(80), + forced_width = dpi(80), + font = beautiful.icon_font_name .. "40", + align = "center", + valign = "center", + widget = wibox.widget.textbox(lock_screen_symbol), +}) + +local some_textbox = wibox.widget.textbox() + +-- Create the lock screen wibox +-- Use widgets::splash::visibility or +-- Set the type to "splash" and set all "splash" windows to be blurred in your +-- compositor configuration file +lock_screen_box = wibox({ visible = false, ontop = true, type = "splash", screen = screen.primary }) +awful.placement.maximize(lock_screen_box) + +lock_screen_box.bg = beautiful.transparent +lock_screen_box.fg = beautiful.fg_normal + +--- Add lockscreen to each screen +awful.screen.connect_for_each_screen(function(s) + if s == screen.primary then + s.mylockscreen = lock_screen_box + else + s.mylockscreen = wibox({ + visible = false, + ontop = true, + type = "splash", + screen = s, + }) + awful.placement.maximize(s.mylockscreen) + s.mylockscreen.bg = beautiful.bg_normal + end +end) + +local function set_visibility(v) + for s in screen do + s.mylockscreen.visible = v + end +end + +--- Word Clock +--- ~~~~~~~~~ +local char = + "I T L I S A S A M P M A C Q U A R T E R D C T W E N T Y F I V E X H A L F S T E N F T O P A S T E R U N I N E O N E S I X T H R E E F O U R F I V E T W O E I G H T E L E V E N S E V E N T W E L V E T E N S E O C L O C K" + +local pos_map = { + ["it"] = { 1, 2 }, + ["is"] = { 4, 5 }, + ["a"] = { 12, 12 }, + ["quarter"] = { 14, 20 }, + ["twenty"] = { 23, 28 }, + ["five"] = { 29, 32 }, + ["half"] = { 34, 37 }, + ["ten"] = { 39, 41 }, + ["past"] = { 45, 48 }, + ["to"] = { 43, 44 }, + ["1"] = { 56, 58 }, + ["2"] = { 75, 77 }, + ["3"] = { 62, 66 }, + ["4"] = { 67, 70 }, + ["5"] = { 71, 74 }, + ["6"] = { 59, 61 }, + ["7"] = { 89, 93 }, + ["8"] = { 78, 82 }, + ["9"] = { 52, 55 }, + ["10"] = { 100, 102 }, + ["11"] = { 83, 88 }, + ["12"] = { 94, 99 }, + ["oclock"] = { 105, 110 }, +} + +local char_map = { + ["it"] = {}, + ["is"] = {}, + ["a"] = {}, + ["quarter"] = {}, + ["twenty"] = {}, + ["five"] = {}, + ["half"] = {}, + ["ten"] = {}, + ["past"] = {}, + ["to"] = {}, + ["1"] = {}, + ["2"] = {}, + ["3"] = {}, + ["4"] = {}, + ["5"] = {}, + ["6"] = {}, + ["7"] = {}, + ["8"] = {}, + ["9"] = {}, + ["10"] = {}, + ["11"] = {}, + ["12"] = {}, + ["oclock"] = {}, +} + +local reset_map = { 4, 12, 14, 23, 29, 34, 39, 43, 45, 52, 56, 59, 62, 67, 71, 75, 78, 83, 89, 94, 100, 105 } + +function split_str(s, delimiter) + result = {} + for match in (s .. delimiter):gmatch("(.-)" .. delimiter) do + table.insert(result, match) + end + + return result +end + +local time_char = split_str(char, " ") + +local time = wibox.widget({ + forced_num_cols = 11, + spacing = dpi(6), + layout = wibox.layout.grid, +}) + +local function create_text_widget(index, w) + local text_widget = wibox.widget({ + id = "t" .. index, + markup = w, + font = beautiful.font_name .. "Bold 24", + align = "center", + valign = "center", + forced_width = dpi(36), + forced_height = dpi(36), + widget = wibox.widget.textbox, + }) + + time:add(text_widget) + + return text_widget +end + +local var_count = 0 +for i, m in pairs(time_char) do + local text = "" .. m .. "" + + var_count = var_count + 1 + local create_dummy_text = true + + for j, k in pairs(pos_map) do + if i >= pos_map[j][1] and i <= pos_map[j][2] then + char_map[j][var_count] = create_text_widget(i, text) + create_dummy_text = false + end + + for _, n in pairs(reset_map) do + if i == n then + var_count = 1 + end + end + end + + if create_dummy_text then + create_text_widget(i, text) + end +end + +local function activate_word(w) + for i, m in pairs(char_map[w]) do + local text = m.text + m.markup = "" .. text .. "" + end +end + +local function deactivate_word(w) + for i, m in pairs(char_map[w]) do + local text = m.text + m.markup = "" .. text .. "" + end +end + +local function reset_time() + for j, k in pairs(char_map) do + deactivate_word(j) + end + + activate_word("it") + activate_word("is") +end + +gears.timer({ + timeout = 1, + call_now = true, + autostart = true, + callback = function() + local time = os.date("%I" .. ":%M") + local h, m = time:match("(%d+):(%d+)") + local min = tonumber(m) + local hour = tonumber(h) + + reset_time() + + if min >= 0 and min <= 2 or min >= 58 and min <= 59 then + activate_word("oclock") + elseif min >= 3 and min <= 7 or min >= 53 and min <= 57 then + activate_word("five") + elseif min >= 8 and min <= 12 or min >= 48 and min <= 52 then + activate_word("ten") + elseif min >= 13 and min <= 17 or min >= 43 and min <= 47 then + activate_word("a") + activate_word("quarter") + elseif min >= 18 and min <= 22 or min >= 38 and min <= 42 then + activate_word("twenty") + elseif min >= 23 and min <= 27 or min >= 33 and min <= 37 then + activate_word("twenty") + activate_word("five") + elseif min >= 28 and min <= 32 then + activate_word("half") + end + + if min >= 3 and min <= 32 then + activate_word("past") + elseif min >= 33 and min <= 57 then + activate_word("to") + end + + local hh + + if min >= 0 and min <= 30 then + hh = hour + else + hh = hour + 1 + end + + if hh > 12 then + hh = hh - 12 + end + + activate_word(tostring(hh)) + end, +}) + +--- Lock animation +local lock_animation_widget_rotate = wibox.container.rotate() + +local arc = function() + return function(cr, width, height) + gears.shape.arc(cr, width, height, 5, 0, math.pi / 2, true, true) + end +end + +local lock_animation_arc = wibox.widget({ + shape = arc(), + bg = beautiful.transparent, + forced_width = dpi(100), + forced_height = dpi(100), + widget = wibox.container.background, +}) + +local lock_animation = { + { + lock_animation_arc, + widget = lock_animation_widget_rotate, + }, + lock_animation_icon, + layout = wibox.layout.stack, +} + +--- Lock helper functions +local characters_entered = 0 +local function reset() + characters_entered = 0 + lock_animation_icon.markup = lock_screen_symbol + lock_animation_widget_rotate.direction = "north" + lock_animation_arc.bg = beautiful.transparent +end + +local function fail() + characters_entered = 0 + lock_animation_icon.markup = lock_screen_fail_symbol + lock_animation_widget_rotate.direction = "north" + lock_animation_arc.bg = beautiful.transparent +end + +local animation_colors = { + --- Rainbow sequence + beautiful.red, + beautiful.magenta, + beautiful.blue, + beautiful.cyan, + beautiful.green, + beautiful.yellow, +} + +local animation_directions = { "north", "west", "south", "east" } + +--- Function that "animates" every key press +local function key_animation(char_inserted) + local color + local direction = animation_directions[(characters_entered % 4) + 1] + if char_inserted then + color = animation_colors[(characters_entered % 6) + 1] + lock_animation_icon.markup = lock_screen_symbol + else + if characters_entered == 0 then + reset() + else + color = beautiful.white .. "55" + end + end + + lock_animation_arc.bg = color + lock_animation_widget_rotate.direction = direction +end + +--- Get input from user +local function grab_password() + awful.prompt.run({ + hooks = { + --- Custom escape behaviour: Do not cancel input with Escape + --- Instead, this will just clear any input received so far. + { + {}, + "Escape", + function(_) + reset() + grab_password() + end, + }, + --- Fix for Control+Delete crashing the keygrabber + { + { "Control" }, + "Delete", + function() + reset() + grab_password() + end, + }, + }, + keypressed_callback = function(mod, key, cmd) + --- Only count single character keys (thus preventing "Shift", "Escape", etc from triggering the animation) + if #key == 1 then + characters_entered = characters_entered + 1 + key_animation(true) + elseif key == "BackSpace" then + if characters_entered > 0 then + characters_entered = characters_entered - 1 + end + key_animation(false) + end + end, + exe_callback = function(input) + --- Check input + if lock_screen.authenticate(input) then + --- YAY + reset() + set_visibility(false) + awesome.emit_signal("widgets::splash::visibility", false) + else + --- NAY + fail() + grab_password() + end + end, + textbox = some_textbox, + }) +end + +awesome.connect_signal("summon::lock_screen", function() + set_visibility(true) + grab_password() + awesome.emit_signal("widgets::splash::visibility", true) +end) + +lock_screen_box:setup({ + --- Horizontal centering + nil, + { + --- Vertical centering + nil, + { + wibox.widget({ + forced_height = dpi(20), + layout = wibox.layout.fixed.vertical, + }), + time, + lock_animation, + spacing = dpi(60), + layout = wibox.layout.fixed.vertical, + }, + expand = "none", + layout = wibox.layout.align.vertical, + }, + expand = "none", + layout = wibox.layout.align.horizontal, +}) diff --git a/modules/home-manager/ricing/awesomewm/gruv/modules/notification_center.lua b/modules/home-manager/ricing/awesomewm/gruv/modules/notification_center.lua new file mode 100644 index 0000000..d15b07c --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/modules/notification_center.lua @@ -0,0 +1,261 @@ +local gears = require("gears") +local awful = require("awful") +local wibox = require("wibox") +local naughty = require("naughty") +local beautiful = require("beautiful") +local helpers = require("helpers") + +-- Notification list +local label = wibox.widget({ + text = "Notifications", + align = "center", + widget = wibox.widget.textbox, +}) + +local notifs_clear = wibox.widget({ + markup = " 󰅙 ", + align = "center", + valign = "center", + widget = wibox.widget.textbox, +}) + +notifs_clear:buttons(gears.table.join(awful.button({}, 1, function() + _G.notif_center_reset_notifs_container() +end))) + +local notifs_empty = wibox.widget({ + forced_height = dpi(300), + widget = wibox.container.background, + { + layout = wibox.layout.flex.vertical, + { + markup = "No notifications", + font = beautiful.font, + align = "center", + valign = "center", + widget = wibox.widget.textbox, + }, + }, +}) + +local notifs_container = wibox.widget({ + forced_width = dpi(240), + forced_height = dpi(715), + layout = wibox.layout.fixed.vertical, + spacing = dpi(10), + spacing_widget = { + top = dpi(2), + bottom = dpi(2), + left = dpi(6), + right = dpi(6), + widget = wibox.container.margin, + { + widget = wibox.container.background, + }, + }, +}) + +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 +end + +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 +end + +local create_notif = function(icon, n, width) + local time = os.date("%H:%M:%S") + + local icon_widget = wibox.widget({ + widget = wibox.container.constraint, + { + widget = wibox.container.margin, + margins = dpi(20), + { + widget = wibox.widget.imagebox, + image = icon, + clip_shape = gears.shape.circle, + halign = "center", + valign = "center", + }, + }, + }) + + local title_widget = wibox.widget({ + widget = wibox.container.scroll.horizontal, + step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth, + speed = 50, + forced_width = dpi(200), + { + widget = wibox.widget.textbox, + text = n.title, + align = "left", + forced_width = dpi(200), + }, + }) + + local time_widget = wibox.widget({ + widget = wibox.container.background, + bg = beautiful.fg_normal, + fg = beautiful.bg_normal, + { + widget = wibox.container.margin, + margins = { left = dpi(10), right = dpi(10), top = dpi(4), bottom = dpi(4) }, + { + widget = wibox.widget.textbox, + text = time, + align = "right", + valign = "bottom", + }, + }, + }) + + local text_notif = wibox.widget({ + markup = n.message, + align = "left", + forced_width = dpi(165), + widget = wibox.widget.textbox, + }) + + local box = wibox.widget({ + widget = wibox.container.background, + forced_height = dpi(120), + bg = beautiful.black_alt, + { + layout = wibox.layout.align.horizontal, + icon_widget, + { + widget = wibox.container.margin, + margins = dpi(10), + { + layout = wibox.layout.align.vertical, + expand = "none", + { + layout = wibox.layout.fixed.vertical, + spacing = dpi(10), + { + layout = wibox.layout.align.horizontal, + expand = "none", + title_widget, + nil, + time_widget, + }, + text_notif, + }, + }, + }, + }, + }) + + box:buttons(gears.table.join(awful.button({}, 1, function() + _G.notif_center_remove_notif(box) + end))) + + 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({}, 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 + + local appicon = n.icon or n.app_icon + if not appicon then + appicon = beautiful.awesome_icon + end + + notifs_container:insert(1, create_notif(appicon, n, width)) +end) + +local notifs = wibox.widget({ + spacing = dpi(10), + layout = wibox.layout.fixed.vertical, + { + widget = wibox.container.margin, + margins = dpi(10), + { + layout = wibox.layout.align.horizontal, + label, + nil, + notifs_clear, + }, + }, + notifs_container, +}) + +-- Main window +local main = wibox.widget({ + widget = wibox.container.background, + bg = beautiful.bg_normal, + { + widget = wibox.container.margin, + margins = dpi(10), + { + layout = wibox.layout.fixed.vertical, + fill_space = true, + spacing = dpi(10), + notifs, + }, + }, +}) + +local notif_center = awful.popup({ + shape = helpers.rrect(beautiful.border_radius), + visible = false, + ontop = true, + border_width = beautiful.border_width, + border_color = beautiful.widget_border_color, + minimum_height = dpi(585), + maximum_height = dpi(585), + minimum_width = dpi(500), + maximum_width = dpi(500), + placement = function(d) + awful.placement.bottom_right(d, { honor_workarea = true, margins = dpi(5) + beautiful.border_width * 2 }) + end, + widget = main, +}) + +-- Summon functions +awesome.connect_signal("summon::notif_center", function() + notif_center.visible = not notif_center.visible +end) + +-- Hide on click on other windows +client.connect_signal("button::press", function() + notif_center.visible = false +end) + +awesome.connect_signal("summon::dismiss", function() + naughty.destroy_all_notifications() + notif_center.visible = false +end) diff --git a/modules/home-manager/ricing/awesomewm/gruv/modules/window_switcher.lua b/modules/home-manager/ricing/awesomewm/gruv/modules/window_switcher.lua new file mode 100644 index 0000000..f086b38 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/modules/window_switcher.lua @@ -0,0 +1,281 @@ +local awful = require("awful") +local gears = require("gears") +local wibox = require("wibox") +local beautiful = require("beautiful") +local dpi = beautiful.xresources.apply_dpi + +local window_switcher_first_client -- The client that was focused when the window_switcher was activated +local window_switcher_minimized_clients = {} -- The clients that were minimized when the window switcher was activated +local window_switcher_grabber + +local get_num_clients = function() + local minimized_clients_in_tag = 0 + local matcher = function(c) + return awful.rules.match(c, { + minimized = true, + skip_taskbar = false, + hidden = false, + first_tag = awful.screen.focused().selected_tag, + }) + end + for c in awful.client.iterate(matcher) do + minimized_clients_in_tag = minimized_clients_in_tag + 1 + end + return minimized_clients_in_tag + #awful.screen.focused().clients +end + +local window_switcher_hide = function(window_switcher_box) + -- Add currently focused client to history + if client.focus then + local window_switcher_last_client = client.focus + awful.client.focus.history.add(window_switcher_last_client) + -- Raise client that was focused originally + -- Then raise last focused client + if window_switcher_first_client and window_switcher_first_client.valid then + window_switcher_first_client:raise() + window_switcher_last_client:raise() + end + end + + -- Minimize originally minimized clients + local s = awful.screen.focused() + for _, c in pairs(window_switcher_minimized_clients) do + if c and c.valid and not (client.focus and client.focus == c) then + c.minimized = true + end + end + -- Reset helper table + window_switcher_minimized_clients = {} + + -- Resume recording focus history + awful.client.focus.history.enable_tracking() + -- Stop and hide window_switcher + awful.keygrabber.stop(window_switcher_grabber) + window_switcher_box.visible = false + window_switcher_box.widget = nil + collectgarbage("collect") +end + +local function draw_widget(mouse_keys) + local tasklist_widget = awful.widget.tasklist({ + screen = awful.screen.focused(), + filter = awful.widget.tasklist.filter.currenttags, + buttons = mouse_keys, + style = { + font = beautiful.font, + bg_normal = beautiful.bg_normal, + bg_focus = beautiful.bg_focus, + fg_normal = beautiful.fg_normal, + fg_focus = beautiful.fg_focus, + shape = gears.shape.rounded_rect, + }, + layout = { + layout = wibox.layout.fixed.horizontal, + }, + widget_template = { + { + { + { + awful.widget.clienticon, + forced_height = dpi(80), + forced_width = dpi(80), + halign = "center", + valign = "center", + widget = wibox.container.place, + }, + { + { + widget = wibox.container.scroll.horizontal, + step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth, + fps = 60, + speed = 75, + { + id = "text_role", + widget = wibox.widget.textbox, + }, + }, + halign = "center", + valign = "center", + widget = wibox.container.place, + }, + spacing = dpi(15), + layout = wibox.layout.fixed.vertical, + }, + margins = dpi(15), + widget = wibox.container.margin, + }, + forced_width = dpi(150), + forced_height = dpi(150), + id = "background_role", + widget = wibox.container.background, + }, + }) + + return wibox.widget({ + { + tasklist_widget, + margins = dpi(15), + widget = wibox.container.margin, + }, + bg = beautiful.background, + shape = gears.shape.rounded_rect, + widget = wibox.container.background, + }) +end + +local hide_window_switcher_key = "Escape" + +local select_client_key = 1 +local minimize_key = "n" +local unminimize_key = "N" +local kill_client_key = "q" + +local cycle_key = "Tab" + +local previous_key = "Left" +local next_key = "Right" + +local vim_previous_key = "h" +local vim_next_key = "l" + +local scroll_previous_key = 4 +local scroll_next_key = 5 + +local window_switcher_box = awful.popup({ + -- bg = beautiful.transparent, + visible = false, + ontop = true, + placement = awful.placement.centered, + screen = awful.screen.focused(), + widget = wibox.container.background, -- A dummy widget to make awful.popup not scream + widget = draw_widget(), +}) + +local mouse_keys = gears.table.join( + awful.button({ + modifiers = { "Any" }, + button = select_client_key, + on_press = function(c) + client.focus = c + end, + }), + + awful.button({ + modifiers = { "Any" }, + button = scroll_previous_key, + on_press = function() + awful.client.focus.byidx(-1) + end, + }), + + awful.button({ + modifiers = { "Any" }, + button = scroll_next_key, + on_press = function() + awful.client.focus.byidx(1) + end, + }) +) + +local keyboard_keys = { + [hide_window_switcher_key] = function() + window_switcher_hide(window_switcher_box) + end, + + [minimize_key] = function() + if client.focus then + client.focus.minimized = true + end + end, + [unminimize_key] = function() + if awful.client.restore() then + client.focus = awful.client.restore() + end + end, + [kill_client_key] = function() + if client.focus then + client.focus:kill() + end + end, + + [cycle_key] = function() + awful.client.focus.byidx(1) + end, + + [previous_key] = function() + awful.client.focus.byidx(1) + end, + [next_key] = function() + awful.client.focus.byidx(-1) + end, + + [vim_previous_key] = function() + awful.client.focus.byidx(1) + end, + [vim_next_key] = function() + awful.client.focus.byidx(-1) + end, +} + +window_switcher_box:connect_signal("property::width", function() + if window_switcher_box.visible and get_num_clients() == 0 then + window_switcher_hide(window_switcher_box) + end +end) + +window_switcher_box:connect_signal("property::height", function() + if window_switcher_box.visible and get_num_clients() == 0 then + window_switcher_hide(window_switcher_box) + end +end) + +awesome.connect_signal("window_switcher::turn_on", function() + local number_of_clients = get_num_clients() + if number_of_clients == 0 then + return + end + + -- Store client that is focused in a variable + window_switcher_first_client = client.focus + + -- Stop recording focus history + awful.client.focus.history.disable_tracking() + + -- Go to previously focused client (in the tag) + awful.client.focus.history.previous() + + -- Track minimized clients + -- Unminimize them + -- Lower them so that they are always below other + -- originally unminimized windows + local clients = awful.screen.focused().selected_tag:clients() + for _, c in pairs(clients) do + if c.minimized then + table.insert(window_switcher_minimized_clients, c) + c.minimized = false + c:lower() + end + end + + -- Start the keygrabber + window_switcher_grabber = awful.keygrabber.run(function(_, key, event) + if event == "release" then + -- Hide if the modifier was released + -- We try to match Super or Alt or Control since we do not know which keybind is + -- used to activate the window switcher (the keybind is set by the user in keys.lua) + if key:match("Super") or key:match("Alt") or key:match("Control") then + window_switcher_hide(window_switcher_box) + end + -- Do nothing + return + end + + -- Run function attached to key, if it exists + if keyboard_keys[key] then + keyboard_keys[key]() + end + end) + + window_switcher_box.widget = draw_widget(mouse_keys) + window_switcher_box.visible = true +end) diff --git a/modules/home-manager/ricing/awesomewm/gruv/rc.lua b/modules/home-manager/ricing/awesomewm/gruv/rc.lua new file mode 100644 index 0000000..4bb0991 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/rc.lua @@ -0,0 +1,798 @@ +-- ░█▄█░█▀█░█▀▄░█▀▀░█▀▀░█▀█░█▀█░█▀█░▀█▀░▀░█▀▀░░░█▀█░█░█░█▀▀░█▀▀░█▀█░█▄█░█▀▀ +-- ░█░█░█░█░█▀▄░▀▀█░█▀▀░█░█░█▀█░█▀▀░░█░░░░▀▀█░░░█▀█░█▄█░█▀▀░▀▀█░█░█░█░█░█▀▀ +-- ░▀░▀░▀▀▀░▀▀░░▀▀▀░▀▀▀░▀░▀░▀░▀░▀░░░▀▀▀░░░▀▀▀░░░▀░▀░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀ + +-- >> The file that binds everything together. +local awesome = awesome +local client = client +local screen = screen +local decorations = {} + +-- User variables and preferences +-- =================================================================== +user = { + terminal = "wezterm start --always-new-process", + floating_terminal = "wezterm start --class floating_terminal", + scratchpad_terminal = "wezterm start --class scratchpad", + editor = "wezterm start --class editor -e hx", + browser = "firefox", + file_manager = "pcmanfm", + term_filemanager = "wezterm start --class term_filemanager -e yazi", + visual_editor = "", + openweathermap_key = "d1b3b6a81db867259446b0863d5f9108", + openweathermap_city_id = { + "25.6", -- lat + "85.1167", -- lon + }, + openweathermap_weather_units = "metric", + lock_screen_custom_password = "040424", + app_launcher = "rofi -matching fuzzy -show drun", +} + +-- Initialization +-- =================================================================== +local beautiful = require("beautiful") +-- Make dpi function global +dpi = beautiful.xresources.apply_dpi + +-- Load AwesomeWM libraries +local gears = require("gears") +local gfs = require("gears.filesystem") +local awful = require("awful") +require("awful.autofocus") +-- Default notification library +local naughty = require("naughty") + +-- Load theme +beautiful.init(gfs.get_configuration_dir() .. "themes/gruva/" .. "theme.lua") + +-- Error handling +-- =================================================================== +naughty.connect_signal("request::display_error", function(message, startup) + naughty.notification({ + urgency = "critical", + title = "Oops, an error happened" .. (startup and " during startup!" or "!"), + message = message, + }) +end) + +-- Features +-- =================================================================== +-- Load helper functions +local helpers = require("helpers") +-- Apps +apps = { + -- TODO: switchtotag not working? + browser = function() + awful.spawn(user.browser, { switchtotag = true }) + end, + file_manager = function() + awful.spawn(user.file_manager, { floating = true }) + end, + term_filemanager = function() + awful.spawn(user.term_filemanager, { floating = true }) + end, + editor = function() + helpers.run_or_raise({ instance = "editor" }, false, user.editor, { switchtotag = true }) + end, + visual_editor = function() + helpers.run_or_raise({ class = "" }, false, user.visual_editor, { switchtotag = true }) + end, + volume = function() + helpers.run_or_raise({ class = "Pavucontrol" }, true, "pavucontrol") + end, + process_monitor = function() + helpers.run_or_raise( + { instance = "bottom" }, + false, + user.terminal .. " --class bottom -e btm", + { switchtotag = true } + ) + end, + screenshot_full = function() + awful.spawn.with_shell("maim -s | swappy -f -") + end, + screenshot_clipboard = function() + awful.spawn.with_shell("maim -s | xclip -selection clipboard -t image/png") + end, + clipboard = function() + awful.spawn.with_shell("clipmenu") + end, + emoji_picker = function() + awful.spawn("rofi -show emoji") + end, +} + +-- Confuguration folder +require("themes/gruva") + +-- Keybinds and mousebinds +local keys = require("keys") + +-- Lock screen +-- Make sure to install lua-pam as described in the README or configure your +-- custom password in the 'user' section above +require("modules.lockscreen") +-- Window switcher +require("modules.window_switcher") +-- Notification center +require("modules.notification_center") + +-- Daemons +-- Most widgets that display system/external info depend on evil. +-- Make sure to initialize it last in order to allow all widgets to connect to +-- their needed evil signals. +require("evil") + +-- Get screen geometry +-- I am using a single screen setup and I assume that screen geometry will not +-- change during the session. +local screen_width = awful.screen.focused().geometry.width +local screen_height = awful.screen.focused().geometry.height + +-- Layouts +-- =================================================================== +-- Table of layouts to cover with awful.layout.inc, order matters. +awful.layout.layouts = { + awful.layout.suit.tile, + awful.layout.suit.floating, + awful.layout.suit.max, + --awful.layout.suit.spiral, + --awful.layout.suit.spiral.dwindle, + --awful.layout.suit.tile.top, + --awful.layout.suit.fair, + --awful.layout.suit.fair.horizontal, + --awful.layout.suit.tile.left, + --awful.layout.suit.tile.bottom, + --awful.layout.suit.max.fullscreen, + --awful.layout.suit.corner.nw, + --awful.layout.suit.magnifier, + --awful.layout.suit.corner.ne, + --awful.layout.suit.corner.sw, + --awful.layout.suit.corner.se, +} + +-- Wallpaper +-- =================================================================== +local function set_wallpaper(s) + if beautiful.wallpaper then + local wallpaper = beautiful.wallpaper + -- If wallpaper is a function, call it with the screen + if type(wallpaper) == "function" then + wallpaper = wallpaper(s) + end + + -- >> Method 1: Built in wallpaper function + gears.wallpaper.maximized(wallpaper, s, true) + + -- >> Method 2: Set theme's wallpaper with feh + -- awful.spawn.with_shell("feh --bg-fill " .. wallpaper) + + -- >> Method 3: Set last wallpaper with feh + -- awful.spawn.with_shell(os.getenv("HOME") .. "/.fehbg") + end +end + +-- Set wallpaper +awful.screen.connect_for_each_screen(function(s) + set_wallpaper(s) +end) + +-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) +screen.connect_signal("property::geometry", set_wallpaper) + +-- Tags +-- =================================================================== +awful.screen.connect_for_each_screen(function(s) + -- Each screen has its own tag table. + local l = awful.layout.suit -- Alias to save time :) + -- Tag layouts + local layouts = { + l.max, + l.max, + l.max, + l.max, + l.max, + l.max, + l.tile, + l.tile, + l.tile, + l.tile, + } + + -- Tag names + local tagnames = beautiful.tagnames or { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" } + -- Create all tags at once (without seperate configuration for each tag) + awful.tag(tagnames, s, layouts) + + -- Create tags with seperate configuration for each tag + -- awful.tag.add(tagnames[1], { + -- layout = layouts[1], + -- screen = s, + -- master_width_factor = 0.6, + -- selected = true, + -- }) + -- ... +end) + +-- Determines how floating clients should be placed +local floating_client_placement = function(c) + -- If the layout is floating or there are no other visible + -- clients, center client + if awful.layout.get(mouse.screen) ~= awful.layout.suit.floating or #mouse.screen.clients == 1 then + return awful.placement.centered(c, { honor_padding = true, honor_workarea = true }) + end + + -- Else use this placement + local p = awful.placement.no_overlap + awful.placement.no_offscreen + return p(c, { honor_padding = true, honor_workarea = true, margins = beautiful.useless_gap * 2 }) +end + +local centered_client_placement = function(c) + return gears.timer.delayed_call(function() + awful.placement.centered(c, { honor_padding = true, honor_workarea = true }) + end) +end + +-- Rules +-- =================================================================== +-- Rules to apply to new clients (through the "manage" signal). +awful.rules.rules = { + { + -- All clients will match this rule. + rule = {}, + properties = { + border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = awful.client.focus.filter, + raise = true, + keys = keys.clientkeys, + buttons = keys.clientbuttons, + screen = awful.screen.focused, + size_hints_honor = false, + honor_workarea = true, + honor_padding = true, + maximized = false, + titlebars_enabled = beautiful.titlebars_enabled, + maximized_horizontal = false, + maximized_vertical = false, + placement = floating_client_placement, + }, + }, + + -- Floating clients + { + rule_any = { + instance = { + "floating_terminal", + "Devtools", -- Firefox devtools + }, + class = { + "Gpick", + "Lxappearance", + "Nm-connection-editor", + "File-roller", + "fst", + "Nvidia-settings", + }, + name = { + "Event Tester", -- xev + "MetaMask Notification", + "Picture in picture", + }, + role = { + "AlarmWindow", + "pop-up", + "GtkFileChooserDialog", + "conversation", + }, + type = { + "dialog", + }, + }, + properties = { floating = true }, + }, + + -- Fullscreen clients + { + rule_any = { + class = { + "dota2", + "dontstarve_steam", + }, + instance = { + "synthetik.exe", + }, + }, + properties = { fullscreen = true }, + }, + + -- Centered clients + { + rule_any = { + type = { + "dialog", + }, + class = { + "Steam", + "discord", + "music", + "scratchpad", + }, + instance = { + "music", + "scratchpad", + }, + role = { + "GtkFileChooserDialog", + "conversation", + }, + }, + properties = { placement = centered_client_placement }, + }, + + -- Titlebars ON (explicitly) + { + rule_any = { + type = { + "dialog", + }, + role = { + "conversation", + }, + }, + callback = function(c) + decorations.show(c) + end, + }, + + -- "Needy": Clients that steal focus when they are urgent + { + rule_any = { + class = { + "TelegramDesktop", + "firefox", + "Nightly", + }, + type = { + "dialog", + }, + }, + callback = function(c) + c:connect_signal("property::urgent", function() + if c.urgent then + c:jump_to() + end + end) + end, + }, + + -- Fixed terminal geometry for floating terminals + { + rule_any = { + class = { + "Alacritty", + "Termite", + "mpvtube", + "kitty", + "st-256color", + "st", + "URxvt", + }, + }, + properties = { width = screen_width * 0.45, height = screen_height * 0.5 }, + }, + + -- File chooser dialog + { + rule_any = { role = { "GtkFileChooserDialog" } }, + properties = { floating = true, width = screen_width * 0.55, height = screen_height * 0.65 }, + }, + + -- Pavucontrol + { + rule_any = { class = { "Pavucontrol" } }, + properties = { floating = true, width = screen_width * 0.45, height = screen_height * 0.8 }, + }, + + -- Galculator + { + rule_any = { class = { "Galculator" } }, + except_any = { type = { "dialog" } }, + properties = { floating = true, width = screen_width * 0.2, height = screen_height * 0.4 }, + }, + + -- File managers + { + rule_any = { + class = { + "Pcmanfm", + "Nemo", + "Thunar", + }, + }, + except_any = { + type = { "dialog" }, + }, + properties = { floating = true, width = screen_width * 0.45, height = screen_height * 0.55 }, + }, + + -- Scratchpad + { + rule_any = { + instance = { + "scratchpad", + "markdown_input", + }, + class = { + "scratchpad", + "markdown_input", + }, + }, + properties = { + skip_taskbar = false, + floating = true, + ontop = false, + minimized = true, + sticky = false, + width = screen_width * 0.7, + height = screen_height * 0.75, + }, + }, + + -- Music clients (usually a terminal running ncmpcpp) + { + rule_any = { + class = { + "music", + }, + instance = { + "music", + }, + }, + properties = { + floating = true, + width = screen_width * 0.45, + height = screen_height * 0.50, + }, + }, + + -- Image viewers + { + rule_any = { + class = { + "feh", + "Sxiv", + }, + }, + properties = { + floating = true, + width = screen_width * 0.7, + height = screen_height * 0.75, + }, + callback = function(c) + awful.placement.centered(c, { honor_padding = true, honor_workarea = true }) + end, + }, + + -- Steam guard + { + rule = { name = "Steam Guard - Computer Authorization Required" }, + properties = { floating = true }, + -- Such a stubborn window, centering it does not work + -- callback = function(c) + -- gears.timer.delayed_call(function() + -- awful.placement.centered(c,{honor_padding = true, honor_workarea=true}) + -- end) + -- end + }, + + -- MPV + { + rule = { class = "mpv" }, + properties = {}, + callback = function(c) + -- Make it floating, ontop and move it out of the way if the current tag is maximized + if awful.layout.get(awful.screen.focused()) == awful.layout.suit.max then + c.floating = true + c.ontop = true + c.width = screen_width * 0.30 + c.height = screen_height * 0.35 + awful.placement.bottom_right(c, { + honor_padding = true, + honor_workarea = true, + margins = { bottom = beautiful.useless_gap * 2, right = beautiful.useless_gap * 2 }, + }) + end + + -- Restore `ontop` after fullscreen is disabled + -- Sorta tries to fix: https://github.com/awesomeWM/awesome/issues/667 + c:connect_signal("property::fullscreen", function() + if not c.fullscreen then + c.ontop = true + end + end) + end, + }, + + -- Start application on specific workspace + -- =================================================================== + -- Browsing + { + rule_any = { + class = { + "firefox", + "Nightly", + "Vivaldi-stable", + }, + }, + except_any = { + role = { "GtkFileChooserDialog" }, + instance = { "Toolkit" }, + type = { "dialog" }, + }, + properties = { screen = 1, tag = awful.screen.focused().tags[1] }, + }, + + -- Editing + { + rule_any = { + class = { + "^editor$", + "VSCodium", + }, + }, + properties = { screen = 1, tag = awful.screen.focused().tags[2] }, + }, + + -- Games + { + rule_any = { + class = { + "Wine", + }, + instance = {}, + }, + properties = { screen = 1, tag = awful.screen.focused().tags[3] }, + }, + + -- Chatting + { + rule_any = { + class = { + "discord", + "Signal", + "Slack", + "zoom", + }, + }, + properties = { screen = 1, tag = awful.screen.focused().tags[4] }, + }, + + -- System monitoring + { + rule_any = { + class = { + "htop", + "bottom", + }, + instance = { + "htop", + "bottom", + }, + }, + properties = { screen = 1, tag = awful.screen.focused().tags[5] }, + }, + + -- Image editing + { + rule_any = { + class = { + "Gimp", + }, + }, + properties = { screen = 1, tag = awful.screen.focused().tags[6] }, + }, + + -- Mail + { + rule_any = { + class = { + "email", + }, + instance = { + "email", + }, + }, + properties = { screen = 1, tag = awful.screen.focused().tags[7] }, + }, + + -- Game clients/launchers + { + rule_any = { + class = { + "Steam", + "battle.net.exe", + "Lutris", + }, + name = { + "Steam", + }, + }, + properties = { screen = 1, tag = awful.screen.focused().tags[8] }, + }, + + -- Miscellaneous + -- All clients that I want out of my way when they are running + { + rule_any = { + class = { + "torrent", + "Transmission", + "Deluge", + "VirtualBox Manager", + "KeePassXC", + }, + instance = { + "torrent", + "qemu", + }, + }, + except_any = { + type = { "dialog" }, + }, + properties = { screen = 1, tag = awful.screen.focused().tags[10] }, + }, +} + +-- Signals +-- =================================================================== +if beautiful.border_width > 0 then + client.connect_signal("focus", function(c) + c.border_color = beautiful.border_focus + end) + client.connect_signal("unfocus", function(c) + c.border_color = beautiful.border_normal + end) +end + +-- Set mouse resize mode (live or after) +awful.mouse.resize.set_mode("live") + +-- Restore geometry for floating clients +-- (for example after swapping from tiling mode to floating mode) +tag.connect_signal("property::layout", function(t) + for k, c in ipairs(t:clients()) do + if awful.layout.get(mouse.screen) == awful.layout.suit.floating then + local cgeo = awful.client.property.get(c, "floating_geometry") + if cgeo then + c:geometry(awful.client.property.get(c, "floating_geometry")) + end + end + end +end) + +client.connect_signal("manage", function(c) + if awful.layout.get(mouse.screen) == awful.layout.suit.floating then + awful.client.property.set(c, "floating_geometry", c:geometry()) + end +end) + +client.connect_signal("property::geometry", function(c) + if awful.layout.get(mouse.screen) == awful.layout.suit.floating then + awful.client.property.set(c, "floating_geometry", c:geometry()) + end +end) + +-- When switching to a tag with urgent clients, raise them. +-- This fixes the issue (visual mismatch) where after switching to +-- a tag which includes an urgent client, the urgent client is +-- unfocused but still covers all other windows (even the currently +-- focused window). +awful.tag.attached_connect_signal(s, "property::selected", function() + local urgent_clients = function(c) + return awful.rules.match(c, { urgent = true }) + end + for c in awful.client.iterate(urgent_clients) do + if c.first_tag == mouse.screen.selected_tag then + client.focus = c + end + end +end) + +-- Enable sloppy focus, so that focus follows mouse. +-- client.connect_signal("mouse::enter", function(c) +-- c:activate { context = "mouse_enter", raise = false } +-- end) + +-- Raise focused clients automatically +client.connect_signal("focus", function(c) + c:raise() +end) + +-- Focus all urgent clients automatically +-- client.connect_signal("property::urgent", function(c) +-- if c.urgent then +-- c.minimized = false +-- c:jump_to() +-- end +-- end) + +-- Disable ontop when the client is not floating, and restore ontop if needed +-- when the client is floating again +-- I never want a non floating client to be ontop. +client.connect_signal("property::floating", function(c) + if c.floating then + if c.restore_ontop then + c.ontop = c.restore_ontop + end + else + c.restore_ontop = c.ontop + c.ontop = false + end +end) + +-- Hide all windows when a splash is shown +awesome.connect_signal("widgets::splash::visibility", function(vis) + local t = screen.primary.selected_tag + if vis then + for idx, c in ipairs(t:clients()) do + c.hidden = true + end + else + for idx, c in ipairs(t:clients()) do + c.hidden = false + end + end +end) + +-- Decorations +-- =================================================================== +local wibox = require("wibox") +-- Apply rounded corners to clients if needed +if beautiful.border_radius and beautiful.border_radius > 0 then + client.connect_signal("manage", function(c, startup) + if not c.fullscreen and not c.maximized then + c.shape = helpers.rrect(beautiful.border_radius) + end + end) + + -- Fullscreen and maximized clients should not have rounded corners + local function no_round_corners(c) + if c.fullscreen or c.maximized then + c.shape = gears.shape.rectangle + else + c.shape = helpers.rrect(beautiful.border_radius) + end + end + + client.connect_signal("property::fullscreen", no_round_corners) + client.connect_signal("property::maximized", no_round_corners) + + beautiful.snap_shape = helpers.rrect(beautiful.border_radius * 2) +else + beautiful.snap_shape = gears.shape.rectangle +end + +function decorations.show(c) + if not c.custom_decoration or not c.custom_decoration[beautiful.titlebar_position] then + awful.titlebar.show(c, beautiful.titlebar_position) + end +end + +-- Dummy titlebar +client.connect_signal("request::titlebars", function(c) + awful.titlebar(c) +end) + +-- Startup apps +-- =================================================================== +-- Spawn once +-- awful.spawn.once({}, false) +-- With shell +-- awful.spawn.with_shell({}, false) + +-- Garbage collection +-- =================================================================== +collectgarbage("setpause", 110) +collectgarbage("setstepmul", 1000) diff --git a/modules/home-manager/ricing/awesomewm/gruv/themes/gruva/init.lua b/modules/home-manager/ricing/awesomewm/gruv/themes/gruva/init.lua new file mode 100644 index 0000000..a8d0027 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/themes/gruva/init.lua @@ -0,0 +1,733 @@ +-- ░█▀▀░█▀█░█▀█░█▀▀░▀█▀░█▀▀░█░█░█▀▄░█▀█░▀█▀░▀█▀░█▀█░█▀█ +-- ░█░░░█░█░█░█░█▀▀░░█░░█░█░█░█░█▀▄░█▀█░░█░░░█░░█░█░█░█ +-- ░▀▀▀░▀▀▀░▀░▀░▀░░░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░▀░░▀░░▀▀▀░▀▀▀░▀░▀ + +local gears = require("gears") +local awful = require("awful") +local wibox = require("wibox") +local beautiful = require("beautiful") +local naughty = require("naughty") +local menubar = require("menubar") +local keys = require("keys") +local helpers = require("helpers") +local awesome = awesome +local client = client + +-- ░█░█░▀█▀░█▀▄░█▀▀░█▀▀░▀█▀░█▀▀ +-- ░█▄█░░█░░█░█░█░█░█▀▀░░█░░▀▀█ +-- ░▀░▀░▀▀▀░▀▀░░▀▀▀░▀▀▀░░▀░░▀▀▀ + +-- Memory widget +-- =================================================================== +local memory_widget = wibox.widget({ + { + { + { + { + id = "icon", + text = "", + forced_width = dpi(30), + align = "center", + valign = "center", + font = beautiful.wibar_icon_font, + widget = wibox.widget.textbox, + }, + -- fixing font centering + right = dpi(3), + widget = wibox.container.margin, + }, + bg = beautiful.darkblue, + fg = beautiful.light_bg, + widget = wibox.widget.background, + }, + { + { + id = "text", + font = beautiful.wibar_font, + widget = wibox.widget.textbox, + }, + left = dpi(5), + right = dpi(5), + widget = wibox.container.margin, + }, + layout = wibox.layout.fixed.horizontal, + }, + fg = beautiful.light_bg, + bg = beautiful.blue, + widget = wibox.container.background, +}) + +awesome.connect_signal("evil::ram", function(used, total) + memory_widget:get_children_by_id("text")[1].markup = tostring(used) .. " MB" +end) + +-- Clock widget +-- =================================================================== +local clock_widget = wibox.widget({ + { + { + { + { + id = "icon", + text = "󱑆", + forced_width = dpi(30), + align = "center", + valign = "center", + font = beautiful.wibar_icon_font, + widget = wibox.widget.textbox, + }, + -- fixing font centering + right = dpi(3), + widget = wibox.container.margin, + }, + bg = beautiful.darkgreen, + fg = beautiful.light_bg, + widget = wibox.widget.background, + }, + { + { + id = "text", + format = "%a %b %d - %I:%M %p", + font = beautiful.wibar_font, + widget = wibox.widget.textclock, + }, + left = dpi(5), + right = dpi(5), + widget = wibox.container.margin, + }, + layout = wibox.layout.fixed.horizontal, + }, + fg = beautiful.light_bg, + bg = beautiful.green, + widget = wibox.container.background, +}) + +-- CPU widget +-- =================================================================== +local cpu_widget = wibox.widget({ + { + { + { + { + id = "icon", + text = "", + forced_width = dpi(30), + align = "center", + valign = "center", + font = beautiful.wibar_icon_font, + widget = wibox.widget.textbox, + }, + -- fixing font centering + right = dpi(5), + widget = wibox.container.margin, + }, + bg = beautiful.cyan, + fg = beautiful.light_bg, + widget = wibox.widget.background, + }, + { + { + id = "text", + font = beautiful.wibar_font, + widget = wibox.widget.textbox, + }, + left = dpi(5), + right = dpi(5), + widget = wibox.container.margin, + }, + layout = wibox.layout.fixed.horizontal, + }, + fg = beautiful.cyan, + bg = beautiful.light_bg, + widget = wibox.container.background, +}) + +awesome.connect_signal("evil::cpu", function(cpu_idle) + cpu_widget:get_children_by_id("text")[1].markup = tostring(cpu_idle) .. "%" +end) + +-- Weather widget +-- =================================================================== +local weather_widget = wibox.widget({ + { + { + { + id = "icon", + text = "", + forced_width = dpi(30), + align = "center", + valign = "center", + font = beautiful.wibar_icon_font, + widget = wibox.widget.textbox, + }, + bg = beautiful.magenta, + fg = beautiful.light_bg, + widget = wibox.widget.background, + }, + { + { + { + id = "description", + font = beautiful.wibar_font, + widget = wibox.widget.textbox, + }, + nil, + { + id = "temp_current", + align = "right", + font = beautiful.wibar_font, + widget = wibox.widget.textbox, + }, + widget = wibox.layout.align.horizontal, + }, + left = dpi(5), + right = dpi(5), + widget = wibox.container.margin, + }, + layout = wibox.layout.fixed.horizontal, + }, + fg = beautiful.magenta, + bg = beautiful.light_bg, + widget = wibox.container.background, +}) + +awesome.connect_signal("evil::weather", function(result) + weather_widget:get_children_by_id("description")[1].markup = result.current.weather[1].description:gsub( + "^%l", + string.upper + ) .. ", " + weather_widget:get_children_by_id("temp_current")[1].markup = math.floor(result.current.temp) + .. "°C" +end) + +-- Playerctl widget +-- =================================================================== +local playerctl_widget = wibox.widget({ + { + { + { + id = "icon", + text = "󰎈", + forced_width = dpi(30), + align = "center", + valign = "center", + font = beautiful.wibar_icon_font, + widget = wibox.widget.textbox, + }, + bg = beautiful.red, + fg = beautiful.light_bg, + widget = wibox.widget.background, + }, + { + { + id = "text", + text = "Not Playing", + font = beautiful.wibar_font, + align = "center", + forced_width = dpi(100), + widget = wibox.widget.textbox, + }, + left = dpi(10), + right = dpi(10), + widget = wibox.container.margin, + }, + layout = wibox.layout.fixed.horizontal, + }, + fg = beautiful.red, + bg = beautiful.light_bg, + widget = wibox.container.background, +}) + +awesome.connect_signal("evil::playerctl", function(artist, title, status) + playerctl_widget:get_children_by_id("text")[1].markup = title +end) + +playerctl_widget:buttons(gears.table.join( + -- left click = all players + awful.button({}, 1, function() + awful.spawn.with_shell("playerctl play-pause") + end) + -- right click = specific player + -- awful.button({}, 3, function() + -- awful.spawn.with_shell("mpvc toggle") + -- end) +)) + +-- Volume bar widget +-- =================================================================== +local volume_bar = wibox.widget({ + max_value = 100, + value = 70, + forced_width = dpi(100), + shape = helpers.rrect(dpi(6)), + bar_shape = helpers.rrect(dpi(6)), + color = beautiful.bg_focus, + background_color = beautiful.light_bg, + widget = wibox.widget.progressbar, +}) + +awesome.connect_signal("evil::volume", function(volume, muted) + volume_bar.value = volume + + if muted then + volume_bar.color = beautiful.light_bg + else + volume_bar.color = beautiful.bg_focus + end +end) + +-- Battery bar widget +-- =================================================================== +local battery_bar = wibox.widget({ + max_value = 100, + value = 50, + forced_width = dpi(100), + shape = helpers.rrect(dpi(6)), + bar_shape = helpers.rrect(dpi(6)), + color = beautiful.bg_focus, + background_color = beautiful.light_bg, + widget = wibox.widget.progressbar, +}) + +awesome.connect_signal("evil::battery", function(value) + battery_bar.value = value +end) + +-- Osd +-- =================================================================== +local slider = wibox.widget({ + widget = wibox.widget.progressbar, + max_value = 100, + forced_width = dpi(380), + forced_height = dpi(10), + shape = gears.shape.rounded_bar, + bar_shape = gears.shape.rounded_bar, + background_color = beautiful.light_bg, + color = beautiful.bg_focus, +}) + +local icon_widget = wibox.widget({ + widget = wibox.widget.textbox, + font = beautiful.icon_font_name .. "15", + forced_width = dpi(30), + align = "center", + valign = "center", +}) + +local text = wibox.widget({ + widget = wibox.widget.textbox, + halign = "center", +}) + +local info = wibox.widget({ + layout = wibox.layout.fixed.horizontal, + { + widget = wibox.container.margin, + margins = dpi(20), + { + layout = wibox.layout.fixed.horizontal, + fill_space = true, + spacing = dpi(8), + icon_widget, + { + widget = wibox.container.background, + forced_width = dpi(36), + text, + }, + slider, + }, + }, +}) + +local osd = awful.popup({ + shape = helpers.rrect(beautiful.border_radius), + visible = false, + ontop = true, + border_width = beautiful.widget_border_width, + border_color = beautiful.widget_border_color, + minimum_height = dpi(60), + maximum_height = dpi(60), + minimum_width = dpi(290), + maximum_width = dpi(290), + placement = function(c) + awful.placement.bottom(c, { margins = dpi(20) + beautiful.border_width * 2 }) + end, + widget = info, +}) + +-- volume +awesome.connect_signal("evil::volume", function(volume, muted, icon) + slider.value = volume + text.text = volume + icon_widget.text = icon +end) + +-- bright +awesome.connect_signal("evil::brightness", function(value) + slider.value = value + text.text = value + icon_widget.text = "󰃟" +end) + +-- function +local function osd_hide() + osd.visible = false + osd_timer:stop() +end + +local osd_timer = gears.timer({ + timeout = 3, + callback = osd_hide, +}) + +local function osd_toggle() + if not osd.visible then + osd.visible = true + osd_timer:start() + else + osd_timer:again() + end +end + +awesome.connect_signal("summon::osd", function() + osd_toggle() +end) + +-- ░█░█░▀█▀░█▀▄░█▀█░█▀▄ +-- ░█▄█░░█░░█▀▄░█▀█░█▀▄ +-- ░▀░▀░▀▀▀░▀▀░░▀░▀░▀░▀ +-- Create a wibox for each screen and add it +awful.screen.connect_for_each_screen(function(s) + -- Create a promptbox for each screen + s.mypromptbox = awful.widget.prompt({ prompt = " Run: ", fg = beautiful.wibar_fg }) + -- Create an imagebox widget which will contain an icon indicating which layout we're using. + -- We need one layoutbox per screen. + s.mylayoutbox = { + widget = wibox.container.place, + awful.widget.layoutbox({ + screen = s, + resize = true, + forced_width = dpi(15), + forced_height = dpi(15), + widget = wibox.container.place, + -- Add buttons, allowing you to change the layout + 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), + }, + }), + } + + -- Create a taglist widget + -- Helper function that updates a taglist item + local update_taglist = function(self, tag, index) + local tagBox = self:get_children_by_id("underline")[1] + local tagName = self:get_children_by_id("index_role")[1] + if tag.selected then + tagName.markup = helpers.colorize_text( + beautiful.taglist_text_focused[index], + beautiful.taglist_text_color_focused[index] + ) + tagBox.bg = beautiful.taglist_text_color_occupied[index] + elseif tag.urgent then + tagName.markup = + helpers.colorize_text(beautiful.taglist_text_urgent[index], beautiful.taglist_text_color_urgent[index]) + tagBox.bg = beautiful.wibar_bg + elseif #tag:clients() > 0 then + tagName.markup = helpers.colorize_text( + beautiful.taglist_text_occupied[index], + beautiful.taglist_text_color_occupied[index] + ) + tagBox.bg = beautiful.wibar_bg + else + tagName.markup = + helpers.colorize_text(beautiful.taglist_text_empty[index], beautiful.taglist_text_color_empty[index]) + tagBox.bg = beautiful.wibar_bg + end + end + + s.mytaglist = awful.widget.taglist({ + screen = s, + filter = awful.widget.taglist.filter.all, + layout = wibox.layout.fixed.horizontal, + buttons = keys.taglist_buttons, + widget_template = { + { + { + layout = wibox.layout.fixed.vertical, + { + { + id = "index_role", + font = beautiful.taglist_text_font, + align = "center", + valign = "center", + forced_width = dpi(24), + widget = wibox.widget.textbox, + }, + top = dpi(0), + right = dpi(4), + bottom = dpi(-1), + widget = wibox.container.margin, + }, + { + { + top = dpi(0), + bottom = dpi(3), + widget = wibox.container.margin, + }, + id = "underline", + bg = beautiful.wibar_bg, + shape = gears.shape.rectangle, + widget = wibox.container.background, + }, + }, + widget = wibox.container.margin, + right = dpi(4), + }, + id = "background_role", + widget = wibox.container.background, + shape = gears.shape.rectangle, + create_callback = update_taglist, + update_callback = update_taglist, + }, + }) + + -- Create a tasklist widget + s.mytasklist = awful.widget.tasklist({ + screen = s, + filter = awful.widget.tasklist.filter.currenttags, + buttons = keys.tasklist_buttons, + style = { + font = beautiful.tasklist_font, + bg = beautiful.tasklist_bg_normal, + }, + layout = { + spacing = dpi(4), + -- layout = wibox.layout.fixed.horizontal + layout = wibox.layout.flex.horizontal, + }, + widget_template = { + { + { + { + { + id = "icon_role", + widget = wibox.widget.imagebox, + }, + margins = dpi(2), + widget = wibox.container.margin, + }, + { + id = "text_role", + widget = wibox.widget.textbox, + }, + layout = wibox.layout.fixed.horizontal, + }, + forced_width = dpi(220), + left = dpi(10), + right = dpi(10), + widget = wibox.container.margin, + }, + -- border_width = dpi(2), + -- shape = gears.shape.rounded_bar, + -- id = "bg_role", + id = "background_role", + widget = wibox.container.background, + }, + }) + + -- Create a system tray widget + s.systray = wibox.widget.systray() + s.systray.visible = true -- can be toggled by a keybind + + -- Create the wibox + s.mywibox = awful.wibar({ + position = beautiful.wibar_position, + screen = s, + type = "dock", + width = beautiful.wibar_width, + height = beautiful.wibar_height, + shape = helpers.rrect(beautiful.wibar_border_radius), + }) + + s.mywibox:setup({ + { + { + s.mytaglist, + s.mytasklist, + align = "left", + spacing = dpi(10), + layout = wibox.layout.fixed.horizontal, + }, + { + s.mypromptbox, + playerctl_widget, + -- volume_bar, + -- battery_bar, + align = "center", + spacing = dpi(10), + layout = wibox.layout.fixed.horizontal, + }, + { + weather_widget, + memory_widget, + cpu_widget, + clock_widget, + s.systray, + s.mylayoutbox, + align = "right", + spacing = dpi(10), + layout = wibox.layout.fixed.horizontal, + }, + expand = "none", + layout = wibox.layout.align.horizontal, + }, + top = dpi(3), + bottom = dpi(3), + left = dpi(3), + right = dpi(3), + widget = wibox.container.margin, + }) + + -- Place bar at the top and add margins + awful.placement.top(s.mywibox, { margins = beautiful.screen_margin * 0 }) -- No margin +end) + +-- ░█▀█░█▀█░▀█▀░▀█▀░█▀█░█▀█░█▀▀ +-- ░█░█░█▀▀░░█░░░█░░█░█░█░█░▀▀█ +-- ░▀▀▀░▀░░░░▀░░▀▀▀░▀▀▀░▀░▀░▀▀▀ + +-- Notification settings +-- =================================================================== +-- Handle notification icon +naughty.connect_signal("request::icon", function(n, context, hints) + -- Handle other contexts here + if context ~= "app_icon" then + n.icon = beautiful.awesome_icon + return + end + + -- Use XDG icon + local path = menubar.utils.lookup_icon(hints.app_icon) or menubar.utils.lookup_icon(hints.app_icon:lower()) + + if path then + n.icon = path + end +end) + +naughty.connect_signal("request::display", function(n) + naughty.layout.box({ + notification = n, + type = "notification", + cursor = "hand1", + shape = beautiful.notification_shape, + maximum_width = beautiful.notification_max_width, + maximum_height = beautiful.notification_max_height, + widget_template = { + widget = wibox.container.constraint, + strategy = "max", + { + widget = naughty.container.background, + id = "background_role", + { + widget = wibox.container.margin, + margins = dpi(10), + { + layout = wibox.layout.fixed.horizontal, + spacing = dpi(20), + fill_space = true, + { + widget = wibox.container.place, + { + widget = wibox.container.background, + shape = gears.shape.circle, + naughty.widget.icon, + }, + }, + { + layout = wibox.layout.fixed.vertical, + spacing = dpi(10), + naughty.widget.title, + naughty.widget.message, + }, + }, + }, + }, + }, + }) +end) + +-- Titlebar +-- =================================================================== +client.connect_signal("request::titlebars", function(c) + local titlebar = awful.titlebar(c, { + position = beautiful.titlebar_position, + size = beautiful.titlebar_size, + }) + + local buttons = gears.table.join( + awful.button({}, 1, function() + client.focus = c + c:raise() + awful.mouse.client.move(c) + end), + awful.button({}, 3, function() + client.focus = c + c:raise() + awful.mouse.client.resize(c) + end) + ) + + titlebar.widget = { + layout = wibox.layout.flex.horizontal, + -- { + -- widget = wibox.container.place, + -- align = "left", + -- { + -- widget = wibox.container.margin, + -- margins = { left = dpi(10), right = dpi(10) top = dpi(8), bottom = dpi(8) }, + -- { + -- layout = wibox.layout.fixed.horizontal, + -- spacing = 8, + -- awful.titlebar.widget.maximizedbutton(c), + -- awful.titlebar.widget.minimizebutton(c), + -- awful.titlebar.widget.closebutton(c), + -- }, + -- }, + -- }, + { + widget = wibox.container.background, + buttons = buttons, + { + widget = wibox.container.margin, + left = dpi(10), + right = dpi(10), + { + widget = wibox.container.constraint, + width = dpi(100), + { + align = beautiful.titlebar_title_align, + widget = awful.titlebar.widget.titlewidget(c), + }, + }, + }, + }, + } +end) + +-- Startup apps +-- =================================================================== +-- awful.spawn.once({},false) +-- With shell +-- awful.spawn.with_shell({}, false) +-- EOF ------------------------------------------------------------------------ diff --git a/modules/home-manager/ricing/awesomewm/gruv/themes/gruva/theme.lua b/modules/home-manager/ricing/awesomewm/gruv/themes/gruva/theme.lua new file mode 100644 index 0000000..1d49387 --- /dev/null +++ b/modules/home-manager/ricing/awesomewm/gruv/themes/gruva/theme.lua @@ -0,0 +1,309 @@ +-- ░▀█▀░█░█░█▀▀░█▄█░█▀▀ +-- ░░█░░█▀█░█▀▀░█░█░█▀▀ +-- ░░▀░░▀░▀░▀▀▀░▀░▀░▀▀▀ + +local theme_assets = require("beautiful.theme_assets") +local xresources = require("beautiful.xresources") +local dpi = xresources.apply_dpi +local xrdb = xresources.get_current_theme() +local gears = require("gears") +local gfs = require("gears.filesystem") +local helpers = require("helpers") +local rnotification = require("ruled.notification") +local themes_path = gfs.get_themes_dir() +local theme = {} + +-- Default wallpaper +theme.wallpaper = os.getenv("HOME") .. "/Pictures/wall.png" + +-- ░█▀▀░█▀█░█▀█░▀█▀░█▀▀ +-- ░█▀▀░█░█░█░█░░█░░▀▀█ +-- ░▀░░░▀▀▀░▀░▀░░▀░░▀▀▀ + +theme.font_name = "monospace " +theme.font = theme.font_name .. "10" +theme.wibar_font = theme.font_name .. "Bold 10" +theme.icon_font_name = "monospace " +theme.wibar_icon_font = theme.font_name .. "12" + +-- ░█▀▀░█▀█░█░░░█▀█░█▀▄░█▀▀ +-- ░█░░░█░█░█░░░█░█░█▀▄░▀▀█ +-- ░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀ + +-- Colors +theme.black = xrdb.color0 +theme.black_alt = xrdb.color8 +theme.red = xrdb.color1 +theme.darkred = helpers.lighten(theme.red, -10) +theme.green = xrdb.color2 +theme.darkgreen = helpers.lighten(theme.green, -10) +theme.yellow = xrdb.color3 +theme.darkyellow = helpers.lighten(theme.yellow, -10) +theme.blue = xrdb.color4 +theme.darkblue = helpers.lighten(theme.blue, -10) +theme.magenta = xrdb.color5 +theme.darkmagenta = helpers.lighten(theme.magenta, -10) +theme.cyan = xrdb.color6 +theme.darkcyan = helpers.lighten(theme.cyan, -10) +theme.white = xrdb.color7 +theme.white_alt = xrdb.color15 +theme.light_bg = helpers.lighten(theme.black, 5) +theme.transparent = "#00000000" + +-- Background Colors +theme.bg_normal = theme.black +theme.bg_focus = theme.blue +theme.bg_urgent = theme.red +theme.bg_minimize = theme.black + +-- Foreground Colors +theme.fg_normal = theme.white +theme.fg_focus = theme.black +theme.fg_urgent = theme.white +theme.fg_minimize = theme.black_alt + +--- ░█░█░▀█▀░░░█▀▀░█░░░█▀▀░█▄█░█▀▀░█▀█░▀█▀░█▀▀ +--- ░█░█░░█░░░░█▀▀░█░░░█▀▀░█░█░█▀▀░█░█░░█░░▀▀█ +--- ░▀▀▀░▀▀▀░░░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀░▀░░▀░░▀▀▀ + +-- Borders +-- =================================================================== +theme.border_width = dpi(3) +theme.border_normal = theme.light_bg +theme.border_focus = theme.blue +theme.border_radius = dpi(15) +theme.widget_border_width = dpi(2) +theme.widget_border_color = theme.light_bg + +-- Wibar +-- =================================================================== +theme.wibar_position = "top" +theme.wibar_height = dpi(27) +theme.wibar_width = dpi(1366) +theme.wibar_bg = theme.black +theme.wibar_fg = theme.white +theme.wibar_border_color = theme.black +theme.wibar_border_width = dpi(0) +theme.wibar_border_radius = dpi(0) + +-- Taglist +-- =================================================================== +theme.taglist_text_font = theme.wibar_ico_font +theme.taglist_text_empty = { "", "", "", "", "", "", "[]=", "", "", "" } +theme.taglist_text_occupied = { "", "", "", "", "", "", "[]=", "", "", "" } +theme.taglist_text_focused = { "", "", "", "", "", "", "[]=", "", "", "" } +theme.taglist_text_urgent = { "", "", "", "", "", "", "", "", "", "" } + +theme.taglist_text_color_empty = { + theme.black_alt, + theme.black_alt, + theme.black_alt, + theme.black_alt, + theme.black_alt, + theme.black_alt, + theme.black_alt, + theme.black_alt, + theme.black_alt, + theme.black_alt, +} +theme.taglist_text_color_occupied = { + theme.blue, + theme.green, + theme.yellow, + theme.red, + theme.cyan, + theme.magenta, + theme.cyan, + theme.cyan, + theme.cyan, + theme.cyan, +} +theme.taglist_text_color_focused = { + theme.blue, + theme.green, + theme.yellow, + theme.red, + theme.cyan, + theme.magenta, + theme.cyan, + theme.cyan, + theme.cyan, + theme.cyan, +} +theme.taglist_text_color_urgent = { + theme.blue, + theme.green, + theme.yellow, + theme.red, + theme.cyan, + theme.magenta, + theme.cyan, + theme.cyan, + theme.cyan, + theme.cyan, +} + +-- Text Taglist (default) +theme.taglist_font = theme.wibar_font +theme.taglist_bg_focus = theme.wibar_bg +theme.taglist_fg_focus = theme.fg_focus +theme.taglist_bg_occupied = theme.wibar_bg +theme.taglist_fg_occupied = theme.fg_normal +theme.taglist_bg_empty = theme.wibar_bg +theme.taglist_fg_empty = theme.black_alt +theme.taglist_bg_urgent = theme.wibar_bg +theme.taglist_fg_urgent = theme.fg_urgent +theme.taglist_disable_icon = true +theme.taglist_spacing = dpi(0) +local taglist_square_size = dpi(0) +theme.taglist_squares_sel = theme_assets.taglist_squares_sel(taglist_square_size, theme.fg_focus) +theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(taglist_square_size, theme.fg_normal) + +-- Tasklist +-- =================================================================== +theme.tasklist_font = theme.font +theme.tasklist_disable_icon = false +theme.tasklist_plain_task_name = true +theme.tasklist_bg_focus = theme.wibar_bg +theme.tasklist_fg_focus = theme.fg_normal +theme.tasklist_bg_normal = theme.wibar_bg +theme.tasklist_fg_normal = theme.black_alt +theme.tasklist_bg_minimize = theme.bg_minimize +theme.tasklist_fg_minimize = theme.fg_minimize +theme.tasklist_bg_urgent = theme.bg_urgent +theme.tasklist_fg_urgent = theme.fg_urgent +theme.tasklist_align = "left" + +--- Titlebar +-- =================================================================== +theme.titlebars_enabled = false +theme.titlebar_size = dpi(32) +theme.titlebar_title_enabled = true +theme.titlebar_font = theme.font +theme.titlebar_title_align = "right" +theme.titlebar_position = "top" +theme.titlebar_bg = theme.bg_normal +-- theme.titlebar_bg_focus = theme.bg_focus +-- theme.titlebar_bg_normal = theme.bg_normal +-- theme.titlebar_fg = theme.fg_normal +-- theme.titlebar_fg_focus = theme.fg_focus +-- theme.titlebar_fg_normal = theme.fg_normal + +-- Menu +-- Variables set for theming the menu: +-- =================================================================== +theme.menu_height = dpi(30) +theme.menu_width = dpi(150) +theme.menu_bg_normal = theme.bg_normal +theme.menu_fg_normal = theme.fg_normal +theme.menu_bg_focus = theme.bg_focus +theme.menu_fg_focus = theme.fg_focus +theme.menu_border_width = theme.widget_border_width +theme.menu_border_color = theme.widget_border_color + +-- Gaps +-- =================================================================== +theme.useless_gap = dpi(8) +theme.screen_margin = dpi(3) + +-- Systray +-- =================================================================== +theme.bg_systray = theme.wibar_bg + +-- Notifications +-- =================================================================== +theme.notification_font = theme.font +theme.notification_bg = theme.bg_normal +theme.notification_fg = theme.fg_normal +theme.notification_border_width = theme.widget_border_width +theme.notification_border_color = theme.widget_border_color +theme.notification_max_width = dpi(300) +theme.notification_max_height = dpi(190) +theme.notification_position = "top_right" +theme.notification_border_radius = theme.border_radius +theme.notification_spacing = theme.screen_margin * 2 +theme.notification_shape = helpers.rrect(theme.notification_border_radius) + +-- Set different colors for notifications. +rnotification.connect_signal("request::rules", function() + rnotification.append_rule({ + rule = { urgency = "critical" }, + properties = { + implicit_timeout = 4, + bg = theme.bg_urgent, + fg = theme.fg_urgent, + font = theme.notification_font, + position = theme.notification_position, + border_color = theme.notification_border_color, + margin = theme.notification_margin, + }, + }) + rnotification.append_rule({ + rule = { urgency = "normal" }, + properties = { + implicit_timeout = 4, + bg = theme.bg_normal, + fg = theme.fg_normal, + font = theme.notification_font, + position = theme.notification_position, + border_color = theme.notification_border_color, + margin = theme.notification_margin, + }, + }) + rnotification.append_rule({ + rule = { urgency = "low" }, + properties = { + implicit_timeout = 4, + bg = theme.bg_normal, + fg = theme.fg_normal, + font = theme.notification_font, + position = theme.notification_position, + border_color = theme.notification_border_color, + margin = theme.notification_margin, + }, + }) +end) + +-- Layout icons +-- =================================================================== +theme.layout_max = themes_path .. "default/layouts/maxw.png" +theme.layout_tile = themes_path .. "default/layouts/tilew.png" +theme.layout_floating = themes_path .. "default/layouts/floatingw.png" +-- not in use layouts +theme.layout_cornernw = themes_path .. "default/layouts/cornernww.png" +theme.layout_cornerne = themes_path .. "default/layouts/cornernew.png" +theme.layout_cornersw = themes_path .. "default/layouts/cornersww.png" +theme.layout_cornerse = themes_path .. "default/layouts/cornersew.png" +theme.layout_fairh = themes_path .. "default/layouts/fairhw.png" +theme.layout_fairv = themes_path .. "default/layouts/fairvw.png" +theme.layout_magnifier = themes_path .. "default/layouts/magnifierw.png" +theme.layout_fullscreen = themes_path .. "default/layouts/fullscreenw.png" +theme.layout_spiral = themes_path .. "default/layouts/spiralw.png" +theme.layout_dwindle = themes_path .. "default/layouts/dwindlew.png" +theme.layout_tiletop = themes_path .. "default/layouts/tiletopw.png" +theme.layout_tilebottom = themes_path .. "default/layouts/tilebottomw.png" +theme.layout_tileleft = themes_path .. "default/layouts/tileleftw.png" +-- Recolor layout icons +theme = theme_assets.recolor_layout(theme, theme.red) +-- Layoutlist +theme.layoutlist_shape_selected = gears.shape.rounded_rect +theme.layoutlist_bg_selected = theme.bg_focus + +-- Misc +-- =================================================================== +-- Edge snap +theme.snap_bg = theme.light_bg +theme.snap_shape = helpers.rrect(theme.border_radius) +theme.snap_border_width = theme.widget_border_width + +-- Hotkeys popup +theme.hotkeys_modifiers_fg = theme.blue + +-- Generate Awesome icon: +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. +theme.icon_theme = nil + +return theme +-- EOF ------------------------------------------------------------------------ diff --git a/modules/home-manager/ricing/default.nix b/modules/home-manager/ricing/default.nix index f7d0f2f..1f3ddbf 100644 --- a/modules/home-manager/ricing/default.nix +++ b/modules/home-manager/ricing/default.nix @@ -3,6 +3,8 @@ { imports = [ ./awesomewm + ./hyprland + ./rofi ]; # GTK theming @@ -16,4 +18,11 @@ qt.platformTheme = "gtk"; qt.style.name = "adwaita-dark"; qt.style.package = pkgs.adwaita-qt; + + programs.yazi.enable = true; + + home.packages = with pkgs; [ + pcmanfm + bottom + ]; } \ No newline at end of file diff --git a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-clear-night.jpg b/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-clear-night.jpg deleted file mode 100644 index a5a36c2..0000000 Binary files a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-clear-night.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-clear-sky.jpg b/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-clear-sky.jpg deleted file mode 100644 index 799b4dc..0000000 Binary files a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-clear-sky.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-clouds-night.jpg b/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-clouds-night.jpg deleted file mode 100644 index 8d2c696..0000000 Binary files a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-clouds-night.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-fog.jpg b/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-fog.jpg deleted file mode 100644 index 925eb08..0000000 Binary files a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-fog.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-showers-scattered.jpg b/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-showers-scattered.jpg deleted file mode 100644 index 41439b9..0000000 Binary files a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-showers-scattered.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-showers.jpg b/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-showers.jpg deleted file mode 100644 index e6f942e..0000000 Binary files a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-showers.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-snow.jpg b/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-snow.jpg deleted file mode 100644 index a579d1c..0000000 Binary files a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-snow.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-stroms.jpg b/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-stroms.jpg deleted file mode 100644 index 83fb291..0000000 Binary files a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-stroms.jpg and /dev/null differ diff --git a/modules/home-manager/ricing/hyprland/eww/assets/empty-notification.png b/modules/home-manager/ricing/hyprland/eww/config/assets/empty-notification.png similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/assets/empty-notification.png rename to modules/home-manager/ricing/hyprland/eww/config/assets/empty-notification.png diff --git a/modules/home-manager/ricing/hyprland/eww/assets/fullpfp.png b/modules/home-manager/ricing/hyprland/eww/config/assets/fullpfp.png similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/assets/fullpfp.png rename to modules/home-manager/ricing/hyprland/eww/config/assets/fullpfp.png diff --git a/modules/home-manager/ricing/hyprland/eww/assets/pfp.png b/modules/home-manager/ricing/hyprland/eww/config/assets/pfp.png similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/assets/pfp.png rename to modules/home-manager/ricing/hyprland/eww/config/assets/pfp.png diff --git a/modules/home-manager/ricing/hyprland/eww/assets/snoo.png b/modules/home-manager/ricing/hyprland/eww/config/assets/snoo.png similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/assets/snoo.png rename to modules/home-manager/ricing/hyprland/eww/config/assets/snoo.png diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-clear-night.jpg b/modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-clear-night.jpg similarity index 100% rename from modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-clear-night.jpg rename to modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-clear-night.jpg diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-clear-sky.jpg b/modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-clear-sky.jpg similarity index 100% rename from modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-clear-sky.jpg rename to modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-clear-sky.jpg diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-clouds-night.jpg b/modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-clouds-night.jpg similarity index 100% rename from modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-clouds-night.jpg rename to modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-clouds-night.jpg diff --git a/modules/home-manager/ricing/hyprland/eww/assets/weather/weather-clouds.jpg b/modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-clouds.jpg similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/assets/weather/weather-clouds.jpg rename to modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-clouds.jpg diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-fog.jpg b/modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-fog.jpg similarity index 100% rename from modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-fog.jpg rename to modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-fog.jpg diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-showers-scattered.jpg b/modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-showers-scattered.jpg similarity index 100% rename from modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-showers-scattered.jpg rename to modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-showers-scattered.jpg diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-showers.jpg b/modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-showers.jpg similarity index 100% rename from modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-showers.jpg rename to modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-showers.jpg diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-snow.jpg b/modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-snow.jpg similarity index 100% rename from modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-snow.jpg rename to modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-snow.jpg diff --git a/modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-stroms.jpg b/modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-stroms.jpg similarity index 100% rename from modules/home-manager/ricing/awesomewm/dotfiles/theme/assets/weather/images/weather-stroms.jpg rename to modules/home-manager/ricing/hyprland/eww/config/assets/weather/weather-stroms.jpg diff --git a/modules/home-manager/ricing/hyprland/eww/eww.scss b/modules/home-manager/ricing/hyprland/eww/config/eww.scss similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/eww.scss rename to modules/home-manager/ricing/hyprland/eww/config/eww.scss diff --git a/modules/home-manager/ricing/hyprland/eww/eww.yuck b/modules/home-manager/ricing/hyprland/eww/config/eww.yuck similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/eww.yuck rename to modules/home-manager/ricing/hyprland/eww/config/eww.yuck diff --git a/modules/home-manager/ricing/hyprland/eww/scripts/ap.sh b/modules/home-manager/ricing/hyprland/eww/config/scripts/ap.sh similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/scripts/ap.sh rename to modules/home-manager/ricing/hyprland/eww/config/scripts/ap.sh diff --git a/modules/home-manager/ricing/hyprland/eww/scripts/bat.sh b/modules/home-manager/ricing/hyprland/eww/config/scripts/bat.sh similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/scripts/bat.sh rename to modules/home-manager/ricing/hyprland/eww/config/scripts/bat.sh diff --git a/modules/home-manager/ricing/hyprland/eww/scripts/bl.sh b/modules/home-manager/ricing/hyprland/eww/config/scripts/bl.sh similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/scripts/bl.sh rename to modules/home-manager/ricing/hyprland/eww/config/scripts/bl.sh diff --git a/modules/home-manager/ricing/hyprland/eww/scripts/cpu.sh b/modules/home-manager/ricing/hyprland/eww/config/scripts/cpu.sh similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/scripts/cpu.sh rename to modules/home-manager/ricing/hyprland/eww/config/scripts/cpu.sh diff --git a/modules/home-manager/ricing/hyprland/eww/scripts/dnd.sh b/modules/home-manager/ricing/hyprland/eww/config/scripts/dnd.sh similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/scripts/dnd.sh rename to modules/home-manager/ricing/hyprland/eww/config/scripts/dnd.sh diff --git a/modules/home-manager/ricing/hyprland/eww/scripts/ms.sh b/modules/home-manager/ricing/hyprland/eww/config/scripts/ms.sh similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/scripts/ms.sh rename to modules/home-manager/ricing/hyprland/eww/config/scripts/ms.sh diff --git a/modules/home-manager/ricing/hyprland/eww/scripts/notification_logger.zsh b/modules/home-manager/ricing/hyprland/eww/config/scripts/notification_logger.zsh similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/scripts/notification_logger.zsh rename to modules/home-manager/ricing/hyprland/eww/config/scripts/notification_logger.zsh diff --git a/modules/home-manager/ricing/hyprland/eww/scripts/weathercopy.sh b/modules/home-manager/ricing/hyprland/eww/config/scripts/weathercopy.sh similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/scripts/weathercopy.sh rename to modules/home-manager/ricing/hyprland/eww/config/scripts/weathercopy.sh diff --git a/modules/home-manager/ricing/hyprland/eww/scripts/wifi.sh b/modules/home-manager/ricing/hyprland/eww/config/scripts/wifi.sh similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/scripts/wifi.sh rename to modules/home-manager/ricing/hyprland/eww/config/scripts/wifi.sh diff --git a/modules/home-manager/ricing/hyprland/eww/scripts/ws.sh b/modules/home-manager/ricing/hyprland/eww/config/scripts/ws.sh similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/scripts/ws.sh rename to modules/home-manager/ricing/hyprland/eww/config/scripts/ws.sh diff --git a/modules/home-manager/ricing/hyprland/eww/style/bar/_init.scss b/modules/home-manager/ricing/hyprland/eww/config/style/bar/_init.scss similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/style/bar/_init.scss rename to modules/home-manager/ricing/hyprland/eww/config/style/bar/_init.scss diff --git a/modules/home-manager/ricing/hyprland/eww/style/control/_init.scss b/modules/home-manager/ricing/hyprland/eww/config/style/control/_init.scss similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/style/control/_init.scss rename to modules/home-manager/ricing/hyprland/eww/config/style/control/_init.scss diff --git a/modules/home-manager/ricing/hyprland/eww/style/dash/_init.scss b/modules/home-manager/ricing/hyprland/eww/config/style/dash/_init.scss similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/style/dash/_init.scss rename to modules/home-manager/ricing/hyprland/eww/config/style/dash/_init.scss diff --git a/modules/home-manager/ricing/hyprland/eww/style/moment/_init.scss b/modules/home-manager/ricing/hyprland/eww/config/style/moment/_init.scss similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/style/moment/_init.scss rename to modules/home-manager/ricing/hyprland/eww/config/style/moment/_init.scss diff --git a/modules/home-manager/ricing/hyprland/eww/yuck/_vars.yuck b/modules/home-manager/ricing/hyprland/eww/config/yuck/_vars.yuck similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/yuck/_vars.yuck rename to modules/home-manager/ricing/hyprland/eww/config/yuck/_vars.yuck diff --git a/modules/home-manager/ricing/hyprland/eww/yuck/bar/_init.yuck b/modules/home-manager/ricing/hyprland/eww/config/yuck/bar/_init.yuck similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/yuck/bar/_init.yuck rename to modules/home-manager/ricing/hyprland/eww/config/yuck/bar/_init.yuck diff --git a/modules/home-manager/ricing/hyprland/eww/yuck/control/_init.yuck b/modules/home-manager/ricing/hyprland/eww/config/yuck/control/_init.yuck similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/yuck/control/_init.yuck rename to modules/home-manager/ricing/hyprland/eww/config/yuck/control/_init.yuck diff --git a/modules/home-manager/ricing/hyprland/eww/yuck/dash/_init.yuck b/modules/home-manager/ricing/hyprland/eww/config/yuck/dash/_init.yuck similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/yuck/dash/_init.yuck rename to modules/home-manager/ricing/hyprland/eww/config/yuck/dash/_init.yuck diff --git a/modules/home-manager/ricing/hyprland/eww/yuck/moment/_init.yuck b/modules/home-manager/ricing/hyprland/eww/config/yuck/moment/_init.yuck similarity index 100% rename from modules/home-manager/ricing/hyprland/eww/yuck/moment/_init.yuck rename to modules/home-manager/ricing/hyprland/eww/config/yuck/moment/_init.yuck diff --git a/modules/home-manager/ricing/hyprland/eww/default.nix b/modules/home-manager/ricing/hyprland/eww/default.nix index 8cc2b2c..33b1dba 100644 --- a/modules/home-manager/ricing/hyprland/eww/default.nix +++ b/modules/home-manager/ricing/hyprland/eww/default.nix @@ -1,7 +1,9 @@ { pkgs, ... }: { - home.packages = [ - pkgs.eww - ]; + + programs.eww = { + configDir = ./config; + enable = true; + }; } \ No newline at end of file diff --git a/modules/home-manager/ricing/rofi/config/config.rasi b/modules/home-manager/ricing/rofi/config/config.rasi new file mode 100644 index 0000000..e334821 --- /dev/null +++ b/modules/home-manager/ricing/rofi/config/config.rasi @@ -0,0 +1,199 @@ +* { +active: #b8bb26ff; +active-background: var(active); +active-foreground: var(background); +alternate-active-background: var(active); +alternate-active-foreground: var(background); +alternate-background: var(background-alt); +alternate-normal-background: var(background-alt); +alternate-normal-foreground: var(foreground); +alternate-urgent-background: var(urgent); +alternate-urgent-foreground: var(background); +background: #282828ff; +background-alt: #3c3836ff; +background-colour: var(background); +border-colour: var(selected); +font: "monospace bold 10"; +foreground: #d5c4a1ff; +foreground-colour: var(foreground); +handle-colour: var(selected); +normal-background: var(background-alt); +normal-foreground: var(foreground); +selected: #83a598ff; +selected-active-background: var(urgent); +selected-active-foreground: var(background); +selected-normal-background: var(selected); +selected-normal-foreground: var(background); +selected-urgent-background: var(active); +selected-urgent-foreground: var(background); +urgent: #fb4934ff; +urgent-background: var(urgent); +urgent-foreground: var(background); +} + +configuration { +display-clipboard: ">"; +display-combi: ">"; +display-drun: ">"; +display-emoji: ">"; +drun-display-format: "{name}"; +modi: "drun,combi,emoji"; +show-icons: false; +window-format: "{w} · {c} · {t}"; +} + +element { +background-color: transparent; +border: 0px solid; +border-color: @border-colour; +border-radius: 0px; +cursor: pointer; +enabled: true; +margin: 0px; +padding: 12px; +spacing: 10px; +text-color: @foreground-colour; +} + +element alternate.active { +background-color: var(alternate-active-background); +text-color: var(alternate-active-foreground); +} + +element alternate.normal { +background-color: var(alternate-normal-background); +text-color: var(alternate-normal-foreground); +} + +element alternate.urgent { +background-color: var(alternate-urgent-background); +text-color: var(alternate-urgent-foreground); +} + +element normal.active { +background-color: var(active-background); +text-color: var(active-foreground); +} + +element normal.normal { +background-color: var(normal-background); +text-color: var(normal-foreground); +} + +element normal.urgent { +background-color: var(urgent-background); +text-color: var(urgent-foreground); +} + +element selected.active { +background-color: var(selected-active-background); +text-color: var(selected-active-foreground); +} + +element selected.normal { +background-color: var(selected-normal-background); +text-color: var(selected-normal-foreground); +} + +element selected.urgent { +background-color: var(selected-urgent-background); +text-color: var(selected-urgent-foreground); +} + +element-icon { +background-color: transparent; +cursor: inherit; +size: 24px; +text-color: inherit; +} + +element-text { +background-color: transparent; +cursor: inherit; +highlight: inherit; +horizontal-align: 0.0; +text-color: inherit; +vertical-align: 0.5; +} + +entry { +background-color: inherit; +cursor: text; +enabled: true; +margin: 8px 0px 0px 14px; +placeholder: "Search..."; +placeholder-color: inherit; +text-color: inherit; +} + +inputbar { +background-color: @background-colour; +border: 0px; +border-color: @border-colour; +border-radius: 0px; +children: [ prompt, entry ]; +enabled: true; +margin: 0px; +padding: 0px 0px 6px 0px; +spacing: 10px; +text-color: @foreground-colour; +} + +listview { +background-color: transparent; +border: 0px solid; +border-color: @border-colour; +border-radius: 0px; +columns: 1; +cursor: "default"; +cycle: true; +dynamic: true; +enabled: true; +fixed-columns: true; +fixed-height: true; +layout: vertical; +lines: 7; +margin: 0px; +padding: 0px; +reverse: false; +scrollbar: false; +spacing: 10px; +text-color: @foreground-colour; +} + +mainbox { +background-color: transparent; +border: 0px solid; +border-color: @border-colour; +border-radius: 0px 0px 0px 0px; +children: [ inputbar, listview]; +enabled: true; +margin: 0px; +padding: 10px; +spacing: 10px; +} + +prompt { +background-color: @background-alt; +enabled: true; +padding: 2px 14px 4px 14px; +text-color: inherit; +} + +window { +anchor: center; +background-color: @background-colour; +border: 2px solid; +border-color: @border-colour; +border-radius: 0px; +cursor: "default"; +enabled: true; +fullscreen: false; +location: center; +margin: 0px; +padding: 0px; +transparency: "real"; +width: 420px; +x-offset: 0px; +y-offset: 0px; +} \ No newline at end of file diff --git a/modules/home-manager/ricing/rofi/default.nix b/modules/home-manager/ricing/rofi/default.nix new file mode 100644 index 0000000..f8a09d5 --- /dev/null +++ b/modules/home-manager/ricing/rofi/default.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: + +{ + home.packages = with pkgs; [ + rofi + rofi-emoji + ]; + + home.file.".config" = { + recursive = true; + source = ./config; + }; +} \ No newline at end of file diff --git a/modules/home-manager/terminal/wezterm/colors.nix b/modules/home-manager/terminal/wezterm/colors.nix new file mode 100644 index 0000000..c0af943 --- /dev/null +++ b/modules/home-manager/terminal/wezterm/colors.nix @@ -0,0 +1,48 @@ +{ ... }: + +{ + programs.wezterm.colorSchemes = { + ansi = [ + "282828" "fb4934" "b8bb26" "fabd2f" + "83a598" "d3869b" "8ec07c" "d5c4a1" + ]; + + background = "282828"; + + brights = [ + "665c54" "fb4934" "b8bb26" "fabd2f" + "83a598" "d3869b" "8ec07c" "fbf1c7" + ]; + + cursor_bg = "d5c4a1"; + cursor_fg = "282828"; + foreground = "d5c4a1"; + selection_bg = "d5c4a1"; + selection_fg = "282828"; + + tab_bar = { + background = "282828"; + inactive_tab_edge = "282828"; + + active_tab = { + bg_color = "83a598"; + fg_color = "d5c4a1"; + }; + + inactive_tab = { + bg_color = "282828"; + fg_color = "d5c4a1"; + }; + + new_tab = { + bg_color = "282828"; + fg_color = "83a598"; + }; + + new_tab_hover = { + bg_color = "282828"; + fg_color = "d5c4a1"; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/home-manager/terminal/wezterm/config.nix b/modules/home-manager/terminal/wezterm/config.nix new file mode 100644 index 0000000..0b05374 --- /dev/null +++ b/modules/home-manager/terminal/wezterm/config.nix @@ -0,0 +1,107 @@ +{ pkgs, ... }: + +{ + programs.wezterm.extraConfig = '' + -- ~/.config/wezterm/wezterm.lua +-- See https://wezfurlong.org/wezterm/ + +-- Add config folder to watchlist for config reloads. +local wezterm = require 'wezterm'; +wezterm.add_to_config_reload_watch_list(wezterm.config_dir) + +function font_with_fallback(name, params) + local names = { name, "emoji" } + return wezterm.font_with_fallback(names, params) +end + +local font_name = "monospace" + +return { + -- Font config + font = font_with_fallback(font_name), + font_rules = { + { + italic = true, + font = font_with_fallback(font_name, { italic = true }) + }, + { + italic = true, + intensity = "Bold", + font = font_with_fallback(font_name, { bold = true, italic = true }) + }, + { + intensity = "Bold", + font = font_with_fallback(font_name, { bold = true }) + } + }, + font_size = 10, + line_height = 1.0, + default_cursor_style = "SteadyUnderline", + + -- Keys + disable_default_key_bindings = true, + keys = { + { + mods = "CTRL|SHIFT", + key = [[\]], + action = wezterm.action { + SplitHorizontal = { domain = "CurrentPaneDomain" } + } + }, + { + mods = "CTRL", + key = [[\]], + action = wezterm.action { + SplitVertical = { domain = "CurrentPaneDomain" } + } + }, + { + key = "t", + mods = "CTRL", + action = wezterm.action { SpawnTab = "CurrentPaneDomain" } + }, + { + key = "w", + mods = "CTRL", + action = wezterm.action { CloseCurrentTab = { confirm = false } } + }, + { + mods = "CTRL", + key = "Tab", + action = wezterm.action { ActivateTabRelative = 1 } + }, + { + mods = "CTRL|SHIFT", + key = "Tab", + action = wezterm.action { ActivateTabRelative = -1 } + }, + { key = "x", mods = "CTRL", action = "ActivateCopyMode" }, + { + key = "v", + mods = "CTRL|SHIFT", + action = wezterm.action { PasteFrom = "Clipboard" } + }, + { + key = "c", + mods = "CTRL|SHIFT", + action = wezterm.action { CopyTo = "ClipboardAndPrimarySelection" } + }, + { + key = "L", + mods = "CTRL", + action = wezterm.action.ShowDebugOverlay + } + }, + front_end = "WebGpu", + enable_wayland = true, + check_for_updates = false, + color_scheme = "gruvbox-dark-medium", + window_padding = { left = "30pt", right = "30pt", top = "30pt", bottom = "30pt" }, + inactive_pane_hsb = { saturation = 1.0, brightness = 1.0 }, + enable_tab_bar = true, + use_fancy_tab_bar = false, + hide_tab_bar_if_only_one_tab = true, + show_tab_index_in_tab_bar = false, +} + ''; +} \ No newline at end of file diff --git a/modules/home-manager/terminal/wezterm/default.nix b/modules/home-manager/terminal/wezterm/default.nix index 9a635ac..4aef248 100644 --- a/modules/home-manager/terminal/wezterm/default.nix +++ b/modules/home-manager/terminal/wezterm/default.nix @@ -1,7 +1,12 @@ { pkgs, ... }: { - home.packages = [ - pkgs.wezterm + + imports = [ + ./colors.nix ]; + + programs.wezterm = { + enable = true; + }; } \ No newline at end of file diff --git a/modules/ricing/default.nix b/modules/ricing/default.nix index a39e3be..dcdc5ae 100644 --- a/modules/ricing/default.nix +++ b/modules/ricing/default.nix @@ -2,7 +2,6 @@ { imports = [ - ./stylix ]; environment.systemPackages = with pkgs; [ diff --git a/modules/system/bluetooth/default.nix b/modules/system/bluetooth/default.nix index b297d0f..1bfbbd8 100644 --- a/modules/system/bluetooth/default.nix +++ b/modules/system/bluetooth/default.nix @@ -4,4 +4,7 @@ # Enable bluetooth hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = true; + + # Enable blueman + services.blueman.enable = true; } \ No newline at end of file diff --git a/modules/system/default.nix b/modules/system/default.nix index 68b2d1e..a27df08 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -23,6 +23,7 @@ enableDefaultPackages = true; packages = with pkgs; [ noto-fonts + noto-fonts-color-emoji nerdfonts font-awesome ];