<div dir="ltr"><div>Hello,</div><div>Long time has passed, I have found some free time, and with little help of LLM I have managed to reproduce your work, modify the script(?), and it works. I have enabled stars, but I cannot force clouds display - I think problem is inside of Marble. I have found, that in the script there is marbleItem which is <a href="https://api.kde.org/marble/html/MarbleQuickItem_8h_source.html" target="_blank">https://api.kde.org/marble/html/MarbleQuickItem_8h_source.html</a> - and it has less properties than MarbleMap. In my setup there is a problem with getting location - geolocation is returning access denied or something. My KDE is 5.27, I'm just curious if this script will work on new KDE. This is my sript:</div><div><br></div><div>```<br>/*<br> * Copyright 2018 Friedrich W. H. Kossebau <<a href="mailto:kossebau@kde.org" target="_blank">kossebau@kde.org</a>><br> *<br> * This program is free software; you can redistribute it and/or<br> * modify it under the terms of the GNU Lesser General Public<br> * License as published by the Free Software Foundation; either<br> * version 2.1 of the License, or (at your option) any later version.<br> *<br> * This program is distributed in the hope that it will be useful,<br> * but WITHOUT ANY WARRANTY; without even the implied warranty of<br> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU<br> * Lesser General Public License for more details.<br> *<br> * You should have received a copy of the GNU Lesser General Public<br> * License along with this program. If not, see <<a href="http://www.gnu.org/licenses/" target="_blank">http://www.gnu.org/licenses/</a>>.<br> */<br><br>import QtQuick 2.1<br><br>import org.kde.plasma.core 2.0 as PlasmaCore<br>import org.kde.plasma.extras 2.0 as PlasmaExtras<br><br>import org.kde.marble.private.plasma 0.20<br><br>MarbleItem {<br> id: marbleItem<br> // <a href="https://api.kde.org/marble/html/MarbleQuickItem_8h_source.html" target="_blank">https://api.kde.org/marble/html/MarbleQuickItem_8h_source.html</a><br> // available properties<br><br> readonly property int centerMode: wallpaper.configuration.centerMode<br> property double fixedLongitude: wallpaper.configuration.fixedLongitude<br> property double fixedLatitude: wallpaper.configuration.fixedLatitude<br> property double locationLongitude: 0.0<br> property double locationLatitude: 0.0<br><br> enabled: false // do not handle input<br><br> radius: {<br> var ratio = width/height;<br> if (ratio > 1) {<br> return height / 2.5;<br> }<br> return width / 2.5<br> }<br><br> // Theme settings.<br> projection: MarbleItem.Spherical<br> mapThemeId: "earth/bluemarble/bluemarble.dgml"<br><br> // Visibility of layers/plugins.<br> showAtmosphere: true<br> showClouds: true<br> showBackground: true<br><br> showGrid: false<br> showCrosshairs: false<br> showCompass: false<br> showOverviewMap: false<br> showScaleBar: false<br> showOtherPlaces: false<br> showPublicTransport: false<br> showOutdoorActivities: false<br><br><br> onCenterModeChanged: handleCenterModeChange()<br> function handleCenterModeChange() {<br> if (centerMode === 0) {<br> marbleItem.centerOn(locationLongitude, locationLatitude);<br> } else if (centerMode === 1) {<br> marbleItem.centerOn(fixedLongitude, fixedLatitude);<br> } else {<br> marbleItem.centerOn(locationLongitude, locationLatitude);<br> }<br> }<br><br> onFixedLongitudeChanged: handleFixedLonLatChange()<br> onFixedLatitudeChanged: handleFixedLonLatChange()<br> function handleFixedLonLatChange() {<br> if (centerMode === 1) {<br> marbleItem.centerOn(fixedLongitude, fixedLatitude);<br> }<br> }<br><br> onLocationLongitudeChanged:handleLocationChange()<br> onLocationLatitudeChanged:handleLocationChange()<br> function handleLocationChange() {<br> if (centerMode === 2) {<br> marbleItem.centerOn(locationLongitude, locationLatitude);<br> }<br> }<br><br> Component.onCompleted: {<br><br> // marbleItem.setShowPlaces(false);<br> // marbleItem.setShowCities(false);<br> marbleItem.setShowOtherPlaces(showOtherPlaces);<br> marbleItem.setShowBackground(showBackground);<br><br> handleCenterModeChange();<br> }<br><br> PlasmaCore.DataSource {<br> id: geolocationDataSource<br> engine: "geolocation"<br> connectedSources: (marbleItem.centerMode === 2) ? ["location"] : []<br> interval: 10 * 60 * 1000 // every 30 minutes, might be still too large for users on the ISS :P<br> }<br><br> Timer {<br> id: sunPositionTimer<br> interval: 60000 // Update every minute<br> running: marbleItem.centerMode === 0 // Only when following sun<br> repeat: true<br> triggeredOnStart: true<br> <br> onTriggered: {<br> var sunPos = calculateSunPosition();<br> marbleItem.locationLongitude = sunPos.longitude;<br> marbleItem.locationLatitude = sunPos.latitude;<br> handleCenterModeChange();<br> }<br> }<br><br> // Function to calculate sun's position<br> function calculateSunPosition() {<br> var now = new Date();<br> var dayOfYear = getDayOfYear(now);<br> var timeOfDay = now.getUTCHours() + now.getUTCMinutes() / 60.0;<br> <br> // Solar declination (simplified)<br> var declination = -23.45 * Math.cos(2 * Math.PI * (dayOfYear + 10) / 365.25);<br> <br> // Hour angle - sun's longitude changes 15 degrees per hour<br> var hourAngle = 15 * (timeOfDay - 12); // 0° at solar noon (12:00 UTC)<br> <br> // Sun's subsolar point<br> var longitude = hourAngle;<br> var latitude = declination;<br> <br> // Normalize longitude to [-180, 180]<br> while (longitude > 180) longitude -= 360;<br> while (longitude < -180) longitude += 360;<br><br> // debug<br> //console.log("[earthglobe]]: ", longitude);<br> //console.log("[earthglobe]]: ", latitude);<br> <br> return {<br> longitude: -longitude,<br> latitude: -latitude<br> };<br> }<br><br> function getDayOfYear(date) {<br> var start = new Date(date.getFullYear(), 0, 0);<br> var diff = date - start;<br> return Math.floor(diff / (1000 * 60 * 60 * 24));<br> }<br>}<br>```<br><br><img src="cid:ii_mb0ie39m0" alt="image.png" width="488" height="275"><br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">pt., 12 cze 2020 o 21:26 Piotr Frankowski <<a href="mailto:frankowski.piotrek@gmail.com" target="_blank">frankowski.piotrek@gmail.com</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks - good starting point for me. Your email is like 5 hours of mentoring;) have a nice weekend<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">pt., 12 cze 2020 o 01:10 Friedrich W. H. Kossebau <<a href="mailto:kossebau@kde.org" target="_blank">kossebau@kde.org</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Piotr,<br>
<br>
Am Donnerstag, 11. Juni 2020, 20:49:57 CEST schrieb Piotr Frankowski:<br>
> Hello,<br>
> <br>
> First of all,thanks for such great piece of software, which I am using for<br>
> 15 years. I would like to make small contribution - but I need little help,<br>
> a kind of mentoring or a plan and help at begin. I would like rewrite KDE4<br>
> app - plasma-wallpaper-globe, to KDE5 using QML. I think it is possible to<br>
> do - I am thinking, that I should create plasma-wallpaper plugin, which<br>
> uses Marbles Maps API.<br>
<br>
((quick reminder to speak with same terms: post-KDE4 there is no KDE5, things <br>
got split in cross-platform apps (for platforms like Plasma, Gnome, <br>
$OTHERLINUXSHELL, Windows, macOS, Android. HaikuOS, etc.), modular reusable Qt <br>
extensions (KDE Frameworks) and the actual workspace (Plasma).))<br>
<br>
When it comes to the Globe plasma wallpaper, there actually has been a working <br>
patch. I know because I did it :) Though just for coding fun, did not plan to <br>
use it, so it died as review request because no-one pushed and no-one pulled. <br>
It is up for adaption here, might still apply:<br>
<a href="https://phabricator.kde.org/D11969" rel="noreferrer" target="_blank">https://phabricator.kde.org/D11969</a><br>
<br>
> First questions:<br>
> - is there template for plasma-wallpaper-plugin?<br>
<br>
Yes, the blog post you linked below is referencing one, and it does still <br>
exist.<br>
<br>
> - is there tutorial for writing plasma-plugins?<br>
<br>
Sadly Plasma developers are lacking here and need support. People learning are <br>
some of the best people to write documentation/tutorials while they lean, <br>
because they see all the problems and can mention them, so consider picking up <br>
that as side-task.<br>
<br>
> - I have found some linke, are they actual:<br>
> <a href="https://frinring.wordpress.com/2018/04/04/templates-to-create-your-own-plasm" rel="noreferrer" target="_blank">https://frinring.wordpress.com/2018/04/04/templates-to-create-your-own-plasm</a><br>
> a-wallpaper-plugin/<br>
<br>
Should still apply (I just fixed some links now given you mentioned it and I <br>
found they were broken). Not tested though, but I would hope Plasma developers <br>
kept compatibility during Plasma 5 times ;)<br>
<br>
> - I should learn QML and C++, right?<br>
<br>
Yes. If you are completely new, best first walk yourself through all the Qt <br>
tutorials to get some first sense about things before you enter the partially <br>
rough world of developing for Plasma.<br>
See <a href="https://doc.qt.io/qt-5/qtexamplesandtutorials.html" rel="noreferrer" target="_blank">https://doc.qt.io/qt-5/qtexamplesandtutorials.html</a> and make yourself <br>
familiar with Qt and QtQuick/Qml. And try to find some local people to talk <br>
and learn together in real life, that also helps (it did for me when I <br>
started).<br>
<br>
Sorry, not available myself for mentoring.<br>
<br>
Cheers<br>
Friedrich<br>
<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Pozdrawiam<div>pf</div></div>
</blockquote></div><div><br clear="all"></div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Pozdrawiam<div>pf</div></div>