Skip to content

Commit

Permalink
Update to QT6 Build Tools / KF6 libraries; Updated bundled libraries …
Browse files Browse the repository at this point in the history
…to their latest changes; Updated UI; Updated Screenshot; Updated README with appropriate build instructions and more . . .
  • Loading branch information
--global committed Jun 10, 2024
1 parent eae87d1 commit ac66c66
Show file tree
Hide file tree
Showing 28 changed files with 411 additions and 366 deletions.
148 changes: 94 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<h1 align="center">Koi</h1>

<h3 align="center">Theme scheduling for the KDE Plasma Desktop</h3>
<h3 align="center">Scheduling LIGHT/DARK Theme Converter for the KDE Plasma Desktop</h3>

Koi is a program designed to provide the KDE Plasma Desktop functionality to automatically switch between light and dark themes. Koi is under active development, and while it is stable enough to use daily, expect bugs. Koi is designed to be used with Plasma, and while some features may function under different desktop environments, they are unlikely to work and untested.
Koi is a program designed to provide the KDE Plasma Desktop functionality to automatically switch between light and dark themes. Koi is under semi-active development, and while it is stable enough to use daily, expect bugs. Koi is designed to be used with Plasma, and while some features may function under different desktop environments, they are unlikely to work and untested.

**Disclaimer:** Koi was written as a project to practice Qt by a novice programmer, expect code to be written sloppily.
*Koi was written as a project to practice QT by a novice programmer, expect code to be written sloppily.*

## Features

Expand All @@ -18,115 +18,155 @@ Koi is a program designed to provide the KDE Plasma Desktop functionality to aut
- Change wallpaper.
- Hide application to system tray.

___

## Screenshots

![Screenshot](screenshot.png)
![Screenshots](Screenshot.png)

___

## Using Koi

Koi is designed to be very simple to use. When you first open Koi, settings for the light and dark presets will be empty, all you need to do is select which themes you'd like for Koi to manage and select your desired themes by clicking the *Preferences* button.
Koi is designed to be very simple to use. After the initial run of Koi, settings for the **light** and **dark** presets will be empty, all you need to do is select which themes you would like for Koi to manage and select your desired themes by clicking the *Preferences* button.

If you would like that Koi switch between your light and dark settings automatically, you can select this option in the main page of the program, and choose between following a user set schedule, or at **sunrise** and **sunset** *(planned/scheduled feature)*. To switch between **light** and **dark** manually right click the tray icon and select the desired preset, or do so from Koi's main window.

If you would like that Koi switch between your light and dark settings automatically, you can select this option in the main page of the program, and choose between following a user set schedule, or at sunrise and sunset (planned feature). To switch between light and dark manually right click the tray icon and select the desired preset, or do so from Koi's main window.
#### Startup/Autostart
In order to have Koi started at login, you can do so with the *KDE Plasma System Settings*. Either search for: ***Autostart*** or for **Plasma version 5** navigate to ***System Settings*** -> ***Startup and Shutdown*** -> ***Autostart***; for **Plasma version 6** navigate to ***System Settings*** -> ***System*** -> ***Autostart***, and select *+ Add...*. In addition, it is recommended having the option to *Start Koi hidden* checked, this will prevent Koi from popping up every time you start your operating system.

In order to have Koi start at login, you can do so with the Plasma System Settings. Simply navigate to *Startup and Shutdown* > *Autostart*, and select *Add Program...*. If you are to do this, I recommend that you also check the option to start Koi hidden, so not to be annoyed by Koi popping up every time you start your system.
___

## Get Koi

Lastest version: 0.2.3
*Latest version: 0.3*

### Build from source
### Building from SOURCE

**GENERIC Dependencies**

- Qt [Development files]
<ins>KDE Frameworks [Development files]:</ins>

- KDE Plasma Desktop Environment
* KF6 Config
* KF6 Core Addons
* KF6 Widgets Addons

- KDE Frameworks [Development files]
<ins>KDE Plasma Desktop Environment</ins>

- cmake [Build dependencies]
<ins>Qt [Development files]:</ins>

**Build Instructions**
* QT Core
* QT DBus
* QT Gui
* QT Network
* QT Test
* QT Widgets *(Optional)*
* QT Xml *(Optional)*

1. `git clone https://github.com/baduhai/Koi.git`
<ins>CMake Program</ins>

2. `cd Koi`

3. `mkdir build`
**Build Instructions**

4. `cd build`
1. `git clone https://github.com/baduhai/Koi.git` | `git clone [email protected]:baduhai/Koi.git` | `gh repo clone baduhai/Koi`

