linuxmint / xapp

Cross-desktop libraries and common resources
GNU Lesser General Public License v3.0
128 stars 44 forks source link

Favorites (starred files) #104

Open clefebvre opened 4 years ago

clefebvre commented 4 years ago

Xapp should make it easy to quickly access the user's favorite files.

Starring files

To star a file, right-click it and choose "Star".

To unstar a file, right-click it and choose "Unstar".

Storage

We don't want to use indexing for this. A flat string array in dconf seems perfect.

Utility functions

libxapp should provide utility functions to:

Nemo

Cinnamon menu

Xed, Pix, Xviewer

Xreader

Things to decide

pruning

We probably don't need to prune since the list of starred files is unlikely to get very big. It might be worth being able to unstar files which aren't accessible though (either on unmounted disks, or removed altogether).

The content of the starred place in Nemo could show inaccessible files. These could be shown dimmed for instance with a tooltip that explains why, and that would make it easy for the user to prune by unstarring them.

size of cinnamon menu

Would it be better to have recent and starred items in the same category? If so, how would we separate them?

terminology

Shall we call these files "Starred", or "Favorites"?

compatibility

Starred directories

Should we let users star directories? This can be useful for the following reasons:

If we do, do we consider all files in a starred directory to be starred?

okaestne commented 4 years ago

It might be a little confusing to have both bookmarks and favorites as they seem to serve the same purpose in my opinion. The latter just adds the ability to favorite files instead of folders.

Anyways, I would like to suggest to store these starred files (and folders?) as symlinks in a certain folder instead of dconf for two reasons:

  1. Accessible and manageable via terminal and other apps natively
    1. Access starred items: ls ~/.config/nemo/starred
    2. Un-star item: rm ~/.config/nemo/starred/some-file
  2. Easier to iterate (walk) over all items and to detect invalid entries (broken links)

A problem that still need to be addressed is that starred files (or their parent folders) might be moved or deleted, so we need to track them somehow. A solution might be to add a file monitor to each starred file the same way we are doing it for the bookmarks already.