Difference between revisions of "Plasma/Create a Global Theme Package"

(Formatted and prepared for translation)
(Marked this version for translation)
Line 1: Line 1:
 
<languages />
 
<languages />
 
<translate>
 
<translate>
== How to create your own Look and Feel package ==
+
== How to create your own Look and Feel package == <!--T:1-->
  
 +
<!--T:2-->
 
First of all we need to install '''Plasma Look And Feel Explorer''', which is a part of the '''plasma-sdk''' package.
 
First of all we need to install '''Plasma Look And Feel Explorer''', which is a part of the '''plasma-sdk''' package.
  
 +
<!--T:3-->
 
Plasma Look and Feel Explorer is a rather simple app.
 
Plasma Look and Feel Explorer is a rather simple app.
 
On the right panel/side you have three options:
 
On the right panel/side you have three options:
  
 +
<!--T:4-->
 
* '''A list of installed look and feel themes''' in your system, so you can pick one and edit it directly.</translate>
 
* '''A list of installed look and feel themes''' in your system, so you can pick one and edit it directly.</translate>
 
<translate>
 
<translate>
 +
<!--T:5-->
 
*'''Open Theme folder''' - It opens a directory where look and feel themes are saved.<br /><tt>/home/yourusername/.local/share/plasma/look-and-feel/</tt></translate>
 
*'''Open Theme folder''' - It opens a directory where look and feel themes are saved.<br /><tt>/home/yourusername/.local/share/plasma/look-and-feel/</tt></translate>
 
<translate>
 
<translate>
 +
<!--T:6-->
 
*'''New Theme''', where you can fill in all details of your theme, like name, author etc. You need to fill in all the fields, otherwise  the ''OK'' button will stay grayed out. If you click ''OK'' you will get a notification saying ''Plasma Layout successfully duplicated''.
 
*'''New Theme''', where you can fill in all details of your theme, like name, author etc. You need to fill in all the fields, otherwise  the ''OK'' button will stay grayed out. If you click ''OK'' you will get a notification saying ''Plasma Layout successfully duplicated''.
  
 +
<!--T:7-->
 
You can now chose your freshly created look and feel theme from the list of available themes and edit it in the main window.
 
You can now chose your freshly created look and feel theme from the list of available themes and edit it in the main window.
  
 +
<!--T:8-->
 
*'''Main window'''<br />It is rather self-explanatory. You can edit details of your look an feel package (name, author, etc). These details are saved into metadata.desktop in your look and feel directory. You also have two buttons there:
 
*'''Main window'''<br />It is rather self-explanatory. You can edit details of your look an feel package (name, author, etc). These details are saved into metadata.desktop in your look and feel directory. You also have two buttons there:
  
 +
<!--T:9-->
 
*'''Layout from current Plasma setup'''<br />It saves your current desktop layout like placement of panels, plasma applets, wallpaper etc. TODO Add some info what is exactly saved here. All these settings are saved into:</translate><br /><br /><translate>
 
*'''Layout from current Plasma setup'''<br />It saves your current desktop layout like placement of panels, plasma applets, wallpaper etc. TODO Add some info what is exactly saved here. All these settings are saved into:</translate><br /><br /><translate>
 +
<!--T:10-->
 
<tt>.local/share/plasma/look-and-feel/nameofyourtheme/contents/layout/org.kde.plasma.desktop-layout.js</tt></translate><br /><br /><translate>
 
<tt>.local/share/plasma/look-and-feel/nameofyourtheme/contents/layout/org.kde.plasma.desktop-layout.js</tt></translate><br /><br /><translate>
 +
<!--T:11-->
 
This is a javascript file executed when you check "Use desktop layout from theme" in the Look And Feel module of System Settings.  If your look and feel theme does not change desktop layout, you can safely remove that file.</translate><br /><br /><translate>
 
This is a javascript file executed when you check "Use desktop layout from theme" in the Look And Feel module of System Settings.  If your look and feel theme does not change desktop layout, you can safely remove that file.</translate><br /><br /><translate>
 +
<!--T:12-->
 
The content of the Javascript file will recreate a plasma configuration mirroring the contents of your current main plasma configuration file: <tt>~/.config/plasma-org.kde.plasma.desktop-appletsrc</tt>
 
The content of the Javascript file will recreate a plasma configuration mirroring the contents of your current main plasma configuration file: <tt>~/.config/plasma-org.kde.plasma.desktop-appletsrc</tt>
  
 +
<!--T:13-->
 
*'''Defaults from current setup'''<br />It creates a file:</translate><br /><translate>
 
*'''Defaults from current setup'''<br />It creates a file:</translate><br /><translate>
 +
<!--T:14-->
 
<tt>.local/share/plasma/look-and-feel/nameofyourtheme/contents/"default"</tt></translate><br /><translate>
 
<tt>.local/share/plasma/look-and-feel/nameofyourtheme/contents/"default"</tt></translate><br /><translate>
 +
<!--T:15-->
 
The following settings are saved:</translate>
 
The following settings are saved:</translate>
 
<translate>
 
<translate>
 +
<!--T:16-->
 
**widget style</translate>
 
**widget style</translate>
 
<translate>
 
<translate>
 +
<!--T:17-->
 
**color scheme</translate>
 
**color scheme</translate>
 
<translate>
 
<translate>
 +
<!--T:18-->
 
**icons</translate>
 
**icons</translate>
 
<translate>
 
<translate>
 +
<!--T:19-->
 
**plasma theme</translate>
 
**plasma theme</translate>
 
<translate>
 
<translate>
 +
<!--T:20-->
 
**cursor theme</translate>
 
**cursor theme</translate>
 
<translate>
 
<translate>
 +
<!--T:21-->
 
**window switcher</translate>
 
**window switcher</translate>
 
<translate>
 
<translate>
 +
<!--T:22-->
 
**desktop switcher</translate>
 
**desktop switcher</translate>
 
<translate>
 
<translate>
 +
<!--T:23-->
 
**window decoration.
 
**window decoration.
  
 +
<!--T:24-->
 
You can also add an image which will be used as a preview, stored in
 
You can also add an image which will be used as a preview, stored in
 
<tt>.local/share/plasma/look-and-feel/nameofyourtheme/contents/preview</tt>
 
<tt>.local/share/plasma/look-and-feel/nameofyourtheme/contents/preview</tt>
  
== How to add dependencies from KDE Store. ==
+
== How to add dependencies from KDE Store. == <!--T:25-->
  
 +
<!--T:26-->
 
First of all you need to add
 
First of all you need to add
 
{{Input|1=X-KPackage-Dependencies=}}
 
{{Input|1=X-KPackage-Dependencies=}}
 
to your metadata.desktop. Lets take a look at this example
 
to your metadata.desktop. Lets take a look at this example
  
 +
<!--T:27-->
 
