Skip to content

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