fogine / udiskie-dmenu

Manage removable devices in couple of keystrokes!
MIT License
43 stars 5 forks source link

Does not launch with rofi #10

Closed The-Compiler closed 4 years ago

The-Compiler commented 4 years ago

When I try to run UDISKIE_DMENU_LAUNCHER=rofi udiskie-dmenu like mentioned in the README, I get:

dmenu error: Rofi is unsure what to show.
Please specify the mode you want to show.

    rofi -show {mode}

Normally I'd run rofi -dmenu for its dmenu mode, and the readme suggests that flags can be passed via UDISKIE_DMENU_LAUNCHER - however, that doesn't actually work, because the string in there doesn't seem to be split/interpreted in any way:

UDISKIE_DMENU_LAUNCHER="rofi -dmenu" udiskie-dmenu                                       
events.js:291
      throw er; // Unhandled 'error' event
      ^

Error: spawn rofi -dmenu ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
    at onErrorNT (internal/child_process.js:464:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
    at onErrorNT (internal/child_process.js:464:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn rofi -dmenu',
  path: 'rofi -dmenu',
  spawnargs: []
}
fogine commented 4 years ago

This is a wrapper script I use:

#!/bin/sh

UDISKIE_DMENU_LAUNCHER="rofi" udiskie-dmenu -matching regex -dmenu -i -kb-accept-alt "" -kb-custom-1 "Shift+Return" -no-custom -multi-select -theme $HOME/.dotfiles/rofi/dmenu_vertical_theme.css

if that doesn't work with the most recent version of rofi, then there were major changes that broke the compatibility and I will fix it... let me know..

fogine commented 4 years ago

UDISKIE_DMENU_LAUNCHER="rofi -dmenu" udiskie-dmenu

is not valid though, UDISKIE_DMENU_LAUNCHER takes the name of the executable only

fogine commented 4 years ago

When I try to run UDISKIE_DMENU_LAUNCHER=rofi udiskie-dmenu like mentioned in the README,

rofi expects at least -dmenu flag as the example in readme includes..

Closing this. Please feel free to reopen if it still doesn't work for you.

The-Compiler commented 4 years ago

Thanks for the quick reply! That makes sense and does indeed work.

What confused me is that the readme also says:

The following example redefines the custom shortcut to Shift+Enter:

UDISKIE_DMENU_LAUNCHER='rofi -kb-accept-alt "" -kb-custom-1 "Shift+Return"'

That'd be just as wrong then, no? That doesn't work for me, and it does suggest that arguments can be part of UDISKIE_DMENU_LAUNCHER.

fogine commented 4 years ago

@The-Compiler You are right, fixed, thanks.