[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: start menu icon
From:       Franklin Weng <franklin () goodhorse ! idv ! tw>
Date:       2017-09-03 9:16:01
Message-ID: a8438e2d-a223-f369-fbcc-58fa8429d4c6 () goodhorse ! idv ! tw
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]

[Attachment #4 (multipart/alternative)]


Hi all,


I solved my problem by adding my own template-layout in
.local/share/plasma/layout-templates/.

Thank you for your help.  About the syntax of
org.kde.plasma.desktop-layout.js if you can explain or give me some
documents I'll very appreciate.

I'm going to write a blog about this and hope to help further migrators
who wants to customize Plasma 5.

BTW, there are still some problems like plasmashell ignores
XDG_MENU_PREFIX and some XDG environment variables.  I'll start another
topic for this.


Thanks,
Franklin


Franklin Weng 於 2017年09月02日 20:16 寫道:
>
> Hi Marco & Eike,
>
>
> Marco Martin 於 2017年08月31日 03:51 寫道:
>> On mercoledì 30 agosto 2017 15:07:26 CEST Franklin Weng wrote:
>>> *looking at Eike with shining eyes*
>>> Could you please tell me in more detail about "ship an applet config
>>> initialization script in look-n-feel package"?  In the package
>> documentation-wise i fear all there is is:
>> https://userbase.kde.org/KDE_System_Administration/
>> PlasmaDesktopScripting#Look_and_Feel_dependent_default_setup_for_applets
>>
>> but says oretty much all there is to know
>> you would have in your look and feel a file called
>> contents/plasmoidsetupscripts/org.kde.plasma.kickoff.js
>>
>> in that script you can access to a global variable called "applet"
>> to which you can access and write its configuration like the normal layout.js 
>> script
>> , you would have something like:
>>
>> applet.currentConfigGroup = ["General"]
>> applet.writeConfig("icon", "file:///usr/share/whatever/my/icon/path")
>> applet.reloadConfig();
>
> Thanks for your help, I've successfully customized kicker, kickoff and
> kickerdash with look-n-feel packages.  Also customized the desktop
> successfully.
>
> Now I'm stuck at a few more questions, which I've googled but couldn't
> find the answers:
>  1. In the
> look-and-feel/org.kde.ezgo.desktop/contents/layouts/org.kde.plasma.desktop-layout.js
> the contents include:
>
> var plasma = getApiVersion(1);
> var layout = {
>      "desktops": [
>          { "applets" : [ ], "config" : [ ... ] }
>      ]
>      "panels": [
>          {  "applets" : [...], "config": { ... } ... }
>      ]
> }
>
>     where do "desktops" and "panels" define?  or are they just
> keywords for org.kde.plasma.desktop?  I searched
> shells/org.kde.plasma.desktop but got nothing.  By customizing this
> file I've successfully done what I want.  I just don't quite
> understand the syntax in this file, and in the "layout".
>
>  2. Now I want to modify the contents of the defaultPanel (without
> changing the
> layout-templates/org.kde.plasma.desktop.defaultPanel/contents/layout.js),
> adding some widgets before the task manager.  I tried several ways:
>    -
> look-and-feel/org.kde.ezgo.desktop/contents/layouts/org.kde.plasma.desktop.defaultPanel-layout.js
>    - plasmoidsetupscripts/org.kde.panel.js
>
>    without success.  In the org.kde.panel.js I just added something like
>
> applet.addWidget("org.kde.plasma.showActivityManager")
> applet.reloadConfig()
>
>    When I tried to add a default panel it still showed "default" --
> without activity manager widget on it.  It seems like not to create a
> org.kde.panel plasmoid (which should run the setup scripts).
>
>    And in the defaultPanel-layout.js I used the same way as above but
> no luck too.  I wonder if the syntax in defaultPanel-layout.js should
> be like desktop-layout.js, but I don't know if there is any keywords
> or syntax for defaultPanel.
>
>    Any help is very appreciated.
>
> Thanks,
> Franklin


[Attachment #7 (text/html)]

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi all,</p>
    <p><br>
    </p>
    <p>I solved my problem by adding my own template-layout in
      .local/share/plasma/layout-templates/.</p>
    <p>Thank you for your help.   About the syntax of
      org.kde.plasma.desktop-layout.js if you can explain or give me
      some documents I'll very appreciate.</p>
    <p>I'm going to write a blog about this and hope to help further
      migrators who wants to customize Plasma 5.</p>
    <p>BTW, there are still some problems like plasmashell ignores
      XDG_MENU_PREFIX and some XDG environment variables.   I'll start
      another topic for this.</p>
    <p><br>
    </p>
    <p>Thanks,<br>
      Franklin<br>
    </p>
    <br>
    <div class="moz-cite-prefix">Franklin Weng 於 2017年09月02日 20:16 \
寫道:<br>  </div>
    <blockquote type="cite"
      cite="mid:9968e8fc-8f1c-8fbe-000d-9216c6d41a6f@goodhorse.idv.tw">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <p>Hi Marco &amp; Eike,<br>
      </p>
      <br>
      <div class="moz-cite-prefix">Marco Martin 於 2017年08月31日 03:51 \
寫道:<br>  </div>
      <blockquote type="cite" cite="mid:1607441.bW9ddgzPZz@phobos">
        <pre wrap="">On mercoledì 30 agosto 2017 15:07:26 CEST Franklin Weng wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">*looking at Eike with shining eyes*
Could you please tell me in more detail about "ship an applet config
initialization script in look-n-feel package"?  In the package
</pre>
        </blockquote>
        <pre wrap="">documentation-wise i fear all there is is:
<a class="moz-txt-link-freetext" \
href="https://userbase.kde.org/KDE_System_Administration/" \
moz-do-not-send="true">https://userbase.kde.org/KDE_System_Administration/</a> \
PlasmaDesktopScripting#Look_and_Feel_dependent_default_setup_for_applets

but says oretty much all there is to know
you would have in your look and feel a file called
contents/plasmoidsetupscripts/org.kde.plasma.kickoff.js

in that script you can access to a global variable called "applet"
to which you can access and write its configuration like the normal layout.js 
script
, you would have something like:

applet.currentConfigGroup = ["General"]
applet.writeConfig("icon", <a class="moz-txt-link-rfc2396E" \
href="file:///usr/share/whatever/my/icon/path" \
moz-do-not-send="true">"file:///usr/share/whatever/my/icon/path"</a>) \
applet.reloadConfig(); </pre>
      </blockquote>
      <br>
      Thanks for your help, I've successfully customized kicker, kickoff
      and kickerdash with look-n-feel packages.   Also customized the
      desktop successfully.<br>
      <br>
      Now I'm stuck at a few more questions, which I've googled but
      couldn't find the answers:<br>
        1. In the
look-and-feel/org.kde.ezgo.desktop/contents/layouts/org.kde.plasma.desktop-layout.js
      the contents include:<br>
      <br>
      <font face="Courier New, Courier, monospace">var plasma =
        getApiVersion(1);<br>
        var layout = {<br>
                 "desktops": [<br>
                         { "applets" : [ ], "config" : [ ... ] }<br>
                 ]<br>
                 "panels": [<br>
                         {   "applets" : [...], "config": { ... } ... }<br>
                 ]<br>
        }</font><br>
      <br>
             where do "desktops" and "panels" define?   or are they just
      keywords for org.kde.plasma.desktop?   I searched
      shells/org.kde.plasma.desktop but got nothing.   By customizing
      this file I've successfully done what I want.   I just don't quite
      understand the syntax in this file, and in the "layout".<br>
      <br>
        2. Now I want to modify the contents of the defaultPanel (without
      changing the
layout-templates/org.kde.plasma.desktop.defaultPanel/contents/layout.js),
      adding some widgets before the task manager.   I tried several
      ways:<br>
           -
look-and-feel/org.kde.ezgo.desktop/contents/layouts/org.kde.plasma.desktop.defaultPanel-layout.js<br>
                
           - plasmoidsetupscripts/org.kde.panel.js<br>
      <br>
           without success.   In the org.kde.panel.js I just added
      something like<br>
      <br>
      <font face="Courier New, Courier, \
monospace">applet.addWidget("org.kde.plasma.showActivityManager")<br>  \
applet.reloadConfig()<br>  </font><br>
           When I tried to add a default panel it still showed "default"
      -- without activity manager widget on it.   It seems like not to
      create a org.kde.panel plasmoid (which should run the setup
      scripts).<br>
      <br>
           And in the defaultPanel-layout.js I used the same way as above
      but no luck too.   I wonder if the syntax in defaultPanel-layout.js
      should be like desktop-layout.js, but I don't know if there is any
      keywords or syntax for defaultPanel.<br>
      <br>
           Any help is very appreciated.<br>
      <br>
      Thanks,<br>
      Franklin<br>
    </blockquote>
    <br>
  </body>
</html>


["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic