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
rofi-recent_demo.mp4
-
Download the latest release
-
Extract the archive and make the program executable
tar -xvf rofi-recent-vX.Y.Z.tar.gz chmod +x ./rofi-recent
-
Install by moving the program to your preferred location in
PATH
(runecho $PATH
to list locations)Ex. this works if
~/.local/bin/
is inPATH
: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
-
Add
recent:rofi-recent
to the modi section inconfig.rasi
:configuration { modi: "combi,drun,recent:rofi-recent"; /* ... */ }
Note: if you did not install rofi-recent, add
recent:/path/to/rofi-recent
insteadSee Arguments for options you can add to the command
-
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
andrecent
to the combi section inconfig.rasi
:configuration { /* ... */ combi-modi: "drun,recent"; /* ... */ }
-
For a cleaner experience, I recommend adding this line to
config.rasi
to remove the prefix for rofi-recent:display-recent: "";
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
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";
/* ... */
}
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 ٩(◕‿◕。)۶