A customizable KRunner plugin for Plasma 6 that provides a quick way to copy formatted text patterns to your clipboard.
Based on the great work of Jim Cornmell.
When you type !<keyword> in KRunner, it will offer to copy predefined text patterns to your clipboard. The patterns are fully customizable through a YAML configuration file.
| What you type | What gets copied (default) | What gets copied (customizable) |
|---|---|---|
| !slack | :slack: Slack | Can be customized |
| !bug | 🐛 bug | 🐛 Bug: |
| !meeting | :meeting: meeting | 📅 Meeting Notes - meeting |
| !github | :github: GitHub | Can be customized |
| !anykeyword | :anykeyword: anykeyword | Uses default pattern |
- KDE Plasma 6
- Python 3
- PyYAML (
python3-yamlorpip install pyyaml) wl-clipboard(for clipboard functionality on Wayland)- KRunner
Run these commands to install:
cd ~/.local/share/kio
git clone git@github.com:margual56/krunner_brandit.git
cd krunner_brandit
./install.shThe installation script will:
- Install the plugin files to the appropriate locations
- Check for and install dependencies if needed
- Copy the configuration file to
~/.config/brandIt/config.yaml - Register the D-Bus service
- Restart KRunner to load the plugin
The plugin uses a YAML configuration file located at ~/.config/brandIt/config.yaml.
# Default pattern for unknown keywords
# {brand} will be replaced with the typed keyword
default_pattern: ":{brand}: {brand}"
# Custom patterns for specific keywords
patterns:
slack: ":slack: Slack"
github: ":github: GitHub"
bug: "🐛 Bug:"
feature: "✨ Feature:"
meeting: "📅 Meeting Notes - {brand}"- Edit the config file:
~/.config/brandIt/config.yaml - Add your own patterns under the
patterns:section - Use
{brand}as a placeholder for the keyword itself - Save the file - changes take effect immediately
patterns:
# Simple replacements
python: ":python: Python"
# Emoji shortcuts
bug: "🐛"
star: "⭐"
fire: "🔥"
# Text templates
pr: "Pull Request #{brand}"
issue: "Issue #{brand}:"
todo: "TODO: {brand}"
# Meeting notes
standup: "📅 Daily Standup - {brand}"
retro: "📋 Retrospective Notes - {brand}"
# Commit message prefixes
fix: "fix: {brand}"
feat: "feat: {brand}"
docs: "docs: {brand}"- Open KRunner (usually
Alt+SpaceorAlt+F2) - Type
!followed by a keyword (e.g.,!slack,!bug,!meeting) - Press Enter to copy the formatted text to your clipboard
- Paste anywhere you need it
- Keywords are case-insensitive (
!SLACKand!slackboth work) - Custom patterns have higher priority in search results
- Unknown keywords use the default pattern
- A notification confirms when text is copied
If the plugin doesn't work:
- Check the debug log:
tail -f /tmp/brandit_debug.log - Verify dependencies are installed:
python3 -c "import yaml" # Should not error which wl-copy # Should show path
- Restart KRunner manually:
kquitapp6 krunner kstart6 --windowclass krunner krunner
To remove the plugin:
cd ~/.local/share/kio/BrandIt
./uninstall.shThis will remove the plugin files but preserve your configuration file at ~/.config/brandIt/config.yaml.
main.py- The main plugin codeconfig.yaml- Default configuration templateBrandIt.desktop- KRunner service definitioninstall.sh- Installation scriptuninstall.sh- Uninstallation script~/.config/brandIt/config.yaml- Your personal configuration (created on install)
- Uses D-Bus to communicate with KRunner
- Written in Python 3 with PyYAML for configuration
- Uses
wl-copyfromwl-clipboardfor Wayland clipboard operations - Falls back to KDE's Klipper if
wl-copyis unavailable - Shows desktop notifications when text is copied
GNU General Public License v3.0
Jim Cornmell - brandIt@cornmell.com
Feel free to submit issues or pull requests at https://github.com/jimcornmell/BrandIt
- Support for multiple configuration profiles
- Import/export configuration
- GUI configuration editor
- Integration with other clipboard managers
- Support for rich text/HTML copying