aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers
diff options
context:
space:
mode:
authorZackaryWelch <welch.zackary@gmail.com>2018-01-04 19:28:56 -0500
committerZackaryWelch <welch.zackary@gmail.com>2018-01-04 19:28:56 -0500
commit82c65e8edcbb5a06734e8ac70ae93d13e58f8ad4 (patch)
tree0273effd40ea745d2421e742d6690405cce44ed4 /src-qt5/core/lumina-desktop-unified/extrafiles/screensavers
parentMerge branch 'master' of https://github.com/trueos/lumina (diff)
downloadlumina-82c65e8edcbb5a06734e8ac70ae93d13e58f8ad4.tar.gz
lumina-82c65e8edcbb5a06734e8ac70ae93d13e58f8ad4.tar.bz2
lumina-82c65e8edcbb5a06734e8ac70ae93d13e58f8ad4.zip
Added Matrix screensaver
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/extrafiles/screensavers')
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Matrix.json25
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Matrix.qml74
2 files changed, 99 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Matrix.json b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Matrix.json
new file mode 100644
index 00000000..52cd16ee
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Matrix.json
@@ -0,0 +1,25 @@
+{
+ "name" : {
+ "default" : "Matrix"
+ },
+ "description" : {
+ "default" : "Erratic falling columns of various characters with a set color"
+ },
+ "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" : "20180103",
+ "version" : "1.0"
+ },
+ "qml" : {
+ "exec" : "qml_scripts/Matrix.qml"
+ }
+}
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Matrix.qml b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Matrix.qml
new file mode 100644
index 00000000..1ab4b96c
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Matrix.qml
@@ -0,0 +1,74 @@
+// vi: ft=qml
+import QtQuick 2.0
+import QtMultimedia 5.7
+import QtQuick.Window 2.2
+
+Rectangle {
+ width: Window.width
+ height: Window.height
+ color: "black"
+
+ Row{
+ id: masterRow
+ anchors.left: parent.left
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: parent.width
+ spacing: 5
+ Repeater {
+ id: cR
+ model: Window.width / 15 + 1
+ Column {
+ id: masterColumn
+ width: 10
+ Text {
+ id: column
+ color: "red"
+ font.pixelSize: 10
+ transform: Rotation { origin.x: 0; origin.y: 0; angle: 90 }
+ Timer {
+ //interval: Math.random() * ((cR.index % 2) ? 50 : 20) + ((cR.index % 2) ? 90 : 70)
+ interval: 50
+ repeat: true
+ running: true
+ onTriggered: {
+ if(Math.random() < 0.95) {
+ var bottom = column.text.charAt(column.text.length-1)
+ var newString = bottom+column.text.substring(0, column.text.length-1)
+ column.text = newString
+ //interval = Math.random() * ((cR.index % 2) ? 50 : 20) + ((cR.index % 2) ? 90 : 70)
+ interval = 50
+ }else{
+ interval = 1000
+ }
+ }
+ }
+ Component.onCompleted: {
+ var str = " "
+ var numberChar = Math.random() * 100 + (Window.height * 0.1);
+ if(Math.random() < 0.80) {
+ while(str.length < numberChar) {
+ if(Math.random() < 0.5) {
+ var charCount = Math.random() * 8 + 10
+ var segStr = ""
+ while(segStr.length < charCount) {
+ var randChar = String.fromCharCode(0x30A0 + Math.random() * (0x30FF-0x30A0+1));
+ segStr += randChar
+ }
+ str += segStr
+ }else{
+ var charCount = Math.random() * 6 + 14
+ var segStr = ""
+ while(segStr.length < charCount) {
+ segStr += " "
+ }
+ str += segStr
+ }
+ }
+ }
+ column.text = str
+ }
+ }
+ }
+ }
+ }
+}
bgstack15