clip-expand
A lightweight, clipboard-based text expansion tool for Linux systems. Designed with Remote Desktop sessions in mind, ClipExpand copies your text snippets to the clipboard for easy pasting, making it perfect for both local and remote workflows.
A clipboard-based text expansion tool for Linux systems, designed with Remote Desktop sessions in mind so snippets are copied to the clipboard for easy pasting in both local and remote workflows. Snippets are simple text files stored in a ~/.clipexpand/ directory with subdirectory support, selected through a visual dialog and accessed via a customizable keyboard shortcut, with toast notifications confirming each action. It works across local X11/Wayland sessions, Remote Desktop (RDP, VNC), and SSH with X forwarding on Debian-based distributions. It depends on bash, zenity, xsel, and notify-send, and ships an install script that sets everything up.
Installation
Quick Install
Run the install script to automatically set everything up:
./install.sh
The script will:
- Install required dependencies
- Copy the script to
~/bin/clipexpand.sh - Create the
~/.clipexpand/directory - Install example snippets
- Configure the keyboard shortcut (Ctrl+Shift+T)
Manual Installation
-
Install dependencies:
sudo apt install xsel zenity libnotify-bin -
Copy the script:
mkdir -p ~/bin cp clipexpand.sh ~/bin/ chmod +x ~/bin/clipexpand.sh -
Create snippets directory:
mkdir -p ~/.clipexpand -
Copy example snippets (optional):
cp examples/* ~/.clipexpand/ -
Set up keyboard shortcut:
For GNOME/Ubuntu:
# Add custom keybinding entry gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings \ "$(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings | \ sed "s/]$/, '\/org\/gnome\/settings-daemon\/plugins\/media-keys\/custom-keybindings\/clipexpand\/']/")" # Configure the keybinding gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/clipexpand/ \ name 'ClipExpand' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/clipexpand/ \ command "$HOME/bin/clipexpand.sh" gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/clipexpand/ \ binding '<Ctrl><Shift>t'For other desktop environments:
Use your desktop environment’s keyboard settings to create a custom shortcut:
- Command:
~/bin/clipexpand.sh - Shortcut: Ctrl+Shift+T (or your preference)
- Command: