a lot of stuff

This commit is contained in:
Kievits Rene
2022-04-16 05:08:33 +02:00
parent dae28d55eb
commit 1ceec3a7d9
74 changed files with 4743 additions and 716 deletions

View File

@@ -2,6 +2,8 @@
-- This is a button widget to add a new tag to the taglist --
-------------------------------------------------------------
-- !!! THIS WIDGET IS OBSCOLETE !!!
-- Awesome Libs
local awful = require("awful")
local dpi = require("beautiful").xresources.apply_dpi
@@ -15,10 +17,10 @@ local color = require("theme.crylia.colors")
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/addtag/"
-- Returns the add tag button widget
return function ()
return function()
-- This is the widget that gets dispayed
local add_tag_button = wibox.widget{
local add_tag_button = wibox.widget {
{
{
image = gears.color.recolor_image(icondir .. "plus.svg", color.color["White"]),
@@ -29,7 +31,7 @@ return function ()
widget = wibox.container.margin
},
bg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
@@ -38,12 +40,12 @@ return function ()
-- Keybindings and Mouse click bindings
add_tag_button:buttons(
gears.table.join(
-- Add a new tag
-- Add a new tag
awful.button(
{ },
{},
1,
nil,
function ()
function()
awful.tag.add()
end
)
@@ -54,7 +56,7 @@ return function ()
local old_wibox, old_cursor, old_bg
add_tag_button:connect_signal(
"mouse::enter",
function ()
function()
old_bg = add_tag_button.bg
add_tag_button.bg = "#ffffff" .. "12"
local w = mouse.current_wibox
@@ -66,19 +68,19 @@ return function ()
)
add_tag_button:connect_signal(
"button::press",
function ()
function()
add_tag_button.bg = "#ffffff" .. "24"
end
)
add_tag_button:connect_signal(
"button::release",
function ()
function()
add_tag_button.bg = "#ffffff" .. "12"
end
)
add_tag_button:connect_signal(
"mouse::leave",
function ()
function()
add_tag_button.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
@@ -88,4 +90,4 @@ return function ()
)
return add_tag_button
end
end

View File

@@ -14,9 +14,9 @@ require("main.signals")
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/audio/"
-- Returns the audio widget
return function ()
return function()
local audio_widget = wibox.widget{
local audio_widget = wibox.widget {
{
{
{
@@ -33,7 +33,7 @@ return function ()
widget = wibox.container.margin,
id = "icon_margin"
},
spacing = dpi(6),
spacing = dpi(10),
{
id = "label",
align = "center",
@@ -44,22 +44,26 @@ return function ()
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(5),
right = dpi(10),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Yellow200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local get_volume = function ()
local get_volume = function()
awful.spawn.easy_async_with_shell(
[[ pacmd list-sinks | grep "volume: front" | awk '{print $5}' ]],
function (stdout)
[[
SINK="$(pacmd stat | awk -F": " '/^Default sink name: /{print $2}')"
echo $(pacmd list-sinks | awk '/^\s+name: /{indefault = $2 == "<'$SINK'>"} /^\s+volume: / && indefault {print $5; exit}')
]],
function(stdout)
local icon = icondir .. "volume"
stdout = stdout:gsub("%%", "")
local volume = tonumber(stdout) or 0
@@ -82,10 +86,10 @@ return function ()
)
end
local check_muted = function ()
local check_muted = function()
awful.spawn.easy_async_with_shell(
[[ pacmd list-sinks | grep "muted" ]],
function (stdout)
function(stdout)
if stdout:match("yes") then
audio_widget.container.audio_layout.label.visible = false
audio_widget.container:set_right(0)
@@ -99,11 +103,11 @@ return function ()
end
-- Signals
hover_signal(audio_widget, color.color["Yellow200"])
Hover_signal(audio_widget, color.color["Yellow200"])
audio_widget:connect_signal(
"button::press",
function ()
function()
awesome.emit_signal("widget::volume")
awesome.emit_signal("module::volume_osd:show", true)
awesome.emit_signal("module::slider:update")
@@ -113,7 +117,7 @@ return function ()
awesome.connect_signal(
"widget::volume",
function (c)
function(c)
check_muted()
end
)

View File

@@ -16,8 +16,8 @@ require("main.signals")
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/battery/"
-- Returns the battery widget
return function ()
local battery_widget = wibox.widget{
return function()
local battery_widget = wibox.widget {
{
{
{
@@ -35,7 +35,7 @@ return function ()
top = dpi(2),
widget = wibox.container.margin
},
spacing = dpi(8),
spacing = dpi(10),
{
visible = false,
align = 'center',
@@ -47,30 +47,30 @@ return function ()
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(5),
right = dpi(10),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Purple200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local battery_tooltip = awful.tooltip{
objects = {battery_widget},
local battery_tooltip = awful.tooltip {
objects = { battery_widget },
text = "",
mode = "outside",
mode = "inside",
preferred_alignments = "middle",
margins = dpi(10)
}
local get_battery_info = function ()
local get_battery_info = function()
awful.spawn.easy_async_with_shell(
[[ upower -i $(upower -e | grep BAT) | grep "time to " ]],
function (stdout)
function(stdout)
if stdout == nil or stdout == '' then
battery_tooltip:set_text('No Battery Found')
return
@@ -95,7 +95,7 @@ return function ()
local last_battery_check = os.time()
local notify_critical_battery = true
local battery_warning = function ()
local battery_warning = function()
naughty.notify({
icon = gears.color.recolor_image(icondir .. "battery-alert.svg", color.color["White"]),
app_name = "System notification",
@@ -105,10 +105,10 @@ return function ()
})
end
local update_battery = function (status)
local update_battery = function(status)
awful.spawn.easy_async_with_shell(
[[sh -c "upower -i $(upower -e | grep BAT) | grep percentage | awk '{print \$2}' |tr -d '\n%'"]],
function (stdout)
function(stdout)
local battery_percentage = tonumber(stdout)
if not battery_percentage then
@@ -129,7 +129,7 @@ return function ()
if battery_percentage > 0 and battery_percentage < 10 and status == 'discharging' then
icon = icon .. '-' .. 'alert'
if(os.difftime(os.time(), last_battery_check) > 300 or notify_critical_battery) then
if (os.difftime(os.time(), last_battery_check) > 300 or notify_critical_battery) then
last_battery_check = os.time()
notify_critical_battery = false
battery_warning()
@@ -156,7 +156,7 @@ return function ()
icon = icon .. '-' .. status .. '-' .. '70'
elseif battery_percentage >= 80 and battery_percentage < 90 then
icon = icon .. '-' .. status .. '-' .. '80'
elseif battery_percentage >=90 and battery_percentage < 100 then
elseif battery_percentage >= 90 and battery_percentage < 100 then
icon = icon .. '-' .. status .. '-' .. '90'
end
@@ -166,18 +166,18 @@ return function ()
)
end
hover_signal(battery_widget, color.color["Purple200"])
Hover_signal(battery_widget, color.color["Purple200"])
battery_widget:connect_signal(
'button::press',
function ()
function()
awful.spawn("xfce4-power-manager-settings")
end
)
battery_widget:connect_signal(
"mouse::enter",
function ()
function()
get_battery_info()
end
)
@@ -185,7 +185,7 @@ return function ()
watch(
[[sh -c "upower -i $(upower -e | grep BAT) | grep state | awk '{print \$2}' | tr -d '\n'"]],
5,
function (widget, stdout)
function(widget, stdout)
local status = stdout:gsub('%\n', '')
if status == nil or status == '' then
battery_widget.container.battery_layout.spacing = dpi(0)

View File

@@ -14,8 +14,8 @@ require("main.signals")
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/bluetooth/"
-- Returns the bluetooth widget
return function ()
local bluetooth_widget = wibox.widget{
return function()
local bluetooth_widget = wibox.widget {
{
{
{
@@ -28,22 +28,22 @@ return function ()
widget = wibox.container.place
},
id = "icon_margin",
left = dpi(5),
right = dpi(5),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Blue200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local bluetooth_tooltip = awful.tooltip{
objects = {bluetooth_widget},
local bluetooth_tooltip = awful.tooltip {
objects = { bluetooth_widget },
text = "",
mode = "outside",
mode = "inside",
preferred_alignments = "middle",
margins = dpi(10)
}
@@ -51,69 +51,72 @@ return function ()
local bluetooth_state = "off"
local connected_device = "nothing"
local get_bluetooth_information = function ()
awful.spawn.easy_async_with_shell(
[[ bluetoothctl show | grep Powered | awk '{print $2}' ]],
function (stdout)
local icon = icondir .. "bluetooth"
stdout = stdout:gsub("\n", "")
if stdout == "yes" then
icon = icon .. "-on"
bluetooth_state = "on"
awful.spawn.easy_async_with_shell(
[[ bluetoothctl info | grep Name: | awk '{ first = $1; $1 = ""; print $0 }' ]],
function (stdout2)
if stdout2 == nil or stdout2:gsub("\n", "") == "" then
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently not connected")
else
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently connected to:" .. connected_device)
connected_device = stdout2
end
end
)
else
icon = icon .. "-off"
bluetooth_state = "off"
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n")
end
bluetooth_widget.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icon .. ".svg", color.color["Grey900"]))
end
)
-- ! if you don't have a bluetooth device then this function will
-- ! spawn hundereds of processes of bluetoothctl, this will be bad
-- TODO: Check for a bluetooth controller first, maybe use a different program
local get_bluetooth_information = function()
-- awful.spawn.easy_async_with_shell(
-- [[ bluetoothctl show | grep Powered | awk '{print $2}' ]],
-- function(stdout)
-- local icon = icondir .. "bluetooth"
-- stdout = stdout:gsub("\n", "")
-- if stdout == "yes" then
-- icon = icon .. "-on"
-- bluetooth_state = "on"
-- awful.spawn.easy_async_with_shell(
-- [[ bluetoothctl info | grep Name: | awk '{ first = $1; $1 = ""; print $0 }' ]],
-- function(stdout2)
-- if stdout2 == nil or stdout2:gsub("\n", "") == "" then
-- bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently not connected")
-- else
-- bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently connected to:" .. connected_device)
-- connected_device = stdout2
-- end
-- end
-- )
-- else
-- icon = icon .. "-off"
-- bluetooth_state = "off"
-- bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n")
-- end
-- bluetooth_widget.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icon .. ".svg", color.color["Grey900"]))
-- end
-- )
end
local bluetooth_update = gears.timer{
local bluetooth_update = gears.timer {
timeout = 5,
autostart = true,
call_now = true,
callback = function ()
awful.spawn.easy_async_with_shell(
callback = function()
--[[ awful.spawn.easy_async_with_shell(
"bluetoothctl list",
function (stdout)
function(stdout)
if stdout ~= nil or stdout:gsub("\n", ""):match("") then
get_bluetooth_information()
end
end
)
) ]]
end
}
-- Signals
hover_signal(bluetooth_widget, color.color["Blue200"])
Hover_signal(bluetooth_widget, color.color["Blue200"])
bluetooth_widget:connect_signal(
"button::press",
function ()
function()
if bluetooth_state == "on" then
awful.spawn.easy_async_with_shell(
"bluetoothctl power off",
function (stdout)
function(stdout)
get_bluetooth_information()
end
)
else
awful.spawn.easy_async_with_shell(
"bluetoothctl power on",
function (stdout)
function(stdout)
get_bluetooth_information()
end
)

View File

@@ -14,9 +14,9 @@ require("main.signals")
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/clock/"
-- Returns the clock widget
return function ()
return function()
local clock_widget = wibox.widget{
local clock_widget = wibox.widget {
{
{
{
@@ -45,19 +45,19 @@ return function ()
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(10),
right = dpi(10),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Orange200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local set_clock = function ()
local set_clock = function()
clock_widget.container.clock_layout.label:set_text(os.date("%H:%M"))
end
@@ -67,12 +67,12 @@ return function ()
timeout = 5,
autostart = true,
call_now = true,
callback = function ()
callback = function()
set_clock()
end
}
hover_signal(clock_widget, color.color["Orange200"])
Hover_signal(clock_widget, color.color["Orange200"])
return clock_widget
end

View File

@@ -14,9 +14,9 @@ require("main.signals")
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/date/"
-- Returns the date widget
return function ()
return function()
local date_widget = wibox.widget{
local date_widget = wibox.widget {
{
{
{
@@ -45,19 +45,19 @@ return function ()
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(10),
right = dpi(10),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Teal200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local set_date = function ()
local set_date = function()
date_widget.container.date_layout.label:set_text(os.date("%a, %b %d"))
end
@@ -66,24 +66,24 @@ return function ()
timeout = 60,
autostart = true,
call_now = true,
callback = function ()
callback = function()
set_date()
end
}
-- Signals
hover_signal(date_widget, color.color["Teal200"])
Hover_signal(date_widget, color.color["Teal200"])
date_widget:connect_signal(
"mouse::enter",
function ()
function()
awesome.emit_signal("widget::calendar_osd:stop", true)
end
)
date_widget:connect_signal(
"mouse::leave",
function ()
function()
awesome.emit_signal("widget::calendar_osd:rerun", true)
end
)

View File

@@ -13,8 +13,8 @@ require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/kblayout/"
return function (s)
local kblayout_widget = wibox.widget{
return function(s)
local kblayout_widget = wibox.widget {
{
{
{
@@ -32,7 +32,7 @@ return function (s)
widget = wibox.container.margin,
id = "icon_margin"
},
spacing = dpi(6),
spacing = dpi(10),
{
id = "label",
align = "center",
@@ -43,129 +43,129 @@ return function (s)
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(5),
right = dpi(10),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Green200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local layout = "";
local get_kblayout = function ()
local get_kblayout = function()
awful.spawn.easy_async_with_shell(
[[ setxkbmap -query | grep layout | awk '{print $2}' ]],
function (stdout)
layout = stdout
kblayout_widget.container.kblayout_layout.label.text = stdout
return stdout
function(stdout)
layout = stdout:gsub("\n", "")
kblayout_widget.container.kblayout_layout.label.text = layout
return layout
end
)
return layout
end
local function create_kb_layout_item (keymap)
local function create_kb_layout_item(keymap)
-- TODO: Add more, too lazy rn
local longname, shortname
local xkeyboard_country_code = {
{"ad", "", "AND"}, -- Andorra
{"af", "", "AFG"}, -- Afghanistan
{"al", "", "ALB"}, -- Albania
{"am", "", "ARM"}, -- Armenia
{"ara", "", "ARB"}, -- Arabic
{"at", "", "AUT"}, -- Austria
{"az", "", "AZE"}, -- Azerbaijan
{"ba", "", "BIH"}, -- Bosnia and Herzegovina
{"bd", "", "BGD"}, -- Bangladesh
{"be", "", "BEL"}, -- Belgium
{"bg", "", "BGR"}, -- Bulgaria
{"br", "", "BRA"}, -- Brazil
{"bt", "", "BTN"}, -- Bhutan
{"bw", "", "BWA"}, -- Botswana
{"by", "", "BLR"}, -- Belarus
{"ca", "", "CAN"}, -- Canada
{"cd", "", "COD"}, -- Congo
{"ch", "", "CHE"}, -- Switzerland
{"cm", "", "CMR"}, -- Cameroon
{"cn", "", "CHN"}, -- China
{"cz", "", "CZE"}, -- Czechia
{"de", "Deutsch (Germany)", "GER"}, -- Germany
{"dk", "", "DNK"}, -- Denmark
{"ee", "", "EST"}, -- Estonia
{"es", "", "ESP"}, -- Spain
{"et", "", "ETH"}, -- Ethiopia
{"eu", "?", "?"}, -- EurKey
{"fi", "", "FIN"}, -- Finland
{"fo", "", "FRO"}, -- Faroe Islands
{"fr", "", "FRA"}, -- France
{"gb", "English (Bri'ish)", "ENG"}, -- United Kingdom
{"ge", "", "GEO"}, -- Georgia
{"gh", "", "GHA"}, -- Ghana
{"gn", "", "GIN"}, -- Guinea
{"gr", "", "GRC"}, -- Greece
{"hr", "", "HRV"}, -- Croatia
{"hu", "", "HUN"}, -- Hungary
{"ie", "", "IRL"}, -- Ireland
{"il", "", "ISR"}, -- Israel
{"in", "", "IND"}, -- India
{"iq", "", "IRQ"}, -- Iraq
{"ir", "", "IRN"}, -- Iran
{"is", "", "ISL"}, -- Iceland
{"it", "", "ITA"}, -- Italy
{"jp", "", "JPN"}, -- Japan
{"ke", "", "KEN"}, -- Kenya
{"kg", "", "KGZ"}, -- Kyrgyzstan
{"kh", "", "KHM"}, -- Cambodia
{"kr", "", "KOR"}, -- Korea
{"kz", "", "KAZ"}, -- Kazakhstan
{"la", "", "LAO"}, -- Laos
{"latam", "?", "?"}, -- Latin America
{"latin", "?", "?"}, -- Latin
{"lk", "", "LKA"}, -- Sri Lanka
{"lt", "", "LTU"}, -- Lithuania
{"lv", "", "LVA"}, -- Latvia
{"ma", "", "MAR"}, -- Morocco
{"mao", "?", "?"}, -- Maori
{"me", "", "MNE"}, -- Montenegro
{"mk", "", "MKD"}, -- Macedonia
{"ml", "", "MLI"}, -- Mali
{"mm", "", "MMR"}, -- Myanmar
{"mn", "", "MNG"}, -- Mongolia
{"mt", "", "MLT"}, -- Malta
{"mv", "", "MDV"}, -- Maldives
{"ng", "", "NGA"}, -- Nigeria
{"nl", "", "NLD"}, -- Netherlands
{"no", "", "NOR"}, -- Norway
{"np", "", "NRL"}, -- Nepal
{"ph", "", "PHL"}, -- Philippines
{"pk", "", "PAK"}, -- Pakistan
{"pl", "", "POL"}, -- Poland
{"pt", "", "PRT"}, -- Portugal
{"ro", "", "ROU"}, -- Romania
{"rs", "", "SRB"}, -- Serbia
{"ru", "Русски (Russia)", "RUS"}, -- Russia
{"se", "", "SWE"}, -- Sweden
{"si", "", "SVN"}, -- Slovenia
{"sk", "", "SVK"}, -- Slovakia
{"sn", "", "SEN"}, -- Senegal
{"sy", "", "SYR"}, -- Syria
{"th", "", "THA"}, -- Thailand
{"tj", "", "TJK"}, -- Tajikistan
{"tm", "", "TKM"}, -- Turkmenistan
{"tr", "", "TUR"}, -- Turkey
{"tw", "", "TWN"}, -- Taiwan
{"tz", "", "TZA"}, -- Tanzania
{"ua", "", "UKR"}, -- Ukraine
{"us", "English (United States)", "USA"}, -- USA
{"uz", "", "UZB"}, -- Uzbekistan
{"vn", "", "VNM"}, -- Vietnam
{"za", "", "ZAF"} -- South Africa
{ "ad", "", "AND" }, -- Andorra
{ "af", "", "AFG" }, -- Afghanistan
{ "al", "", "ALB" }, -- Albania
{ "am", "", "ARM" }, -- Armenia
{ "ara", "", "ARB" }, -- Arabic
{ "at", "", "AUT" }, -- Austria
{ "az", "", "AZE" }, -- Azerbaijan
{ "ba", "", "BIH" }, -- Bosnia and Herzegovina
{ "bd", "", "BGD" }, -- Bangladesh
{ "be", "", "BEL" }, -- Belgium
{ "bg", "", "BGR" }, -- Bulgaria
{ "br", "", "BRA" }, -- Brazil
{ "bt", "", "BTN" }, -- Bhutan
{ "bw", "", "BWA" }, -- Botswana
{ "by", "", "BLR" }, -- Belarus
{ "ca", "", "CAN" }, -- Canada
{ "cd", "", "COD" }, -- Congo
{ "ch", "", "CHE" }, -- Switzerland
{ "cm", "", "CMR" }, -- Cameroon
{ "cn", "", "CHN" }, -- China
{ "cz", "", "CZE" }, -- Czechia
{ "de", "Deutsch (Germany)", "GER" }, -- Germany
{ "dk", "", "DNK" }, -- Denmark
{ "ee", "", "EST" }, -- Estonia
{ "es", "", "ESP" }, -- Spain
{ "et", "", "ETH" }, -- Ethiopia
{ "eu", "?", "?" }, -- EurKey
{ "fi", "", "FIN" }, -- Finland
{ "fo", "", "FRO" }, -- Faroe Islands
{ "fr", "", "FRA" }, -- France
{ "gb", "English (Bri'ish)", "ENG" }, -- United Kingdom
{ "ge", "", "GEO" }, -- Georgia
{ "gh", "", "GHA" }, -- Ghana
{ "gn", "", "GIN" }, -- Guinea
{ "gr", "", "GRC" }, -- Greece
{ "hr", "", "HRV" }, -- Croatia
{ "hu", "", "HUN" }, -- Hungary
{ "ie", "", "IRL" }, -- Ireland
{ "il", "", "ISR" }, -- Israel
{ "in", "", "IND" }, -- India
{ "iq", "", "IRQ" }, -- Iraq
{ "ir", "", "IRN" }, -- Iran
{ "is", "", "ISL" }, -- Iceland
{ "it", "", "ITA" }, -- Italy
{ "jp", "", "JPN" }, -- Japan
{ "ke", "", "KEN" }, -- Kenya
{ "kg", "", "KGZ" }, -- Kyrgyzstan
{ "kh", "", "KHM" }, -- Cambodia
{ "kr", "", "KOR" }, -- Korea
{ "kz", "", "KAZ" }, -- Kazakhstan
{ "la", "", "LAO" }, -- Laos
{ "latam", "?", "?" }, -- Latin America
{ "latin", "?", "?" }, -- Latin
{ "lk", "", "LKA" }, -- Sri Lanka
{ "lt", "", "LTU" }, -- Lithuania
{ "lv", "", "LVA" }, -- Latvia
{ "ma", "", "MAR" }, -- Morocco
{ "mao", "?", "?" }, -- Maori
{ "me", "", "MNE" }, -- Montenegro
{ "mk", "", "MKD" }, -- Macedonia
{ "ml", "", "MLI" }, -- Mali
{ "mm", "", "MMR" }, -- Myanmar
{ "mn", "", "MNG" }, -- Mongolia
{ "mt", "", "MLT" }, -- Malta
{ "mv", "", "MDV" }, -- Maldives
{ "ng", "", "NGA" }, -- Nigeria
{ "nl", "", "NLD" }, -- Netherlands
{ "no", "", "NOR" }, -- Norway
{ "np", "", "NRL" }, -- Nepal
{ "ph", "", "PHL" }, -- Philippines
{ "pk", "", "PAK" }, -- Pakistan
{ "pl", "", "POL" }, -- Poland
{ "pt", "", "PRT" }, -- Portugal
{ "ro", "", "ROU" }, -- Romania
{ "rs", "", "SRB" }, -- Serbia
{ "ru", "Русски (Russia)", "RUS" }, -- Russia
{ "se", "", "SWE" }, -- Sweden
{ "si", "", "SVN" }, -- Slovenia
{ "sk", "", "SVK" }, -- Slovakia
{ "sn", "", "SEN" }, -- Senegal
{ "sy", "", "SYR" }, -- Syria
{ "th", "", "THA" }, -- Thailand
{ "tj", "", "TJK" }, -- Tajikistan
{ "tm", "", "TKM" }, -- Turkmenistan
{ "tr", "", "TUR" }, -- Turkey
{ "tw", "", "TWN" }, -- Taiwan
{ "tz", "", "TZA" }, -- Tanzania
{ "ua", "", "UKR" }, -- Ukraine
{ "us", "English (United States)", "USA" }, -- USA
{ "uz", "", "UZB" }, -- Uzbekistan
{ "vn", "", "VNM" }, -- Vietnam
{ "za", "", "ZAF" } -- South Africa
}
for i, c in ipairs(xkeyboard_country_code) do
@@ -175,7 +175,7 @@ return function (s)
end
end
local kb_layout_item = wibox.widget{
local kb_layout_item = wibox.widget {
{
{
{
@@ -184,7 +184,7 @@ return function (s)
{
text = shortname,
widget = wibox.widget.textbox,
font = "JetBrains Mono ExtraBold, 12",
font = user_vars.vars.font.extrabold,
id = "kbmapname"
},
widget = wibox.container.margin,
@@ -195,7 +195,7 @@ return function (s)
{
text = longname,
widget = wibox.widget.textbox,
font = "JetBrains Mono Bold, 12",
font = user_vars.vars.font.bold,
},
widget = wibox.container.margin
@@ -208,7 +208,7 @@ return function (s)
widget = wibox.container.margin,
id = "margin"
},
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 10)
end,
bg = color.color["Grey800"],
@@ -219,13 +219,13 @@ return function (s)
margins = dpi(5),
widget = wibox.container.margin
}
hover_signal(kb_layout_item.background, color.color["White"], color.color["Grey900"])
Hover_signal(kb_layout_item.background, color.color["White"], color.color["Grey900"])
kb_layout_item:connect_signal(
"button::press",
function ()
function()
awful.spawn.easy_async_with_shell(
"setxkbmap " .. keymap,
function (stdout)
function(stdout)
awesome.emit_signal("kblayout::hide:kbmenu")
get_kblayout()
end
@@ -245,9 +245,9 @@ return function (s)
return kb_layout_items
end
local kb_menu_widget = awful.popup{
local kb_menu_widget = awful.popup {
screen = s,
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background,
@@ -257,7 +257,7 @@ return function (s)
max_height = dpi(600),
visible = false,
ontop = true,
placement = function (c) awful.placement.align(c, {position = "top_right", margins = {right = dpi(255), top = dpi(60)}}) end
placement = function(c) awful.placement.align(c, { position = "top_right", margins = { right = dpi(255), top = dpi(60) } }) end
}
kb_menu_widget:setup(
@@ -267,20 +267,20 @@ return function (s)
local function toggle_kb_layout()
awful.spawn.easy_async_with_shell(
"setxkbmap -query | grep layout: | awk '{print $2}'",
function (stdout)
function(stdout)
for j, n in ipairs(user_vars.vars.kblayout) do
if stdout:match(n) then
if j == #user_vars.vars.kblayout then
awful.spawn.easy_async_with_shell(
"setxkbmap " .. user_vars.vars.kblayout[1],
function ()
function()
get_kblayout()
end
)
else
awful.spawn.easy_async_with_shell(
"setxkbmap " .. user_vars.vars.kblayout[j + 1],
function ()
function()
get_kblayout()
end
)
@@ -293,19 +293,19 @@ return function (s)
awesome.connect_signal(
"kblayout::toggle",
function ()
function()
toggle_kb_layout()
end
)
--kb_menu_widget:move_next_to(mouse.current_widget_geometry)
-- Signals
hover_signal(kblayout_widget, color.color["Green200"])
Hover_signal(kblayout_widget, color.color["Green200"])
local kblayout_keygrabber = awful.keygrabber{
local kblayout_keygrabber = awful.keygrabber {
autostart = false,
stop_event = 'release',
keypressed_callback = function (self, mod, key, command)
keypressed_callback = function(self, mod, key, command)
if key == 'Escape' then
awesome.emit_signal("kblayout::hide:kbmenu")
end
@@ -314,7 +314,7 @@ return function (s)
kblayout_widget:connect_signal(
"button::press",
function ()
function()
if kb_menu_widget.visible then
kb_menu_widget.visible = false
kblayout_keygrabber:stop()
@@ -327,7 +327,7 @@ return function (s)
awesome.connect_signal(
"kblayout::hide:kbmenu",
function ()
function()
kb_menu_widget.visible = false
kblayout_keygrabber:stop()
end

View File

@@ -11,30 +11,36 @@ local wibox = require("wibox")
require("main.signals")
-- Returns the layoutbox widget
return function ()
local layout = wibox.widget{
return function()
local layout = wibox.widget {
{
awful.widget.layoutbox(),
margins = dpi(3),
forced_width = dpi(33),
{
awful.widget.layoutbox(),
id = "icon_layout",
widget = wibox.container.place
},
id = "icon_margin",
left = dpi(5),
right = dpi(5),
forced_width = dpi(40),
widget = wibox.container.margin
},
bg = color.color["LightBlue200"],
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
-- Signals
hover_signal(layout, color.color["LightBlue200"])
Hover_signal(layout, color.color["LightBlue200"])
layout:connect_signal(
"button::press",
function ()
function()
awful.layout.inc(-1)
end
)
return layout
end
end

View File

@@ -16,18 +16,18 @@ local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/networ
-- Insert your interfaces here, get the from ip a
local interfaces = {
wlan_interface = "wlo1",
lan_interface = "enx00e04c89ce6f"
wlan_interface = user_vars.vars.network.wlan,
lan_interface = user_vars.vars.network.ethernet
}
local network_mode = nil
-- Returns the network widget
return function ()
return function()
local startup = true
local reconnect_startup = true
local network_widget = wibox.widget{
local wifi_strength
local network_widget = wibox.widget {
{
{
{
@@ -45,7 +45,7 @@ return function ()
top = dpi(2),
widget = wibox.container.margin
},
spacing = dpi(8),
spacing = dpi(10),
{
id = "label",
visible = false,
@@ -57,22 +57,22 @@ return function ()
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(10),
right = dpi(10),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Red200"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local network_tooltip = awful.tooltip{
local network_tooltip = awful.tooltip {
text = "Loading",
objects = {network_widget},
mode = "outside",
objects = { network_widget },
mode = "inside",
preferred_alignments = "middle",
margins = dpi(10)
}
@@ -92,21 +92,21 @@ return function ()
fi
]=]
local update_startup = function ()
local update_startup = function()
if startup then
startup = false
end
end
local update_reconnect_startup = function (status)
local update_reconnect_startup = function(status)
reconnect_startup = status
end
local update_tooltip = function (message)
local update_tooltip = function(message)
network_tooltip:set_markup(message)
end
local network_notify = function (message, title, app_name, icon)
local network_notify = function(message, title, app_name, icon)
naughty.notify({
text = message,
title = title,
@@ -116,21 +116,21 @@ return function ()
})
end
local update_wireless = function ()
local update_wireless = function()
network_mode = "wireless"
local notify_connected = function (essid)
local message = "You are now connected to ".. essid
local notify_connected = function(essid)
local message = "You are now connected to " .. essid
local title = "Connection successfull"
local app_name = "System Notification"
local icon = icondir .. "wifi-strength-4.svg"
network_notify(message, title, app_name, icon)
end
local update_wireless_data = function (healthy)
local update_wireless_data = function(healthy)
awful.spawn.easy_async_with_shell(
[[ iw dev ]] .. interfaces.wlan_interface .. [[ link ]],
function (stdout)
function(stdout)
local essid = stdout:match("SSID: (.-)\n") or "N/A"
local bitrate = stdout:match("tx bitrate: (.+/s)") or "N/A"
local message = "Connected to <b>" .. essid .. "</b>\nSignal strength <b>" .. tostring(wifi_strength) .. "%</b>\n" .. "Bit rate <b>" .. tostring(bitrate) .. "</b>"
@@ -149,10 +149,10 @@ return function ()
)
end
local update_wireless_icon = function (strength)
local update_wireless_icon = function(strength)
awful.spawn.easy_async_with_shell(
check_for_internet,
function (stdout)
function(stdout)
local icon = "wifi-strength"
if not stdout:match("Connected but no internet") then
if startup or reconnect_startup then
@@ -170,10 +170,10 @@ return function ()
)
end
local update_wireless_strength = function ()
local update_wireless_strength = function()
awful.spawn.easy_async_with_shell(
[[ awk 'NR==3 {printf "%3.0f", ($3/70)*100}' /proc/net/wireless ]],
function (stdout)
function(stdout)
if not tonumber(stdout) then
return
end
@@ -191,11 +191,11 @@ return function ()
update_startup()
end
local update_wired = function ()
local update_wired = function()
network_mode = "wired"
local notify_connected = function ()
local message = "You are now connected to ".. interfaces.lan_interface
local notify_connected = function()
local message = "You are now connected to " .. interfaces.lan_interface
local title = "Connection successfull"
local app_name = "System Notification"
local icon = icondir .. "ethernet.svg"
@@ -204,7 +204,7 @@ return function ()
awful.spawn.easy_async_with_shell(
check_for_internet,
function (stdout)
function(stdout)
local icon = "ethernet"
if stdout:match("Connected but no internet") then
@@ -229,15 +229,15 @@ return function ()
end
local update_disconnected = function ()
local notify_wireless_disconnected = function (essid)
local update_disconnected = function()
local notify_wireless_disconnected = function(essid)
local message = "WiFi has been disconnected"
local title = "Connection lost"
local app_name = "System Notification"
local icon = icondir .. "wifi-strength-off-outline.svg"
network_notify(message, title, app_name, icon)
end
local notify_wired_disconnected = function (essid)
local notify_wired_disconnected = function(essid)
local message = "Ethernet has been unplugged"
local title = "Connection lost"
local app_name = "System Notification"
@@ -264,7 +264,7 @@ return function ()
network_widget.container.network_layout.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icondir .. icon .. ".svg", color.color["Grey900"]))
end
local check_network_mode = function ()
local check_network_mode = function()
awful.spawn.easy_async_with_shell(
[=[
wireless="]=] .. tostring(interfaces.wlan_interface) .. [=["
@@ -301,7 +301,7 @@ return function ()
}
print_network_mode
]=],
function (stdout)
function(stdout)
local mode = stdout:gsub("%\n", "")
if stdout:match("No internet connected") then
update_disconnected()
@@ -314,21 +314,21 @@ return function ()
)
end
local network_updater = gears.timer{
local network_updater = gears.timer {
timeout = 5,
autostart = true,
call_now = true,
callback = function ()
callback = function()
check_network_mode()
end
}
-- Signals
hover_signal(network_widget, color.color["Red200"])
Hover_signal(network_widget, color.color["Red200"])
network_widget:connect_signal(
"button::press",
function ()
function()
awful.spawn("gnome-control-center wlan")
end
)

View File

@@ -14,9 +14,9 @@ require("main.signals")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/power/"
return function ()
return function()
local power_widget = wibox.widget{
local power_widget = wibox.widget {
{
{
{
@@ -38,24 +38,24 @@ return function ()
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(5),
right = dpi(5),
left = dpi(8),
right = dpi(8),
widget = wibox.container.margin
},
bg = color.color["Red200"],
fg = color.color["Grey800"],
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, height, width, 5)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
-- Signals
hover_signal(power_widget, color.color["Red200"])
Hover_signal(power_widget, color.color["Red200"])
power_widget:connect_signal(
"button::release",
function ()
function()
awesome.emit_signal("module::powermenu:show")
end
)

View File

@@ -11,16 +11,13 @@ local wibox = require("wibox")
require("main.signals")
return function (s)
return function(s)
local systray = wibox.widget{
local systray = wibox.widget {
{
{
wibox.widget.systray(),
top = dpi(6),
bottom = dpi(6),
left = dpi(6),
right = dpi(6),
margins = dpi(6),
widget = wibox.container.margin,
id = 'st'
},
@@ -29,13 +26,15 @@ return function (s)
id = "container"
},
widget = wibox.container.background,
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
bg = color.color["BlueGrey800"]
}
-- Signals
hover_signal(systray.container, color.color["Red200"])
Hover_signal(systray.container, color.color["Red200"])
systray.container.st.widget:set_base_size(dpi(20))
return systray
end

View File

@@ -5,87 +5,81 @@ local dpi = require("beautiful").xresources.apply_dpi
local color = require("theme.crylia.colors")
require("theme.crylia.tools.icon_handler")
local list_update = function (widget, buttons, label, data, objects)
local list_update = function(widget, buttons, label, data, objects)
widget:reset()
for i, object in ipairs(objects) do
local tag_icon = wibox.widget{
nil,
{
id = "icon",
resize = true,
widget = wibox.widget.imagebox
},
nil,
layout = wibox.layout.align.horizontal
}
local tag_icon = wibox.widget {
nil,
{
id = "icon",
resize = true,
widget = wibox.widget.imagebox
},
nil,
layout = wibox.layout.align.horizontal
}
local tag_icon_margin = wibox.widget{
tag_icon,
forced_width = dpi(33),
margins = dpi(3),
widget = wibox.container.margin
}
local tag_icon_margin = wibox.widget {
tag_icon,
forced_width = dpi(33),
margins = dpi(3),
widget = wibox.container.margin
}
local tag_label = wibox.widget{
text = "",
align = "center",
valign = "center",
visible = true,
font = "JetBrains Mono ExtraBold, 14",
local tag_label = wibox.widget {
text = "",
align = "center",
valign = "center",
visible = true,
font = user_vars.vars.font.extrabold,
forced_width = dpi(25),
widget = wibox.widget.textbox
}
widget = wibox.widget.textbox
}
local tag_label_margin = wibox.widget{
tag_label,
left = dpi(5),
local tag_label_margin = wibox.widget {
tag_label,
left = dpi(5),
right = dpi(5),
widget = wibox.container.margin
}
widget = wibox.container.margin
}
local tag_widget = wibox.widget {
id = "widget_margin",
{
id = "widget_margin",
{
id = "container",
tag_label_margin,
layout = wibox.layout.fixed.horizontal
},
margins = dpi(0),
widget = wibox.container.margin
},
id = "container",
tag_label_margin,
layout = wibox.layout.fixed.horizontal
},
fg = color.color["White"],
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local function create_buttons(buttons, object)
if buttons then
local btns = {}
for _, b in ipairs(buttons) do
-- Create a proxy button object: it will receive the real
-- press and release events, and will propagate them to the
-- button object the user provided, but with the object as
-- argument.
local btn = awful.button {
modifiers = b.modifiers,
button = b.button,
on_press = function()
b:emit_signal('press', object)
end,
on_release = function()
b:emit_signal('release', object)
end
}
btns[#btns + 1] = btn
end
return btns
end
end
if buttons then
local btns = {}
for _, b in ipairs(buttons) do
local btn = awful.button {
modifiers = b.modifiers,
button = b.button,
on_press = function()
b:emit_signal('press', object)
end,
on_release = function()
b:emit_signal('release', object)
end
}
btns[#btns + 1] = btn
end
return btns
end
end
tag_widget:buttons(create_buttons(buttons, object))
@@ -102,9 +96,10 @@ local list_update = function (widget, buttons, label, data, objects)
tag_widget:set_bg("#3A475C")
end
-- Set the icon for each client
for _, client in ipairs(object:clients()) do
tag_label_margin:set_right(0)
local icon = wibox.widget{
local icon = wibox.widget {
{
id = "icon_container",
{
@@ -115,21 +110,22 @@ local list_update = function (widget, buttons, label, data, objects)
widget = wibox.container.place
},
tag_icon_margin,
forced_width = dpi(33),
margins = dpi(6),
widget = wibox.container.margin
forced_width = dpi(33),
margins = dpi(6),
widget = wibox.container.margin
}
icon.icon_container.icon:set_image(Get_icon("Papirus-Dark", client))
tag_widget.widget_margin.container:setup({
tag_widget.container:setup({
icon,
layout = wibox.layout.align.horizontal
strategy = "exact",
layout = wibox.container.constraint,
})
end
local old_wibox, old_cursor, old_bg
tag_widget:connect_signal(
"mouse::enter",
function ()
function()
old_bg = tag_widget.bg
if object == awful.screen.focused().selected_tag then
tag_widget.bg = '#dddddd' .. 'dd'
@@ -146,7 +142,7 @@ local list_update = function (widget, buttons, label, data, objects)
tag_widget:connect_signal(
"button::press",
function ()
function()
if object == awful.screen.focused().selected_tag then
tag_widget.bg = '#bbbbbb' .. 'dd'
else
@@ -157,7 +153,7 @@ local list_update = function (widget, buttons, label, data, objects)
tag_widget:connect_signal(
"button::release",
function ()
function()
if object == awful.screen.focused().selected_tag then
tag_widget.bg = '#dddddd' .. 'dd'
else
@@ -168,7 +164,7 @@ local list_update = function (widget, buttons, label, data, objects)
tag_widget:connect_signal(
"mouse::leave",
function ()
function()
tag_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
@@ -182,31 +178,31 @@ local list_update = function (widget, buttons, label, data, objects)
end
end
local tag_list = function (s)
local tag_list = function(s)
return awful.widget.taglist(
s,
awful.widget.taglist.filter.noempty,
gears.table.join(
awful.button(
{ },
{},
1,
function (t)
function(t)
t:view_only()
end
),
awful.button(
{ modkey },
1,
function (t)
function(t)
if client.focus then
client.focus:move_to_tag(t)
end
end
),
awful.button(
{ },
{},
3,
function (t)
function(t)
if client.focus then
client.focus:toggle_tag(t)
end
@@ -215,23 +211,23 @@ local tag_list = function (s)
awful.button(
{ modkey },
3,
function (t)
function(t)
if client.focus then
client.focus:toggle_tag(t)
end
end
),
awful.button(
{ },
{},
4,
function (t)
function(t)
awful.tag.viewnext(t.screen)
end
),
awful.button(
{ },
{},
5,
function (t)
function(t)
awful.tag.viewprev(t.screen)
end
)

View File

@@ -4,12 +4,12 @@ local dpi = require('beautiful').xresources.apply_dpi
local gears = require('gears')
local color = require('theme.crylia.colors')
local list_update = function (widget, buttons, label, data, objects)
local list_update = function(widget, buttons, label, data, objects)
widget:reset()
local count
for i, object in ipairs(objects) do
count = i
local task_widget = wibox.widget{
local task_widget = wibox.widget {
{
{
{
@@ -47,14 +47,14 @@ local list_update = function (widget, buttons, label, data, objects)
},
bg = color.color["White"],
fg = color.color["Grey900"],
shape = function (cr, width, height)
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end,
widget = wibox.container.background
}
local task_tool_tip = awful.tooltip{
objects = {task_widget},
local task_tool_tip = awful.tooltip {
objects = { task_widget },
mode = "inside",
align = "right",
delay_show = 1
@@ -83,6 +83,7 @@ local list_update = function (widget, buttons, label, data, objects)
return btns
end
end
task_widget:buttons(create_buttons(buttons, object))
local text, bg, bg_image, icon, args = label(object, task_widget.container.layout_it.title)
@@ -92,7 +93,7 @@ local list_update = function (widget, buttons, label, data, objects)
else
local text_full = text:match('>(.-)<')
if text_full then
text = object.class:sub(1,20)
text = object.class:sub(1, 20)
task_tool_tip:set_text(text_full)
task_tool_tip:add_to_object(task_widget)
else
@@ -110,55 +111,55 @@ local list_update = function (widget, buttons, label, data, objects)
widget:add(task_widget)
widget:set_spacing(dpi(6))
local old_wibox, old_cursor, old_bg
task_widget:connect_signal(
"mouse::enter",
function ()
old_bg = task_widget.bg
task_widget:connect_signal(
"mouse::enter",
function()
old_bg = task_widget.bg
if object == client.focus then
task_widget.bg = '#dddddddd'
task_widget.bg = '#dddddddd'
else
task_widget.bg = '#3A475Cdd'
end
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = "hand1"
end
end
)
local w = mouse.current_wibox
if w then
old_cursor, old_wibox = w.cursor, w
w.cursor = "hand1"
end
end
)
task_widget:connect_signal(
"button::press",
function ()
if object == client.focus then
task_widget:connect_signal(
"button::press",
function()
if object == client.focus then
task_widget.bg = "#ffffffaa"
else
task_widget.bg = '#3A475Caa'
end
end
)
end
)
task_widget:connect_signal(
"button::release",
function ()
if object == client.focus then
task_widget:connect_signal(
"button::release",
function()
if object == client.focus then
task_widget.bg = "#ffffffdd"
else
task_widget.bg = '#3A475Cdd'
end
end
)
end
)
task_widget:connect_signal(
"mouse::leave",
function ()
task_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end
)
task_widget:connect_signal(
"mouse::leave",
function()
task_widget.bg = old_bg
if old_wibox then
old_wibox.cursor = old_cursor
old_wibox = nil
end
end
)
end
return widget
end