A modi to use with rofi. It presents a
list of named snippets (keys) and simulate a user keyboard input of a
corresponding value. Key/value pairs are stored in a mysnippets
config file.
- xdotool
-
Clone the repo.
-
Modify the
snippets.sh
file to point theSNIPFILE
variable to the actual location of themysnippet
file on your computer. -
Add your own snippets.
-
Start
rofi
as follows:rofi -show snip -modi snip:/home/raph/Code/langageBash/rofi-modi-snippets/snippets.sh
(it can be combined with other modi
s, separated by commas)
Snippets are strings of text, which are written with xdotool
in the window
with focus. Snippets starting by cmd are passed through eval
and the written
string is the result of the evaluation. See the cmddate
and cmdepoch
examples.
- You may change the separator used in the
mysnippet
config file. - It differs from rofi-snippet in that
rofi-snippet is a standalone Python script calling
rofi
.rofi-modi-snippet
is intended to be a modi forrofi
, combined with others (ssh, run, window, etc.)