worked on powerbutton

This commit is contained in:
Rene Kievits
2021-10-02 21:03:54 +02:00
parent 558831d305
commit 16508c1fae
21 changed files with 2577 additions and 5 deletions

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13" /></svg>

After

Width:  |  Height:  |  Size: 508 B

View File

@@ -0,0 +1,19 @@
-----------------------------------
-- This is the volume_old module --
-----------------------------------
-- Awesome Libs
local awful = require("awful")
local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/audio/"
return function ()
end

View File

@@ -90,7 +90,7 @@ return function ()
echo "Connected but no internet"
fi
]=]
local update_startup = function ()
if startup then
startup = false

View File

@@ -0,0 +1,93 @@
--------------------------------
-- This is the power widget --
--------------------------------
-- Awesome Libs
local awful = require("awful")
local color = require("theme.crylia.colors")
local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local naughty = require("naughty")
local wibox = require("wibox")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/power/"
return function ()
local power_widget = wibox.widget{
{
{
{
{
{
id = "icon",
image = gears.color.recolor_image(icondir .. "power.svg", color.color["Grey900"]),
widget = wibox.widget.imagebox,
resize = false
},
id = "icon_layout",
widget = wibox.container.place
},
id = "icon_margin",
top = dpi(2),
widget = wibox.container.margin
},
id = "power_layout",
layout = wibox.layout.fixed.horizontal
},
id = "container",
left = dpi(5),
right = dpi(5),
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)
end,
widget = wibox.widget.background
}
-- 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
)
power_widget:connect_signal(
"button::release",
function ()
power_widget.bg = color.color["Red200"] .. "dd"
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
)
return power_widget
end