How to use rofi plugins with the rofr.sh script?
Can you show us the script ? If as I suppose youâre talking about rofi_run it should be like this for launching apps
rofr.sh -r
or for windows view
rofr.sh -w
etcâŚ
and
[don@don-pc ~]$ rofr.sh -h
USAGE: rofr.sh [OPTIONS]
OPTIONS:
-h,--help Display this message
-v,--version Display script version
-w,--window Switch between open windows
-r,--run Program launcher & run dialog
-q,--qalculate Persistant calculator dialog (requires libqalculate)
-c,--clipboard Select previous clipboard entries (requires greenclip)
-b,--browser Browser search by keyword (requires surfraw)
-l,--logout Session logout dialog
Without any options -r,--run will be opened.
[don@don-pc ~]$
Thank you both for your reply.
I already knew all options of rofr.sh script.
I wanted to know how to use rofi plugin scripts. Now i know.
Now i have a new problem.
When i launch this ebook search rofi plugin script , I canât exit from it by pressing ESC. i have to open a book to exit from it.
Edit it
i dont know bash scripting
Create a new script, make it executable and try something like this:
#!/bin/sh
locate /home/alOoOz/Books | rofi -threads 0 -width 50 -dmenu -nb â#1C2023â -sf â#1C2023â -sb â#00EFFFâ -nf â#9B9081â -i -p âBooks:â | xargs -r -0 xdg-open
Of course you need locate as dependency, install it
sudo pacman -S mlocate && sudo updatedb
First database update is a bit long (few seconds) but this works fine for me.
Keep It Simple Stupid
Thatâs because that script uses -only-match
I suggest at the very least
man rofi
to learn the flags and what they do.
That script is also fairly poorly written, something like what @archus provided is a better option.
find ~/Books -name '*.pdf' | rofi -dmenu -i -p 'Books' | xargs -r -0 xdg-open
Everyone starts somewhere, you type commands in a terminal? Itâs no different.
Read the SHELL GRAMMAR
section
man bash
Thanks.
Removing the -only-match part solves the problem
I tried your simple solution.
Why does the list shows full path of the books rather than only the name of the books?
Because itâs easier.
Done from my phone so canât garunteed it works, just play around with it
find ~/Books -name '*.pdf' | awk -F'/' '{print $NF}' | rofi -dmenu -i -p 'Books' | awk '{print '"$HOME/Books/"'$0}' | xargs -r -0 xdg-open
Thanks a lot for your help. Works like a charm
You should edit that awk command to use your $BOOK_DIR
instead of $HOME/Books
that I used above or it wonât work properly.
Remove the xdg-open end to see the output.
oops, didnât see it.
But hey itâs showing correct without changing the awk command
And just now iâve found out that the script doesnât open the selected book
I just tried to open a book that was already opened by that long script so i thought this is working
The selected book is not opening.
Think about what itâs doing, run each individually.