diff options
author | Luc Menut <lmenut@mageia.org> | 2012-03-05 22:29:01 +0000 |
---|---|---|
committer | Luc Menut <lmenut@mageia.org> | 2012-03-05 22:29:01 +0000 |
commit | e92528710cad4100e691b6016fadc5e4647ea040 (patch) | |
tree | 6d7c51532ce0bc3db24b38de10c18911a27e170b /kde4-profiles | |
parent | 027a1e4784d5ed71db413853554dc0aed59e9cab (diff) | |
download | config-e92528710cad4100e691b6016fadc5e4647ea040.tar config-e92528710cad4100e691b6016fadc5e4647ea040.tar.gz config-e92528710cad4100e691b6016fadc5e4647ea040.tar.bz2 config-e92528710cad4100e691b6016fadc5e4647ea040.tar.xz config-e92528710cad4100e691b6016fadc5e4647ea040.zip |
- new plasma's configuration :
+ remove system plasma-desktoprc & plasma-desktop-appletsrc
+ add ECMA Script to init & update panel
+ add default panel (using icontasks)
+ add classic panel (using tasks)
- show tooltips in systemsettings by default
Diffstat (limited to 'kde4-profiles')
12 files changed, 389 insertions, 79 deletions
diff --git a/kde4-profiles/Default/org.kde.plasma-desktop.mageia/contents/layout.js b/kde4-profiles/Default/org.kde.plasma-desktop.mageia/contents/layout.js deleted file mode 100644 index 133fc46..0000000 --- a/kde4-profiles/Default/org.kde.plasma-desktop.mageia/contents/layout.js +++ /dev/null @@ -1,69 +0,0 @@ -////////function remove in case of error of first remove :S - -function remove() -{ - for (i in panelIds) { - - - panelById(panelIds[i]).remove() - } - -} -////////////////////////////////////////////////////////// - - -/////function remove standard/////////////////////////////// -function RemoveOldPanels() -{ - for (i in panelIds) { - // panelById(panelIds[i]).remove() - p = panelById(panelIds[i]); - if (typeof p === "undefined") { - print("E: Couldn't find first panel"); - remove() //load the remove function in case of problems - } - else { - panelById(panelIds[i]).remove() - } - } -} - -//RemoveOldPanels() //load the function - ////////////////////////////////////////////////////////// - -function mageiapanel(){ - -var panel = new Panel -if (panelIds.length == 1) { - // we are the only panel, so set the location for the user - panel.location = 'bottom' -} - -panel.height = screenGeometry(panel.screen).height > 1024 ? 35 : 27 - -panel.addWidget("simplelauncher") -panel.addWidget("showdesktop") -pager = panel.addWidget("pager"); -pager.writeGlobalConfig("rows", "1"); -var icontasks = panel.addWidget("icontasks") -systray = panel.addWidget("systemtray") -panel.addWidget("digital-clock") - -icontasks.currentConfigGroup = new Array("Launchers") -icontasks.writeConfig("Items","file:///usr/share/applications/mageia-drakconf.desktop,file:///usr/share/applications/kde4/systemsettings.desktop") -icontasks.writeConfig("browser", "preferred://browser, , , ") -icontasks.writeConfig("filemanager", "preferred://filemanager, , , ") -icontasks.writeConfig("showOnlyCurrentActivity","true"); -icontasks.writeConfig("showOnlyCurrentDesktop","false"); -icontasks.writeConfig("showOnlyCurrentScreen","true"); -icontasks.writeConfig("mediaButtons","true"); -icontasks.writeConfig("showProgress","true"); -icontasks.writeConfig("showSeparator","true"); -icontasks.writeConfig("launcherIcons","false"); -icontasks.writeConfig("unity","false"); -icontasks.writeConfig("style","1"); - -} - -mageiapanel() - diff --git a/kde4-profiles/Default/share/apps/plasma-desktop/init/00-defaultLayout.js b/kde4-profiles/Default/share/apps/plasma-desktop/init/00-defaultLayout.js new file mode 100644 index 0000000..8c53e02 --- /dev/null +++ b/kde4-profiles/Default/share/apps/plasma-desktop/init/00-defaultLayout.js @@ -0,0 +1,23 @@ +loadTemplate("org.mageia.plasma-desktop.defaultPanel"); + +for (var i = 0; i < screenCount; ++i) { + var desktop = new Activity("folderview"); + desktop.name = i18n("Desktop"); + desktop.screen = i; + desktop.wallpaperPlugin = 'image'; + desktop.wallpaperMode = 'SingleImage'; + desktop.currentConfigGroup = Array('Wallpaper', 'image'); + desktop.writeConfig('wallpaper', '/usr/share/mga/backgrounds/default.jpg'); + desktop.currentConfigGroup = Array(); + + //Create more panels for other screens + if (i > 0){ + var panel = new Panel; + panel.screen = i; + panel.location = 'bottom'; + panel.height = panels()[i].height = screenGeometry(0).height > 1024 ? 35 : 27; + var tasks = panel.addWidget("tasks"); + tasks.writeConfig("showOnlyCurrentScreen", true); + } +} +locked = true; diff --git a/kde4-profiles/Default/share/apps/plasma-desktop/updates/050_mga1-to-mga2.js b/kde4-profiles/Default/share/apps/plasma-desktop/updates/050_mga1-to-mga2.js new file mode 100644 index 0000000..d1d1bb4 --- /dev/null +++ b/kde4-profiles/Default/share/apps/plasma-desktop/updates/050_mga1-to-mga2.js @@ -0,0 +1,189 @@ +function addLauncher(icontasks, applicationDesktop, applicationWmClass) { + icontasks.currentConfigGroup = new Array("Launchers"); + var itemsLaunchers = icontasks.readConfig("Items", ""); + if (itemsLaunchers !== "") { + itemsLaunchers += ","; + } + itemsLaunchers += "file://" + applicationPath(applicationDesktop) + "?wmClass=" + applicationWmClass; + icontasks.writeConfig("Items", itemsLaunchers); +} + + +var myActivity14 = false; +var oldPanel = false; +myActivity14 = activityById(14); +oldPanel = activityById(2); + +locked = false; + +if (myActivity14) { + myActivity14.wallpaperPlugin = "image"; + myActivity14.wallpaperMode = "SingleImage"; + myActivity14.currentConfigGroup = Array('Wallpaper', 'image'); + myActivity14.writeConfig('wallpaper', '/usr/share/mga/backgrounds/default.jpg'); + myActivity14.currentConfigGroup = Array(); + myActivity14.reloadConfig(); +} + + +if (oldPanel) { + loadTemplate("org.mageia.plasma-desktop.defaultPanel"); + + var kickoffLauncher; + var lancelotLauncher; + var iconsAdded; + var widgetsAdded; + var newPanel = false; + + newPanel = panelById(Math.max.apply(null, panelIds)); + + kickoffLauncher = oldPanel.widgets("launcher"); + if (newPanel && (kickoffLauncher.length > 0)) { + var simpleLauncher = newPanel.widgets("simplelauncher"); + newPanel.addWidget(kickoffLauncher[0]); + kickoffLauncher[0].index = 0; + simpleLauncher[0].remove(); + } + + lancelotLauncher = oldPanel.widgets("lancelot_launcher"); + if (newPanel && (lancelotLauncher.length > 0)) { + var simpleLauncher = newPanel.widgets("simplelauncher"); + newPanel.addWidget(lancelotLauncher[0]); + lancelotLauncher[0].index = 0; + simpleLauncher[0].remove(); + } + newPanel.reloadConfig(); + + iconsAdded = oldPanel.widgets("icon"); + if (newPanel && (iconsAdded.length > 0)) { + var i = 3; + for (var j in iconsAdded) { + newPanel.addWidget(iconsAdded[j]); + iconsAdded[j].index = i; + i++; + } + } + newPanel.reloadConfig(); + + widgetsAdded = oldPanel.widgets(); + if (newPanel && (widgetsAdded.length > 0)) { + for (var j in widgetsAdded) { + newPanel.addWidget(widgetsAdded[j]); + } + } + newPanel.reloadConfig(); + + oldPanel.remove(); + +} else { + + var myPanel = false; + myPanel = panelById(2); + + if (myPanel) { + var showActivityManagerFound = false; + var iconsWidgets; + var launcherIndex = -1; + var tasksIndex = -1; + + var panelWidgets = myPanel.widgets(); + for (var id in panelWidgets) { + + switch(panelWidgets[id].type) { + case "simplelauncher": + if (launcherIndex === -1) { + var w_simplelauncher = panelWidgets[id]; + w_simplelauncher.writeConfig("icon", "mgabutton"); + w_simplelauncher.writeConfig("format", "Name"); + w_simplelauncher.writeConfig("showMenuTitles", "true"); + w_simplelauncher.writeConfig("views", "RecentlyUsedApplications,Applications,Favorites,RecentlyUsed,RunCommand,Leave"); + w_simplelauncher.reloadConfig(); + launcherIndex = w_simplelauncher.index; + } + break; + case "launcher": + case "lancelot_launcher": + if (launcherIndex === -1) { + launcherIndex = panelWidgets[id].index; + } + break; + case "tasks": + if (tasksIndex === -1) { + tasksIndex = panelWidgets[id].index; + panelWidgets[id].remove(); + + var w_icontasks = myPanel.addWidget("icontasks"); + w_icontasks.index = tasksIndex; + w_icontasks.writeConfig("showOnlyCurrentActivity","true"); + w_icontasks.writeConfig("showOnlyCurrentDesktop","false"); + w_icontasks.writeConfig("showOnlyCurrentScreen","true"); + w_icontasks.writeConfig("mediaButtons","true"); + w_icontasks.writeConfig("showProgress","true"); + w_icontasks.writeConfig("showSeparator","0"); + w_icontasks.writeConfig("launcherIcons","true"); + w_icontasks.writeConfig("unity","false"); + w_icontasks.writeConfig("style","1"); + + addLauncher(w_icontasks, "dolphin.desktop", "Dolphin"); + addLauncher(w_icontasks, "systemsettings.desktop", "Systemsettings"); + addLauncher(w_icontasks, "mageia-drakconf.desktop", "Drakconf.real"); + addLauncher(w_icontasks, "firefox.desktop", "Firefox"); + + w_icontasks.reloadConfig(); + + } + break; + case "org.kde.showActivityManager": + showActivityManagerFound = true; + break; + case "showdesktop": + panelWidgets[id].remove(); + break; + case "digital-clock": + var w_clock = panelWidgets[id]; + w_clock.writeConfig("displayHolidays","false"); + w_clock.writeConfig("displayEvents","false"); + w_clock.reloadConfig(); + break; + default: + break; + } + + myPanel.reloadConfig(); + } + + if (tasksIndex > -1) { + iconsWidgets = myPanel.widgets("icon"); + for (var j in iconsWidgets) { + var iconUrl = iconsWidgets[j].readConfig("Url","noUrl"); + var iconApp = iconUrl.substr(iconUrl.lastIndexOf('/') +1); + switch(iconApp) { + case "dolphin.desktop": + case "systemsettings.desktop": + case "mageia-drakconf.desktop": + case "firefox.desktop": + var myIcon = iconsWidgets[j]; + myIcon.remove(); + break; + default: + break; + } + } + } + myPanel.reloadConfig(); + + if (! showActivityManagerFound) { + var newShowActivityManager = myPanel.addWidget("org.kde.showActivityManager"); + showActivityManagerFound = true; + if (launcherIndex > -1) { + newShowActivityManager.index = launcherIndex + 1; + } else { + newShowActivityManager.index = 0; + } + } + myPanel.reloadConfig(); + } +} + +sleep(2); +locked = true; diff --git a/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.classicPanel/contents/layout.js b/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.classicPanel/contents/layout.js new file mode 100644 index 0000000..ba94f85 --- /dev/null +++ b/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.classicPanel/contents/layout.js @@ -0,0 +1,69 @@ +function addIcon(appDesktop) { + var w_icon = panel.addWidget("icon"); + w_icon.writeConfig("Url", "file://" + applicationPath(appDesktop)); +} + +var panel = new Panel; +if (panelIds.length == 1) { + // we are the only panel, so set the location for the user + panel.location = 'bottom'; +} + +panel.height = screenGeometry(panel.screen).height > 1024 ? 35 : 27; + +var w_simplelauncher = panel.addWidget("simplelauncher"); +w_simplelauncher.writeConfig("icon", "mgabutton"); +w_simplelauncher.writeConfig("format", "Name"); +w_simplelauncher.writeConfig("showMenuTitles", "true"); +w_simplelauncher.writeConfig("views", "RecentlyUsedApplications,Applications,Favorites,RecentlyUsed,RunCommand,Leave"); +w_simplelauncher.reloadConfig(); + +panel.addWidget("org.kde.showActivityManager"); + +addIcon("dolphin.desktop"); +addIcon("systemsettings.desktop"); +addIcon("mageia-drakconf.desktop"); +addIcon("firefox.desktop"); + +panel.addWidget("pager"); + +panel.addWidget("tasks"); + +var w_systray = panel.addWidget("systemtray"); + +var w_clock = panel.addWidget("digital-clock"); +w_clock.writeConfig("displayHolidays","false"); +w_clock.writeConfig("displayEvents","false"); +w_clock.reloadConfig(); + +panel.addWidget("lockout"); + +var biggestId = 0; +var tmpBiggestId = 0; + +for (var i in activityIds) { + var activity = activityById(activityIds[i]); + if (activity.widgetIds.length > 0) { + tmpBiggestId = Math.max.apply(null, activity.widgetIds); + if (tmpBiggestId > biggestId) { + biggestId = tmpBiggestId; + } + } +} + +for (var i in panelIds) { + var panel = panelById(panelIds[i]); + if (panel.widgetIds.length > 0) { + tmpBiggestId = Math.max.apply(null, panel.widgetIds); + if (tmpBiggestId > biggestId) { + biggestId = tmpBiggestId; + } + } +} + +w_systray.currentConfigGroup = new Array('Applets', biggestId+1); +w_systray.writeConfig('plugin', 'org.kde.telepathy-presence'); +w_systray.currentConfigGroup = new Array(); +w_systray.reloadConfig(); + +sleep(2); diff --git a/kde4-profiles/Default/org.kde.plasma-desktop.mageia/metadata.desktop b/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.classicPanel/metadata.desktop index 71bb06e..0045821 100644 --- a/kde4-profiles/Default/org.kde.plasma-desktop.mageia/metadata.desktop +++ b/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.classicPanel/metadata.desktop @@ -1,18 +1,16 @@ [Desktop Entry] Encoding=UTF-8 -Name=Mageia Default -Name[fr]= Tableau de bord Mageia +Name=Mageia Classic Panel Type=Service ServiceTypes=Plasma/LayoutTemplate X-Plasma-Shell=plasma-desktop X-Plasma-ContainmentCategories=panel -X-KDE-PluginInfo-Author=Balcaen John -X-KDE-PluginInfo-Email=mikala@mageia.org -X-KDE-PluginInfo-Name=org.kde.plasma-desktop.mageia -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website=http://www.mageia.org +X-KDE-PluginInfo-Author=Luc Menut +X-KDE-PluginInfo-Email=lmenut@mageia.org +X-KDE-PluginInfo-Name=org.mageia.plasma-desktop.classicPanel +X-KDE-PluginInfo-Version=1.0 +X-KDE-PluginInfo-Website=http://www.mageia.org/ X-KDE-PluginInfo-Category= X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-EnabledByDefault=true - diff --git a/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.defaultPanel/contents/layout.js b/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.defaultPanel/contents/layout.js new file mode 100644 index 0000000..7c46505 --- /dev/null +++ b/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.defaultPanel/contents/layout.js @@ -0,0 +1,84 @@ +function addLauncher(icontasks, applicationDesktop, applicationWmClass) { + icontasks.currentConfigGroup = new Array("Launchers"); + var itemsLaunchers = icontasks.readConfig("Items", ""); + if (itemsLaunchers !== "") { + itemsLaunchers += ","; + } + itemsLaunchers += "file://" + applicationPath(applicationDesktop) + "?wmClass=" + applicationWmClass; + icontasks.writeConfig("Items", itemsLaunchers); +} + +var panel = new Panel; +if (panelIds.length == 1) { + // we are the only panel, so set the location for the user + panel.location = 'bottom'; +} + +panel.height = screenGeometry(panel.screen).height > 1024 ? 35 : 27; + +var w_simplelauncher = panel.addWidget("simplelauncher"); +w_simplelauncher.writeConfig("icon", "mgabutton"); +w_simplelauncher.writeConfig("format", "Name"); +w_simplelauncher.writeConfig("showMenuTitles", "true"); +w_simplelauncher.writeConfig("views", "RecentlyUsedApplications,Applications,Favorites,RecentlyUsed,RunCommand,Leave"); +w_simplelauncher.reloadConfig(); + +panel.addWidget("org.kde.showActivityManager"); + +panel.addWidget("pager"); + +var w_icontasks = panel.addWidget("icontasks"); +w_icontasks.writeConfig("showOnlyCurrentActivity","true"); +w_icontasks.writeConfig("showOnlyCurrentDesktop","false"); +w_icontasks.writeConfig("showOnlyCurrentScreen","true"); +w_icontasks.writeConfig("mediaButtons","true"); +w_icontasks.writeConfig("showProgress","true"); +w_icontasks.writeConfig("showSeparator","0"); +w_icontasks.writeConfig("launcherIcons","true"); +w_icontasks.writeConfig("unity","false"); +w_icontasks.writeConfig("style","1"); + +addLauncher(w_icontasks, "dolphin.desktop", "Dolphin"); +addLauncher(w_icontasks, "systemsettings.desktop", "Systemsettings"); +addLauncher(w_icontasks, "mageia-drakconf.desktop", "Drakconf.real"); +addLauncher(w_icontasks, "firefox.desktop", "Firefox"); + +w_icontasks.reloadConfig(); + +var w_systray = panel.addWidget("systemtray"); + +var w_clock = panel.addWidget("digital-clock"); +w_clock.writeConfig("displayHolidays","false"); +w_clock.writeConfig("displayEvents","false"); +w_clock.reloadConfig(); + +panel.addWidget("lockout"); + +var biggestId = 0; +var tmpBiggestId = 0; + +for (var i in activityIds) { + var activity = activityById(activityIds[i]); + if (activity.widgetIds.length > 0) { + tmpBiggestId = Math.max.apply(null, activity.widgetIds); + if (tmpBiggestId > biggestId) { + biggestId = tmpBiggestId; + } + } +} + +for (var i in panelIds) { + var panel = panelById(panelIds[i]); + if (panel.widgetIds.length > 0) { + tmpBiggestId = Math.max.apply(null, panel.widgetIds); + if (tmpBiggestId > biggestId) { + biggestId = tmpBiggestId; + } + } +} + +w_systray.currentConfigGroup = new Array('Applets', biggestId+1); +w_systray.writeConfig('plugin', 'org.kde.telepathy-presence'); +w_systray.currentConfigGroup = new Array(); +w_systray.reloadConfig(); +sleep(2); diff --git a/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.defaultPanel/metadata.desktop b/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.defaultPanel/metadata.desktop new file mode 100644 index 0000000..40077d1 --- /dev/null +++ b/kde4-profiles/Default/share/apps/plasma/layout-templates/org.mageia.plasma-desktop.defaultPanel/metadata.desktop @@ -0,0 +1,16 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Mageia Default Panel +Type=Service +ServiceTypes=Plasma/LayoutTemplate +X-Plasma-Shell=plasma-desktop +X-Plasma-ContainmentCategories=panel +X-KDE-PluginInfo-Author=Luc Menut +X-KDE-PluginInfo-Email=lmenut@mageia.org +X-KDE-PluginInfo-Name=org.mageia.plasma-desktop.defaultPanel +X-KDE-PluginInfo-Version=1.0 +X-KDE-PluginInfo-Website=http://www.mageia.org/ +X-KDE-PluginInfo-Category= +X-KDE-PluginInfo-Depends= +X-KDE-PluginInfo-License=GPL +X-KDE-PluginInfo-EnabledByDefault=true diff --git a/kde4-profiles/Default/share/config/taskmanagerrulesrc b/kde4-profiles/Default/share/config/taskmanagerrulesrc new file mode 100644 index 0000000..a9d2b47 --- /dev/null +++ b/kde4-profiles/Default/share/config/taskmanagerrulesrc @@ -0,0 +1,2 @@ +[Mapping] +Drakconf.real::drakconf.real=file:///usr/share/applications/mageia-drakconf.desktop diff --git a/kde4-profiles/common/share/config/plasma-desktop-appletsrc b/kde4-profiles/common/share/config/plasma-desktop-appletsrc.disabled index e90ee80..e90ee80 100644 --- a/kde4-profiles/common/share/config/plasma-desktop-appletsrc +++ b/kde4-profiles/common/share/config/plasma-desktop-appletsrc.disabled diff --git a/kde4-profiles/common/share/config/plasma-desktoprc b/kde4-profiles/common/share/config/plasma-desktoprc.disabled index 925f640..925f640 100644 --- a/kde4-profiles/common/share/config/plasma-desktoprc +++ b/kde4-profiles/common/share/config/plasma-desktoprc.disabled diff --git a/kde4-profiles/common/share/config/plasmarc b/kde4-profiles/common/share/config/plasmarc deleted file mode 100644 index e69de29..0000000 --- a/kde4-profiles/common/share/config/plasmarc +++ /dev/null diff --git a/kde4-profiles/common/share/config/systemsettingsrc b/kde4-profiles/common/share/config/systemsettingsrc deleted file mode 100644 index c50f5e7..0000000 --- a/kde4-profiles/common/share/config/systemsettingsrc +++ /dev/null @@ -1,2 +0,0 @@ -[Main] -ShowToolTips=false |