Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

YodaEmbedding/frece

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

119 Commits

Repository files navigation

License: MIT CI Status Publish Status

Maintain a database sorted by frecency (frequency + recency).

Installation

Simply download the latest release and add the frece executable to PATH.

Arch Linux users may install from the AUR packages frece or frece-git.

Commands

frece provides the following subcommands:

increment Increases an entry's count and resets its timer
init Creates a database file from given list of entries
print Prints list of frecency sorted entries
update Updates a database file from given list of entries

See frece --help or the Examples section for more information.

Examples

General

Begin by creating a database:

# Create list of entries
$ echo "apple
banana
cherry" > fruits.txt
# Initialize a database using list of items
$ frece init "fruits.db" "fruits.txt"

Access entries and print out a frecency sorted list of entries:

# Access an entry
$ frece increment "fruits.db" "cherry"
# Print out frecency sorted list
$ frece print "fruits.db"
cherry
apple
banana

Furthermore, a database can be updated with new entries:

# Create another list
$ echo "apple
cherry
elderberry
grapefruit" > fruits.txt
# Update database with new list
# Optionally, purge old entries like "banana"
$ frece update "fruits.db" "fruits.txt" --purge-old
# Print out frecency sorted list (verbosely)
$ frece print "fruits.db" --verbose
frecency count last access date item
0.128476 1 2019年05月17日T00:49:14+00:00 cherry
0.000000 0 1970年01月01日T00:00:00+00:00 apple
0.000000 0 1970年01月01日T00:00:00+00:00 elderberry
0.000000 0 1970年01月01日T00:00:00+00:00 grapefruit

Rofi

The following examples may be found in the examples directory:

examples/dir Open a directory
examples/emoji Copy an emoji to clipboard
examples/file Open a file

For instance, examples/dir may be used as follows:

  1. Initialize/update a database in $HOME/.frece_dir.db, providing a list of paths to directories to index:

    SEARCH_PATHS=("$HOME" "/some/other/path")
    ./examples/dir_update.sh "${SEARCH_PATHS[@]}"

    Tip: run this periodically via a systemd timer or cronjob to refresh the database.

  2. Open with rofi, optionally providing a list of arguments:

    ROFI_ARGS=(-p 'folders' -i -levenshtein-sort)
    ./examples/dir_rofi.sh "${ROFI_ARGS[@]}"

    This will open up a rofi menu with entries sorted by frecency:

Similarly, other examples are offered, including a rofi script to copy emojis to clipboard:

About

Maintain a database sorted by frecency (frequency + recency)

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /