mirror of
https://github.com/kossLAN/dots.git
synced 2025-11-05 06:59:50 -05:00
Initial commit
This commit is contained in:
commit
05cd51b54e
148 changed files with 10112 additions and 0 deletions
75
wallpaper/Controller.qml
Normal file
75
wallpaper/Controller.qml
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import QtQuick
|
||||
import ".."
|
||||
|
||||
Scope {
|
||||
id: root
|
||||
required property var screen
|
||||
property string matugenConf: Qt.resolvedUrl("matugen.toml").toString().replace("file://", "")
|
||||
|
||||
LazyLoader {
|
||||
loading: true
|
||||
|
||||
Scope {
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
PanelWindow {
|
||||
required property var modelData
|
||||
color: "black"
|
||||
aboveWindows: false
|
||||
screen: modelData
|
||||
|
||||
anchors {
|
||||
left: true
|
||||
right: true
|
||||
top: true
|
||||
bottom: true
|
||||
}
|
||||
|
||||
Image {
|
||||
source: ShellSettings.settings.wallpaperUrl
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ShellSettings.settings
|
||||
|
||||
function onWallpaperUrlChanged() {
|
||||
console.log("Switching wallpaper: " + ShellSettings.settings.wallpaperUrl);
|
||||
matugen.running = true;
|
||||
}
|
||||
|
||||
function onColorSchemeChanged() {
|
||||
console.log("Switching color scheme: " + ShellSettings.settings.colorScheme);
|
||||
matugen.running = true;
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: matugen
|
||||
running: false
|
||||
|
||||
// Formatter is keeping me hostage frfr...
|
||||
command: ["matugen", "image", ShellSettings.settings.wallpaperUrl.replace("file://", ""), "--type", ShellSettings.settings.colorScheme, "--json", "hex", "--config", root.matugenConf]
|
||||
|
||||
stdout: SplitParser {
|
||||
onRead: data => {
|
||||
console.log(ShellSettings.settings.colorScheme);
|
||||
try {
|
||||
ShellSettings.settings.colors = JSON.parse(data)['colors']['dark'];
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
stderr: SplitParser {
|
||||
onRead: data => console.log(`line read: ${data}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue