Skip to content

algolg/rofi-recent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rofi-recent

rofi-recent is a script for rofi that provides a way for users to have quick access to recently-used files. The program works by parsing recently-used.xbel using a modified version of System76's recently-used-xbel Rust crate and outputing necessary information to rofi.

Once added as a rofi modi, rofi-recent can be used alongside drun for a convenient file-searching experience.

Table of Contents
  1. Install
  2. Usage
  3. Contributing
rofi-recent_demo.mp4

Install

  1. Download the latest release

  2. Extract the archive and make the program executable

    tar -xvf rofi-recent-vX.Y.Z.tar.gz
    chmod +x ./rofi-recent
  3. Install by moving the program to your preferred location in PATH (run echo $PATH to list locations)

    Ex. this works if ~/.local/bin/ is in PATH:

    mv ./rofi-recent ~/.local/bin/

    Note: if you choose not to install rofi-recent, make sure to give rofi the path to rofi-recent in the next step

Adding rofi-recent to rofi

  1. Add recent:rofi-recent to the modi section in config.rasi:

    configuration {
        modi: "combi,drun,recent:rofi-recent";
        /* ... */
      }

    Note: if you did not install rofi-recent, add recent:/path/to/rofi-recent instead

    See Arguments for options you can add to the command

  2. By using rofi-recent with drun, searching for an application will also show a list of files recently opened in that application (ex. searching for GIMP will also show a list of files recently opened in GIMP, as in the video above)

    This can be done by adding drun and recent to the combi section in config.rasi:

    configuration {
        /* ... */
        combi-modi: "drun,recent";
        /* ... */
      }
  3. For a cleaner experience, I recommend adding this line to config.rasi to remove the prefix for rofi-recent:

    display-recent: "";

Usage

Now, rofi-recent can easily be called from the terminal:

rofi -show recent

If rofi-recent was added as a combi modi, the following command should also work:

rofi -show combi

Arguments

You can optionally add any of these arguments in config.rasi

Argument Accepts a value? Purpose
-l or --limit yes Specify the max number of recent files to list per program. Set to 0 to disable the limit. Default limit is 5 files per program.
-e or --exclude yes Specify programs to exclude from output. Take the program names word-for-word from rofi-recent's output. If excluding multiple programs, encase in quotes with a space between each program (ex. rofi-recent -e "gimp firefox"). Remember to escape quotes if needed.
-s or --show-all-paths no Shows full path for all files

Ex. config.rasi, using all arguments:

configuration {
      modi: "combi,drun,recent:rofi-recent -l 0 -e \"gimp firefox\" -s";
      /* ... */
   }

Contributing

If you want to help improve this program, feel free to fork the repo and make a pull request when you're ready. Contributions are highly appreciated ٩(◕‿◕。)۶

About

A rofi script that provides quick access to recently-used files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages