Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

pull the pfp from Accounts Service if set #132

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions config/awesome/ui/panels/central-panel/user-profile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,20 @@ local function widget()
forced_height = dpi(25),
forced_width = dpi(25),
})


local pfp_imgbox = wibox.widget({
image = beautiful.pfp,
resize = true,
clip_shape = gears.shape.circle,
halign = "center",
valign = "center",
widget = wibox.widget.imagebox,
})

local image = wibox.widget({
{
{
{
image = beautiful.pfp,
resize = true,
clip_shape = gears.shape.circle,
halign = "center",
valign = "center",
widget = wibox.widget.imagebox,
},
pfp_imgbox,
shape = gears.shape.circle,
widget = wibox.container.background,
},
Expand All @@ -89,6 +91,22 @@ local function widget()
layout = wibox.layout.stack,
})

local function pfp(name)
local path = "/var/lib/AccountsService/icons/" .. name
local img = gears.surface.load_uncached(path)
if img ~= nil then pfp_imgbox:set_image(img) end
end

awful.spawn.easy_async_with_shell(
[[
sh -c 'whoami'
]],
function(stdout)
local stdout = stdout:gsub("%\n", "")
pfp(stdout)
end
)

--- username
local profile_name = wibox.widget({
widget = wibox.widget.textbox,
Expand Down