Giter VIP home page Giter VIP logo

bemenu_frecency's Introduction

bemenu_frecency

This shell script displays commands sorted by their frecency, which is a measure combining both frequency and recency.

I wrote this script for using it with bemenu but it can also be used with any dmenu like programs. To use it with dmenu, apply the required patches first and then,

cp bemenu_run dmenu_run
sed -i 's/bemenu/dmenu/' dmenu_run

Patches

The below patches improve the functionality of bemenu_run, apply them using patch command,

patch < patches/patch_name.diff
  • bemenu_atime.diff - this allows sorting the unlaunched commands by their access time instead of their alphabetical order. This minimizes keystrokes by providing recently launched commands first.
  • bemenu_zsh_af.diff - this allows launching zsh aliases and functions through bemenu_run.

History file

Each launched command occupies a single line in the history file, and that line will be structured like this,

# n = maximum no. of timestamps allowed [default: 10]
command | launch count | timestamp(n) [latest timestamp] | timestamp(n - 1) | ... | timestamp(1) 

If you had removed a command from your system, then remove the line associated with that command so that it doesn't display unnecessarily. You can also modify the timestamp and launch count values if you want.

About the algorithm

The Frecency algorithm is first known to be implemented in Mozilla Firefox. My implementation is based on this article.

bemenu_frecency's People

Contributors

surrealreverie avatar

Stargazers

Brenden Hoffman avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.