[https://store.kde.org/p/1001720 Elementary Luna Plasma Color Schemes]
 
[https://store.kde.org/p/1001720 Elementary Luna Plasma Color Schemes]
  
  {{Input|1=X-KPackage-Dependencies=kns://colorschemes.knsrc/api.kde-look.org/1001720}}
+
  <!--T:28-->
 +
{{Input|1=X-KPackage-Dependencies=kns://colorschemes.knsrc/api.kde-look.org/1001720}}
  
 +
<!--T:29-->
 
'''kns://''' - the name of the protocol
 
'''kns://''' - the name of the protocol
  
 +
<!--T:30-->
 
'''colorschemes.knsrc''' - type of the resource we want to download (color scheme in that case)
 
'''colorschemes.knsrc''' - type of the resource we want to download (color scheme in that case)
 
Here is a list of available resources on my system (/etc/xdg)
 
Here is a list of available resources on my system (/etc/xdg)
  
 +
<!--T:31-->
 
*aurorae.knsrc
 
*aurorae.knsrc
  
 +
<!--T:32-->
 
*cgcgtk3.knsrc
 
*cgcgtk3.knsrc
  
 +
<!--T:33-->
 
*cgcicon.knsrc
 
*cgcicon.knsrc
  
 +
<!--T:34-->
 
*cgctheme.knsrc
 
*cgctheme.knsrc
  
 +
<!--T:35-->
 
*colorschemes.knsrc
 
*colorschemes.knsrc
  
 +
<!--T:36-->
 
*comic.knsrc
 
*comic.knsrc
  
 +
<!--T:37-->
 
*discover_ktexteditor_codesnippets_core.knsrc
 
*discover_ktexteditor_codesnippets_core.knsrc
  
 +
<!--T:38-->
 
*emoticons.knsrc
 
*emoticons.knsrc
  
 +
<!--T:39-->
 
*icons.knsrc  
 
*icons.knsrc  
  
 +
<!--T:40-->
 
*kfontinst.knsrc
 
*kfontinst.knsrc
  
 +
<!--T:41-->
 
*ksysguard.knsrc
 
*ksysguard.knsrc
  
 +
<!--T:42-->
 
*kwineffect.knsrc
 
*kwineffect.knsrc
  
 +
<!--T:43-->
 
*kwinscripts.knsrc
 
*kwinscripts.knsrc
  
 +
<!--T:44-->
 
*kwinswitcher.knsrc
 
*kwinswitcher.knsrc
  
 +
<!--T:45-->
 
*lookandfeel.knsrc
 
*lookandfeel.knsrc
  
 +
<!--T:46-->
 
*plasma-themes.knsrc
 
*plasma-themes.knsrc
  
 +
<!--T:47-->
 
*plasmoids.knsrc
 
*plasmoids.knsrc
  
 +
<!--T:48-->
 
*sddmtheme.knsrc
 
*sddmtheme.knsrc
  
 +
<!--T:49-->
 
*servicemenu.knsrc
 
*servicemenu.knsrc
  
 +
<!--T:50-->
 
*wallpaper.knsrc
 
*wallpaper.knsrc
  
 +
<!--T:51-->
 
*xcursor.knsrc
 
*xcursor.knsrc
  
  
 +
<!--T:52-->
 
'''api.kde-look.org/1001720''' - the url to the content stored on the server, from my experience ''api.kde-look.org/'' is always the same, only id changes. You can get the id from the kde store url ''https://store.kde.org/p/1001720'' '''1001720'''.
 
'''api.kde-look.org/1001720''' - the url to the content stored on the server, from my experience ''api.kde-look.org/'' is always the same, only id changes. You can get the id from the kde store url ''https://store.kde.org/p/1001720'' '''1001720'''.
  
 +
<!--T:53-->
 
You can specify more than one dependency. Here is an example from [https://store.kde.org/p/1167950/ United] metadata.desktop
 
You can specify more than one dependency. Here is an example from [https://store.kde.org/p/1167950/ United] metadata.desktop
  
 +
<!--T:54-->
 
{{Input|1=X-KPackage-Dependencies=kns://colorschemes.knsrc/api.kde-look.org/1001495,kns://plasma-themes.knsrc/api.kde-look.org/998797,kns://aurorae.knsrc/api.kde-look.org/1136954}}
 
{{Input|1=X-KPackage-Dependencies=kns://colorschemes.knsrc/api.kde-look.org/1001495,kns://plasma-themes.knsrc/api.kde-look.org/998797,kns://aurorae.knsrc/api.kde-look.org/1136954}}
  
 +
<!--T:55-->
 
On JSON:
 
On JSON:
 
{{Input|1=<nowiki>X-KPackage-Dependencies: { "kns://colorschemes.knsrc/api.kde-look.org/1001495", "kns://plasma-themes.knsrc/api.kde-look.org/998797", "kns://aurorae.knsrc/api.kde-look.org/1136954" }</nowiki>}}
 
{{Input|1=<nowiki>X-KPackage-Dependencies: { "kns://colorschemes.knsrc/api.kde-look.org/1001495", "kns://plasma-themes.knsrc/api.kde-look.org/998797", "kns://aurorae.knsrc/api.kde-look.org/1136954" }</nowiki>}}
  
 +
<!--T:56-->
 
* [https://store.kde.org/p/1001495 Color Scheme (Ambiance)]
 
* [https://store.kde.org/p/1001495 Color Scheme (Ambiance)]
  
 +
<!--T:57-->
 
* [https://store.kde.org/p/998797 Plasma theme (Unity Ambiance)]
 
* [https://store.kde.org/p/998797 Plasma theme (Unity Ambiance)]
  
 +
<!--T:58-->
 
* [https://store.kde.org/p/1136954 Aurorae (Blender Ambiance)]
 
* [https://store.kde.org/p/1136954 Aurorae (Blender Ambiance)]
  
 +
<!--T:59-->
 
You can install your look and feel package from terminal using  
 
You can install your look and feel package from terminal using  
 
{{Input|1=kpackagetool5 -i "name of your theme"}}
 
{{Input|1=kpackagetool5 -i "name of your theme"}}
 
It will be installed to <tt>.local/share/plasma/look-and-feel/</tt>
 
It will be installed to <tt>.local/share/plasma/look-and-feel/</tt>
  
 +
<!--T:60-->
 
This will also install dependencies specified in <tt>metadata.desktop</tt>, so you can test it locally on your system.
 
This will also install dependencies specified in <tt>metadata.desktop</tt>, so you can test it locally on your system.
 
Type <code>kpackagetool5 -h</code> to see more options.
 
Type <code>kpackagetool5 -h</code> to see more options.
  
== System dependencies  (experimental)==
+
== System dependencies  (experimental)== <!--T:61-->
  
 +
<!--T:62-->
 
You can specify system dependencies using their AppStream URI scheme. More information about it can be found [https://www.freedesktop.org/software/appstream/docs/sect-AppStream-Services-UrlHandler.html here].
 
You can specify system dependencies using their AppStream URI scheme. More information about it can be found [https://www.freedesktop.org/software/appstream/docs/sect-AppStream-Services-UrlHandler.html here].
  
 +
<!--T:63-->
 
To look up what's the resource you are looking for, you can check on your system by calling <code>appstreamcli search <something></code>
 
To look up what's the resource you are looking for, you can check on your system by calling <code>appstreamcli search <something></code>
  
 +
<!--T:64-->
 
When the Look and Feel package is installed, if a system dependency is specified, it will be the system deciding how to install it, most likely using PackageKit.
 
When the Look and Feel package is installed, if a system dependency is specified, it will be the system deciding how to install it, most likely using PackageKit.
  
 +
<!--T:65-->
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]
 
</translate>
 
</translate>

Revision as of 10:38, 3 September 2017

Other languages:
English • ‎українська

How to create your own Look and Feel package

First of all we need to install Plasma Look And Feel Explorer, which is a part of the plasma-sdk package.

Plasma Look and Feel Explorer is a rather simple app. On the right panel/side you have three options:

  • A list of installed look and feel themes in your system, so you can pick one and edit it directly.
  • Open Theme folder - It opens a directory where look and feel themes are saved.
    /home/yourusername/.local/share/plasma/look-and-feel/
  • New Theme, where you can fill in all details of your theme, like name, author etc. You need to fill in all the fields, otherwise the OK button will stay grayed out. If you click OK you will get a notification saying Plasma Layout successfully duplicated.

You can now chose your freshly created look and feel theme from the list of available themes and edit it in the main window.

  • Main window
    It is rather self-explanatory. You can edit details of your look an feel package (name, author, etc). These details are saved into metadata.desktop in your look and feel directory. You also have two buttons there:
  • Layout from current Plasma setup
    It saves your current desktop layout like placement of panels, plasma applets, wallpaper etc. TODO Add some info what is exactly saved here. All these settings are saved into:

    .local/share/plasma/look-and-feel/nameofyourtheme/contents/layout/org.kde.plasma.desktop-layout.js

    This is a javascript file executed when you check "Use desktop layout from theme" in the Look And Feel module of System Settings. If your look and feel theme does not change desktop layout, you can safely remove that file.

    The content of the Javascript file will recreate a plasma configuration mirroring the contents of your current main plasma configuration file: ~/.config/plasma-org.kde.plasma.desktop-appletsrc
  • Defaults from current setup
    It creates a file:
    .local/share/plasma/look-and-feel/nameofyourtheme/contents/"default"
    The following settings are saved:
    • widget style
    • color scheme
    • icons
    • plasma theme
    • cursor theme
    • window switcher
    • desktop switcher
    • window decoration.

You can also add an image which will be used as a preview, stored in .local/share/plasma/look-and-feel/nameofyourtheme/contents/preview

How to add dependencies from KDE Store.

First of all you need to add

X-KPackage-Dependencies=

to your metadata.desktop. Lets take a look at this example

Elementary Luna Plasma Color Schemes

X-KPackage-Dependencies=kns://colorschemes.knsrc/api.kde-look.org/1001720

kns:// - the name of the protocol

colorschemes.knsrc - type of the resource we want to download (color scheme in that case) Here is a list of available resources on my system (/etc/xdg)

  • aurorae.knsrc
  • cgcgtk3.knsrc
  • cgcicon.knsrc
  • cgctheme.knsrc
  • colorschemes.knsrc
  • comic.knsrc
  • discover_ktexteditor_codesnippets_core.knsrc
  • emoticons.knsrc
  • icons.knsrc
  • kfontinst.knsrc
  • ksysguard.knsrc
  • kwineffect.knsrc
  • kwinscripts.knsrc
  • kwinswitcher.knsrc
  • lookandfeel.knsrc
  • plasma-themes.knsrc
  • plasmoids.knsrc
  • sddmtheme.knsrc
  • servicemenu.knsrc
  • wallpaper.knsrc
  • xcursor.knsrc


api.kde-look.org/1001720 - the url to the content stored on the server, from my experience api.kde-look.org/ is always the same, only id changes. You can get the id from the kde store url https://store.kde.org/p/1001720 1001720.

You can specify more than one dependency. Here is an example from United metadata.desktop

X-KPackage-Dependencies=kns://colorschemes.knsrc/api.kde-look.org/1001495,kns://plasma-themes.knsrc/api.kde-look.org/998797,kns://aurorae.knsrc/api.kde-look.org/1136954

On JSON:

X-KPackage-Dependencies: { "kns://colorschemes.knsrc/api.kde-look.org/1001495", "kns://plasma-themes.knsrc/api.kde-look.org/998797", "kns://aurorae.knsrc/api.kde-look.org/1136954" }

You can install your look and feel package from terminal using

kpackagetool5 -i "name of your theme"

It will be installed to .local/share/plasma/look-and-feel/

This will also install dependencies specified in metadata.desktop, so you can test it locally on your system. Type kpackagetool5 -h to see more options.

System dependencies (experimental)

You can specify system dependencies using their AppStream URI scheme. More information about it can be found here.

To look up what's the resource you are looking for, you can check on your system by calling appstreamcli search <something>

When the Look and Feel package is installed, if a system dependency is specified, it will be the system deciding how to install it, most likely using PackageKit.


This page was last edited on 3 September 2017, at 10:38. Content is available under Creative Commons License SA 4.0 unless otherwise noted.