Skip to content

Custom status bar #1114

Closed Answered by lpnh
og900aero asked this question in Q&A
Jun 3, 2024 · 3 comments · 4 replies
Discussion options

You must be logged in to vote

Hi! Try this:

function Status:permissions()
	local h = cx.active.current.hovered
	if not h then
		return ui.Line {}
	end

	local perm = h.cha:permissions()
	if not perm then
		return ui.Line {}
	end

	local spans = {}
	for i = 1, #perm do
		local c = perm:sub(i, i)
		local style = THEME.status.permissions_t
		if c == "-" then
			style = THEME.status.permissions_s
		elseif c == "r" then
			style = THEME.status.permissions_r
		elseif c == "w" then
			style = THEME.status.permissions_w
		elseif c == "x" or c == "s" or c == "S" or c == "t" or c == "T" then
			style = THEME.status.permissions_x
		end
		spans[i] = ui.Span(c):style(style):fg("black"):bg("red")
	end

	table.insert(spans, 1, ui.Span(

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@og900aero
Comment options

@sxyazi
Comment options

@og900aero
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@og900aero
Comment options

Answer selected by og900aero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants