Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change username color to RED when su to root #321

Open
Halfwalker opened this issue Feb 29, 2020 · 1 comment
Open

Change username color to RED when su to root #321

Halfwalker opened this issue Feb 29, 2020 · 1 comment

Comments

@Halfwalker
Copy link

Change the default username color to something like blue (via variable, so it's changeable). Then, when user su's to root or logs in as root, change username color to RED. This would be a good visual warning that you might be doing something with root privs by mistake ...

So the _username function would check the euid, and if 0 set color to RED

@gpakosz
Copy link
Owner

gpakosz commented Mar 4, 2020

Actually a dupe of #155

You can combine #{?} and #{==:}:

tmux_conf_theme_status_right='#{?#{==:#{username},root},#[fg=red],}#{username}#[inherit]'

I'm not sure how I want to generalize this. This doesn't compose well with segment colors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants