28 lines
824 B
Lua
28 lines
824 B
Lua
|
local awful = require("awful")
|
||
|
local gears = require("gears")
|
||
|
local wibox = require("wibox")
|
||
|
local awmtk = require("awmtk")
|
||
|
|
||
|
return function(args)
|
||
|
local style = awmtk.style(awmtk.defaults, args.style or {},"username_")
|
||
|
local icon = style.icon({
|
||
|
{
|
||
|
widget = wibox.widget.imagebox,
|
||
|
image = style["username_logout_icon"],
|
||
|
id = "widget_icon",
|
||
|
resize = true
|
||
|
},
|
||
|
{
|
||
|
widget = wibox.widget.textbox,
|
||
|
markup = os.getenv("USER"),
|
||
|
id = "widget_text"
|
||
|
},
|
||
|
layout = wibox.layout.fixed.horizontal,
|
||
|
spacing = style.username_container_spacing_horizontal or 4
|
||
|
})
|
||
|
icon:get_children_by_id("widget_icon")[1]:connect_signal("button::press",function()
|
||
|
awesome.quit()
|
||
|
end)
|
||
|
return icon
|
||
|
end
|