NickyKatze
NickyKatze

Reputation: 153

Setting keybind / hotkey for rofi on KDE

I'm trying to setup a keybind for running rofi -show combi without having to type it in my terminal (which works fine).

Setting up a custom shortcut via System Settings -> Shortcuts -> Custom Shortcuts does not seem to do anything:

I'm running kubuntu 18.04 and rofi is installed via apt.

Tanks!

Upvotes: 1

Views: 8878

Answers (3)

x5657
x5657

Reputation: 1202

enter image description here

In the Custom Shortcuts tree, after adding your new action, don't forget to enable it by checking the checkbox and clicking Apply button.

Upvotes: 0

Nils
Nils

Reputation: 422

Here's what did the trick for me:

sudo nano /usr/local/bin/rofi-run

Paste in:

#!/bin/bash 
export LC_ALL="C" 
rofi -show run 2>&1 | tee /tmp/rofi-run.log 
exit 0

Make the file executable:

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). Also if something fails you can now read the log under /tmp/rofi-run.log

Upvotes: 3

NickyKatze
NickyKatze

Reputation: 153

I've got a workaround.

Since I'm using guake as my main terminal, I'm just making it open a new tab, show rofi and exit the tab afterwards.

guake -n guake -e " rofi -show combi && exit"

The executed command deliberately starts with a space, so it won't land in bash history.

Hope it helps others too :D

Upvotes: 0

Related Questions