summaryrefslogtreecommitdiff
path: root/experiments/logout-widget/logout.lua
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2020-09-06 21:47:07 -0400
committerstreetturtle <streetturtle@gmail.com>2020-09-06 21:47:07 -0400
commit1fe7e123175aba76128c4460d226a745f75d71e9 (patch)
treefea25df49e44a5c9ec0390830d76f44ac869c359 /experiments/logout-widget/logout.lua
parentcbe255727385b4b86a3d328c8c7479a8cacbf305 (diff)
[logout] improvements
Diffstat (limited to 'experiments/logout-widget/logout.lua')
-rw-r--r--experiments/logout-widget/logout.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/experiments/logout-widget/logout.lua b/experiments/logout-widget/logout.lua
index c68506b..f68d9a7 100644
--- a/experiments/logout-widget/logout.lua
+++ b/experiments/logout-widget/logout.lua
@@ -12,7 +12,7 @@ local capi = {keygrabber = keygrabber }
local wibox = require("wibox")
local gears = require("gears")
local beautiful = require("beautiful")
-local fancybuttons = require("awesome-buttons.awesome-buttons")
+local awesomebuttons = require("awesome-buttons.awesome-buttons")
local HOME_DIR = os.getenv("HOME")
@@ -38,7 +38,7 @@ local action = wibox.widget {
local function create_button(icon_name, action_name, color, onclick)
- local button = fancybuttons.with_icon{ type = 'basic', icon = icon_name, color = color, onclick = onclick }
+ local button = awesomebuttons.with_icon{ type = 'basic', icon = icon_name, color = color, onclick = onclick }
button:connect_signal("mouse::enter", function(c) action:set_text(action_name) end)
button:connect_signal("mouse::leave", function(c) action:set_text(' ') end)
return button
@@ -52,10 +52,10 @@ local function launch(args)
local phrases = args.phrases or {'Goodbye!'}
local onlogout = args.onlogout or function () awesome.quit() end
- local onlock = args.onlock
- local onreboot = args.onreboot
- local onsuspend = args.onsuspend or function () awful.spawn.with_shell("systemctl suspend") end
- local onpoweroff = args.onpoweroff or function () awful.spawn.with_shell("shutdown now") end
+ local onlock = args.onlock or function() awful.spawn.with_shell("systemctl suspend") end
+ local onreboot = args.onreboot or function() awful.spawn.with_shell("reboot") end
+ local onsuspend = args.onsuspend or function() awful.spawn.with_shell("systemctl suspend") end
+ local onpoweroff = args.onpoweroff or function() awful.spawn.with_shell("shutdown now") end
w:set_bg(bg_color)
@@ -110,10 +110,12 @@ local function launch(args)
end
local function widget(args)
+ local icon = args.icon or WIDGET_DIR .. '/power.svg'
+
local res = wibox.widget {
{
{
- image = WIDGET_DIR .. '/power.svg',
+ image = icon,
widget = wibox.widget.imagebox
},
margins = 4,