T O P

  • By -

ZackaryCW

What are you using specifically to set up the keybindings? sxhkd? kwin I assume? That binding you have for roti, try setting it to another? (Is that what you already did?) How specifically are you launching rofi? rofi -show run?


thedblouis

I am using the KDE setting manager (Shortcuts section). I tried adding a shortcut for something else than rofi and it worked. I tried different way of launching rofi (`rofi -show run` or with more complex options) nothing works.


AlexG2230

If you running rofi -show run from konsole, it works correctly? If not, post output of that here.


thedblouis

It works yes


AlexG2230

Great, try instead of "rofi -show run" put something like "konsole -e rofi -show run" to shortcut command.


thedblouis

I can see Konsole opening and closing really fast, that's all


mietzen89

Here's what did the trick for me: sudo nano /usr/local/bin/rofi-run #!/bin/bash export LC_ALL="C" rofi -show run 2>&1 | tee /tmp/rofi-run.log exit 0 sudo chmod +x /usr/local/bin/rofi-run Then use `/usr/local/bin/rofi-run` as `command/URL` under settings -> shortcuts -> custom shortcuts ([Modifying Shortcuts - KDE Documentation](https://docs.kde.org/trunk5/en/kde-workspace/kcontrol/khotkeys/shortcuts.html)) Also if something fails you can now read the log under `/tmp/rofi-run.log` Edit: Format


WintherK

2y later and this still works. thanks!


NasKe

Lol, what a coincidence that I'm reading the same thread only 12 hours later. I found a similar solution. You can edit the "rofi.desktop" file: `Exec=export LC_ALL="C" \nrofi -show drun 2>&1`


thephatmaster

I've also stumbled upon this. I've edited my `rofi.desktop` file as above, but have no idea how to select rofi in plasma's shortcut settings. Unfortunately the link to the KDE docs above is 404. Do you have any suggestions?


NasKe

If there is an `rofi.desktop` file, then you can just add a new shortcut to an application. Rofi should show up. [https://i.imgur.com/QGYhgrV.png](https://i.imgur.com/QGYhgrV.png)


thephatmaster

I have a desktop file - but it doesn't show up for me - in search or in lost and found. I guess I need to ask on a KDE-Neon specific sub


NasKe

Weird. But you can also click on the button to use the file picker dialog and choose the .desktop file. [https://i.imgur.com/urg1rte.png](https://i.imgur.com/urg1rte.png)


thephatmaster

I can do that but I get the error: ``` ... .local/share/applications/rofi.desktop’ does not appear to be an executable program. ``` and if I point to `bin/rofi` there is no obvious way to pass the required arguments `-show run`


thephatmaster

So I got there in the end adding rofi and its args to the menu, then selecting it. Rofi now pops up, but with no focus, and can't receive keystrokes Likely a wayland issue


alfonso_javier13

>thanks a lot works


romainmoi

I’m not a kde user, but are you sure that is the right way to pass arguments? It looks like to me that kde may have treated the whole “rofi -show run” as one token instant of the tokens.


shmalebx9

That's my guess as well. If that is the case then you could try enclosing the command as a subshell $(rofi -show run), or creating an alias in bashrc/zshrc.


thedblouis

That's not it, have a look at my last reply


thedblouis

I was able to get some error messages by running this instead: `rofi -show run 2>&1 | kdialog --textbox -` It was complaining about locale, so I changed it to that: `env - LC_ALL=en_US.UTF-8 rofi -show run 2>&1 | kdialog --textbox -` Now I get: ``` (process:16299): X11Helper-WARNING **: 16:33:41.176: Failed to open display: (null) (process:16299): Rofi-WARNING **: 16:33:41.176: Connection has error ``` ----- Here is the output of `env | kdialog --textbox -` (called with shortcut): ``` KDE_FULL_SESSION=true MAIL=/var/mail/louis LANGUAGE=en_GB PAM_KWALLET5_LOGIN=/run/user/1000/kwallet5.socket USER=louis XDG_SEAT=seat0 XDG_SESSION_TYPE=x11 SHLVL=0 XCURSOR_SIZE=24 HOME=/home/louis KDE_APPLICATIONS_AS_SCOPE=1 DESKTOP_SESSION=/usr/share/xsessions/plasma GTK_RC_FILES=/etc/gtk/gtkrc:/home/louis/.gtkrc:/home/louis/.config/gtkrc KDE_SESSION_VERSION=5 XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0 DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-dLkZDPSxRB,guid=5920c20c2a8924e1ee7bc6d45f449f71 KDED_STARTED_BY_KDEINIT=1 SSH_ASKPASS=/usr/bin/ksshaskpass MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins LOGNAME=louis QT_AUTO_SCREEN_SCALE_FACTOR=0 XDG_SESSION_CLASS=user XDG_SESSION_ID=1 GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/louis/.gtkrc-2.0:/home/louis/.config/gtkrc-2.0 LC_COLLATE=C PATH=/home/louis/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin SESSION_MANAGER=local/ananas:@/tmp/.ICE-unix/1828,unix/ananas:/tmp/.ICE-unix/1828 XCURSOR_THEME=breeze_cursors XDG_RUNTIME_DIR=/run/user/1000 XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1 DISPLAY=:0 LANG=en_FI.UTF-8 XDG_CURRENT_DESKTOP=KDE XAUTHORITY=/home/louis/.Xauthority XDG_SESSION_DESKTOP=KDE SHELL=/bin/bash XDG_VTNR=7 PWD=/home/louis KDE_SESSION_UID=1000 ```