refactor: dotfiles

This commit is contained in:
rxyhn 2022-03-06 20:04:04 +07:00
parent 6e0748bb60
commit 2975984d23
28 changed files with 146 additions and 224 deletions

View file

@ -17,12 +17,6 @@ bling.module.tiled_wallpaper("", s, {
zickzack = true
})
-- Enable Playerctl Module from Bling
playerctl = bling.signal.playerctl.lib {
ignore = {"firefox", "qutebrowser", "chromium", "brave"},
update_on_activity = true
}
-- Enable Tag Preview Module from Bling
bling.widget.tag_preview.enable {
show_client_content = false,

View file

@ -22,7 +22,7 @@ require("module.better-resize")
client.connect_signal("request::manage", function(c)
if not c.icon then
local i = gears.surface(gfs.get_configuration_dir() ..
"assets/icons/awesome.png")
"theme/assets/icons/awesome.png")
c.icon = i._native
end

View file

@ -4,4 +4,5 @@ require("signal.volume")
require("signal.cpu")
require("signal.ram")
require("signal.todo")
require("signal.weather")
require("signal.weather")
require("signal.playerctl")

View file

@ -0,0 +1,11 @@
-- Notification handling library
local naughty = require("naughty")
-- Playerctl
local playerctl = require("module.bling").signal.playerctl.lib()
playerctl:connect_signal("metadata", function(_, title, artist, album_path, album, new, player_name)
if new == true then
naughty.notify({title = title, text = artist, image = album_path})
end
end)

View file

Before

Width:  |  Height:  |  Size: 403 B

After

Width:  |  Height:  |  Size: 403 B

View file

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#d9d7d6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevrons-right"><polyline points="13 17 18 12 13 7"></polyline><polyline points="6 17 11 12 6 7"></polyline></svg>

After

Width:  |  Height:  |  Size: 313 B

View file

Before

Width:  |  Height:  |  Size: 519 B

After

Width:  |  Height:  |  Size: 519 B

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 508 B

After

Width:  |  Height:  |  Size: 508 B

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 634 B

After

Width:  |  Height:  |  Size: 634 B

View file

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 238 B

View file

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 208 B

View file

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 208 B

View file

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 208 B

View file

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 208 B

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -39,20 +39,20 @@ theme.lighter_bg = "#162026"
theme.dash_fg = "#666c79"
-- Titlebar
local icon_path = gfs.get_configuration_dir() .. "assets/icons/"
local icon_path = gfs.get_configuration_dir() .. "theme/assets/icons/"
local titlebar_icon_dir = icon_path .. "titlebar/"
-- PFP
theme.pfp = gears.surface.load_uncached(gfs.get_configuration_dir() .. "assets/images/pfp.png")
theme.pfp = gears.surface.load_uncached(gfs.get_configuration_dir() .. "theme/assets/pfp.png")
-- Wallpaper
theme.wallpaper = gears.surface.load_uncached(gfs.get_configuration_dir() .. "assets/images/bg.png")
theme.wallpaper = gears.surface.load_uncached(gfs.get_configuration_dir() .. "theme/assets/bg.png")
-- Awesome Logo
theme.awesome_logo = gears.surface.load_uncached(gfs.get_configuration_dir() .. "assets/icons/awesome.png")
theme.awesome_logo = gears.surface.load_uncached(gfs.get_configuration_dir() .. "theme/assets/icons/awesome.png")
-- Notifications icon
theme.notification_icon = gears.surface.load_uncached(gfs.get_configuration_dir() .. "assets/icons/notification.png")
theme.notification_icon = gears.surface.load_uncached(gfs.get_configuration_dir() .. "theme/assets/icons/notification.png")
-- Fonts
theme.font_name = "Iosevka "
@ -144,6 +144,14 @@ theme.titlebar_maximized_button_focus_inactive = titlebar_icon_dir .. "maximize
theme.titlebar_maximized_button_normal_active = titlebar_icon_dir .. "default.svg"
theme.titlebar_maximized_button_focus_active = titlebar_icon_dir .. "maximized.svg"
-- Pop up notifications
theme.pop_size = dpi(180)
theme.pop_bg = theme.xbackground
theme.pop_bar_bg = theme.xcolor0
theme.pop_vol_color = theme.xcolor4
theme.pop_brightness_color = theme.xcolor3
theme.pop_fg = theme.xforeground
theme.pop_border_radius = dpi(6)
-- Edge snap
theme.snap_bg = theme.xcolor8
@ -172,7 +180,7 @@ theme.menu_bg_focus = theme.lighter_bg
theme.menu_fg_focus = theme.xforeground
theme.menu_bg_normal = theme.xbackground
theme.menu_fg_normal = theme.xforeground
theme.menu_submenu_icon = gears.filesystem.get_configuration_dir() .. "assets/icons/submenu.png"
theme.menu_submenu_icon = gears.filesystem.get_configuration_dir() .. "theme/assets/icons/submenu.svg"
theme.menu_height = dpi(20)
theme.menu_width = dpi(130)
theme.menu_border_color = theme.xcolor8

View file

@ -24,7 +24,7 @@ local music_text = wibox.widget{
}
local music_art = wibox.widget {
image = gears.filesystem.get_configuration_dir() .. "assets/images/no_music.png",
image = gears.filesystem.get_configuration_dir() .. "theme/assets/no_music.png",
resize = true,
widget = wibox.widget.imagebox
}

View file

@ -1,88 +0,0 @@
local wibox = require("wibox")
local awful = require("awful")
local gears = require("gears")
local beautiful = require("beautiful")
local helpers = require("helpers")
local dpi = beautiful.xresources.apply_dpi
local width = dpi(50)
local height = dpi(300)
local active_color_1 = {
type = 'linear',
from = {0, 0},
to = {200, 50}, -- replace with w,h later
stops = {{0, beautiful.xcolor6}, {0.50, beautiful.xcolor4}}
}
local bright_icon = wibox.widget {
markup = "<span foreground='" .. beautiful.xcolor4 .. "'><b></b></span>",
align = 'center',
valign = 'center',
font = beautiful.font_name .. '25',
widget = wibox.widget.textbox
}
local bright_adjust = awful.popup({
type = "notification",
maximum_width = width,
maximum_height = height,
visible = false,
ontop = true,
widget = wibox.container.background,
bg = "#00000000",
placement = function(c)
awful.placement
.right(c, {margins = {right = beautiful.useless_gap * 2}})
end
})
local bright_bar = wibox.widget {
bar_shape = gears.shape.rectangle,
shape = gears.shape.rounded_rect,
background_color = beautiful.lighter_bg,
color = active_color_1,
max_value = 100,
value = 0,
widget = wibox.widget.progressbar
}
local bright_ratio = wibox.widget {
layout = wibox.layout.ratio.vertical,
{
{bright_bar, direction = "east", widget = wibox.container.rotate},
top = dpi(20),
left = dpi(20),
right = dpi(20),
widget = wibox.container.margin
},
bright_icon,
nil
}
bright_ratio:adjust_ratio(2, 0.72, 0.28, 0)
bright_adjust.widget = wibox.widget {
bright_ratio,
shape = helpers.rrect(beautiful.border_radius),
bg = beautiful.xbackground,
widget = wibox.container.background
}
-- create a 3 second timer to hide the volume adjust
-- component whenever the timer is started
local hide_bright_adjust = gears.timer {
timeout = 3,
autostart = true,
callback = function() bright_adjust.visible = false end
}
awesome.connect_signal("signal::brightness", function(value)
bright_bar.value = value
if bright_adjust.visible then
hide_bright_adjust:again()
else
bright_adjust.visible = true
hide_bright_adjust:start()
end
end)

View file

@ -19,9 +19,7 @@ naughty.connect_signal("request::icon", function(n, context, hints)
end)
require("ui.notifs.brightness")
require("ui.notifs.playerctl")
require("ui.notifs.volume")
require("ui.notifs.popup")
require("ui.notifs.notifications-center")
naughty.config.defaults.ontop = true

View file

@ -1,8 +0,0 @@
local naughty = require("naughty")
playerctl:connect_signal("metadata",
function(title, artist, album_path, album, new, player_name)
if new == true then
naughty.notify({title = title, text = artist, image = album_path})
end
end)

View file

@ -0,0 +1,104 @@
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
-- Theme handling library
local beautiful = require("beautiful")
local dpi = beautiful.xresources.apply_dpi
-- Widget library
local wibox = require("wibox")
-- Helpers
local helpers = require("helpers")
-- Pop up
------------
local pop_icon = wibox.widget{
font = beautiful.icon_font_name .. "Round 48",
align = "center",
widget = wibox.widget.textbox
}
local pop_bar = wibox.widget {
max_value = 100,
value = 0,
background_color = beautiful.pop_bar_bg,
color = beautiful.bg_accent,
shape = gears.shape.rounded_bar,
bar_shape = gears.shape.rounded_bar,
forced_height = dpi(5),
widget = wibox.widget.progressbar
}
local pop = wibox({
type = "dock",
screen = screen.focused,
height = beautiful.pop_size,
width = beautiful.pop_size,
shape = helpers.rrect(beautiful.pop_border_radius - 1),
bg = beautiful.transparent,
ontop = true,
visible = false
})
pop:setup {
{
{
{
helpers.vertical_pad(dpi(10)),
pop_icon,
layout = wibox.layout.fixed.vertical
},
nil,
pop_bar,
layout = wibox.layout.align.vertical
},
margins = dpi(30),
widget = wibox.container.margin
},
bg = beautiful.xbackground,
shape = helpers.rrect(beautiful.pop_border_radius),
widget = wibox.container.background
}
awful.placement.bottom(pop, {margins = {bottom = dpi(100)}})
local pop_timeout = gears.timer {
timeout = 1.4,
autostart = true,
callback = function()
pop.visible = false
end
}
local function toggle_pop()
if pop.visible then
pop_timeout:again()
else
pop.visible = true
pop_timeout:start()
end
end
awesome.connect_signal("signal::volume", function(value, muted)
pop_icon.markup = ""
pop_bar.value = value
if muted then
pop_bar.color = beautiful.xcolor8
else
pop_bar.color = beautiful.pop_vol_color
end
toggle_pop()
end)
awesome.connect_signal("signal::brightness", function(value)
pop_icon.markup = ""
pop_bar.value = value
pop_bar.color = beautiful.pop_brightness_color
toggle_pop()
end)

View file

@ -1,100 +0,0 @@
local wibox = require("wibox")
local awful = require("awful")
local gears = require("gears")
local beautiful = require("beautiful")
local helpers = require("helpers")
local dpi = beautiful.xresources.apply_dpi
local width = dpi(50)
local height = dpi(300)
local active_color_1 = {
type = 'linear',
from = {0, 0},
to = {200, 50}, -- replace with w,h later
stops = {{0, beautiful.xcolor6}, {0.50, beautiful.xcolor4}}
}
local volume_icon = wibox.widget {
markup = "<span foreground='" .. beautiful.xcolor4 .. "'><b></b></span>",
align = 'center',
valign = 'center',
font = beautiful.font_name .. '25',
widget = wibox.widget.textbox
}
local volume_adjust = awful.popup({
type = "notification",
maximum_width = width,
maximum_height = height,
visible = false,
ontop = true,
widget = wibox.container.background,
bg = "#00000000",
placement = function(c)
awful.placement
.right(c, {margins = {right = beautiful.useless_gap * 2}})
end
})
local volume_bar = wibox.widget {
bar_shape = gears.shape.rectangle,
shape = gears.shape.rounded_rect,
background_color = beautiful.lighter_bg,
color = active_color_1,
max_value = 100,
value = 0,
widget = wibox.widget.progressbar
}
local volume_ratio = wibox.widget {
layout = wibox.layout.ratio.vertical,
{
{volume_bar, direction = "east", widget = wibox.container.rotate},
top = dpi(20),
left = dpi(20),
right = dpi(20),
widget = wibox.container.margin
},
volume_icon,
nil
}
volume_ratio:adjust_ratio(2, 0.72, 0.28, 0)
volume_adjust.widget = wibox.widget {
volume_ratio,
shape = helpers.rrect(beautiful.border_radius),
bg = beautiful.xbackground,
widget = wibox.container.background
}
-- create a 3 second timer to hide the volume adjust
-- component whenever the timer is started
local hide_volume_adjust = gears.timer {
timeout = 3,
autostart = true,
callback = function()
volume_adjust.visible = false
volume_bar.mouse_enter = false
end
}
awesome.connect_signal("signal::volume", function(vol, muted)
volume_bar.value = vol
if muted or vol == 0 then
volume_icon.markup = "<span foreground='" .. beautiful.xcolor4 ..
"'><b>ﳌ</b></span>"
else
volume_icon.markup = "<span foreground='" .. beautiful.xcolor4 ..
"'><b></b></span>"
end
if volume_adjust.visible then
hide_volume_adjust:again()
else
volume_adjust.visible = true
hide_volume_adjust:start()
end
end)

View file

@ -25,15 +25,15 @@ local get_taglist = function(s)
-- The actual png icons
-- I do have the svgs, but inkscape does a better job of scaling
local ghost = gears.surface.load_uncached(
gfs.get_configuration_dir() .. "assets/icons/taglist/ghost.png")
gfs.get_configuration_dir() .. "theme/assets/icons/taglist/ghost.png")
local ghost_icon = gears.color.recolor_image(ghost, beautiful.xcolor6)
local dot = gears.surface.load_uncached(
gfs.get_configuration_dir() .. "assets/icons/taglist/dot.png")
gfs.get_configuration_dir() .. "theme/assets/icons/taglist/dot.png")
local dot_icon = gears.color.recolor_image(dot, beautiful.xcolor8)
local pacman = gears.surface.load_uncached(
gfs.get_configuration_dir() .. "assets/icons/taglist/pacman.png")
gfs.get_configuration_dir() .. "theme/assets/icons/taglist/pacman.png")
local pacman_icon = gears.color.recolor_image(pacman, beautiful.xcolor3)
-- Function to update the tags

View file

@ -1,10 +1,11 @@
# Shadows
shadow = true;
shadow-radius = 14;
shadow-opacity = 0.7;
shadow-offset-x = -12;
shadow-offset-y = -12;
shadow = true;
shadow-radius = 20;
shadow-spread = 10;
shadow-offset-x = -20;
shadow-offset-y = -20;
shadow-opacity = 1.8;
shadow-exclude = [
"class_g = 'Synapse'",
"class_g = 'slop'",
@ -25,7 +26,7 @@ no-fading-destroyed-argb = true;
# Corners
corner-radius = 3
# corner-radius = 3
rounded-corners-exclude = [
"name *= 'screenkey'",
"window_type = 'dock'",
@ -70,7 +71,7 @@ wintypes:
normal = { fade = true; full-shadow = true; };
tooltip = { fade = true; };
menu = { fade = true; };
popup_menu = { fade = true; shadow = false; };
popup_menu = { fade = true; full-shadow = true; };
dropdown_menu = { fade = true; };
utility = { fade = true; };
dialog = { fade = true; };