Giter Site home page Giter Site logo

rofi-search's Issues

[Bug] Duckduckgo not working

With environment variable

Okay i followed your usage guide and set ROFI_SEARCH to ddgr.
When i start rofi-search it displays:
{"prompt":"search","input action":"send"}
and waits for input but doesn't open the search gui.
When i type something into the commandline and hit enter this error pops up (e.g. "a"):

undefined:1
a
^

SyntaxError: Unexpected token a in JSON at position 0
    at JSON.parse (<anonymous>)
    at ReadStream.<anonymous> (/usr/lib/node_modules/rofi-search/rofi-search:80:36)
    at Array.forEach (<anonymous>)
    at ReadStream.<anonymous> (/usr/lib/node_modules/rofi-search/rofi-search:78:22)
    at ReadStream.emit (node:events:527:28)
    at emitReadable_ (node:internal/streams/readable:601:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v17.7.2

Without environment variable

Okay after that i tried it without the environment variable set but no googler installed.
Then the GUI opens and when i type something in it, it immediately crashes and shows this error:

Can not find "googler" executable.
BlocksMode-Message: 18:57:03.494: Child 257334 exited abnormally

Which makes sense because googler isn't installed. But shouldn't there be a fallback if googler is not installed to use ddgr?

Information about system and installation

I'm using endeavouros with i3-gaps. I use the linux-zen kernel.
I installed it using AUR but the rofi-blocks-git PKGBUILD file was faulty. So i installed rofi-blocks via makepkg -si and an edited version of the PKGBUILD file. More information on that in the AUR Package comments for rofi-blocks-git.

rofi-search spawns rofi

Greetings,

For what I could find, rofi-search spawns internally rofi which makes it incompatible with the provided examples.

$ rofi -modi blocks -blocks-wrap rofi-search -show blocks

(process:773472): Helper-WARNING **: 00:15:00.469: Failed to set lock on pidfile: Rofi already running?

(process:773472): Helper-WARNING **: 00:15:00.469: Got error: -1 Socket operation on non-socket
BlocksMode-Message: 00:15:00.474: Child 773464 exited normally

image

image

Is there a solution for that? If rofi-search spawns rofi internally, it would be nice to be able to pass arguments to rofi. Otherwise rofi should not be launched internally.

Odd output

For whatever reason when I use this the output comes through fairly garbled.
This is what it looks like. https://imgur.com/5NIG007

This is the command I'm using.

rofi -modi blocks -blocks-wrap /usr/bin/rofi-search -show blocks \ 
-lines 4 -eh 4 -kb-custom-1 'Control+y' -theme /usr/share/rofi/themes/glue_pro_blue.rasi

I'm guessing that it's either a font problem or I'm missing a dependency. I'm not sure which is most likely. I installed through the AUR.

Search time string 'unavailable'

Rofi's message box for reporting 'search time' is only displaying:

about <unavailable> results (<unavailable> seconds)

Not a big deal, just figured I would report it while I am here. I do wonder if its something with my environment but have yet to figure it out.

EDIT: Read over this my first time through doc:

(ddgr, googler) ...does not parse information about number of search results so this information is not currently available when using this method

Assuming that why, issue can be closed...sorry.

DX Suggestions and ... questions.

One

number one on my wtf list is this:

#!/bin/sh
':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@"

console.log('Hello world');

I understand this part: $(command -v nodejs || command -v node)" "$0" "$@"

  • if there's a command on called nodejs, or node, then
  • execute the current file "$0" with whatever args were passed originally "$@"

but the part I'm not entirely understanding is ':' //; :

  • ':' i get that this is just a string so bash does nothing with it?
  • // ; ???? lmao wut?

Second

this lead me to be think about the experience editing this file:

  • because it ends in .sh, or
  • because there's no vim modelines,

There's no automatic correct syntax highlighting (whole file is considered bash so shellcheck screams about everything)

So the second question is did you try this instead:

  • rename the file to rofi-search.js (now the file gets automatic syntax highlighting regardless of the editor)
  • change the hashbang to #!/usr/bin/env node (now the js file will execute with nodejs)

image


My only assumption is that you're trying to account for ubuntu users that incorrectly have nodejs installed via apt as nodejs.

clearing query causes crash

Hi,

I installed your patched rofi-blocks and dropped rofi-search in my $PATH.

rofi command:

rofi -modi blocks -blocks-wrap /usr/local/bin/rofi-search -show blocks -lines 4 -eh 4 -kb-custom-1 'Control+y' -theme /home/clu/.config/rofi/brotab.rasi

Steps to reproduce

  • type any search string
  • backspace to clear query string

What behavior you see

Rofi exits with message:

[ERROR] string index out of range
BlocksMode-Message: 15:17:03.012: Child 309732 exited abnormally

What behavior you expect to see

  • Rofi remains open, allow for another query to be made.

I am unsure if this is expected behavior or perhaps a limitation of the implementation. If I clear the current query string, and quickly type another query a crash can be avoided.

Thanks for sharing this tool. It's impressive what can be accomplished with rofi, and rofi-search is making me rethink some of my own scripts, haha.

How do I use this?

There are instructions for installing the package, but not for how to use it in conjuction with rofi

I tried running it in the terminal but just got this:

~
❯ rofi-search
{"prompt":"search","input action":"send"}

does rofi need to configured in a certain way to make use of this package?

wish: support passing a custom browser command

I use a "work profile" and a "personal profile" and I might want to open a search result in either.

Also, a custom browser command could be used to launch an Incognito search.

The custom browser command may contain spaces, as itself might include options passed to a browser binary.

not able to open link in browser

not able to open search results in the browser. I have added -kb-accept-entry but nothing happens I am able to copy the URL by pressing control+y.

[support] Add keyboard shortcut (xfce4)

Hello,

Thanks for this great piece of software.

But I fail to map it to a hotkey in xfce4.

How would I go about this ? I'd like to use ddgr.

rofu itself works great and all needed dependencies are installed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.