Rsearch, a rofi files search tool

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
User avatar
Girafenaine
Posts: 132
Joined: Fri Aug 02, 2019 8:02 am

Re: Rsearch, a rofi files search tool

#11 Post by Girafenaine »

Hello @josevidal ,
Thanks for the kind words you took the time to write.
I have been using this script as my daily search tool for years now, and still find it as useful (same version as my last post in this thread). Glad if you can use it yourself and adapt it to your needs !

I started with Albert too, on a Macbook a long time ago. I wanted to have something as snappy as Albert was. I ended with rofi, F1 key to classical apps list, and F2 for rsearch through my files.

I will have a look at your idea about copy mode for rsearch. I have to think out a way to deal with keeping a choice between "open the file" and "copy the file’s path".
Personal: MX-Fluxbox 23 (Dell XPS 15 Laptop, Intel Core i7-9750H, GeForce 1650, RAM 16 Gb, SSD 500 Gb)
Work: AntiX 21 runit Fluxbox + AntiX 19 Fluxbox ("frugal" installs on Windows laptop)

User avatar
josevidal
Posts: 7
Joined: Sun Oct 11, 2020 12:01 pm

Re: Rsearch, a rofi files search tool

#12 Post by josevidal »

Hello @Girafenaine , I am reading rofi's documentation.

There is an option to send an alternative command by pressing shift+Return . -kb-accept-alt [command] or -kb-custom-1 [command]
I'm not getting it to work though. When it works I will use it to open the folder where the file is.

I will continue reading
Enjoying with: MX Linux 23 xfce

User avatar
Girafenaine
Posts: 132
Joined: Fri Aug 02, 2019 8:02 am

Re: Rsearch, a rofi files search tool

#13 Post by Girafenaine »

Hello @josevidal ,

Thanks for your post.

The way this script uses rofi is "dmenu" mode : it takes a file (or STDIN) as an entry, show you the files with its nice fuzzy search, and gives the selected file back to your script. It’s the script that tells which action is done on this file (and this action is : open the file).

And I don’t know yet how to have more than one action once modi has given back the selected file…

However, you could use fzf. It’s a command line tool that act like my script, with a great fuzzy search. It just gives the file you select, so it should be easy to copy the path if needed.
Personal: MX-Fluxbox 23 (Dell XPS 15 Laptop, Intel Core i7-9750H, GeForce 1650, RAM 16 Gb, SSD 500 Gb)
Work: AntiX 21 runit Fluxbox + AntiX 19 Fluxbox ("frugal" installs on Windows laptop)

User avatar
ceeslans
Posts: 832
Joined: Sun Apr 14, 2019 3:48 am

Re: Rsearch, a rofi files search tool

#14 Post by ceeslans »

@Girafenaine : Dunno why, but I seem to have missed your 2021 posts; guess back then I wasn't focused that much on rofi's capabilities...
My belated thanks for sharing your rsearch script, I've created a Alt+F1 keybind for easy access and daily use to my $HOME files.

Whilst on the subject, I'm also relying heavily on fsearch, which gives instant access to system-wide files/folders (it won't quit after first selection, which comes in handy when checking out multiple findings)
Sony Vaio VPCF23P (2011), Intel Core i7-2670, 6gb RAM, 240gb SSD, MX-Linux 23 based Fluxbox v/1.3.7+
Lenovo Thinkpad L560 (2016), Intel Core i5-6200, 16gb RAM, 240gb SSD, Devuan Daedalus based Fluxbox v/1.3.7+

User avatar
thomasl
Posts: 480
Joined: Sun Feb 04, 2018 9:26 am

Re: Rsearch, a rofi files search tool

#15 Post by thomasl »

ceeslans wrote: Mon Aug 05, 2024 2:47 amWhilst on the subject, I'm also relying heavily on fsearch, which gives instant access to system-wide files/folders (it won't quit after first selection, which comes in handy when checking out multiple findings)
+1. fsearch is extremely fast (especially when used with the right options), can do regex searches and can sort results according to name, size, mod date (though so far not access time --> perhaps I should open a github issue to have this implemented in a future version).
Frugal installs on Lenovo ThinkPad L14 Ryzen 5 4650U/24GB * HP Pavilion Ryzen 3 3300U/16GB * Toshiba R950 i5-3340M/12GB
I have a reservation... What do you mean it's not in the COMPUTER!

User avatar
Girafenaine
Posts: 132
Joined: Fri Aug 02, 2019 8:02 am

Re: Rsearch, a rofi files search tool

#16 Post by Girafenaine »

Hello,

Thanks @ceeslans and @thomasl !

I do use fsearch as well. I remember fsearch was not able to sort results by modification time when I tried, a few years ago. Perhaps I just didn’t found it…
fsearch is indeed very fast, and more powerful with some useful options.

