aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-11-14 00:04:49 +0000
committerWeblate <noreply@weblate.org>2017-11-14 00:04:49 +0000
commitdc40a01ae695b47f87daff7ee08f3519d79b12ae (patch)
tree6e1d58f23d4537f8f501ba7e531f9ed90f269dda /src-qt5/core/lumina-desktop-unified/extrafiles/screensavers
parentTranslated using Weblate (German) (diff)
parentAdd a special rule for Ubuntu Linux: (diff)
downloadlumina-dc40a01ae695b47f87daff7ee08f3519d79b12ae.tar.gz
lumina-dc40a01ae695b47f87daff7ee08f3519d79b12ae.tar.bz2
lumina-dc40a01ae695b47f87daff7ee08f3519d79b12ae.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/extrafiles/screensavers')
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Fireflies.json26
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/README.md79
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Video.json25
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Warp.json25
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Fireflies.qml19
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Firefly.qml63
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Grav.qml123
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Video.qml50
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Warp.qml64
9 files changed, 474 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Fireflies.json b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Fireflies.json
new file mode 100644
index 00000000..c09de308
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Fireflies.json
@@ -0,0 +1,26 @@
+{
+ "name" : {
+ "default" : "Fireflies"
+ },
+ "description" : {
+ "default" : "Dancing balls of light on the screen"
+ },
+ "author" : {
+ "name" : "Ken Moore",
+ "email" : "ken@ixsystems.com",
+ "website" : "https://github.com/beanpole135",
+ "company" : "iXsystems",
+ "company_website" : "http://ixsystems.com"
+ },
+ "meta" : {
+ "license" : "3-clause BSD",
+ "license_url" : "https://github.com/trueos/lumina/blob/master/LICENSE",
+ "copyright" : "Copyright (c) 2017, Ken Moore (ken@ixsystems.com)",
+ "date_created" : "20171010",
+ "version" : "1.0"
+ },
+ "qml" : {
+ "exec" : "qml_scripts/Fireflies.qml",
+ "additional_files" : ["qml_scripts/Firefly.qml"]
+ }
+}
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/README.md b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/README.md
new file mode 100644
index 00000000..d9093b44
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/README.md
@@ -0,0 +1,79 @@
+## Screensaver Format
+The screensaver system for the Lumina desktop allows for the creation and use of scripts written in the QML language, with a number of screensavers and other examples installed out-of-box. There are only a couple warnings/caveats to consider when developing a new screensaver:
+
+1. The root object in your QML script will be automatically sized to fit the screen as needed. Avoid trying to hard-code specific screen dimensions within your script as it will not work properly.
+2. A JSON manifest file must be created (format listed below) and placed into one of the screensaver plugin directories for it to be recognized as a valid screensaver by the desktop.
+
+
+### JSON Manifest
+The manifest file contains all the information needed to actually validate/launch the screensaver, as well as additional information about the author and/or the screensaver itself.
+
+Example JSON manifest file (sample.json):
+```
+{
+ "name" : {
+ "default" : "sample",
+ "en_US" : "US English localization of the name",
+ "en" : "Generic english localization of the name"
+ },
+
+ "description" : {
+ "default" : "sample screensaver",
+ "en_US" : "US English Localization of the description"
+ },
+
+ "author" : {
+ "name" : "Me",
+ "email" : "Me@myself.net",
+ "website" : "http://mywebsite.net",
+ "company" : "iXsystems",
+ "company_website" : "http://ixsystems.com"
+ },
+
+ "meta" : {
+ "license" : "3-clause BSD",
+ "license_url" : "https://github.com/trueos/lumina/blob/master/LICENSE",
+ "copyright" : "Copyright (c) 2017, Ken Moore (ken@ixsystems.com)",
+ "date_created" : "20171010",
+ "date_updated" : "20171011",
+ "version" : "1.0"
+ },
+
+ "qml" : {
+ "exec" : "absolute/or/relative/path/to/script.qml",
+ "additional_files" : ["file/which/must/exist.png"],
+ "qt_min_version" : "5.0",
+ "qt_max_version" : "6.0"
+ }
+}
+```
+
+Details of the individual items in the manifest:
+* NOTE: for locale codes, both long and short version are acceptable:
+ Example 1: If the current locale is "en_GB", but the JSON manifest lists translations for "en_US" and "en", then the "en" translation will be used.
+ Example 2: If the current locale is "en_GB", but neither "en_GB" nor "en" translations exist, then the "default" version will be used.
+
+* **name** : (required) This is the official name of the screensaver to show to users
+ * *default* : (required) Non-translated name of the screensaver
+ * *[locale]* : (optional) Translated name for specific [locale]
+* **description** : (required) This is a short description of the screensaver to show to users
+ * *default* : (required) Non-translated description of the screensaver
+ * *[locale]* : (optional) Translated description for specific [locale]
+* **author** : (all optional) Additional information about the author(s) of the screensaver
+ * *name* : Name of the author
+ * *email* : Email to contact the author (useful for licensing questions and such)
+ * *website* : Personal website for the author (github/facebook/twitter profile, etc)
+ * *company* : Company for which the author is creating this screensaver
+ * *company_website* : Website for the company
+* **meta** : (all optional) Additional information about the screensaver itself
+ * *license* : License the screensaver is released under
+ * *license_url* : Website which contains the full text of the license
+ * *copyright* : Copyright notice for this screensaver
+ * *date_created* : (yyyyMMdd) Date the screensaver was initially created
+ * *date_updated* : (yyyyMMdd) Date the screensaver was last updated
+ * *version* : Current version of the screensaver (typically updated every time "date_updated" is changed)
+* **qml** : (required) Information about launching the screensaver and checking validity
+ * *exec* : (required) Absolute or relative path to the QML script (relative to the directory which contains the JSON manifest)
+ * *additional_files* : (optional) Array of paths for other files/scripts which must exist for the screensaver to work properly.
+ * *qt_min_version* : (optional) Minimum version of the Qt libraries that this screensaver supports
+ * *qt_max_version* : (optional) Maximum version of the Qt libraries that this screensaver supports
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Video.json b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Video.json
new file mode 100644
index 00000000..2fa6e6da
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Video.json
@@ -0,0 +1,25 @@
+{
+ "name" : {
+ "default" : "Video"
+ },
+ "description" : {
+ "default" : "Play a single video or a list of videos in a loop"
+ },
+ "author" : {
+ "name" : "Zackary Welch",
+ "email" : "zwelch@ixsystems.com",
+ "website" : "https://github.com/ZackaryWelch",
+ "company" : "iXsystems",
+ "company_website" : "http://ixsystems.com"
+ },
+ "meta" : {
+ "license" : "3-clause BSD",
+ "license_url" : "https://github.com/trueos/lumina/blob/master/LICENSE",
+ "copyright" : "Copyright (c) 2017, Ken Moore (ken@ixsystems.com)",
+ "date_created" : "20171025",
+ "version" : "1.0"
+ },
+ "qml" : {
+ "exec" : "qml_scripts/Video.qml"
+ }
+}
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Warp.json b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Warp.json
new file mode 100644
index 00000000..888df01f
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Warp.json
@@ -0,0 +1,25 @@
+{
+ "name" : {
+ "default" : "Warp"
+ },
+ "description" : {
+ "default" : "Warp trail through the stars"
+ },
+ "author" : {
+ "name" : "Ken Moore",
+ "email" : "ken@ixsystems.com",
+ "website" : "https://github.com/beanpole135",
+ "company" : "iXsystems",
+ "company_website" : "http://ixsystems.com"
+ },
+ "meta" : {
+ "license" : "3-clause BSD",
+ "license_url" : "https://github.com/trueos/lumina/blob/master/LICENSE",
+ "copyright" : "Copyright (c) 2017, Ken Moore (ken@ixsystems.com)",
+ "date_created" : "20171012",
+ "version" : "1.0"
+ },
+ "qml" : {
+ "exec" : "qml_scripts/Warp.qml"
+ }
+}
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Fireflies.qml b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Fireflies.qml
new file mode 100644
index 00000000..d8dcc1ed
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Fireflies.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+import "." as QML
+
+Rectangle {
+ id : canvas
+ anchors.fill: parent
+ color: "black"
+
+ Repeater {
+ model: Math.round(Math.random()*canvas.width/10)+100
+ QML.Firefly {
+ parent: canvas
+ x: Math.round(Math.random()*canvas.width)
+ y: Math.round(Math.random()*canvas.height)
+ }
+ } //end of Repeater
+
+} //end of canvas rectangle
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Firefly.qml b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Firefly.qml
new file mode 100644
index 00000000..7b65d8ec
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Firefly.qml
@@ -0,0 +1,63 @@
+import QtQuick 2.0
+import QtQuick.Window 2.2
+import QtGraphicalEffects 1.0
+
+Item {
+
+ RectangularGlow {
+ anchors.fill: fly
+ glowRadius: Math.round(fly.radius /2)
+ spread: 0.5
+ color: Qt.rgba(1,1,1,0.3)
+ cornerRadius: fly.radius + glowRadius
+ }
+
+ Rectangle {
+ id: fly
+ width: Math.round(Math.random()*canvas.width/200)+2
+ height: width
+ x: parent.x
+ y: parent.y
+ color: Qt.rgba(Math.random(),Math.random(),0,0.5)
+ radius: Math.floor(width/2)
+ property int jitterX: Math.round(Math.random()*100)+10
+ property int jitterY: Math.round(Math.random()*100)+10
+
+ Behavior on color {
+ ColorAnimation {
+ duration: 500
+ }
+ }
+ Behavior on x {
+ SmoothedAnimation {
+ velocity: 10+Math.random()*canvas.width/100
+ }
+ }
+ Behavior on y {
+ SmoothedAnimation {
+ velocity: 10+Math.random()*canvas.height/100
+ }
+ }
+
+ }
+
+
+
+ Timer {
+ interval: 5
+ repeat: true
+ running: true
+ property bool starting: true
+ onTriggered: {
+ if(starting){ interval = Math.round(Math.random()*1000)+500; starting = false; }
+ if ( (fly.x+fly.jitterX)>parent.width || (fly.x+fly.jitterX)<0 ){ fly.jitterX = 0-fly.jitterX }
+ fly.x = fly.x+fly.jitterX
+ if( (fly.y+fly.jitterY)>parent.height || (fly.y+fly.jitterY)<0 ){ fly.jitterY = 0-fly.jitterY }
+ fly.y = fly.y+fly.jitterY
+ fly.jitterX = (Math.round(Math.random())*2 - 1) *fly.jitterX
+ fly.jitterY = (Math.round(Math.random())*2 - 1) *fly.jitterY
+ fly.color = Qt.rgba(Math.random(),Math.random(),Math.random(),0.5)
+
+ }
+ } //end of timer
+} //end of item
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Grav.qml b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Grav.qml
new file mode 100644
index 00000000..7a3c33cd
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Grav.qml
@@ -0,0 +1,123 @@
+import QtQuick 2.7
+import QtGraphicalEffects 1.0
+
+Rectangle {
+ id : canvas
+ anchors.fill: parent
+ width: 800
+ height: 600
+ color: "black"
+
+ //TODO Add orbital trails option
+
+ //Between 5 and 15 planets, read from settings
+ property int planets: Math.round(( Math.random() * 10 ) + 5 )
+ property int cx: Math.round(width/2)
+ property int cy: Math.round(height/2)
+
+ //Create planets
+ Repeater {
+ id: planetRepeater
+ model: planets
+
+ Rectangle {
+ id : index
+ parent: canvas
+
+ //Creates random distance for elipse
+ property double c: Math.random() * 250
+ property double b: Math.random() * 150 + c
+ property double a: Math.sqrt(b*b+c*c)
+ //Random angle of rotation
+ property double th: Math.random() * Math.PI
+
+ //Calculates starting position
+ x: Math.round(cx + a * Math.cos(th))
+ y: Math.round(cy + b * Math.sin(th))
+
+ //Planet size between 14 and 32 pixels
+ width: Math.round(1.75 * (((Math.random() * 10) + 8 )))
+ height: width
+
+ //Make each rectangle look circular
+ radius: width / 2
+
+ //Give each planet a random color, semi-transparent
+ color: Qt.rgba(Math.random(), Math.random(), Math.random(), 0.5)
+
+ Timer {
+ //Each planet updates between 1ms and 51ms (smaller times=faster)
+ interval: Math.round(Math.random() * 50 ) + 1
+ repeat: true
+ running: true
+ property bool starting: true
+ property int time: 0
+
+ onTriggered: {
+ //Move a planet 80 pixels away from the sun if the planet is too close
+ if(starting) {
+ if(x > cx && Math.abs(cx-x) < 80) {
+ x+=80
+ }else if(x < cx && Math.abs(cx-x) < 80) {
+ x-=80
+ }
+
+ if(y > cy && Math.abs(cy-y) < 80) {
+ y+=80
+ }else if(y < cy && Math.abs(cy-y) < 80) {
+ y-=80
+ }
+ starting = false;
+ }
+ //Parametric equation that calculates the position of the general ellipse. Completes a loop ever 314 cycles. Credit to
+ x = cx+a*Math.cos(2*Math.PI*(time/314.0))*Math.cos(th) - b*Math.sin(2*Math.PI*(time/314.0))*Math.sin(th)
+ y = cy+a*Math.cos(2*Math.PI*(time/314.0))*Math.sin(th) + b*Math.sin(2*Math.PI*(time/314.0))*Math.cos(th)
+ time++;
+ }
+ }
+ }
+ }
+
+ //Create the star
+ Rectangle{
+ id: star
+ parent: canvas
+
+ //Centers in star in the center of the canvas, with an offset to center the animation
+ x: cx - 30
+ y: cy - 30
+
+ width: 60
+ height: width
+
+ //Create the wobble animation
+ SequentialAnimation on height {
+ loops: Animation.Infinite
+ PropertyAnimation { duration: 2000; to: 90 }
+ PropertyAnimation { duration: 2000; to: 60 }
+ }
+
+ SequentialAnimation on width {
+ loops: Animation.Infinite
+ PropertyAnimation { duration: 2000; to: 90 }
+ PropertyAnimation { duration: 2000; to: 60 }
+ }
+
+ color: "black"
+ radius: width / 2
+
+ //Creates a radial gradient to make the star look cool
+ RadialGradient {
+ anchors.fill: parent
+ gradient: Gradient {
+ GradientStop { position:0 ;color: Qt.rgba(0,0,0,0)}
+ GradientStop { position:0.18 ;color: Qt.rgba(0,0,0,0)}
+ GradientStop { position:0.2 ;color: Qt.rgba(0.32,0.47,0.30,0.13)}
+ GradientStop { position:0.3 ;color: Qt.rgba(0.62,0.92,0.58,0.25)}
+ GradientStop { position:0.4 ;color: Qt.rgba(1.00,0.93,0.59,0.51)}
+ GradientStop { position:0.5 ;color: Qt.rgba(0,0,0,0)}
+ }
+ }
+
+ }
+}
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Video.qml b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Video.qml
new file mode 100644
index 00000000..e7d0626d
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Video.qml
@@ -0,0 +1,50 @@
+import QtQuick 2.0
+import QtMultimedia 5.7
+import QtQuick.Window 2.2
+import Qt.labs.folderlistmodel 2.1
+
+Rectangle {
+ //width: Screen.width
+ //height: Screen.height
+ width: 800
+ height: 600
+ color: "black"
+
+ FolderListModel {
+ id: folderModel
+ folder: "/usr/local/videos"
+ }
+
+ Repeater {
+ model: folderModel
+ Component {
+ Item {
+ Component.onCompleted: { playlist.addItem(fileURL) }
+ }
+ }
+ }
+
+ Playlist {
+ id: playlist
+ playbackMode: Playlist.Random
+ PlaylistItem { source: "/" }
+ onError: { console.log("ERROR") }
+ }
+
+ MediaPlayer {
+ id: player
+ autoPlay: true
+ playlist: playlist
+ }
+
+ VideoOutput {
+ id: videoOutput
+ source: player
+ anchors.fill: parent
+ }
+
+ Component.onCompleted: {
+ playlist.shuffle()
+ console.log(playlist.itemCount)
+ }
+}
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Warp.qml b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Warp.qml
new file mode 100644
index 00000000..1cf9bc37
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Warp.qml
@@ -0,0 +1,64 @@
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Rectangle {
+ id : canvas
+ anchors.fill: parent
+ color: "black"
+
+ function getStarColor(num){
+ if(num < 1) { return "white" }
+ if(num < 2) { return "mistyrose" }
+ return "lightblue"
+ }
+
+ // CREATE STARFIELD
+ Repeater {
+ model: Math.round(Math.random()*canvas.width/10)+500
+ Rectangle {
+ parent: canvas
+ x: Math.round(Math.random()*canvas.width)
+ y: Math.round(Math.random()*canvas.height)
+ width: Math.round(Math.random()*3)+3
+ height: width
+ radius: width/2
+ color: getStarColor( (index%3) )
+
+ }
+ } //end of Repeater
+
+ // NOW CREATE THE WARP EFFECT
+ ZoomBlur {
+ id: blur
+ anchors.fill: canvas
+ source: canvas
+ samples: 24
+ length: canvas.width / 20
+ horizontalOffset: 0
+ verticalOffset: 0
+
+ Behavior on horizontalOffset{
+ NumberAnimation{
+ duration: 3000
+ }
+ }
+ Behavior on verticalOffset{
+ NumberAnimation{
+ duration: 3000
+ }
+ }
+ } //end of zoom blur
+
+ Timer {
+ interval: 5
+ repeat: true
+ running: true
+ property bool starting: true
+ onTriggered: {
+ if(starting){ interval = 3010; starting = false; }
+ blur.horizontalOffset = (Math.random()*canvas.width/4) - (canvas.width/8)
+ blur.verticalOffset = (Math.random()*canvas.height/4) - (canvas.height/8)
+ }
+ } //end of timer
+
+} //end of canvas rectangle
bgstack15