5. `cmake ../src/`
2. `cmake -S "./Koi/src/" -B "./Koi/src/build/"`

6. `sudo make`
3. `sudo make -C "./Koi/src/build/"`

7. `sudo make install`
4. `sudo make -C "./Koi/src/build/" install` *# This will 'install' Koi into `/usr/local/bin/`*

These instructions also apply to building the latest release version of Koi. Instead of cloning the repository, download and extract the latest *Source Code* archive, from then follow step 2 and beyond.

**Building with NIX**
***Building with NIX (OS)***

`nix-build -E 'with import <nixpkgs> {}; pkgs.libsForQt5.callPackage ./dev.nix {}'`

## Downloads

### Arch Linux
### Prerequisites:

### Arch Linux - [[AUR]](https://aur.archlinux.org/packages/koi/)

**Build Dependencies:**

- ``` 'gcc' 'qt6-base' 'qt6-tools' 'qt6-svg' 'cmake' 'extra-cmake-modules' ```

**Run Dependencies:**

- ``` 'plasma-desktop' 'plasma-integration' ```

**Dependencies**
- `qt5-base`
- `plasma-desktop | kconfig | kcoreaddons | kwidgetsaddons`
### openSUSE TumbleWeed - [[OBS]](https://build.opensuse.org/package/show/KDE:Extra/koi)

**Download**
**Build Dependencies:**

