Closed AdrienLemaire closed 5 years ago
Stuff like snippy uses rofi's dmenu mode which basically doesn't have too much to do with rofi itself. Basically you make some script output stuff and pipe it to "rofi -dmenu". You can then store the selected line from rofi in a variable and work with that. There is nothing else to it.
Example:
foo=$(echo -e "1\n2\n3" | rofi -dmenu)
echo "You selected ${foo}"
But yes, someone should update the wiki.
@carnager thanks for the reply.
I went with something very simple to start
textexpand
#!/usr/bin/env bash
CONFIG=${HOME}/.textexpandrc
ALL_KEYS=$(sed 's/\].*/]/' ${CONFIG} | tr -d '[]')
KEY=$(echo $ALL_KEYS | rofi -sep ' ' -dmenu -p "autocomplete")
grep "\[${KEY}\]" $CONFIG | sed "s/\[${KEY}\] //" | xsel -ib
xdotool key ctrl+shift+v
i3config
bindsym $mod+c exec --no-startup-id textexpand
.textexpandrc
[yoro] よろしくお願いします。
[otsu] お疲れさまでします。
[ohayo] おはようございます。
I would love it if somebody would like to adopt the wiki. I do not have the time for it.
Not gonna fix this one (no time), help/contributions welcome.
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.
Steps to reproduce
What behaviour you see
Page is missing
What behaviour you expect to see
Page should be present with documentation on how to use rofi in scripts.
I am looking for an application-agnostic text expander, and after finding snippy which work for dmenu, I'd like to adapt it for rofi. I wasn't clear on the process after reading rofi's manpage, which is why I went looking for more infos in the wiki.