MarkHedleyJones/dmenu-extended

Remove prefix from filenames

adityam opened this issue · 4 comments

Is it possible to add an option to remove '$HOME' (or perhaps a user specified prefix) from the list before displaying the files?

It would be possible to add such an option, but here are some reasons that I'm hoping will convince you that it's not a good idea.

  1. It would require making an alias for every file in the cache. So... when you execute Pictures/cat.png, the menu would have to look-up the alias table and get the full-path to the file. That adds a layer of complexity that every plug-in or special use character (e.g. ...@, ...:...) would have to deal with.
  2. Because the paths are being modified, how would you deal with the case where two paths, that were previously unique, have become the same (e.g. /home/username/Pictures/cat.png -> Pictures/cat.png, and /etc/var/www/Pictures/cat.png -> Pictures/cat.png?

What could work may be to just replace /home/username with ~ which would make the paths a bit tidier (for ones under the users home directory) and still keep them absolute (full paths).

Hi again.
Try the branch in #106 and let me know if that does what you're hoping for.
See the README.md in that branch for details on how to enable it.

Thanks. This works perfectly!