This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Saving a customized panel

Tags: None
(comma "," separated)
greggs
Registered Member
Posts
2
Karma
0

Saving a customized panel

Sat May 21, 2016 3:08 pm
Hello,

First, this is my first post so if I am missing information that is standard of posting questions then I would appreciate a heads up.

Question:
Is there any way to save a panel once I've tailored it the way I want it? And then make that saved panel available when I right click on the desktop -> Add Panel (by default it just shows: 1. Default Panel; 2. Empty Panel)?

History:
This is my main laptop/workstation that I use in the office and at home. Both locations have multiple monitors (work: 4 - not using laptop screen, home: 2 - using laptop screen). I occasionally find shutting down at work and booting up at home displays the behavior where my customized panel disappears. I've noticed other strange behavior with my panel at home and work (like it not being placed on the primary monitor i select in the display configuration). Not trying to get all of this answered/solved here. But I'm just trying to give some history of why I am asking this question.

Version Info:
In case this helps/matters I am using leap 42.1 with latest patches. And konsole --version version returns:
QCoreApplication::arguments: Please instantiate the QApplication object first
Qt: 5.5.1
KDE Frameworks: 5.21.0
Konsole: 15.12.3


Thanks,
Gregg
User avatar
google01103
Manager
Posts
6668
Karma
25

Re: Saving a customized panel

Sat May 21, 2016 3:30 pm
I believe:

to affect the use of "add panel" you'd have to look at the code or replace the default or empty panel whereever they are stored and they will probably be overwritten during an upgrade

there are a number of plasma config files ~/.config/plasma* the 2 most critical to the panel are the plasmashellrc and plasma-org.kde.plasma.desktop-appletsrc but all should be considered. The plasma-org.kde.plasma.desktop-appletsrc contains the panel(s) and the desktop not just the panel(s)

to backup:
Code: Select all
kquitapp plasmashell
 sleep 20s
 mkdir -p $HOME/plasma-config/
 cp ~/.config/plasma* $HOME/plasma-config/ (obviously this doesn't allow multiple point of time backups)
plasmashell &

note: you kquitapp & sleep the plasmashell to make sure that the current setup has been saved iirc

to restore:
you would kquitapp plasmashell and copy the saved files to ~/.config then run plasmashell


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
Rog131
Registered Member
Posts
828
Karma
10

Re: Saving a customized panel

Sun May 22, 2016 7:09 pm
My Panel

There is an option to make a panel layout-template.

Copy the /usr/share/plasma/layout-templates/org.kde.plasma.desktop.defaultPanel/ to ~/.local/share/plasma/layout-templates/org.kde.plasma.desktop.myPanel/

Image
Full image: http://i.imgur.com/C5y2VA5.png

Edit the ~/.local/share/plasma/layout-templates/org.kde.plasma.desktop.myPanel/metadata.desktop
At this example:
Code: Select all
[Desktop Entry]
Encoding=UTF-8
Name=My Panel
Name[x-test]=xxMy Panelxx

Type=Service
ServiceTypes=Plasma/LayoutTemplate
X-Plasma-Shell=plasmashell
X-Plasma-ContainmentCategories=panel
X-KDE-PluginInfo-Name=org.kde.plasma.desktop.myPanel
X-KDE-PluginInfo-Version=0.1
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true


=> an option to add 'My Panel'

Image


The panel widgets are listed at the ~/.local/share/plasma/layout-templates/org.kde.plasma.desktop.myPanel/contents/layout.js
i.e
Code: Select all
panel.addWidget("org.kde.milou")
panel.addWidget("org.kde.plasma.systemtray")
panel.addWidget("org.kde.plasma.fuzzyclock")


will add milou, sytemtray and fuzzy clock.

Image
greggs
Registered Member
Posts
2
Karma
0

Re: Saving a customized panel

Wed May 25, 2016 3:28 am
Sorry I haven't updated sooner. I did try the statements offered by google01103 but it didn't work for me. I hope to fool around with the other recommendation sometime tomorrow. I did notice something interesting on Monday when returning to work (where I had configured the original panel that I thought i lost) - it reappeared. Both panels were available. So I'm running with 1 panel at home and 2 panels at work until I can get this sorted out. I will be sure to update this post with my results.

Thank you,
Gregg
User avatar
ZDragon
Registered Member
Posts
1
Karma
0
OS

Re: Saving a customized panel

Tue Mar 07, 2017 2:14 pm
Greatings,

This is not a complete solution, but I hope the info helps.

Where does KDE5 / Plasma 5 store the users customized panel configuration / layout ?

These paths, files, and examples are from fresh install of: openSUSE Leap 42.2

(I chopped out alt languge parts, snipits have "//Begin" & "//End" added for clarity.)

There is nothing KDE5 / Plasma related in /etc, /tmp, or /var

----

Global system defaults::

Top level panel settings appear to be in:

/usr/share/kservices5/

plasma-layout-template-org.kde.plasma.desktop.emptyPanel.desktop

plasma-layout-template-org.kde.plasma.desktop.defaultPanel.desktop

//Begin

[Desktop Entry]
Encoding=UTF-8
Name=Default Panel
//(Name[<LANG>_<CC>]="<name in native characters>")
Name[x-test]=xxDefault Panelxx
Type=Service
ServiceTypes=Plasma/LayoutTemplate
X-Plasma-Shell=plasmashell
X-Plasma-ContainmentCategories=panel
X-KDE-PluginInfo-Author=Aaron Seigo
X-KDE-PluginInfo-Email=aseigo@kde.org
X-KDE-PluginInfo-Name=org.kde.plasma.desktop.defaultPanel
X-KDE-PluginInfo-Version=1.0
X-KDE-PluginInfo-Website=http://plasma.kde.org/
X-KDE-PluginInfo-Category=
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true

//End


Which then map to the above entries:

"ServiceTypes=Plasma/LayoutTemplate"

= /usr/share/plasma/layout-templates/

"X-KDE-PluginInfo-Name=org.kde.plasma.desktop.defaultPanel"

= /usr/share/plasma/layout-templates/org.kde.plasma.desktop.defaultPanel/
metadata.desktop
contents/layout.js

---

//Begin: layout.js

var panel = new Panel
var panelScreen = panel.screen
var freeEdges = {"bottom": true, "top": true, "left": true, "right": true}

for (i = 0; i < panelIds.length; ++i) {
var tmpPanel = panelById(panelIds[i])
if (tmpPanel.screen == panelScreen) {
// Ignore the new panel
if (tmpPanel.id != panel.id) {
freeEdges[tmpPanel.location] = false;
}
}
}

if (freeEdges["bottom"] == true) {
panel.location = "bottom";
} else if (freeEdges["top"] == true) {
panel.location = "top";
} else if (freeEdges["left"] == true) {
panel.location = "left";
} else if (freeEdges["right"] == true) {
panel.location = "right";
} else {
// There is no free edge, so leave the default value
panel.location = "top";
}

panel.height = gridUnit * 2

var kickoff = panel.addWidget("org.kde.plasma.kicker")
kickoff.currentConfigGroup = ["Shortcuts"]
kickoff.writeConfig("global", "Alt+F1")

//panel.addWidget("org.kde.plasma.showActivityManager")
panel.addWidget("org.kde.plasma.pager")
panel.addWidget("org.kde.plasma.taskmanager")

/* Next up is determining whether to add the Input Method Panel
* widget to the panel or not. This is done based on whether
* the system locale's language id is a member of the following
* white list of languages which are known to pull in one of
* our supported IME backends when chosen during installation
* of common distributions. */

//var langIds = ["as", // Assamese
//<..snipped..>

if (langIds.indexOf(languageId) != -1) {
panel.addWidget("org.kde.plasma.kimpanel");
}

panel.addWidget("org.kde.plasma.systemtray")
panel.addWidget("org.kde.plasma.digitalclock")

//End: layout.js

---

/usr/share/plasma/layout-templates/org.opensuse.desktop.defaultPanel/
metadata.desktop
contents/layout.js

//Begin: layout.js

var panel = new Panel
var panelScreen = panel.screen
var freeEdges = {"bottom": true, "top": true, "left": true, "right": true}

for (i = 0; i < panelIds.length; ++i) {
var tmpPanel = panelById(panelIds[i])
if (tmpPanel.screen == panelScreen) {
// Ignore the new panel
if (tmpPanel.id != panel.id) {
freeEdges[tmpPanel.location] = false;
}
}
}

if (freeEdges["bottom"] == true) {
panel.location = "bottom";
} else if (freeEdges["top"] == true) {
panel.location = "top";
} else if (freeEdges["left"] == true) {
panel.location = "left";
} else if (freeEdges["right"] == true) {
panel.location = "right";
} else {
// There is no free edge, so leave the default value
panel.location = "top";
}

panel.height = gridUnit * 2

var kickoff = panel.addWidget("org.kde.plasma.kicker")
kickoff.currentConfigGroup = ["Shortcuts"]
kickoff.writeConfig("global", "Alt+F1")

//panel.addWidget("org.kde.plasma.showActivityManager")
panel.addWidget("org.kde.plasma.pager")
panel.addWidget("org.kde.plasma.taskmanager")

/* Next up is determining whether to add the Input Method Panel
* widget to the panel or not. This is done based on whether
* the system locale's language id is a member of the following
* white list of languages which are known to pull in one of
* our supported IME backends when chosen during installation
* of common distributions. */

// var langIds = ["as", // Assamese
// <...snipped...>

if (langIds.indexOf(languageId) != -1) {
panel.addWidget("org.kde.plasma.kimpanel");
}

panel.addWidget("org.kde.plasma.systemtray")
panel.addWidget("org.kde.plasma.digitalclock")

//End: layout.js

---

The widgets = plasmoids, are listed from left to right:

panel.addWidget("org.kde.plasma.pager")
panel.addWidget("org.kde.plasma.taskmanager")
panel.addWidget("org.kde.plasma.systemtray")
panel.addWidget("org.kde.plasma.digitalclock")

They are located @ /usr/share/plasma/plasmoids/

====

These seems to be what we are looking for:

shell@host:~$ find . -name plasma* -print

./.config/plasma-org.kde.plasma.desktop-appletsrc

//Begin

[Containments][3]
activityId=
formfactor=2
immutability=1
lastScreen=0
location=3
plugin=org.kde.panel
wallpaperplugin=org.kde.image

[Containments][3][Applets][18][Configuration]
activityId=
formfactor=0
immutability=1
lastScreen=-1
location=0
plugin=org.kde.plasma.folder
wallpaperplugin=

[Containments][3][Applets][18][Configuration][ConfigDialog]
DialogHeight=540
DialogWidth=720

[Containments][3][Applets][18][Configuration][General]
pressToMoveHelp=false
url=file:///home/shell

<....>

[Containments][3][Applets][4]
immutability=1
plugin=org.kde.plasma.kicker

[Containments][3][Applets][4][Configuration][ConfigDialog]
DialogHeight=540
DialogWidth=720

[Containments][3][Applets][4][Configuration][General]
favoriteApps=preferred://browser,systemsettings.desktop,org.kde.dolphin.desktop

[Containments][3][Applets][4][Configuration][Shortcuts]
global=Alt+F1

[Containments][3][Applets][4][Shortcuts]
global=Alt+F1

//< But also contains non-panel / desktop items too, so might make creating a config template tricky ? >

[Containments][30]
activityId=79e08e5e-07da-47b7-8138-c83a3ae06281
formfactor=0
immutability=1
lastScreen=1
location=0
plugin=org.kde.desktopcontainment
wallpaperplugin=org.kde.slideshow

[Containments][30][ConfigDialog]
DialogHeight=540
DialogWidth=720

[Containments][30][General]
pressToMoveHelp=false

[Containments][30][Wallpaper][General]
SlidePaths=/home/shell/Pictures

[Containments][30][Wallpaper][org.kde.image][General]
height=1024
width=1280


//End

So looks like the format is [Containments][<ID>][<componant>][<comp.ID>]
and match up the ID's..

---
zdragon@dragnux.org 2017-03-07::07:46/cdt


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kesang, Sogou [Bot], Yahoo [Bot]