aboutsummaryrefslogtreecommitdiff
path: root/.config/awesome/ui/decorations
diff options
context:
space:
mode:
authordelta <darkussdelta@gmail.com>2023-03-04 22:04:55 +0100
committerdelta <darkussdelta@gmail.com>2023-03-04 22:18:21 +0100
commitf0b32f45746c026d402651013b7e98315d6956a1 (patch)
treef42609e98522da081cebdd21a674a702d1054bbc /.config/awesome/ui/decorations
parenta0f8b5fa6acdd1c2477fb1881dd9067956bf0ae6 (diff)
restructure awesome config, add fresnel
Diffstat (limited to '.config/awesome/ui/decorations')
-rw-r--r--.config/awesome/ui/decorations/init.lua2
-rw-r--r--.config/awesome/ui/decorations/titlebar.lua84
-rw-r--r--.config/awesome/ui/decorations/wallpaper.lua28
3 files changed, 114 insertions, 0 deletions
diff --git a/.config/awesome/ui/decorations/init.lua b/.config/awesome/ui/decorations/init.lua
new file mode 100644
index 0000000..9493a67
--- /dev/null
+++ b/.config/awesome/ui/decorations/init.lua
@@ -0,0 +1,2 @@
+require "ui.decorations.titlebar"
+require "ui.decorations.wallpaper"
diff --git a/.config/awesome/ui/decorations/titlebar.lua b/.config/awesome/ui/decorations/titlebar.lua
new file mode 100644
index 0000000..8451817
--- /dev/null
+++ b/.config/awesome/ui/decorations/titlebar.lua
@@ -0,0 +1,84 @@
+local awful = require "awful"
+local vars = require "misc.vars"
+local gears = require "gears"
+local wibox = require "wibox"
+local rubato = require "lib.rubato"
+local cfg = require "misc.cfg"
+
+local function button(color, color_focus, callback)
+ local widget = wibox.widget {
+ widget = wibox.container.background,
+ forced_height = vars.button_size,
+ forced_width = vars.button_size,
+ bg = color,
+ shape = vars.shape,
+ buttons = { callback }
+ }
+
+ widget:connect_signal("mouse::enter", function()
+ local timed = rubato.timed {
+ duration = 0.1,
+ intro = 0.05,
+ pos = vars.button_size,
+ subscribed = function(pos)
+ widget.forced_width = pos
+ end
+ }
+
+ timed.target = vars.button_size * 2
+ widget.bg = color_focus
+ end)
+
+ widget:connect_signal("mouse::leave", function()
+ local timed = rubato.timed {
+ duration = 0.1,
+ intro = 0.05,
+ pos = vars.button_size * 2,
+ subscribed = function(pos)
+ widget.forced_width = pos
+ end
+ }
+
+ timed.target = vars.button_size
+ widget.bg = color
+ end)
+
+ return widget
+end
+
+client.connect_signal("request::titlebars", function(c)
+ if not cfg.draw_titlebar then return end
+
+ local titlebar = awful.titlebar(c, {
+ position = "top",
+ size = vars.button_size + vars.padding * 2
+ })
+
+ awful.titlebar.enable_tooltip = false
+
+ titlebar.widget = {
+ widget = wibox.container.margin,
+ margins = vars.padding,
+ {
+ nil,
+ nil,
+ {
+ button(vars.colors.green, vars.colors.bright.green, awful.button({}, 1, function()
+ c.maximized = not c.maximized
+ end)),
+ button(vars.colors.yellow, vars.colors.bright.yellow, awful.button({}, 1, function()
+ gears.timer.delayed_call(function()
+ c.minimized = true
+ end)
+ end)),
+ button(vars.colors.red, vars.colors.bright.red, awful.button({}, 1, function()
+ c:kill()
+ end)),
+
+ spacing = vars.padding,
+ layout = wibox.layout.fixed.horizontal
+ },
+ layout = wibox.layout.align.horizontal
+ }
+ }
+end)
diff --git a/.config/awesome/ui/decorations/wallpaper.lua b/.config/awesome/ui/decorations/wallpaper.lua
new file mode 100644
index 0000000..f7104ff
--- /dev/null
+++ b/.config/awesome/ui/decorations/wallpaper.lua
@@ -0,0 +1,28 @@
+local wallpaper = require "awful.wallpaper"
+local wibox = require "wibox"
+local vars = require "misc.vars"
+local h = require "misc.helpers"
+
+screen.connect_signal("request::wallpaper", function(s)
+ wallpaper {
+ bg = vars.colors.dim.bg,
+ screen = s,
+ widget = {
+ widget = wibox.container.place,
+ valign = "center",
+ halign = "center",
+ {
+ widget = wibox.widget.textbox,
+ font = h.font(1.5),
+ markup = table.concat({
+ h.markup_fg(vars.colors.red, " ___"),
+ h.markup_fg(vars.colors.green, " /\\ \\"),
+ h.markup_fg(vars.colors.yellow, " /::\\ \\"),
+ h.markup_fg(vars.colors.blue, "/::\\:\\__\\"),
+ h.markup_fg(vars.colors.pink, "\\/\\::/ /"),
+ h.markup_fg(vars.colors.cyan, " \\/__/")
+ }, "\n")
+ }
+ }
+ }
+end)