davatorium / rofi

Rofi: A window switcher, application launcher and dmenu replacement
https://davatorium.github.io/rofi/
Other
13.24k stars 613 forks source link

broken wiki link #861

Closed AdrienLemaire closed 5 years ago

AdrienLemaire commented 6 years ago

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.

carnager commented 6 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.

AdrienLemaire commented 6 years ago

@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] おはようございます。
DaveDavenport commented 6 years ago

I would love it if somebody would like to adopt the wiki. I do not have the time for it.

DaveDavenport commented 5 years ago

Not gonna fix this one (no time), help/contributions welcome.

github-actions[bot] commented 4 years ago

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.