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

[WIP] Implement conditional highlighting of permissions, user and group #90

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

xPMo
Copy link

@xPMo xPMo commented Mar 10, 2019

Two methods, currently set by K_PERM_COLOR

  • absolute: u ⇒ green, g ⇒ yellow, o ⇒ red (same as grc)
  • relative: u,g ⇒ fade if user doesn't have UID/GID

This PR also:

  • Only fades the owner and group if the UID and GID matches
  • colors all link permissions with K_COLOR_LN, since they don't have any bearing on the actual permissions used.

Unfortunate consequences of the methods I used:

  • Runs zstat a second time on every file, to get numeric values for uid and gid. (OTOH, this does bring up possibilities for using numeric values elsewhere for speed. date/time methods especially)
  • Uses a few temp variables to do add color in the ${string//match/replacement}

If there is interest, I would be happy to change things, clean this up, split this it up atomically, get it merge-ready.

Demo screenshot

xPMo added 2 commits March 9, 2019 23:48
Two methods, set by K_PERM_COLOR
abs*: u ⇒ green, g ⇒ yellow, o ⇒ red
rel*: u,g ⇒ fade if user doesn't have UID/GID
@xPMo
Copy link
Author

xPMo commented Mar 11, 2019

Alternate relative method: Don't fade all the -s, just each (rwx) column group.

Demo screenshot

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

Successfully merging this pull request may close these issues.

1 participant