Recent files rofi script

Help for MX Fluxbox
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
mg979
Posts: 31
Joined: Fri Jan 05, 2018 9:37 am

Recent files rofi script

#1 Post by mg979 »

Hi, I made a script some time ago to open recent files with rofi. It's in two files, the main script and another script that finds the icons paths (they are cached in ~/.local/share/rofi-recent-icons-cache)
Image

The scripts are in the archive, they go into ~/.fluxbox/scripts

Code: Select all

Usage:		env ROFI_RECENT_MODE=files ROFI_ICONS_THEME=Papirus-Dark \
  			rofi -show recent -modi recent:path/to/rofi-recent-files \
  			-kb-custom-1 "Alt-space" -kb-custom-2 "Alt-Delete" \
  			-kb-custom-3 "Alt-r"
                                                                         
Alt-space is used to toggle between recent files and directories.
Alt-delete is used to remove an entry from the recent files.
Alt-r is used to refresh the icons cache (necessary when changing theme)
It's recommended to use this keybinding in ~/.fluxbox/keys

Code: Select all

Mod1 space :Exec env ROFI_RECENT_MODE=files ROFI_ICONS_THEME=Papirus-Dark rofi -show recent -modi recent:~/.fluxbox/scripts/rofi-recent-files -kb-custom-1 "Alt-space" -kb-custom-2 "Alt-Delete" -kb-custom-3 "Alt-r"
That is, Alt-space shows recent files, hit Alt-space again to show recent directories.
You do not have the required permissions to view the files attached to this post.

User avatar
Jerry3904
Administrator
Posts: 23082
Joined: Wed Jul 19, 2006 6:13 am

Re: Recent files rofi script

#2 Post by Jerry3904 »

That sounds interesting, thanks.
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

mg979
Posts: 31
Joined: Fri Jan 05, 2018 9:37 am

Re: Recent files rofi script

#3 Post by mg979 »

Note that I made some changes to the default rofi theme to make it look better

~/.config/rofi/themes/MX-comfort.rasi

Code: Select all

/**
 * ROFI Color theme by Melber & MX-Devs
 */

* {
    // MX-comfort
    // uses flag-for-font-awesome
    // mxrr template-comfort.rasi
    font: "Noto Sans 12";
}

* {
    // Title background
    color01: #1D2324;
    // Title text
    color02: #CACDD0;
    // Searchbar background
    color03: #29353B;
    // Searchbar text
    color04: #ffffff;
    // Inctive tab background
    color05: #29353B;
    // Inctive tab text
    color06: #CACDD0;
    // Active tab background
    color07: #1D2324;
    // Active tab text
    color08: #ffffff;
    // Active tab highlight
    color09: #0f56d9;
    // Selection background
    color10: #0f56d9;
    // Selection text
    color11: #ffffff;
}

window {
anchor: center;
location: center;
y-offset: 0;
x-offset: 0;
width: 30%;
}

mainbox {
    background-color: @color01;
    children: [ inputbar, wrapper-mode-switcher, listview ];
    spacing: 0px;
}

inputbar {
    background-color: @color01;
    text-color: @color02;
    padding: 10px;
    margin: 5px 0px 5px 0px;
    children: [textbox-prompt-colon, entry];
}

textbox-prompt-colon {
    background-color: @color01;
    expand: false;
    font: "FontAwesome 12";
    str:  "  ";
    vertical-align: 0.5;
    text-color: @color02;
}

entry {
    border-radius:  5px 5px 5px 5px;
    background-color: @color03;
    text-color: @color04;
    font: "Noto Sans Bold 12";
    vertical-align: 0.5;
    padding: 5px 15px;
}

wrapper-mode-switcher {
    orientation: horizontal;
    expand: false;
    spacing: 0;
    children: [ mode-switcher ];
}

mode-switcher {
    spacing: 0px;
    expand: true;
}

button {
    background-color: @color05;
    text-color: @color06;
    border: 4px 0px 0px 0px ;
    border-color: @color05;
}

button selected.normal {
    background-color: @color07;
    text-color: @color08;
    border: 4px 0px 0px 0px ;
    border-color: @color09;
}

listview {
    columns: 1;
lines: 12;
    background-color: @color07;
}

element {
    background-color: @color07;
    padding: 6;
    text-color: @color08;
}

element selected {
    background-color: @color10;
    text-color: @color11;
}

element-text {
    background-color: inherit;
    text-color: inherit;
    vertical-align: 0.5;
}

element-icon {
    size: 30;
    background-color: inherit;
    margin: 0px 10px 0px 0px;
}

Post Reply

Return to “MX Fluxbox Official Release”