k icon indicating copy to clipboard operation
k copied to clipboard

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

Open xPMo opened this issue 5 years ago • 1 comments

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 avatar Mar 10 '19 06:03 xPMo