A simple, fast, and powerful text expansion utility for the modern Linux desktop, using your favorite menu launcher (rofi
or dmenu
).
Tylex lets you create short abbreviations (e.g., em
) that expand into longer phrases or snippets of text (e.g., [email protected]
). It's written in pure shell script, making it lightweight and a perfect fit for any workflow, from minimal tiling window managers to full-featured desktop environments.
- Flexible Actions: Press
Enter
to type text instantly, or pressCtrl+Enter
to copy it to the clipboard. - Fast & Lightweight: Written in shell script with minimal dependencies.
- Launcher-Based: Uses
rofi
ordmenu
, so it integrates perfectly with your existing workflow. - Usage-Aware: Automatically sorts your expansions by how often you use them.
- Fuzzy Finding: Full fuzzy search support when using
rofi
. - XDG Compliant: Follows standards for storing configuration and data files.
Tylex requires the following programs, which will be installed automatically when using a package manager.
bash
jq
(for parsing JSON)rofi
(Recommended launcher)dmenu
(Fallback launcher)xdotool
(for typing on X11)
Tylex is smart and will automatically use whichever launcher it finds. We recommend rofi
for the best experience.
Tylex works in two simple steps: adding a new snippet and expanding it.
Use your hotkey for tylex-add
(e.g., Super + Shift + Z
). You will be prompted twice:
- First, type the short abbreviation you want to use (e.g.,
em
) and press Enter. - Next, type the full expansion text it should become (e.g.,
[email protected]
) and press Enter.
Use your hotkey for tylex-expand
(e.g., Super + Z
).
- A list of all your saved expansions will appear in
rofi
ordmenu
. - Start typing any part of the abbreviation or the expansion to filter the list.
- Select the entry you want and press Enter. The full text will be typed out for you instantly.
This is the recommended method for most users.
yay -S tylex-git
- Install the Tylex Scripts (with
sudo
):
git clone https://github.com/raoeus/tylex.git
cd tylex
sudo make install
- Create Your User Configuration (without
sudo
):
make config
Tylex is most effective when bound to a keyboard shortcut. The process differs between graphical desktop environments and tiling window managers.
A safe and memorable shortcut is Super + ;
(the Super key is the Windows or Command key).
Must use X11. Wayland is incompatible.
Most desktop environments provide a graphical settings panel to create custom keyboard shortcuts that run a command.
-
Open your system's Settings application.
-
Navigate to the Keyboard or Shortcuts section.
-
Look for an option to add a Custom Shortcut.
-
Create two new shortcuts with the following details:
- Shortcut 1: Expand Text
- Name:
Tylex Expand
- Command:
tylex-expand
- Shortcut:
Super + ;
- Name:
- Shortcut 2: Add Expansion
- Name:
Tylex Add
- Command:
tylex-add
- Shortcut:
Super + Shift + ;
- Name:
- Shortcut 1: Expand Text
For tiling window managers, you'll need to edit your configuration file directly.
# Tylex: Expand a snippet
bindsym $mod+semicolon exec tylex-expand
# Tylex: Add a new snippet
bindsym $mod+Shift+semicolon exec tylex-add
# Tylex: Expand a snippet
super + semicolon
tylex-expand
# Tylex: Add a new snippet
super + shift + semicolon
tylex-add
awful.keyboard.append_global_keybindings({
-- Tylex: Expand a snippet
awful.key({ modkey }, ";", function () awful.spawn.with_shell("tylex-expand") end,
{description = "Expand Tylex snippet", group = "launcher"}),
-- Tylex: Add a new snippet
awful.key({ modkey, "Shift" }, ";", function () awful.spawn.with_shell("tylex-add") end,
{description = "Add Tylex snippet", group = "launcher"})
})