Plasma/Create a Global Theme Package/uk: Difference between revisions

    From KDE UserBase Wiki
    (Created page with "Спочатку, вам слід додати рядок {{Input|1=X-KPackage-Dependencies=}} до вашого файла metadata.desktop. Погляньом на цей п...")
    (Created page with "'''colorschemes.knsrc''' — тип ресурсу, який слід отримати (у нашому випадку це схема кольорів). Ось список...")
    Line 41: Line 41:
    '''kns://''' — назва протоколу
    '''kns://''' — назва протоколу


    '''colorschemes.knsrc''' - type of the resource we want to download (color scheme in that case)
    '''colorschemes.knsrc''' — тип ресурсу, який слід отримати (у нашому випадку це схема кольорів).
    Here is a list of available resources on my system (/etc/xdg)
    Ось список доступних ресурсів у моїй системі (/etc/xdg):


    *aurorae.knsrc
    *aurorae.knsrc

    Revision as of 16:03, 7 September 2017

    Other languages:

    Як створити власний пакунок-оболонку

    Спочатку вам слід встановити Навігатор темами вигляду Плазми, який є частиною пакунка plasma-sdk.

    Навігатор темами вигляду Плазми є доволі простою програмою. На правій панелі програми розташовано три пункти:

    • Список встановлених тем вигляду у вашій системі, за допомогою якого ви можете вибрати тему і почати її безпосереднє редагування.
    • Відкрити теку тем — відкриває каталог, у якому зберігаються теми вигляду.
      /home/ваше_ім'я_користувача/.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
    • Типові параметри з поточного налаштування
      Створює файл:
      .local/share/plasma/look-and-feel/назва_вашої_теми/contents/"default"
      Зберігаються такі параметри:
      • стиль віджетів
      • схема кольорів
      • піктограми
      • тема Плазми
      • тема вказівників
      • перемикач вікон
      • перемикач стільниць
      • декорації вікон.

    Ви також можете додати зображення, яке буде використано для попереднього перегляду і яке зберігатиметься у теці .local/share/plasma/look-and-feel/назва_вашої_теми/contents/preview

    Як додати залежності з KDE Store

    Спочатку, вам слід додати рядок

    X-KPackage-Dependencies=

    до вашого файла metadata.desktop. Погляньом на цей приклад:

    Схеми кольорів Плазми Elementary Luna

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

    kns:// — назва протоколу

    colorschemes.knsrc — тип ресурсу, який слід отримати (у нашому випадку це схема кольорів). Ось список доступних ресурсів у моїй системі (/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" }

    Встановити пакунок обгортки можна за допомогою команди, відданої з термінала:

    kpackagetool5 -i "назва вашої теми"

    Тему буде встановлено до .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.

    Загальносистемні залежності (експериментальне)

    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.