commit 5c01b363c0a931109424c8b6c7b883671f9eb8c8 Author: Kai Folf Date: Fri Apr 7 19:32:08 2023 +0700 Initial commit diff --git a/contents/config/config.qml b/contents/config/config.qml new file mode 100644 index 0000000..e69de29 diff --git a/contents/config/main.xml b/contents/config/main.xml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/contents/config/main.xml @@ -0,0 +1 @@ + diff --git a/contents/images/hello/0.png b/contents/images/hello/0.png new file mode 100644 index 0000000..3a5b122 Binary files /dev/null and b/contents/images/hello/0.png differ diff --git a/contents/images/hello/1.png b/contents/images/hello/1.png new file mode 100644 index 0000000..5b5d545 Binary files /dev/null and b/contents/images/hello/1.png differ diff --git a/contents/images/hello/2.png b/contents/images/hello/2.png new file mode 100644 index 0000000..d0c00a4 Binary files /dev/null and b/contents/images/hello/2.png differ diff --git a/contents/images/hello/3.png b/contents/images/hello/3.png new file mode 100644 index 0000000..c9e6a68 Binary files /dev/null and b/contents/images/hello/3.png differ diff --git a/contents/images/idle/0.png b/contents/images/idle/0.png new file mode 100644 index 0000000..64f9fb3 Binary files /dev/null and b/contents/images/idle/0.png differ diff --git a/contents/images/idle/1.png b/contents/images/idle/1.png new file mode 100644 index 0000000..0da7939 Binary files /dev/null and b/contents/images/idle/1.png differ diff --git a/contents/images/idle/2.png b/contents/images/idle/2.png new file mode 100644 index 0000000..d2bda4e Binary files /dev/null and b/contents/images/idle/2.png differ diff --git a/contents/images/idle/3.png b/contents/images/idle/3.png new file mode 100644 index 0000000..4f17905 Binary files /dev/null and b/contents/images/idle/3.png differ diff --git a/contents/images/idle/4.png b/contents/images/idle/4.png new file mode 100644 index 0000000..1a56448 Binary files /dev/null and b/contents/images/idle/4.png differ diff --git a/contents/images/idle/5.png b/contents/images/idle/5.png new file mode 100644 index 0000000..c210047 Binary files /dev/null and b/contents/images/idle/5.png differ diff --git a/contents/images/idle/6.png b/contents/images/idle/6.png new file mode 100644 index 0000000..23155e4 Binary files /dev/null and b/contents/images/idle/6.png differ diff --git a/contents/images/idle/7.png b/contents/images/idle/7.png new file mode 100644 index 0000000..7ac958b Binary files /dev/null and b/contents/images/idle/7.png differ diff --git a/contents/images/talk/0.png b/contents/images/talk/0.png new file mode 100644 index 0000000..6eab9f2 Binary files /dev/null and b/contents/images/talk/0.png differ diff --git a/contents/images/talk/1.png b/contents/images/talk/1.png new file mode 100644 index 0000000..5e8d64d Binary files /dev/null and b/contents/images/talk/1.png differ diff --git a/contents/images/talk/1.png~ b/contents/images/talk/1.png~ new file mode 100644 index 0000000..ca1e020 Binary files /dev/null and b/contents/images/talk/1.png~ differ diff --git a/contents/sounds/0.wav b/contents/sounds/0.wav new file mode 100644 index 0000000..d676f15 Binary files /dev/null and b/contents/sounds/0.wav differ diff --git a/contents/sounds/1.wav b/contents/sounds/1.wav new file mode 100644 index 0000000..1225e49 Binary files /dev/null and b/contents/sounds/1.wav differ diff --git a/contents/sounds/2.wav b/contents/sounds/2.wav new file mode 100644 index 0000000..a300c90 Binary files /dev/null and b/contents/sounds/2.wav differ diff --git a/contents/sounds/3.wav b/contents/sounds/3.wav new file mode 100644 index 0000000..9fa6ff4 Binary files /dev/null and b/contents/sounds/3.wav differ diff --git a/contents/sounds/4.wav b/contents/sounds/4.wav new file mode 100644 index 0000000..6524442 Binary files /dev/null and b/contents/sounds/4.wav differ diff --git a/contents/sounds/5.wav b/contents/sounds/5.wav new file mode 100644 index 0000000..0f1570c Binary files /dev/null and b/contents/sounds/5.wav differ diff --git a/contents/sounds/6.wav b/contents/sounds/6.wav new file mode 100644 index 0000000..4c35848 Binary files /dev/null and b/contents/sounds/6.wav differ diff --git a/contents/sounds/7.wav b/contents/sounds/7.wav new file mode 100644 index 0000000..b0ce679 Binary files /dev/null and b/contents/sounds/7.wav differ diff --git a/contents/ui/configGeneral.qml b/contents/ui/configGeneral.qml new file mode 100644 index 0000000..e69de29 diff --git a/contents/ui/main.qml b/contents/ui/main.qml new file mode 100644 index 0000000..cdbb15d --- /dev/null +++ b/contents/ui/main.qml @@ -0,0 +1,92 @@ +import QtQuick 2.12 +import QtQuick.Layouts 1.12 +import QtQuick.Controls 2.5 +import QtMultimedia 5.15 + +import org.kde.plasma.plasmoid 2.0 +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.components 3.0 as PlasmaComponents3 + +Item { + Plasmoid.backgroundHints: "NoBackground" + Plasmoid.fullRepresentation: Item { + Layout.minimumWidth: 100 + Layout.minimumHeight: 100 + Layout.preferredWidth: 200 + Layout.preferredHeight: 200 + + property int imageIndex: 0 + property int talkIndex: 0 + property int soundIndex: 0 + property bool isIdle: true + + Item { + width: Math.min(parent.width, parent.height) + height: Math.min(parent.width, parent.height) + Image { + id: idle + anchors.fill: parent + source: "../images/idle/" + imageIndex + ".png" + visible: isIdle + } + Image { + id: hello + anchors.fill: parent + source: "../images/hello/" + (imageIndex%4) + ".png" + visible: !isIdle + } + Image { + id: talk + width: parent.width + height: parent.height + anchors.right: idle.left + anchors.rightMargin: -60 + anchors.bottom: idle.top + anchors.bottomMargin: -60 + + source: "../images/talk/" + (talkIndex) + ".png" + visible: !isIdle + } + Timer { + interval: 100 + running: true + repeat: true + onTriggered: { + // Loop 0 to 7 + imageIndex = (imageIndex + 1) % 8 + + // Loop 0 to 1, change every 8 frames + talkIndex = imageIndex == 0 ? !talkIndex : talkIndex + } + } + Timer { + id: idleTimer + interval: 1600 + running: false + repeat: false + onTriggered: { + // Set to idle + imageIndex = 0 + isIdle = true + } + } + MediaPlayer { + id: mediaplayer + source: "../sounds/" + soundIndex + ".wav" + } + MouseArea { + anchors.fill: parent + onClicked: { + // Set to hello + isIdle = false + idleTimer.restart() + + // Play sound + soundIndex = (soundIndex + 1) % 8 + mediaplayer.play() + } + } + } + } +} + diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..0535244 Binary files /dev/null and b/icon.png differ diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..5352e32 --- /dev/null +++ b/metadata.json @@ -0,0 +1,25 @@ +{ + "KPlugin": { + "Authors": [ + { + "Email": "git@fcd.im", + "Name": "Kai Folf" + } + ], + "Category": "Fun and Games", + "Description": "The Sharkle widget, as featured in Night in the Woods, now on KDE Plasma!", + "Icon": "./icon.png", + "Id": "im.fcd.sharkle", + "License": "MIT", + "Name": "Sharkle", + "ServiceTypes": [ + "Plasma/Applet" + ], + "Version": "1.0", + "Website": "https://github.com/folfcoder/plasma-sharkle" + }, + "X-Plasma-API": "declarativeappletscript", + "X-Plasma-MainScript": "ui/main.qml", + "KPackageStructure": "Plasma/Applet", + "X-Plasma-StandAloneApp": true +}