Page 2 of 2

Re: Rsearch, a rofi files search tool

Posted: Sun Apr 28, 2024 5:55 pm
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".

Re: Rsearch, a rofi files search tool

Posted: Sat Aug 03, 2024 12:38 pm
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

Re: Rsearch, a rofi files search tool

Posted: Sun Aug 04, 2024 4:15 pm
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.

Re: Rsearch, a rofi files search tool

Posted: Mon Aug 05, 2024 2:47 am
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)

Re: Rsearch, a rofi files search tool

Posted: Mon Aug 05, 2024 9:41 am
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).

Re: Rsearch, a rofi files search tool

Posted: Tue Aug 06, 2024 4:57 pm
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" !

Re: Rsearch, a rofi files search tool

Posted: Wed Aug 07, 2024 9:38 am
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.

Re: Rsearch, a rofi files search tool

Posted: Wed Aug 07, 2024 11:04 am
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.

Re: Rsearch, a rofi files search tool

Posted: Wed Aug 07, 2024 12:26 pm
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!