Snippet Expander
for Linux
Your little expandable text snippets helper
Auto Expand Snippets
Save your often used text snippets and then auto expand them whenever you type their abbreviation.
For example, you could have an abbreviation "ser`" that expands to "Snippet Expander rules! 🤘" when you type it 😃.
Search & Paste Window
Use the search and paste window if you can't remember your abbreviation, or happen to be using an application that does not allow auto expansion of snippets.
The most recently used snippets are shown first, with numeric quick select keys.
GUI & CLI
As well as the desktop application, you can use a fully featured command line interface to manage your snippets and settings.
Placeholders
In the body of a snippet you can use placeholders for date and time, with calculations and formatting, the clipboard, other snippets, and where the cursor should go after expansion.
Settings
You can control whether Snippet Expander starts when you log in, whether snippets should auto expand, how the Search & Paste window is opened and whether the search box is focused at first.
Import & Export
You can export your snippets as a backup, or to then import on another machine.
Install
Snippet Expander isn't available to install from most Linux distribution's yet. However, here's a couple of ways you can get it.
Debian & Ubuntu
Download the file with the extension .deb from the release page, then use apt to install it.
curl -O https://git.sr.ht/~ianmjones/snippetexpander/refs/download/v1.0.3/snippetexpander_1.0.3-1_amd64.deb sudo apt install snippetexpander_1.0.3-1_amd64.deb
Nixpkgs & NixOS
Snippet Expander is available as separate packages in Nixpkgs unstable, and should be in the 24.05 and following stable channels.
Here's the basic commands you can use with Nixpkgs.
nix-env -f '<nixpkgs>' -iA snippetexpanderd nix-env -f '<nixpkgs>' -iA snippetexpanderx nix-env -f '<nixpkgs>' -iA snippetexpander nix-env -f '<nixpkgs>' -iA snippetexpandergui
For NixOS, you can add the packages to your configuration.nix.
environment.systemPackages = with pkgs; [ snippetexpanderd snippetexpanderx snippetexpander snippetexpandergui ];
Build & Install
As long as you have all the dependencies installed, you could build and install Snippet Expander manually.
git clone https://git.sr.ht/~ianmjones/snippetexpander cd snippetexpander make sudo make install
For Debian, the build time dependencies are as follows, the names might be slightly different on other distributions:
wails golang-go nodejs npm libx11-dev libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config valac libatspi2.0-dev libgee-0.8-dev libglib2.0-dev libibus-1.0-dev scdoc
Wails is used to build Snippet Expander's GUI, and isn't as widely available as a package as the rest of the dependencies. To install it, just run the following command once you have Go installed.
go install github.com/wailsapp/wails/v2/cmd/wails@latest export PATH="$PATH:$HOME/go/bin"
Wails is also available in Nixpkgs.
nix-env -f '<nixpkgs>' -iA wails
Runtime Dependencies
The daemon has the following runtime package dependencies:
xclip wl-clipboard xdotool wtype
When using X Server for display, xclip is used for copying snippets into the clipboard, and xdotool is used to paste the snippet, e.g. when using the Search & Paste window.
When using Wayland for display, wcopy (from wl-clipboard) is used for copying snippets into the clipboard, and wtype is used to paste the snippet, e.g. when using the Search & Paste window.
Snippet Pixie
Looking for Snippet Pixie, Snippet Expander's predecessor?