This commit is contained in:
root
2021-11-18 19:30:30 +01:00
parent 5a9012fcb2
commit 7f28224bf1
51 changed files with 1632 additions and 433 deletions

View File

@@ -8,6 +8,7 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/audio/"
@@ -98,43 +99,15 @@ return function ()
end
-- Signals
local old_wibox, old_cursor, old_bg
audio_widget:connect_signal(
"mouse::enter",
function ()
old_bg = audio_widget.bg
audio_widget.bg = color.color["Yellow200"] .. "dd"
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = "hand1"
end
end
)
hover_signal(audio_widget, color.color["Yellow200"])
audio_widget:connect_signal(
"button::press",
function ()
awesome.emit_signal("widget::volume")
awesome.emit_signal("module::volume_osd:show", true)
audio_widget.bg = color.color["Yellow200"] .. "bb"
end
)
audio_widget:connect_signal(
"button::release",
function ()
audio_widget.bg = color.color["Yellow200"] .. "dd"
end
)
audio_widget:connect_signal(
"mouse::leave",
function ()
audio_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
awesome.emit_signal("module::slider:update")
awesome.emit_signal("widget::volume_osd:rerun")
end
)

View File

@@ -10,6 +10,7 @@ local gears = require("gears")
local naughty = require("naughty")
local watch = awful.widget.watch
local wibox = require("wibox")
require("Main.Signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/battery/"
@@ -165,45 +166,7 @@ return function ()
)
end
local old_wibox, old_cursor, old_bg
battery_widget:connect_signal(
"mouse::enter",
function ()
old_bg = battery_widget.bg
battery_widget.bg = color.color["Purple200"] .. "dd"
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = "hand1"
end
end
)
-- Signals
battery_widget:connect_signal(
"button::press",
function ()
battery_widget.bg = color.color["Purple200"] .. "bb"
end
)
battery_widget:connect_signal(
"button::release",
function ()
battery_widget.bg = color.color["Purple200"] .. "dd"
end
)
battery_widget:connect_signal(
"mouse::leave",
function ()
battery_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end
)
hover_signal(battery_widget, color.color["Purple200"])
battery_widget:connect_signal(
'button::press',

View File

@@ -8,6 +8,7 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/bluetooth/"
@@ -90,44 +91,7 @@ return function ()
}
-- Signals
local old_wibox, old_cursor, old_bg
bluetooth_widget:connect_signal(
"mouse::enter",
function ()
old_bg = bluetooth_widget.bg
bluetooth_widget.bg = color.color["Blue200"] .. "dd"
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = "hand1"
end
end
)
bluetooth_widget:connect_signal(
"button::press",
function ()
bluetooth_widget.bg = color.color["Blue200"] .. "bb"
end
)
bluetooth_widget:connect_signal(
"button::release",
function ()
bluetooth_widget.bg = color.color["Blue200"] .. "dd"
end
)
bluetooth_widget:connect_signal(
"mouse::leave",
function ()
bluetooth_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end
)
hover_signal(bluetooth_widget, color.color["Blue200"])
bluetooth_widget:connect_signal(
"button::press",

View File

@@ -8,6 +8,7 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/clock/"
@@ -71,45 +72,7 @@ return function ()
end
}
-- Signals
local old_wibox, old_cursor, old_bg
clock_widget:connect_signal(
"mouse::enter",
function ()
old_bg = clock_widget.bg
clock_widget.bg = color.color["Orange200"] .. "dd"
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = "hand1"
end
end
)
clock_widget:connect_signal(
"button::press",
function ()
clock_widget.bg = color.color["Orange200"] .. "bb"
end
)
clock_widget:connect_signal(
"button::release",
function ()
clock_widget.bg = color.color["Orange200"] .. "dd"
end
)
clock_widget:connect_signal(
"mouse::leave",
function ()
clock_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end
)
hover_signal(clock_widget, color.color["Orange200"])
return clock_widget
end

View File

