rofi icon indicating copy to clipboard operation
rofi copied to clipboard

[REQUEST] From rofi launcher to edit certain file by keybinding.

Open thepenguinthatwants opened this issue 5 years ago • 1 comments

rofi -v
Version: 1.5.4

I use i3wm and I have some bash scripts that opens up a list of stuff by piping cat sed and rofi to list files to easily open certain files.

The problem is that sometimes I want to edit the lists or files. Is there possibility to add into rofi that it allows using keybindings ctrl-e to edit certain file after opening the rofi launcher?

thepenguinthatwants avatar Apr 12 '20 05:04 thepenguinthatwants

This already exists in rofi.

#!/usr/bin/bash

main () {
    menu="$(echo -e "1\n2\n3\n4\n" | rofi -dmenu -kb-move-end "" -kb-custom-1 "Control-e")"
    exit_status=$?

    case "${exit_status}" in
        "10") echo "Control+e has been pressed" ;;
        "0") exit ;;
         *) ;;
    esac
}

main

-kb-move-end "" is needed, because there already exists a keybinding for this. This will disable it. You can see a full list of keybindings and the associated names with rofi -show keys each -kb-custom-n returns a different exit code, starting from 10 (n+9).

Also I just realized this isn't mentioned in manpage, I hope I find the time to add this.

carnager avatar Apr 12 '20 06:04 carnager

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Feb 22 '23 00:02 github-actions[bot]