A little krunner plugin (Plasma 5) to retrieve unicode symbols, or any other string, based on a corresponding keyword.
E.g. you can type
lambda and krunner will yield the proper unicode symbol λ. It can be used to quickly get a symbol when writing some text, or to retrieve often-needed texts (or links, or emotes ...) by typing a certain abbreviation.
If desired, the plugin supports to search the full Unicode database. It is also possible to let the plugin open some file or URL or to execute some command when selecting a result.
The definitions for all these use cases can be freely configured (see Configuration).
git clone https://github.com/domschrei/krunner-symbols.git; cd krunner-symbols; bash install.sh
This executes the plugin's install script inside the
krunner-symbols directory. You will be prompted for
sudo after a successful build because some files need to be written into
/usr. Some dependencies are required, see below for your distribution. If your distribution is not listed and you get an error, the output from
make will tell you which package is missing.
Arch Linux users can just install the
plasma5-runners-symbols package from AUR, which is based on the most recent release here on Github.
Debian / Ubuntu
Installing the following dependencies should suffice for Debian and Ubuntu installations with the KDE Plasma desktop:
sudo apt install cmake extra-cmake-modules build-essential libkf5runner-dev libkf5textwidgets-dev qtdeclarative5-dev gettext
For openSUSE Tumbleweed, these dependencies are sufficient:
sudo zypper install cmake extra-cmake-modules libQt5Widgets5 libQt5Core5 libqt5-qtlocation-devel ki18n-devel ktextwidgets-devel kservice-devel krunner-devel gettext-tools
Try these packages on Fedora (29):
sudo dnf install cmake extra-cmake-modules kf5-ki18n-devel kf5-kservice-devel kf5-krunner-devel kf5-ktextwidgets-devel gettext
Open krunner and enter the keyword for what you want to copy. Click on the desired entry tagged with Symbols or press Enter while focusing it (navigating with arrow keys). krunner disappears and the result has been copied to your clipboard. With
Ctrl+V, you can paste it anywhere.
You can use the plugin as some more general form of alias-resolver (i.e. entering some keyword in order to get the corresponding text) and as a general shortcut app by editing the configuration file appropriately.
TL;DR: Look at the file
krunner-symbolsrc and you will get the idea. Store custom stuff in
~/.config/krunner-symbolsrc. Don't forget to activate full Unicode support if you want it!
Additional to the primary source
/usr/share/config/krunner-symbolsrc, you can create a second file
~/.config/krunner-symbolsrc for custom, additional definitions. Those definitions will override those inside the global config, so that you can give a new meaning to globally defined symbols, if you wish. Keep in mind that you will have to restart krunner (
kquitapp krunner && krunner) for configuration changes to take effect.
The syntax is easy (you can just copy from the file
krunner-symbolsrc from the downloaded git directory). Define custom symbols below a config group called "Definitions":
For custom definitions, just create lines like this:
Keyword is what you have to type and
Output is what you get when typing it. They can be entire sentences, or just single symbols. Comments with
# and blank lines are ignored.
Multiple keywords for the same result can be expressed like this:
which will internally be expanded to this:
ampersand=& fancyand=& curlyand=&
The plugin is not only able to copy strings to your clipboard, but also to open URLs and documents (with
open:) and execute commands (with
exec:). Here are some examples:
# Open the KDE homepage in the standard browser kde=open:https://www.kde.org/ # Open this plugin's configuration in the standard text editor config=open:~/.config/krunner-symbolsrc # Open the folder Documents in the standard file browser doc=open:~/Documents # Execute the given command (here: restart krunner) kill=exec:killall krunner && krunner
If selected, the plugin will try to open or execute the specified location or command, using the corresponding default application. Using these types of definitions is obviously at your own risk, as harmful commands might be executed if the config file is set up accordingly.
This plugin now supports the Unicode database, i.e. all symbols inside the official UnicodeData.txt can be retrieved by entering (parts of) the corresponding description for the symbol. At the moment this feature is disabled by default because there is some performance overhead of searching all the unicode domain, and you can enable it by setting
true inside the
[Preferences] group of your config file (and then restarting
This very large database also contains a lot of emojis and pictograms (try
cat face or
krunner is a great tool because it's always accessible, very fast, and really unintrusive, as it temporarily gets focused when called but then returns the focus to the previously focused view when finished. Because of this, a quick krunner query can be perfectly integrated into a user's workflow, adding efficiency and convenience. This little tool is meant to support this idea of usage.
If you are interested in the project, have any recommendations or suggestions, feel free to contact me or post an issue.