Install it from the [AUR](https://aur.archlinux.org/packages/koi/). Packaged by AUR user [dasbaumwolltier](https://aur.archlinux.org/account/dasbaumwolltier), let them know if it's out of date, not me.
- ``` 'cmake' 'cmake-extras' 'kf6-kconfigwidgets-devel' 'kf6-kconfig-devel' 'kf6-kcoreaddons-devel' 'qt6-dbus-devel' 'qt6-gui-devel' 'qt6-network-devel' 'qt6-test-devel' 'qt6-widgets-devel' 'qt6-xml-devel' 'hicolor-icon-theme' ```

### openSUSE Tumbleweed + Leap
**Run Dependencies:**

**Dependencies**
- ``` 'plasma6-desktop' ```

- `cmake | cmake-full | extra-cmake-modules | patterns-kde-devel_kde_frameworks | patterns-kde-devel_qt5 | fdupes`
- `patterns-kde-kde | patterns-kde-kde_plasma | desktop-file-utils`
### openSUSE Leap - [[OBS]](https://build.opensuse.org/package/show/KDE:Extra/koi)

**Download**
**Build Dependencies:**

Available from [OBS](https://build.opensuse.org/package/show/home:ozu/koi) | [REPO](https://download.opensuse.org/repositories/home:/ozu:/). Packaged by [Fabio Pesari-fpesari](https://github.com/fpesari) + [Martin von Reichenberg](https://github.com/MartinVonReichenberg), let them know if it's out of date, not me.
- ``` 'cmake' 'cmake-extras' 'kf5-kconfigwidgets-devel' 'kf5-kconfig-devel' 'kf5-kcoreaddons-devel' 'qt5-dbus-devel' 'qt5-gui-devel' 'qt5-network-devel' 'qt5-test-devel' 'qt5-widgets-devel' 'qt5-xml-devel' 'hicolor-icon-theme' ```

### Fedora
**Run Dependencies:**

**Dependencies**
- `cmake | desktop-file-utils`
- ``` 'plasma5-desktop' 'plasma-framework-components' 'plasma-framework-desktoptheme' ```

**Download**
Available from [copr](https://copr.fedorainfracloud.org/coprs/birkch/Koi/). Packaged by [h3o66](https://github.com/h3o66), let them know if it's out of date, not me.
### Fedora - [[COPR]](https://copr.fedorainfracloud.org/coprs/birkch/Koi/)

### NixOS and distros with nix.
**Build Dependencies:**

**Download**
- ``` 'cmake' 'extra-cmake-modules' 'kf6-kconfigwidgets-devel' 'kf6-kconfig-devel' 'kf6-kcoreaddons-devel' 'qt6qt-base' 'hicolor-icon-theme' ```

Available from me [NUR](https://nur.nix-community.org/repos/baduhai/) repo. Packaged by yours truly.
Install to your NIX profile with `nix-env -iA koi -f https://github.com/baduhai/nur/tarball/master`, to add to you nixos configuration, follow the [Instructions](https://github.com/nix-community/nur#installation) on the NUR repo.
**Run Dependencies:**

- ``` 'plasma-desktop' 'plasma-integration' 'plasma-workspace' ```

### *NixOS - [[NUR]](https://nur.nix-community.org/repos/baduhai/)*

- *Install to your NIX profile with `nix-env -iA koi -f https://github.com/baduhai/nur/tarball/master`, to add to you nixos configuration, follow the [Instructions](https://github.com/nix-community/nur#installation) on the NUR repo.*

### Debian/Ubuntu

**Dependencies**
- `g++ | qtbase5-dev | cmake | libkf5coreaddons-dev | libkf5widgetsaddons-dev | libkf5config-dev | libkf5package-dev | libkf5service-dev`
**Build Dependencies:**

- ``` 'g++' 'cmake' 'cmake-extras' 'libkf5config-dev' 'libkf5coreaddons-dev' 'libkf5dbusaddons-dev' 'libkf5widgetsaddons-dev' 'qtbase5-dev' ```

**Run Dependencies:**

- ``` 'kde-plasma-desktop' 'plasma-framework' 'plasma-integration' 'plasma-workspace' ```

### KDE Neon

**Build Dependencies:**

- ``` 'g++' 'cmake' 'cmake-extras' 'libkf6config-dev' 'libkf6coreaddons-dev' 'libkf6dbusaddons-dev' 'libkf6widgetsaddons-dev' 'qtbase6-dev' ```

**Run Dependencies:**

**Download**
_Not yet available . . ._
- ``` 'kde-plasma-desktop' 'plasma-desktop' ```

### Other Distributions
___

Install with [NIX](https://nixos.org/download.html) (See *NixOS* above) or grab the AppImage of the latest release.
## Credits:

_Koi targets the latest version of the above deps. Since I can't know the name of every dependency for every distribution . . ._
* William Franco Abdul Hai [(baduhai)](https://github.com/baduhai)
* Martin Stibor [(Martin von Reichenberg)](https://github.com/MartinVonReichenberg)
* [ducvietcao](https://github.com/ducvietcao)
* [toboil-features](https://github.com/toboil-features)


## References

The following is a list of resources that I used as reference and inspiration for writing Koi.
The following is a list of resources that was used as reference and inspiration for writing Koi.

- [Yin-Yang](https://github.com/daehruoydeef/Yin-Yang) - For UI layout and features inspiration.
- [system-tray-icon-qt](https://github.com/C0D1UM/system-tray-icon-qt) - For teaching me how to implement a system tray icon with Qt.
- [plasma-theme-switcher](https://github.com/maldoinc/plasma-theme-switcher) - For teaching me how to set current Qt colour scheme.
- [plasma-theme-switcher](https://github.com/maldoinc/plasma-theme-switcher) - For teaching me how to set current Qt color scheme.
- [ksetwallpaper](https://github.com/pashazz/ksetwallpaper) - For teaching me how to set the wallpaper on Plasma.
- [SunRise](https://github.com/signetica/SunRise) - For scheduled sunrise/sunset light/dark theme switching.
- [CTPL](https://github.com/vit-vit/CTPL) - Extra library for parallel job execution.
- [Scheduler](https://github.com/Bosma/Scheduler) - For timed light/dark theme switching.
- [This blog post from Zren](https://zren.github.io/2020/04/28/how-to-change-plasma-icon-theme-in-the-terminal) - For teaching me how to set the icon theme.
Binary file added Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Binary file removed screenshot.png
Binary file not shown.
26 changes: 13 additions & 13 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(Koi VERSION 0.2.4 LANGUAGES CXX)
project(Koi VERSION 0.3 LANGUAGES CXX)

configure_file(headers/config.h.in config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
Expand All @@ -19,20 +19,20 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/koi.desktop DESTINATION share/applicat
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/icons/koi.svg DESTINATION share/icons/hicolor/scalable/apps)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/icons/koi_tray.svg DESTINATION share/icons/hicolor/scalable/apps)

find_package(KF5Config)
find_package(KF5CoreAddons)
find_package(KF5WidgetsAddons)
find_package(QT NAMES Qt5 REQUIRED COMPONENTS Core)
find_package(KF6Config)
find_package(KF6CoreAddons)
find_package(KF6WidgetsAddons)
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS DBus Gui Network Test)
find_package(Qt${QT_VERSION_MAJOR} OPTIONAL_COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} OPTIONAL_COMPONENTS Xml)


add_executable(koi
libs/Cron.h
libs/InterruptableSleep.h
libs/Scheduler.h
libs/SunRise.cpp libs/SunRise.h
libraries/Cron.h
libraries/InterruptableSleep.h
libraries/Scheduler.h
libraries/SunRise.cpp libraries/SunRise.h

resources/resources.qrc

Expand Down Expand Up @@ -60,10 +60,10 @@ target_compile_definitions(koi PUBLIC
)

target_link_libraries(koi PUBLIC
KF5::ConfigCore
KF5::ConfigGui
KF5::CoreAddons
KF5::WidgetsAddons
KF6::ConfigCore
KF6::ConfigGui
KF6::CoreAddons
KF6::WidgetsAddons
Qt::Core
Qt::DBus
Qt::Gui
Expand Down
4 changes: 2 additions & 2 deletions src/about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ About::About(QWidget *parent) :
QString kfVersion = "<ul><li>KDE Frameworks ";
kfVersion += KCoreAddons::versionString();
kfVersion += "</li></ul>";
ui->kf5Version->setText(kfVersion);
ui->kf5Version->setTextFormat(Qt::RichText);
ui->kfVersion->setText(kfVersion);
ui->kfVersion->setTextFormat(Qt::RichText);
QString bosmaLabel = "<ul><li><a href=\"https://github.com/Bosma/Scheduler\">Bosma Scheduler</a></li></ul>";
ui->bosmaLib->setText(bosmaLabel);
ui->bosmaLib->setTextFormat(Qt::RichText);
Expand Down
4 changes: 2 additions & 2 deletions src/headers/about.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#define ABOUT_H
// Headers
#include "license.h"
// Qt libs
// Qt libraries
#include <QDialog>
//KF5 libs
// KF libraries
#include <KCoreAddons>

namespace Ui {
Expand Down
2 changes: 1 addition & 1 deletion src/headers/colorscheme.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef COLORSCHEME_H
#define COLORSCHEME_H
// Qt libs
// Qt libraries
#include <QString>
#include <QProcess>

Expand Down
2 changes: 1 addition & 1 deletion src/headers/license.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef LICENSE_H
#define LICENSE_H
// Qt libs
// Qt libraries
#include <QDialog>

namespace Ui {
Expand Down
26 changes: 13 additions & 13 deletions src/headers/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
//Headers
#include "about.h"
#include "utils.h"
//Qt libs
//Qt libraries
#include <QFileDialog>
#include <QFileInfo>
#include <QMainWindow>
#include <QSystemTrayIcon>
#include <QMessageBox>
#include <QCloseEvent>
//Other libs
#include "libs/Scheduler.h"
//Other libraries
#include "libraries/Scheduler.h"

QT_BEGIN_NAMESPACE
namespace Ui
Expand Down Expand Up @@ -68,16 +68,16 @@ private slots:

void on_lightWallBtn_clicked();
void on_darkWallBtn_clicked();
void on_lightDropStyle_currentIndexChanged(const QString &arg1);
void on_darkDropStyle_currentIndexChanged(const QString &arg1);
void on_lightDropColor_currentIndexChanged(const QString &arg1);
void on_darkDropColor_currentIndexChanged(const QString &arg1);
void on_lightDropGtk_currentIndexChanged(const QString &arg1);
void on_darkDropGtk_currentIndexChanged(const QString &arg1);
void on_lightDropIcon_currentIndexChanged(const QString &arg1);
void on_darkDropIcon_currentIndexChanged(const QString &arg1);
void on_lightDropKvantumStyle_currentIndexChanged(const QString &arg1);
void on_darkDropKvantumStyle_currentIndexChanged(const QString &arg1);
void on_lightDropStyle_currentTextChanged(const QString &arg1);
void on_darkDropStyle_currentTextChanged(const QString &arg1);
void on_lightDropColor_currentIndexChanged(int index);
void on_darkDropColor_currentIndexChanged(int index);
void on_lightDropGtk_currentTextChanged(const QString &arg1);
void on_darkDropGtk_currentTextChanged(const QString &arg1);
void on_lightDropIcon_currentTextChanged(const QString &arg1);
void on_darkDropIcon_currentTextChanged(const QString &arg1);
void on_lightDropKvantumStyle_currentTextChanged(const QString &arg1);
void on_darkDropKvantumStyle_currentTextChanged(const QString &arg1);
void on_lightTimeEdit_userTimeChanged(const QTime &time);
void on_darkTimeEdit_userTimeChanged(const QTime &time);
void on_latitudeDSB_valueChanged(double lat);
Expand Down
4 changes: 2 additions & 2 deletions src/headers/plasmastyle.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef PLASMASTYLE_H
#define PLASMASTYLE_H
// Qt libs
// Qt libraries
#include <QString>
#include <QProcess>
#include <QDir>
// KF5 libs
// KF libraries
#include <KSharedConfig>
#include <KConfigGroup>

Expand Down
Loading

0 comments on commit ac66c66

Please sign in to comment.