k
k copied to clipboard
[WIP] Implement conditional highlighting of permissions, user and group
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.