aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-08-18 14:15:15 -0400
committerKen Moore <ken@ixsystems.com>2017-08-18 14:15:15 -0400
commitddde99fd0aaf1c474a3e4b4a759a850780871903 (patch)
tree4c8ca56b899cea83853706678daf4095fb842f6b
parentUpdate the x11/lumina meta-port to include a dependency on x11-themes/lumina-... (diff)
downloadlumina-ddde99fd0aaf1c474a3e4b4a759a850780871903.tar.gz
lumina-ddde99fd0aaf1c474a3e4b4a759a850780871903.tar.bz2
lumina-ddde99fd0aaf1c474a3e4b4a759a850780871903.zip
Add the ability to generate symlinks in the Desktop folder the first time Lumina starts up for a user, based on entries in the system's luminaDesktop.conf file.
-rw-r--r--src-qt5/core/libLumina/LDesktopUtils.cpp10
-rw-r--r--src-qt5/core/libLumina/LDesktopUtils.h4
-rw-r--r--src-qt5/core/lumina-desktop/defaults/luminaDesktop-TrueOS.conf13
3 files changed, 25 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/LDesktopUtils.cpp b/src-qt5/core/libLumina/LDesktopUtils.cpp
index 973763e8..4c87ae22 100644
--- a/src-qt5/core/libLumina/LDesktopUtils.cpp
+++ b/src-qt5/core/libLumina/LDesktopUtils.cpp
@@ -337,6 +337,16 @@ void LDesktopUtils::LoadSystemDefaults(bool skipOS){
else if(var=="favorites_remove"){ qDebug() << " - Removing:"; LDesktopUtils::removeFavorite(val); }
}
+ tmp = sysDefaults.filter("desktoplinks_");
+ QString desktopFolder = QDir::homePath()+"/Desktop/"; //need to make this translatable and dynamic later
+ for(int i=0; i<tmp.length(); i++){
+ if(tmp[i].startsWith("#") || !tmp[i].contains("=") ){ continue; }
+ QString var = tmp[i].section("=",0,0).toLower().simplified();
+ QString val = tmp[i].section("=",1,1).section("#",0,0).simplified();
+ val = LUtils::AppToAbsolute(val); //turn any relative files into absolute
+ if(var=="desktoplinks_add" && QFile::exists(val) && !QFile::exists(desktopFolder+val.section("/",-1)) ){ QFile::link(val, desktopFolder+val.section("/",-1)); }
+ }
+
// -- QUICKLAUNCH --
tmp = sysDefaults.filter("quicklaunch_");
if(tmp.isEmpty()){ tmp = sysDefaults.filter("quicklaunch."); }
diff --git a/src-qt5/core/libLumina/LDesktopUtils.h b/src-qt5/core/libLumina/LDesktopUtils.h
index b21bc78a..a9b44c67 100644
--- a/src-qt5/core/libLumina/LDesktopUtils.h
+++ b/src-qt5/core/libLumina/LDesktopUtils.h
@@ -30,7 +30,7 @@ public:
static QString findQuickPluginFile(QString ID);
static QStringList listQuickPlugins(); //List of valid ID's
static QStringList infoQuickPlugin(QString ID); //Returns: [Name, Description, Icon]
-
+
//Various functions for the favorites sub-system
// Formatting Note: "<name>::::[dir/app/<mimetype>]::::<path>"
// the <name> field might not be used for "app" flagged entries
@@ -40,7 +40,7 @@ public:
static bool addFavorite(QString path, QString name = "");
static void removeFavorite(QString path);
static void upgradeFavorites(int fromoldversionnumber);
-
+
//Load the default setup for the system
static void LoadSystemDefaults(bool skipOS = false);
static bool checkUserFiles(QString lastversion); //returns true if something changed
diff --git a/src-qt5/core/lumina-desktop/defaults/luminaDesktop-TrueOS.conf b/src-qt5/core/lumina-desktop/defaults/luminaDesktop-TrueOS.conf
index f9481459..e453c0b8 100644
--- a/src-qt5/core/lumina-desktop/defaults/luminaDesktop-TrueOS.conf
+++ b/src-qt5/core/lumina-desktop/defaults/luminaDesktop-TrueOS.conf
@@ -97,6 +97,19 @@ favorites_add_ifexists=~/Videos
#quicklaunch_add=<file/dir path> #Create a quicklaunch shortcut for this file/dir
#quicklaunch_add_ifexists=<file/dir path> #Create a quicklaunch shortcut for this file/dir if the file/dir exists
+#Desktop Folder symlinks
+#desktoplinks_add=<file/dir path>
+desktoplinks_add=firefox.desktop
+desktoplinks_add=chromium-browser.desktop
+desktoplinks_add=qupzilla.desktop
+desktoplinks_add=thunderbird.desktop
+desktoplinks_add=trojita.desktop
+desktoplinks_add=vlc.desktop
+desktoplinks_add=pccontrol.desktop
+desktoplinks_add=lthemeengine.desktop
+desktoplinks_add=lumina-config.desktop
+desktoplinks_add=appcafe.desktop
+desktoplinks_add=handbook.desktop
#Generic scripts/utilities to run for any additional setup procedures
# These are always run after all other settings are saved
#Format: usersetup_run=<generic command to run>
bgstack15