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.
- π Clipboard-based: Works seamlessly in Remote Desktop sessions
- β¨οΈ Keyboard-driven: Quick access via customizable keyboard shortcut
- π File-based snippets: Simple text files in
~/.clipexpand/directory - π Easy selection: Visual dialog for snippet selection
- π’ Toast notifications: Non-intrusive confirmation messages
- ποΈ Subdirectory support: Organize snippets in folders
- π Lightweight: Minimal dependencies, fast execution
- Ubuntu 20.04+ (tested on 24.04)
- Linux Mint
- Debian 10+
- Pop!_OS
- Elementary OS
- Other Debian-based distributions with GNOME or similar desktop environments
Works with:
- β Local sessions (X11/Wayland)
- β Remote Desktop (RDP, VNC, etc.)
- β SSH with X forwarding
bashzenity- for the selection dialogxsel- for clipboard managementnotify-send(libnotify-bin) - for notificationsfind,sed,tr- standard Unix utilities (usually pre-installed)
Run the install script to automatically set everything up:
./install.shThe 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)
-
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:
-
Trigger ClipExpand:
- Press your configured keyboard shortcut (default: Ctrl+Shift+T)
-
Select a snippet:
- Press Tab to focus the snippet list
- Use arrow keys to navigate
- Press Enter to select
-
Paste:
- The snippet is copied to your clipboard
- You'll see a brief notification: "Text copied to clipboard!"
- Press Ctrl+V to paste the text
Snippets are simple text files stored in ~/.clipexpand/. The filename becomes the snippet name.
Create a file with your text content:
echo "your.email@example.com" > ~/.clipexpand/emailUse a text editor for multi-line snippets:
nano ~/.clipexpand/signatureContent:
Best regards,
John Doe
Software Engineer
john.doe@example.com
Keep snippets organized in folders:
mkdir -p ~/.clipexpand/work
mkdir -p ~/.clipexpand/personal
echo "work@company.com" > ~/.clipexpand/work/email
echo "personal@email.com" > ~/.clipexpand/personal/emailSnippets will appear as:
work/emailpersonal/email
The examples/ directory contains sample snippets:
email- Email address templatephone- Phone number templatesignature- Email signaturemeeting-link- Meeting room URL
Copy them to your snippets directory:
cp examples/* ~/.clipexpand/Then customize them with your information!
ClipExpand uses a clipboard-based approach instead of direct keyboard injection. This design choice provides several advantages:
- β Remote Desktop compatible: Works perfectly with RDP, VNC, and other remote desktop protocols
- β Wayland compatible: No issues with Wayland's security restrictions
- β Universal: Works in any application that supports clipboard pasting
- β Reliable: No timing issues or focus problems
- β Simple: Fewer dependencies and easier to maintain
The trade-off is one extra step (Ctrl+V to paste), but this makes the tool far more versatile and reliable across different environments.
- Check if the shortcut conflicts with another application
- Try a different key combination
- Verify the script is executable:
chmod +x ~/bin/clipexpand.sh
- Ensure zenity is installed:
sudo apt install zenity - Check if the script is in your PATH or use full path in keyboard shortcut
- Verify xsel is installed:
sudo apt install xsel - Test manually:
echo "test" | xsel -b -i && xsel -b -o
- Check that
~/.clipexpand/directory exists - Ensure snippet files are readable:
ls -la ~/.clipexpand/ - Verify files are regular text files, not hidden or special files
To remove ClipExpand:
# Remove the script
rm ~/bin/clipexpand.sh
# Remove snippets (backup first if needed!)
rm -rf ~/.clipexpand
# Remove keyboard shortcut (GNOME)
gsettings reset org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/clipexpand/ name
gsettings reset org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/clipexpand/ command
gsettings reset org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/clipexpand/ bindingContributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
Inspired by Texpander by Lee Blue, reimagined for clipboard-based workflow and Remote Desktop compatibility.
Enjoy ClipExpand! π