@@ -8,6 +8,7 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/date/"
@@ -71,32 +72,12 @@ return function ()
}
-- Signals
local old_wibox, old_cursor, old_bg
hover_signal(date_widget, color.color["Teal200"])
date_widget:connect_signal(
"mouse::enter",
function ()
awesome.emit_signal("widget::calendar_osd:stop", true)
old_bg = date_widget.bg
date_widget.bg = color.color["Teal200"] .. "dd"
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = "hand1"
end
end
)
date_widget:connect_signal(
"button::press",
function ()
date_widget.bg = color.color["Teal200"] .. "bb"
end
)
date_widget:connect_signal(
"button::release",
function ()
date_widget.bg = color.color["Teal200"] .. "dd"
end
)
@@ -104,11 +85,6 @@ return function ()
"mouse::leave",
function ()
awesome.emit_signal("widget::calendar_osd:rerun", true)
date_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end
)

View File

@@ -8,6 +8,7 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/kblayout/"
@@ -76,43 +77,12 @@ return function ()
end
-- Signals
local old_wibox, old_cursor, old_bg
kblayout_widget:connect_signal(
"mouse::enter",
function ()
old_bg = kblayout_widget.bg
kblayout_widget.bg = color.color["Green200"] .. "dd"
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = "hand1"
end
end
)
hover_signal(kblayout_widget, color.color["Green200"])
kblayout_widget:connect_signal(
"button::press",
function ()
set_kblayout()
kblayout_widget.bg = color.color["Green200"] .. "bb"
end
)
kblayout_widget:connect_signal(
"button::release",
function ()
kblayout_widget.bg = color.color["Green200"] .. "dd"
end
)
kblayout_widget:connect_signal(
"mouse::leave",
function ()
kblayout_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end
)

View File

@@ -8,10 +8,10 @@ local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
require("Main.Signals")
-- Returns the layoutbox widget
return function ()
local layout = wibox.widget{
{
awful.widget.layoutbox(),
@@ -27,42 +27,12 @@ return function ()
}
-- Signals
local old_wibox, old_cursor, old_bg
layout:connect_signal(
"mouse::enter",
function ()
old_bg = layout.bg
layout.bg = color.color["LightBlue200"] .. "dd"
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = "hand1"
end
end
)
hover_signal(layout, color.color["LightBlue200"])
layout:connect_signal(
"button::press",
function ()
layout.bg = color.color["LightBlue200"] .. "bb"
end
)
layout:connect_signal(
"button::release",
function ()
layout.bg = color.color["LightBlue200"] .. "dd"
end
)
layout:connect_signal(
"mouse::leave",
function ()
layout.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
awful.layout.inc(-1)
end
)

View File

@@ -9,6 +9,7 @@ local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local naughty = require("naughty")
local wibox = require("wibox")
require("Main.Signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/network/"
@@ -126,7 +127,7 @@ return function ()
network_notify(message, title, app_name, icon)
end
local update_wireless_data = function (strength, healthy)
local update_wireless_data = function (healthy)
awful.spawn.easy_async_with_shell(
[[ iw dev ]] .. interfaces.wlan_interface .. [[ link ]],
function (stdout)
@@ -158,10 +159,10 @@ return function ()
awesome.emit_signal("system::network_connected")
end
icon = icon .. '-' .. tostring(strength)
update_wireless_data(wifi_strength_rounded, true)
update_wireless_data(true)
else
icon = icon .. "-" .. tostring(strength)
update_wireless_data(wifi_strength_rounded, false)
update_wireless_data(false)
end
network_widget.container.network_layout.spacing = dpi(8)
network_widget.container.network_layout.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icondir .. icon .. ".svg", color.color["Grey900"]))
@@ -323,44 +324,7 @@ return function ()
}
-- Signals
local old_wibox, old_cursor, old_bg
network_widget:connect_signal(
"mouse::enter",
function ()
old_bg = network_widget.bg
network_widget.bg = color.color["Red200"] .. "dd"
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = "hand1"
end
end
)
network_widget:connect_signal(
"button::press",
function ()
network_widget.bg = color.color["Red200"] .. "bb"
end
)
network_widget:connect_signal(
"button::release",
function ()
network_widget.bg = color.color["Red200"] .. "dd"
end
)
network_widget:connect_signal(
"mouse::leave",
function ()
network_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end
)
hover_signal(network_widget, color.color["Red200"])
network_widget:connect_signal(
"button::press",

View File

@@ -9,6 +9,7 @@ local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local naughty = require("naughty")
local wibox = require("wibox")
require("Main.Signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/power/"
@@ -50,44 +51,12 @@ return function ()
}
-- Signals
local old_wibox, old_cursor, old_bg
power_widget:connect_signal(
"mouse::enter",
function ()
old_bg = power_widget.bg
power_widget.bg = color.color["Red200"] .. "dd"
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = "hand1"
end
end
)
power_widget:connect_signal(
"button::press",
function ()
power_widget.bg = color.color["Red200"] .. "bb"
end
)
hover_signal(power_widget, color.color["Red200"])
power_widget:connect_signal(
"button::release",
function ()
power_widget.bg = color.color["Red200"] .. "dd"
awesome.emit_signal("module::powermenu:show")
--awful.spawn("rofi -show power-menu -modi 'power-menu:~/.config/rofi/rofi-power-menu --choices=shutdown/reboot/logout/lockscreen' -theme ~/.config/rofi/powermenu/powermenu.rasi")
end
)
power_widget:connect_signal(
"mouse::leave",
function ()
power_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end
)

View File

@@ -3,7 +3,8 @@ local awful = require("awful")
local gears = require("gears")
local dpi = require("beautiful").xresources.apply_dpi
local color = require("theme.crylia.colors")
local naughty = require("naughty")
local naughty =require("naughty")
require("theme.crylia.Tools.IconHandler")
local list_update = function (widget, buttons, label, data, objects)
widget:reset()
@@ -102,32 +103,27 @@ local list_update = function (widget, buttons, label, data, objects)
end
for _, client in ipairs(object:clients()) do
if client.icon then
tag_label_margin:set_right(0)
local icon = wibox.widget{
tag_label_margin:set_right(0)
local icon = wibox.widget{
{
id = "icon_container",
{
id = "icon_container",
{
id = "icon",
resize = true,
widget = wibox.widget.imagebox
},
widget = wibox.container.place
id = "icon",
resize = true,
widget = wibox.widget.imagebox
},
tag_icon,
forced_width = dpi(33),
margins = dpi(6),
widget = wibox.container.margin
}
icon.icon_container.icon:set_image(client:get_icon(1))
tag_widget.widget_margin.container:setup({
icon,
layout = wibox.layout.align.horizontal
})
else
tag_icon_margin:set_margins(0)
tag_icon:set_forced_width(0)
end
widget = wibox.container.place
},
tag_icon,
forced_width = dpi(33),
margins = dpi(6),
widget = wibox.container.margin
}
icon.icon_container.icon:set_image(GetIcon("Papirus", client))
tag_widget.widget_margin.container:setup({
icon,
layout = wibox.layout.align.horizontal
})
end
local old_wibox, old_cursor, old_bg
@@ -135,7 +131,6 @@ local list_update = function (widget, buttons, label, data, objects)
"mouse::enter",
function ()
old_bg = tag_widget.bg
--naughty.notify({title = tostring(old_bg)})
if object == awful.screen.focused().selected_tag then
tag_widget.bg = '#dddddd' .. 'dd'
else

View File

@@ -3,7 +3,6 @@ local wibox = require('wibox')
local dpi = require('beautiful').xresources.apply_dpi
local gears = require('gears')
local color = require('theme.crylia.colors')
local naughty = require("naughty")
local list_update = function (widget, buttons, label, data, objects)
widget:reset()
@@ -111,11 +110,7 @@ local list_update = function (widget, buttons, label, data, objects)
task_title:set_text('')
end
if icon then
task_icon.icon:set_image(object:get_icon(1))
else
task_icon_margin:set_margins(0)
end
task_icon.icon:set_image(GetIcon("Papirus", object))
widget:add(task_widget)
widget:set_spacing(dpi(6))
@@ -192,14 +187,10 @@ return function(s)
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
c:emit_signal('request::activate')
c:raise()
end