diff options
author | Ken Moore <moorekou@gmail.com> | 2016-06-14 13:21:29 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-06-14 13:21:29 -0400 |
commit | f6bb0b0e52214a7235cc64dc7a52fb4fbaa61a3c (patch) | |
tree | 1a045f6368ad50ecb5118f95f3e377ec3226ff75 /src-qt5/core/libLumina | |
parent | Large update to the project files: (diff) | |
download | lumina-f6bb0b0e52214a7235cc64dc7a52fb4fbaa61a3c.tar.gz lumina-f6bb0b0e52214a7235cc64dc7a52fb4fbaa61a3c.tar.bz2 lumina-f6bb0b0e52214a7235cc64dc7a52fb4fbaa61a3c.zip |
Another large batch of updates:
1) Move the "runtime" directory in the users home to the XDG_CONFIG_HOME/lumina-desktop rather than ~/.lumina
2) Update the Glass theme a bit more.
Diffstat (limited to 'src-qt5/core/libLumina')
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-Debian.cpp | 6 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-DragonFly.cpp | 12 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp | 12 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-Gentoo.cpp | 6 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-Linux.cpp | 6 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-OpenBSD.cpp | 6 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaOS-kFreeBSD.cpp | 6 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaThemes.cpp | 34 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaUtils.cpp | 47 | ||||
-rw-r--r-- | src-qt5/core/libLumina/themes/Glass.qss.template | 5 |
10 files changed, 70 insertions, 70 deletions
diff --git a/src-qt5/core/libLumina/LuminaOS-Debian.cpp b/src-qt5/core/libLumina/LuminaOS-Debian.cpp index cb8e9cdd..b893be50 100644 --- a/src-qt5/core/libLumina/LuminaOS-Debian.cpp +++ b/src-qt5/core/libLumina/LuminaOS-Debian.cpp @@ -61,8 +61,8 @@ QStringList LOS::ExternalDevicePaths(){ int LOS::ScreenBrightness(){ //Returns: Screen Brightness as a percentage (0-100, with -1 for errors) if(screenbrightness==-1){ - if(QFile::exists(QDir::homePath()+"/.lumina/.currentxbrightness")){ - int val = LUtils::readFile(QDir::homePath()+"/.lumina/.currentxbrightness").join("").simplified().toInt(); + if(QFile::exists(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness")){ + int val = LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness").join("").simplified().toInt(); screenbrightness = val; } } @@ -84,7 +84,7 @@ void LOS::setScreenBrightness(int percent){ //Save the result for later if(ret!=0){ screenbrightness = -1; } else{ screenbrightness = percent; } - LUtils::writeFile(QDir::homePath()+"/.lumina/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); + LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); } diff --git a/src-qt5/core/libLumina/LuminaOS-DragonFly.cpp b/src-qt5/core/libLumina/LuminaOS-DragonFly.cpp index 919c88e5..2ebc62a0 100644 --- a/src-qt5/core/libLumina/LuminaOS-DragonFly.cpp +++ b/src-qt5/core/libLumina/LuminaOS-DragonFly.cpp @@ -112,8 +112,8 @@ QStringList LOS::ExternalDevicePaths(){ int LOS::ScreenBrightness(){ //Returns: Screen Brightness as a percentage (0-100, with -1 for errors) if(screenbrightness==-1){ - if(QFile::exists(QDir::homePath()+"/.lumina/.currentxbrightness")){ - int val = LUtils::readFile(QDir::homePath()+"/.lumina/.currentxbrightness").join("").simplified().toInt(); + if(QFile::exists(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness")){ + int val = LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness").join("").simplified().toInt(); screenbrightness = val; } } @@ -139,7 +139,7 @@ void LOS::setScreenBrightness(int percent){ //Save the result for later if(!success){ screenbrightness = -1; } else{ screenbrightness = percent; } - LUtils::writeFile(QDir::homePath()+"/.lumina/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); + LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); } //Read the current volume @@ -147,7 +147,7 @@ int LOS::audioVolume(){ //Returns: audio volume as a percentage (0-100, with -1 int out = audiovolume; if(out < 0){ //First time session check: Load the last setting for this user - QString info = LUtils::readFile(QDir::homePath()+"/.lumina/.currentvolume").join(""); + QString info = LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentvolume").join(""); if(!info.isEmpty()){ out = info.simplified().toInt(); audiovolume = out; //unset this internal flag @@ -164,7 +164,7 @@ int LOS::audioVolume(){ //Returns: audio volume as a percentage (0-100, with -1 else{ out = R; } if(out != audiovolume){ //Volume changed by other utility: adjust the saved value as well - LUtils::writeFile(QDir::homePath()+"/.lumina/.currentvolume", QStringList() << QString::number(out), true); + LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentvolume", QStringList() << QString::number(out), true); } audiovolume = out; } @@ -190,7 +190,7 @@ void LOS::setAudioVolume(int percent){ //Run Command audiovolume = percent; //save for checking later LUtils::runCmd("mixer vol "+QString::number(L)+":"+QString::number(R)); - LUtils::writeFile(QDir::homePath()+"/.lumina/.currentvolume", QStringList() << QString::number(percent), true); + LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentvolume", QStringList() << QString::number(percent), true); } } diff --git a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp index 6f03767b..568ac910 100644 --- a/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp +++ b/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp @@ -71,8 +71,8 @@ int LOS::ScreenBrightness(){ else if( !LUtils::isValidBinary("xbrightness") ){ return -1; } //incomplete install //Now perform the standard brightness checks if(screenbrightness==-1){ //memory value - if(QFile::exists(QDir::homePath()+"/.lumina/.currentxbrightness")){ //saved file value - int val = LUtils::readFile(QDir::homePath()+"/.lumina/.currentxbrightness").join("").simplified().toInt(); + if(QFile::exists(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness")){ //saved file value + int val = LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness").join("").simplified().toInt(); screenbrightness = val; } } @@ -114,7 +114,7 @@ void LOS::setScreenBrightness(int percent){ //Save the result for later if(!success){ screenbrightness = -1; } else{ screenbrightness = percent; } - LUtils::writeFile(QDir::homePath()+"/.lumina/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); + LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); } //Read the current volume @@ -122,7 +122,7 @@ int LOS::audioVolume(){ //Returns: audio volume as a percentage (0-100, with -1 int out = audiovolume; if(out < 0){ //First time session check: Load the last setting for this user - QString info = LUtils::readFile(QDir::homePath()+"/.lumina/.currentvolume").join(""); + QString info = LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentvolume").join(""); if(!info.isEmpty()){ out = info.simplified().toInt(); audiovolume = out; //unset this internal flag @@ -139,7 +139,7 @@ int LOS::audioVolume(){ //Returns: audio volume as a percentage (0-100, with -1 else{ out = R; } if(out != audiovolume){ //Volume changed by other utility: adjust the saved value as well - LUtils::writeFile(QDir::homePath()+"/.lumina/.currentvolume", QStringList() << QString::number(out), true); + LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentvolume", QStringList() << QString::number(out), true); } audiovolume = out; } @@ -165,7 +165,7 @@ void LOS::setAudioVolume(int percent){ //Run Command audiovolume = percent; //save for checking later LUtils::runCmd("mixer vol "+QString::number(L)+":"+QString::number(R)); - LUtils::writeFile(QDir::homePath()+"/.lumina/.currentvolume", QStringList() << QString::number(percent), true); + LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentvolume", QStringList() << QString::number(percent), true); } } diff --git a/src-qt5/core/libLumina/LuminaOS-Gentoo.cpp b/src-qt5/core/libLumina/LuminaOS-Gentoo.cpp index 3a9c7320..5ed40be8 100644 --- a/src-qt5/core/libLumina/LuminaOS-Gentoo.cpp +++ b/src-qt5/core/libLumina/LuminaOS-Gentoo.cpp @@ -61,8 +61,8 @@ QStringList LOS::ExternalDevicePaths(){ int LOS::ScreenBrightness(){ //Returns: Screen Brightness as a percentage (0-100, with -1 for errors) if(screenbrightness==-1){ - if(QFile::exists(QDir::homePath()+"/.lumina/.currentxbrightness")){ - int val = LUtils::readFile(QDir::homePath()+"/.lumina/.currentxbrightness").join("").simplified().toInt(); + if(QFile::exists(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness")){ + int val = LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness").join("").simplified().toInt(); screenbrightness = val; } } @@ -84,7 +84,7 @@ void LOS::setScreenBrightness(int percent){ //Save the result for later if(ret!=0){ screenbrightness = -1; } else{ screenbrightness = percent; } - LUtils::writeFile(QDir::homePath()+"/.lumina/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); + LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); } diff --git a/src-qt5/core/libLumina/LuminaOS-Linux.cpp b/src-qt5/core/libLumina/LuminaOS-Linux.cpp index c40cbd60..1bc200af 100644 --- a/src-qt5/core/libLumina/LuminaOS-Linux.cpp +++ b/src-qt5/core/libLumina/LuminaOS-Linux.cpp @@ -58,8 +58,8 @@ QStringList LOS::ExternalDevicePaths(){ int LOS::ScreenBrightness(){ //Returns: Screen Brightness as a percentage (0-100, with -1 for errors) if(screenbrightness==-1){ - if(QFile::exists(QDir::homePath()+"/.lumina/.currentxbrightness")){ - int val = LUtils::readFile(QDir::homePath()+"/.lumina/.currentxbrightness").join("").simplified().toInt(); + if(QFile::exists(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness")){ + int val = LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness").join("").simplified().toInt(); screenbrightness = val; } } @@ -81,7 +81,7 @@ void LOS::setScreenBrightness(int percent){ //Save the result for later if(ret!=0){ screenbrightness = -1; } else{ screenbrightness = percent; } - LUtils::writeFile(QDir::homePath()+"/.lumina/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); + LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); } diff --git a/src-qt5/core/libLumina/LuminaOS-OpenBSD.cpp b/src-qt5/core/libLumina/LuminaOS-OpenBSD.cpp index 30a02078..0d04b52d 100644 --- a/src-qt5/core/libLumina/LuminaOS-OpenBSD.cpp +++ b/src-qt5/core/libLumina/LuminaOS-OpenBSD.cpp @@ -61,8 +61,8 @@ int LOS::ScreenBrightness(){ if( !info.filter(QRegExp("VirtualBox|KVM")).isEmpty() ){ return -1; } //Now perform the standard brightness checks if(screenbrightness==-1){ - if(QFile::exists(QDir::homePath()+"/.lumina/.currentxbrightness")){ - int val = LUtils::readFile(QDir::homePath()+"/.lumina/.currentxbrightness").join("").simplified().toInt(); + if(QFile::exists(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness")){ + int val = LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness").join("").simplified().toInt(); screenbrightness = val; } } @@ -81,7 +81,7 @@ void LOS::setScreenBrightness(int percent){ //Save the result for later if(ret!=0){ screenbrightness = -1; } else{ screenbrightness = percent; } - LUtils::writeFile(QDir::homePath()+"/.lumina/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); + LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); } //Read the current volume diff --git a/src-qt5/core/libLumina/LuminaOS-kFreeBSD.cpp b/src-qt5/core/libLumina/LuminaOS-kFreeBSD.cpp index 8414db1a..680e0164 100644 --- a/src-qt5/core/libLumina/LuminaOS-kFreeBSD.cpp +++ b/src-qt5/core/libLumina/LuminaOS-kFreeBSD.cpp @@ -62,8 +62,8 @@ QStringList LOS::ExternalDevicePaths(){ int LOS::ScreenBrightness(){ //Returns: Screen Brightness as a percentage (0-100, with -1 for errors) if(screenbrightness==-1){ - if(QFile::exists(QDir::homePath()+"/.lumina/.currentxbrightness")){ - int val = LUtils::readFile(QDir::homePath()+"/.lumina/.currentxbrightness").join("").simplified().toInt(); + if(QFile::exists(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness")){ + int val = LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness").join("").simplified().toInt(); screenbrightness = val; } } @@ -85,7 +85,7 @@ void LOS::setScreenBrightness(int percent){ //Save the result for later if(ret!=0){ screenbrightness = -1; } else{ screenbrightness = percent; } - LUtils::writeFile(QDir::homePath()+"/.lumina/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); + LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/.currentxbrightness", QStringList() << QString::number(screenbrightness), true); } diff --git a/src-qt5/core/libLumina/LuminaThemes.cpp b/src-qt5/core/libLumina/LuminaThemes.cpp index 9d33960f..d9ca537b 100644 --- a/src-qt5/core/libLumina/LuminaThemes.cpp +++ b/src-qt5/core/libLumina/LuminaThemes.cpp @@ -33,7 +33,7 @@ QStringList LTHEME::availableSystemThemes(){ } QStringList LTHEME::availableLocalThemes(){ //returns: [name::::path] for each item - QDir dir(QDir::homePath()+"/.lumina/themes"); + QDir dir( QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/themes"); QStringList list = dir.entryList(QStringList() <<"*.qss.template", QDir::Files, QDir::Name); for(int i=0; i<list.length(); i++){ //Format the output entry [<name>::::<fullpath>] @@ -54,7 +54,7 @@ QStringList LTHEME::availableSystemColors(){ //returns: [name::::path] for each } QStringList LTHEME::availableLocalColors(){ //returns: [name::::path] for each item - QDir dir(QDir::homePath()+"/.lumina/colors"); + QDir dir(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/colors"); QStringList list = dir.entryList(QStringList() <<"*.qss.colors", QDir::Files, QDir::Name); for(int i=0; i<list.length(); i++){ //Format the output entry [<name>::::<fullpath>] @@ -108,13 +108,13 @@ QStringList LTHEME::availableSystemCursors(){ //returns: [name] for each item //Save a new theme/color file bool LTHEME::saveLocalTheme(QString name, QStringList contents){ - QString localdir = QDir::homePath()+"/.lumina/themes/"; + QString localdir = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/themes/"; if(!QFile::exists(localdir)){ QDir dir; dir.mkpath(localdir); } return LUtils::writeFile(localdir+name+".qss.template", contents, true); } bool LTHEME::saveLocalColors(QString name, QStringList contents){ - QString localdir = QDir::homePath()+"/.lumina/colors/"; + QString localdir = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/colors/"; if(!QFile::exists(localdir)){ QDir dir; dir.mkpath(localdir); } return LUtils::writeFile(localdir+name+".qss.colors", contents, true); } @@ -122,7 +122,7 @@ bool LTHEME::saveLocalColors(QString name, QStringList contents){ //Return the currently selected Theme/Colors/Icons QStringList LTHEME::currentSettings(){ //returns [theme path, colorspath, iconsname, font, fontsize] QStringList out; out << "" << "" << "" << "" << ""; - QStringList settings = LUtils::readFile(QDir::homePath()+"/.lumina/themesettings.cfg"); + QStringList settings = LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/themesettings.cfg"); for(int i=0; i<settings.length(); i++){ if(settings[i].startsWith("THEMEFILE=")){ out[0] = settings[i].section("=",1,1).simplified(); } else if(settings[i].startsWith("COLORFILE=")){ out[1] = settings[i].section("=",1,1).simplified(); } @@ -172,7 +172,7 @@ bool LTHEME::setCurrentSettings(QString themepath, QString colorpath, QString ic contents << "ICONTHEME="+iconname; contents << "FONTFAMILY="+font; contents << "FONTSIZE="+fontsize; - bool ok = LUtils::writeFile(QDir::homePath()+"/.lumina/themesettings.cfg", contents, true); + bool ok = LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/themesettings.cfg", contents, true); return ok; } @@ -275,9 +275,9 @@ QStringList LTHEME::cursorInformation(QString name){ QStringList LTHEME::CustomEnvSettings(){ //view all the key=value settings static QStringList info = QStringList(); static QDateTime lastcheck = QDateTime(); - if(lastcheck.isNull() || lastcheck < QFileInfo(QDir::homePath()+"/.lumina/envsettings.conf").lastModified()){ + if(lastcheck.isNull() || lastcheck < QFileInfo(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/envsettings.conf").lastModified()){ lastcheck = QDateTime::currentDateTime(); - info = LUtils::readFile(QDir::homePath()+"/.lumina/envsettings.conf"); + info = LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/envsettings.conf"); } return info; } @@ -287,8 +287,8 @@ void LTHEME::LoadCustomEnvSettings(){ QStringList info = LTHEME::CustomEnvSettings(); if(info.isEmpty()){ //Ensure the file exists, and create it otherwise; - if(!QFile::exists(QDir::homePath()+"/.lumina/envsettings.conf")){ - LUtils::writeFile(QDir::homePath()+"/.lumina/envsettings.conf", QStringList() << "", true); + if(!QFile::exists( QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/envsettings.conf")){ + LUtils::writeFile( QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/envsettings.conf", QStringList() << "", true); } } for(int i=0; i<info.length(); i++){ @@ -316,7 +316,7 @@ bool LTHEME::setCustomEnvSetting(QString var, QString val){ } } if(!changed){ info << var+"="+val; } - return LUtils::writeFile(QDir::homePath()+"/.lumina/envsettings.conf", info, true); + return LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/envsettings.conf", info, true); } QString LTHEME::readCustomEnvSetting(QString var){ @@ -429,8 +429,8 @@ LuminaThemeEngine::LuminaThemeEngine(QApplication *app){ //setenv("XCURSOR_THEME", cursors.toLocal8Bit(),1); watcher = new QFileSystemWatcher(this); - watcher->addPath( QDir::homePath()+"/.lumina/envsettings.conf" ); - watcher->addPath( QDir::homePath()+"/.lumina/themesettings.cfg" ); + watcher->addPath( QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/envsettings.conf" ); + watcher->addPath( QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/themesettings.cfg" ); watcher->addPaths( QStringList() << theme << colors << QDir::homePath()+"/.icons/default/index.theme" ); //also watch these files for changes connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(watcherChange(QString)) ); connect(syncTimer, SIGNAL(timeout()), this, SLOT(reloadFiles()) ); @@ -452,7 +452,7 @@ void LuminaThemeEngine::watcherChange(QString file){ void LuminaThemeEngine::reloadFiles(){ //Check the Theme file/settings - if(lastcheck < QFileInfo(QDir::homePath()+"/.lumina/themesettings.cfg").lastModified().addSecs(1) ){ + if(lastcheck < QFileInfo(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/themesettings.cfg").lastModified().addSecs(1) ){ QStringList current = LTHEME::currentSettings(); if(application->applicationFilePath().section("/",-1)=="lumina-desktop"){ application->setStyleSheet( LTHEME::assembleStyleSheet(current[0], current[1], current[3], current[4]) ); @@ -495,13 +495,13 @@ void LuminaThemeEngine::reloadFiles(){ //Environment Changes - if( lastcheck < QFileInfo(QDir::homePath()+"/.lumina/envsettings.conf").lastModified()){ + if( lastcheck < QFileInfo(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/envsettings.conf").lastModified()){ LTHEME::LoadCustomEnvSettings(); emit EnvChanged(); } lastcheck = QDateTime::currentDateTime(); //Now update the watched files to ensure nothing is missed - watcher->removePaths( QStringList() << theme << colors << QDir::homePath()+"/.icons/default/index.theme" << QDir::homePath()+"/.lumina/envsettings.conf"); - watcher->addPaths( QStringList() << theme << colors << QDir::homePath()+"/.icons/default/index.theme" << QDir::homePath()+"/.lumina/envsettings.conf"); + watcher->removePaths( QStringList() << theme << colors << QDir::homePath()+"/.icons/default/index.theme" << QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/envsettings.conf"); + watcher->addPaths( QStringList() << theme << colors << QDir::homePath()+"/.icons/default/index.theme" << QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/envsettings.conf"); } diff --git a/src-qt5/core/libLumina/LuminaUtils.cpp b/src-qt5/core/libLumina/LuminaUtils.cpp index 4911b9fa..73f16274 100644 --- a/src-qt5/core/libLumina/LuminaUtils.cpp +++ b/src-qt5/core/libLumina/LuminaUtils.cpp @@ -442,7 +442,7 @@ bool LUtils::validQuickPlugin(QString ID){ QString LUtils::findQuickPluginFile(QString ID){ if(ID.startsWith("quick-")){ ID = ID.section("-",1,50); } //just in case //Give preference to any user-supplied plugins (overwrites for system plugins) - QString path = QDir::homePath()+"/.lumina/quickplugins/quick-"+ID+".qml"; + QString path = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/quickplugins/quick-"+ID+".qml"; if( QFile::exists(path) ){return path; } path = LOS::LuminaShare()+"quickplugins/quick-"+ID+".qml"; if( QFile::exists(path) ){return path; } @@ -450,7 +450,7 @@ QString LUtils::findQuickPluginFile(QString ID){ } QStringList LUtils::listQuickPlugins(){ - QDir dir(QDir::homePath()+"/.lumina/quickplugins"); + QDir dir(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/quickplugins"); QStringList files = dir.entryList(QStringList() << "quick-*.qml", QDir::Files | QDir::NoDotAndDotDot, QDir::Name); dir.cd(LOS::LuminaShare()+"quickplugins"); files << dir.entryList(QStringList() << "quick-*.qml", QDir::Files | QDir::NoDotAndDotDot, QDir::Name); @@ -486,16 +486,16 @@ QStringList LUtils::infoQuickPlugin(QString ID){ //Returns: [Name, Description, QStringList LUtils::listFavorites(){ static QDateTime lastRead; QDateTime cur = QDateTime::currentDateTime(); - if(lastRead.isNull() || lastRead<QFileInfo(QDir::homePath()+"/.lumina/favorites/fav.list").lastModified()){ - fav = LUtils::readFile(QDir::homePath()+"/.lumina/favorites/fav.list"); + if(lastRead.isNull() || lastRead<QFileInfo( QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/favorites.list").lastModified()){ + fav = LUtils::readFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/favorites.list"); fav.removeAll(""); //remove any empty lines fav.removeDuplicates(); lastRead = cur; - if(fav.isEmpty()){ + /*if(fav.isEmpty()){ //Make sure the favorites dir exists, and create it if necessary QDir dir(QDir::homePath()+"/.lumina/favorites"); if(!dir.exists()){ dir.mkpath(QDir::homePath()+"/.lumina/favorites"); } - } + }*/ } return fav; @@ -503,7 +503,7 @@ QStringList LUtils::listFavorites(){ bool LUtils::saveFavorites(QStringList list){ list.removeDuplicates(); - bool ok = LUtils::writeFile(QDir::homePath()+"/.lumina/favorites/fav.list", list, true); + bool ok = LUtils::writeFile(QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/favorites.list", list, true); if(ok){ fav = list; } //also save internally in case of rapid write/read of the file return ok; } @@ -545,7 +545,7 @@ void LUtils::removeFavorite(QString path){ } void LUtils::upgradeFavorites(int fromoldversionnumber){ - if(fromoldversionnumber <= 8004){ // < pre-0.8.4>, sym-links in the ~/.lumina/favorites dir} + /*if(fromoldversionnumber <= 8004){ // < pre-0.8.4>, sym-links in the ~/.lumina/favorites dir} //Include 0.8.4-devel versions in this upgrade (need to distinguish b/w devel and release versions later somehow) QDir favdir(QDir::homePath()+"/.lumina/favorites"); QFileInfoList symlinks = favdir.entryInfoList(QDir::Files | QDir::Dirs | QDir::System | QDir::NoDotAndDotDot); @@ -568,7 +568,7 @@ void LUtils::upgradeFavorites(int fromoldversionnumber){ if(newentry){ LUtils::saveFavorites(favfile); } - } //end check for version <= 0.8.4 + }*/ //end check for version <= 0.8.4 } @@ -824,7 +824,7 @@ void LUtils::LoadSystemDefaults(bool skipOS){ //qDebug() << " - Final Theme Color:" << themesettings[1]; //Ensure that the settings directory exists - QString setdir = QDir::homePath()+"/.lumina/LuminaDE"; + QString setdir = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop"; if(!QFile::exists(setdir)){ QDir dir; dir.mkpath(setdir); @@ -845,11 +845,12 @@ bool LUtils::checkUserFiles(QString lastversion){ bool newversion = ( oldversion < nversion ); //increasing version number bool newrelease = ( lastversion.contains("-devel", Qt::CaseInsensitive) && QApplication::applicationVersion().contains("-release", Qt::CaseInsensitive) ); //Moving from devel to release + QString confdir = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/"; //Check for the desktop settings file - QString dset = QDir::homePath()+"/.lumina/LuminaDE/desktopsettings.conf"; + QString dset = confdir+"desktopsettings.conf"; bool firstrun = false; - if(!QFile::exists(dset) || oldversion < 5000){ - if( oldversion < 5000 ){ QFile::remove(dset); qDebug() << "Current desktop settings obsolete: Re-implementing defaults"; } + if(!QFile::exists(dset) || oldversion < 100000){ + if( oldversion < 100000 && nversion>=100000 ){ system("rm -rf ~/.lumina"); qDebug() << "Current desktop settings obsolete: Re-implementing defaults"; } else{ firstrun = true; } LUtils::LoadSystemDefaults(); } @@ -858,7 +859,7 @@ bool LUtils::checkUserFiles(QString lastversion){ LUtils::upgradeFavorites(oldversion); } //Convert any "userbutton" and "appmenu" panel plugins to the new "systemstart" plugin (0.8.7) - if(oldversion <= 8007 && (newversion || newrelease) && nversion < 8008){ + /*if(oldversion <= 8007 && (newversion || newrelease) && nversion < 8008){ QSettings dset(QSettings::UserScope, "LuminaDE","desktopsettings"); QStringList plugKeys = dset.allKeys().filter("panel").filter("/pluginlist"); for(int i=0; i<plugKeys.length(); i++){ @@ -888,10 +889,10 @@ bool LUtils::checkUserFiles(QString lastversion){ if(QFile::exists(QDir::homePath()+"/.lumina/pluginsettings/desktopsettings.conf")){ QFile::remove(QDir::homePath()+"/.lumina/pluginsettings/desktopsettings.conf"); } - } + }*/ //Convert to the XDG autostart spec as necessary (Change occured with 0.8.5) - if(QFile::exists(QDir::homePath()+"/.lumina/startapps") ){ + /*if(QFile::exists(QDir::homePath()+"/.lumina/startapps") ){ QStringList cmds = LUtils::readFile(QDir::homePath()+"/.lumina/startapps"); for(int i=0; i<cmds.length(); i++){ cmds[i] = cmds[i].remove("lumina-open").simplified(); //remove the file opener @@ -900,15 +901,13 @@ bool LUtils::checkUserFiles(QString lastversion){ LXDG::setAutoStarted(true, cmds[i]); } QFile::remove(QDir::homePath()+"/.lumina/startapps"); //delete the old file - } + }*/ - //Check for the default applications file for lumina-open - dset = QDir::homePath()+"/.lumina/LuminaDE/lumina-open.conf"; - if(!QFile::exists(dset)){ + //Check the fluxbox configuration files + dset = QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/"; + if(!QFile::exists(dset+"fluxbox-init")){ firstrun = true; } - //Check the fluxbox configuration files - dset = QDir::homePath()+"/.lumina/"; bool fluxcopy = false; if(!QFile::exists(dset+"fluxbox-init")){ fluxcopy=true; } else if(!QFile::exists(dset+"fluxbox-keys")){fluxcopy=true; } @@ -917,7 +916,9 @@ bool LUtils::checkUserFiles(QString lastversion){ qDebug() << "Copying default fluxbox configuration files"; if(QFile::exists(dset+"fluxbox-init")){ QFile::remove(dset+"fluxbox-init"); } if(QFile::exists(dset+"fluxbox-keys")){ QFile::remove(dset+"fluxbox-keys"); } - QFile::copy(LOS::LuminaShare()+"fluxbox-init-rc", dset+"fluxbox-init"); + QString finit = LUtils::readFile(LOS::LuminaShare()+"fluxbox-init-rc").join("\n"); + finit.replace("${XDG_CONFIG_HOME}", QString(getenv("XDG_CONFIG_HOME"))); + LUtils::writeFile(dset+"fluxbox-init", finit.split("\n")); QFile::copy(LOS::LuminaShare()+"fluxbox-keys", dset+"fluxbox-keys"); QFile::setPermissions(dset+"fluxbox-init", QFile::ReadOwner | QFile::WriteOwner | QFile::ReadUser | QFile::ReadOther | QFile::ReadGroup); QFile::setPermissions(dset+"fluxbox-keys", QFile::ReadOwner | QFile::WriteOwner | QFile::ReadUser | QFile::ReadOther | QFile::ReadGroup); diff --git a/src-qt5/core/libLumina/themes/Glass.qss.template b/src-qt5/core/libLumina/themes/Glass.qss.template index 13e54df3..de032668 100644 --- a/src-qt5/core/libLumina/themes/Glass.qss.template +++ b/src-qt5/core/libLumina/themes/Glass.qss.template @@ -457,7 +457,7 @@ QProgressBar::chunk:horizontal{ margin-bottom: 2px; } -LDPlugin#applauncher QToolButton{ +LDPlugin#applauncher QToolButton, LDPlugin, LDPlugin#desktopview QListWidget::item{ background-color: qradialgradient(spread:reflect, cx:0.113757, cy:0.875, radius:0.7, fx:0.045, fy:0.954545, stop:0 rgba(234, 236, 243, 30), stop:1 rgba(229, 229, 229, 70)); border-width: 3px; border-style: solid; @@ -468,7 +468,7 @@ LDPlugin#applauncher QToolButton{ border-right-color: qradialgradient(spread:pad, cx:0, cy:0.5, radius:0.5, fx:1, fy:0.5, stop:0 rgba(255, 255, 255, 30), stop:0.724868 rgba(255, 255, 255, 60), stop:1 rgba(255, 255, 255, 10)); color: white; } -LDPlugin#applauncher QToolButton:hover{ +LDPlugin#applauncher QToolButton:hover, LDPlugin#desktopview QListWidget::item:hover{ background-color: qradialgradient(spread:reflect, cx:0.113757, cy:0.875, radius:0.7, fx:0.045, fy:0.954545, stop:0 rgba(234, 236, 243, 100), stop:1 rgba(229, 229, 229, 150)); border-width: 3px; border-style: solid; @@ -477,7 +477,6 @@ LDPlugin#applauncher QToolButton:hover{ border-bottom-color: qradialgradient(spread:pad, cx:0.5, cy:0, radius:0.5, fx:0.5, fy:0, stop:0 rgba(255, 255, 255, 30), stop:0.724868 rgba(255, 255, 255, 60), stop:1 rgba(255, 255, 255, 10)); border-left-color: qradialgradient(spread:pad, cx:1, cy:0.5, radius:0.5, fx:1, fy:0.5, stop:0 rgba(255, 255, 255, 30), stop:0.724868 rgba(255, 255, 255, 60), stop:1 rgba(255, 255, 255, 10)); border-right-color: qradialgradient(spread:pad, cx:0, cy:0.5, radius:0.5, fx:1, fy:0.5, stop:0 rgba(255, 255, 255, 30), stop:0.724868 rgba(255, 255, 255, 60), stop:1 rgba(255, 255, 255, 10)); - color: white; color: %%TEXTHIGHLIGHTCOLOR%%; } QWidget#LuminaPanelColor{ |