Skip to content

Commit

Permalink
Update docs and change build dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
alex1701c committed Dec 9, 2019
1 parent 009b371 commit 37637cd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@ If you don't have colorful emojis please try the solution from https://github.co

### Required Dependencies

Note: If the build dependency libxdo-dev is not at compile time installed the plugin will use the `xdotool` program to paste emojis
Note: If the xdo.h file is not at compile time available the plugin will use the `xdotool` program to paste emojis,
but having the library installed is recommended.

Debian/Ubuntu:
`sudo apt install cmake extra-cmake-modules build-essential libkf5runner-dev libkf5textwidgets-dev qtdeclarative5-dev gettext libxdo-dev`

openSUSE:
`sudo zypper install cmake extra-cmake-modules libQt5Widgets5 libQt5Core5 libqt5-qtlocation-devel ki18n-devel
ktextwidgets-devel kservice-devel krunner-devel gettext-tools xdotool kconfigwidgets-devel`
ktextwidgets-devel kservice-devel krunner-devel gettext-tools xdotool-devel kconfigwidgets-devel`

Fedora:
`sudo dnf install cmake extra-cmake-modules kf5-ki18n-devel kf5-kservice-devel kf5-krunner-devel kf5-ktextwidgets-devel gettext xdotool`

Arch (Manjaro):
`sudo pacman -S cmake extra-cmake-modules xdotool`
*This xdotool package includes the xdo.h file*

### Build instructions

Expand Down Expand Up @@ -76,12 +77,14 @@ This way you can search for emojis without search results from other plugins
![Search for emojis](https://raw.githubusercontent.com/alex1701c/Screenshots/master/EmojiRunner/search_with_prefix.png)

#### Configure settings
You can search for emojis, set the unicode level (later versions can not be displayed) and you can enable/disable categories
You can search for emojis, set the unicode level (later versions can not be displayed) and you can enable/disable categories.
Additionally you can sort the favourites using drag and drop
![Search for emojis](https://raw.githubusercontent.com/alex1701c/Screenshots/master/EmojiRunner/config.png)

#### Add a custom emoji
You must provide a name and and emoji, the description and tags are optional
![Add a custom emoji](https://raw.githubusercontent.com/alex1701c/Screenshots/master/EmojiRunner/enter_custom_emoji.png)

This gets saved in the ~/.local/share/emojirunner/customemojis.json file.
In this file you can also override the existing emojis, but you have to do that manually.
![Custom emojis file](https://raw.githubusercontent.com/alex1701c/Screenshots/master/EmojiRunner/custom_emojis_file.png)
5 changes: 1 addition & 4 deletions src/config/emojirunner_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@ EmojiRunnerConfigForm::EmojiRunnerConfigForm(QWidget *parent) : QWidget(parent)
setupUi(this);
}

/**
* TODO Fix bug that custom emojis are not loaded !!!
*/

EmojiRunnerConfig::EmojiRunnerConfig(QWidget *parent, const QVariantList &args) : KCModule(parent, args) {
m_ui = new EmojiRunnerConfigForm(this);
auto *layout = new QGridLayout(this);
layout->addWidget(m_ui, 0, 0);

createConfigFile();
config = KSharedConfig::openConfig(QDir::homePath() + "/.config/krunnerplugins/" + Config::ConfigFileName)
->group(Config::RootGroup);
config.config()->reparseConfiguration();
Expand Down
17 changes: 17 additions & 0 deletions src/config/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <QtWidgets/QListWidgetItem>
#include <core/Emoji.h>
#include <core/Config.h>

namespace Utilities {

Expand All @@ -18,4 +19,20 @@ namespace Utilities {
return item;
}
}

/**
* Create the config file and parent folder if they do not exist already
*/
void createConfigFile() {
const QString configFolder = QDir::homePath() + "/.config/krunnerplugins/";
const QDir configDir(configFolder);
if (!configDir.exists()) configDir.mkpath(configFolder);
// Create file
QFile configFile(configFolder + Config::ConfigFileName);
if (!configFile.exists()) {
configFile.open(QIODevice::WriteOnly);
configFile.close();
}
}

#endif //EMOJIRUNNER_UTILITIES_H

0 comments on commit 37637cd

Please sign in to comment.