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

8
awesome/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

8
awesome/.idea/awesome.iml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="CPP_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
awesome/.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/awesome.iml" filepath="$PROJECT_DIR$/.idea/awesome.iml" />
</modules>
</component>
</project>

View File

@@ -260,7 +260,7 @@ function _M.get()
{ modkey },
"d",
function ()
awful.spawn("rofi -show run")
awful.spawn("rofi -show drun -theme ~/.config/rofi/appmenu/rofi.rasi")
end,
{ descripton = "Start a Application", group = "Application" }
),
@@ -268,7 +268,7 @@ function _M.get()
{ modkey },
"Tab",
function ()
awful.spawn("rofi -show window")
awful.spawn("rofi -show window -theme ~/.config/rofi/appmenu/rofi.rasi")
end,
{ descripton = "Start a Application", group = "Application" }
),

View File

@@ -115,6 +115,7 @@ awful.screen.connect_for_each_screen(
s.calendar_osd = require("theme.crylia.modules.calendar_osd")()
s.addtag = require("theme.crylia.widgets.addtag")()
s.layoutlist = require("theme.crylia.widgets.layout_list")()
s.powerbutton = require("theme.crylia.widgets.power")()
s.top_left:setup {
@@ -204,6 +205,13 @@ awful.screen.connect_for_each_screen(
{
s.clock,
left = dpi(3),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
},{
s.powerbutton,
left = dpi(3),
right = dpi(6),
top = dpi(6),
bottom = dpi(6),

View File

@@ -13,7 +13,7 @@ local _M = { }
local terminal = RC.vars.terminal
M.session = {
{ "Logout", function () awful.spawn.with_shell('logout') end },
{ "Logout", function () awesome.quit() end },
{ "Shutdown", function () awful.spawn.with_shell('shutdown now') end },
{ "Reboot", function () awful.spawn.with_shell('reboot') end },
}

View File

@@ -88,6 +88,6 @@ awful.rules.rules = main.rules(
require("main.signals")
-- Autostart programs
awful.spawn.with_shell("~/.screenlayout/screen.sh")
awful.spawn.with_shell("~/.screenlayout/single_screen.sh")
awful.spawn.with_shell("picom --experimental-backends")
awful.spawn.with_shell("xfce4-power-manager")

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