- create ~/.config/autostart if not exists + adopt for new build environment

This commit is contained in:
Dmytro Bogovych 2023-04-21 11:42:27 +03:00
parent 447f33bf94
commit 64658a7778
6 changed files with 20 additions and 10 deletions

View File

@ -64,6 +64,17 @@ static fs::path autostart_path()
void autostart::enable(const std::string& path_to_me) void autostart::enable(const std::string& path_to_me)
{ {
// Ensure autostart directory exists at all
if (!fs::exists(autostart_dir()))
{
std::error_code ec;
if (!fs::create_directory(autostart_dir(), ec))
{
qDebug() << "Failed to create autostart directory. Error: " << QString::fromStdString(ec.message());
return;
}
}
// Put .desktop file to ~/.config/autostart // Put .desktop file to ~/.config/autostart
std::ofstream ofs(autostart_path()); std::ofstream ofs(autostart_path());
if (ofs.is_open()) if (ofs.is_open())

View File

@ -4,7 +4,7 @@
// App version // App version
#define QBREAK_VERSION_MAJOR 0 #define QBREAK_VERSION_MAJOR 0
#define QBREAK_VERSION_MINOR 1 #define QBREAK_VERSION_MINOR 1
#define QBREAK_VERSION_SUFFIX 13 #define QBREAK_VERSION_SUFFIX 14
// How often UI is updated - interval in seconds // How often UI is updated - interval in seconds
#define INTERVAL_UPDATE_UI (15) #define INTERVAL_UPDATE_UI (15)

View File

@ -6,9 +6,9 @@
#if defined(TARGET_LINUX) #if defined(TARGET_LINUX)
#include <QObject> #include <QObject>
#include <QDBusConnection> #include <QtDBus/QDBusConnection>
#include <QDBusReply> #include <QtDBus/QDBusReply>
#include <QDBusInterface> #include <QtDBus/QDBusInterface>
// Thanks to https://stackoverflow.com/questions/222606/detecting-keyboard-mouse-activity-in-linux // Thanks to https://stackoverflow.com/questions/222606/detecting-keyboard-mouse-activity-in-linux

View File

@ -1,8 +1,7 @@
QT += core gui svg multimedia QT += core gui svg multimedia widgets dbus
CONFIG += debug_and_release CONFIG += debug_and_release
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets dbus
CONFIG += c++17 lrelease embed_translations CONFIG += c++17 lrelease embed_translations

View File

@ -2,9 +2,9 @@
# I use this script on two different hosts so there are logic to find proper Qt installation # I use this script on two different hosts so there are logic to find proper Qt installation
export QT_HOME=/home/$USER/qt5.15/5.15.2/gcc_64 export QT_HOME=/home/$USER/tools/qt/5.15.2/gcc_64
if [ ! -d "$QT_HOME" ] ; then if [ ! -d "$QT_HOME" ] ; then
export QT_HOME=/home/$USER/qt5.15/5.15.2/gcc_64 export QT_HOME=/home/$USER/tools/qt/5.15.2/gcc_64
fi fi
# Build .appimage # Build .appimage

View File

@ -2,9 +2,9 @@
# I use this script on two different hosts so there are logic to find proper Qt installation # I use this script on two different hosts so there are logic to find proper Qt installation
export QT_HOME=/home/$USER/qt5.15/5.15.2/gcc_64 export QT_HOME=/home/$USER/tools/qt/5.15.2/gcc_64
if [ ! -d "$QT_HOME" ] ; then if [ ! -d "$QT_HOME" ] ; then
export QT_HOME=/home/$USER/qt5.15/5.15.2/gcc_64 export QT_HOME=/home/$USER/qt/5.15.2/gcc_64
fi fi
# Build .appimage # Build .appimage