However it does not integrate in fluxbox as well as rsearch does in my opinion !
‑ rsearch script uses only find, sort… and rofi. Very simple and robust, like fluxbox the way I see it.
‑ rofi is visually light and very suited for a "keyboard only" use of fluxbox. I use gruvbox theme and like it.

With a "Meta+r" shorcut, rsearch is very convenient for my daily use (full line in keys file : Mod4 r :Exec ~/.local/bin/rsearch -i 90)
I also use :
‑ "Meta+shift+r" for rsearch including hidden files (full line in keys file : Mod4 Shift r :Exec ~/.local/bin/rsearch -hf -d)
- a line in the startup file to update the database :

Code: Select all

bash -c "sleep 300 && /home/user/.local/bin/rsearch --update" &
bash -c "sleep 300 && /home/user/.local/bin/rsearch --update -d -hf" &
And "Meta+space" for rofi as an app launcher. With the same visual theme to search for apps or files, I find it nice and quite a "polished experience" !
Personal: MX-Fluxbox 23 (Dell XPS 15 Laptop, Intel Core i7-9750H, GeForce 1650, RAM 16 Gb, SSD 500 Gb)
Work: AntiX 21 runit Fluxbox + AntiX 19 Fluxbox ("frugal" installs on Windows laptop)

User avatar
thomasl
Posts: 480
Joined: Sun Feb 04, 2018 9:26 am

Re: Rsearch, a rofi files search tool

#17 Post by thomasl »

Girafenaine wrote: Tue Aug 06, 2024 4:57 pmI do use fsearch as well. I remember fsearch was not able to sort results by modification time when I tried, a few years ago. Perhaps I just didn’t found it…
fsearch is indeed very fast, and more powerful with some useful options.

However it does not integrate in fluxbox as well as rsearch does in my opinion !
‑ rsearch script uses only find, sort… and rofi. Very simple and robust, like fluxbox the way I see it.
‑ rofi is visually light and very suited for a "keyboard only" use of fluxbox. I use gruvbox theme and like it.
Re sorting the results of fsearch: if you right-click on the result listbox columns, you can select which columns are shown by fsearch. Enable "Date Modified" and after the column appears it can be clicked to have results sorted by mod date. See pic. (Actually, I'd think adding another column for access date wouldn't be that hard.)
Image

Re integration. I can't say anything about fluxbox as I'm on XFCE but fsearch has a nice context menu to deal with found entries.

The main thing that makes fsearch indispensable for me (next to its raw speed) is the live updating of search results, especially when combined with its powerful regex engine.

And if you like fast search tools have a look at fd: https://github.com/sharkdp/fd This is not as powerful as find but IMO easier to use and faster.
Frugal installs on Lenovo ThinkPad L14 Ryzen 5 4650U/24GB * HP Pavilion Ryzen 3 3300U/16GB * Toshiba R950 i5-3340M/12GB
I have a reservation... What do you mean it's not in the COMPUTER!

User avatar
Girafenaine
Posts: 132
Joined: Fri Aug 02, 2019 8:02 am

Re: Rsearch, a rofi files search tool

#18 Post by Girafenaine »

Hello @thomasl

Since your previous post I have tried again fsearch and checked the sorting abilities ! It is indeed powerful and snappy.

Personnally I don’t need regex or other abilities for my daily use, and I value more the "polished and frugal" experience with rofi and rsearch.

As for fd, you’re right ! It’s much better than find, and very fast. I begin to use it a month ago, and it "kills" traditionnal find command in every aspect. I changed my rsearch script to use fd instead of find inside.
However :
- fd is much faster, but the "sort" command that follows (to get more recently modified files first) is the real bottleneck. So the script is globally only slightly faster.
- fd has no option to print more chosen details about each file (you can only select a "ls -l" way, with too much info printed). rsearch script makes use of this option to add the modification time in the right place.
- and fd is not installed as a default command line tool
So I find better to share a more universal rseach version now with find inside.

Actually, I am getting used to yazi file explorer, which is very interesting and a fast TUI tool. It integrates fd but also fzf as search commands - and a lot of other great simple command line tools.
Personal: MX-Fluxbox 23 (Dell XPS 15 Laptop, Intel Core i7-9750H, GeForce 1650, RAM 16 Gb, SSD 500 Gb)
Work: AntiX 21 runit Fluxbox + AntiX 19 Fluxbox ("frugal" installs on Windows laptop)

User avatar
thomasl
Posts: 480
Joined: Sun Feb 04, 2018 9:26 am

Re: Rsearch, a rofi files search tool

#19 Post by thomasl »

@Girafenaine Now it's my turn to have a look ;) as I had already looked at yazi but haven't done so for a good while now. Thanks for reminding me!
Frugal installs on Lenovo ThinkPad L14 Ryzen 5 4650U/24GB * HP Pavilion Ryzen 3 3300U/16GB * Toshiba R950 i5-3340M/12GB
I have a reservation... What do you mean it's not in the COMPUTER!

Post Reply

Return to “Tips & Tricks by users (not for help)”