mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
feat: wheee
This commit is contained in:
parent
4be1b9f090
commit
d218e71e17
10 changed files with 250 additions and 164 deletions
|
|
@ -1,97 +0,0 @@
|
|||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
readonly property Scheme scheme: Scheme {}
|
||||
|
||||
readonly property color base00: scheme.base00
|
||||
readonly property color base01: scheme.base01
|
||||
readonly property color base02: scheme.base02
|
||||
readonly property color base03: scheme.base03
|
||||
readonly property color base04: scheme.base04
|
||||
readonly property color base05: scheme.base05
|
||||
readonly property color base06: scheme.base06
|
||||
readonly property color base07: scheme.base07
|
||||
readonly property color base08: scheme.base08
|
||||
readonly property color base09: scheme.base09
|
||||
readonly property color base0A: scheme.base0A
|
||||
readonly property color base0B: scheme.base0B
|
||||
readonly property color base0C: scheme.base0C
|
||||
readonly property color base0D: scheme.base0D
|
||||
readonly property color base0E: scheme.base0E
|
||||
readonly property color base0F: scheme.base0F
|
||||
readonly property color defaultBg: scheme.defaultBg
|
||||
readonly property color lighterBg: scheme.lighterBg
|
||||
readonly property color selectionBg: scheme.selectionBg
|
||||
readonly property color comments: scheme.comments
|
||||
readonly property color darkFg: scheme.darkFg
|
||||
readonly property color defaultFg: scheme.defaultFg
|
||||
readonly property color lightFg: scheme.lightFg
|
||||
readonly property color lightBg: scheme.lightBg
|
||||
readonly property color variable: scheme.variable
|
||||
readonly property color integer: scheme.integer
|
||||
readonly property color classy: scheme.classy
|
||||
readonly property color stringy: scheme.stringy
|
||||
readonly property color support: scheme.support
|
||||
readonly property color functiony: scheme.functiony
|
||||
readonly property color keyword: scheme.keyword
|
||||
readonly property color deprecated: scheme.deprecated
|
||||
|
||||
function load(data: string): void {
|
||||
const colours = scheme;
|
||||
const scheme_json = JSON.parse(data);
|
||||
|
||||
for (const [name, colour] of Object.entries(scheme_json)) {
|
||||
colours[name] = colour
|
||||
}
|
||||
}
|
||||
|
||||
FileView {
|
||||
path: "./stylix.json"
|
||||
blockLoading: true
|
||||
watchChanges: true
|
||||
onFileChanged: reload()
|
||||
onLoaded: root.load(text(), false)
|
||||
}
|
||||
component Scheme: QtObject {
|
||||
property string author: ""
|
||||
property string scheme: ""
|
||||
property string slug: ""
|
||||
property color base00: "#000000"
|
||||
property color base01: "#000000"
|
||||
property color base02: "#000000"
|
||||
property color base03: "#000000"
|
||||
property color base04: "#000000"
|
||||
property color base05: "#000000"
|
||||
property color base06: "#000000"
|
||||
property color base07: "#000000"
|
||||
property color base08: "#000000"
|
||||
property color base09: "#000000"
|
||||
property color base0A: "#000000"
|
||||
property color base0B: "#000000"
|
||||
property color base0C: "#000000"
|
||||
property color base0D: "#000000"
|
||||
property color base0E: "#000000"
|
||||
property color base0F: "#000000"
|
||||
property color defaultBg: "#000000"
|
||||
property color lighterBg: "#000000"
|
||||
property color selectionBg: "#000000"
|
||||
property color comments: "#000000"
|
||||
property color darkFg: "#000000"
|
||||
property color defaultFg: "#000000"
|
||||
property color lightFg: "#000000"
|
||||
property color lightBg: "#000000"
|
||||
property color variable: "#000000"
|
||||
property color integer: "#000000"
|
||||
property color classy: "#000000"
|
||||
property color stringy: "#000000"
|
||||
property color support: "#000000"
|
||||
property color functiony: "#000000"
|
||||
property color keyword: "#000000"
|
||||
property color deprecated: "#000000"
|
||||
}
|
||||
}
|
||||
61
quickshell/DataSources/Stylix.qml
Normal file
61
quickshell/DataSources/Stylix.qml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
// https://codeberg.org/permafrozen/shell/src/commit/82d34e9816ba23971d4a007a6a178d952a8cc6bf/src/utils/Theme.qml
|
||||
pragma ComponentBehavior: Bound
|
||||
pragma Singleton
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import QtQuick
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
// Assign Properties from the read in palette.json (stylix generated file)
|
||||
readonly property color base00: json.base00 ? `#${json.base00}` : "#000000"
|
||||
readonly property color base01: json.base01 ? `#${json.base01}` : "#000000"
|
||||
readonly property color base02: json.base02 ? `#${json.base02}` : "#000000"
|
||||
readonly property color base03: json.base03 ? `#${json.base03}` : "#000000"
|
||||
readonly property color base04: json.base04 ? `#${json.base04}` : "#000000"
|
||||
readonly property color base05: json.base05 ? `#${json.base05}` : "#000000"
|
||||
readonly property color base06: json.base06 ? `#${json.base06}` : "#000000"
|
||||
readonly property color base07: json.base07 ? `#${json.base07}` : "#000000"
|
||||
readonly property color base08: json.base08 ? `#${json.base08}` : "#000000"
|
||||
readonly property color base09: json.base09 ? `#${json.base09}` : "#000000"
|
||||
readonly property color base0A: json.base0A ? `#${json.base0A}` : "#000000"
|
||||
readonly property color base0B: json.base0B ? `#${json.base0B}` : "#000000"
|
||||
readonly property color base0C: json.base0C ? `#${json.base0C}` : "#000000"
|
||||
readonly property color base0D: json.base0D ? `#${json.base0D}` : "#000000"
|
||||
readonly property color base0E: json.base0E ? `#${json.base0E}` : "#000000"
|
||||
readonly property color base0F: json.base0F ? `#${json.base0F}` : "#000000"
|
||||
readonly property string author: json.author ? json.author : ""
|
||||
readonly property string scheme: json.scheme ? json.scheme : ""
|
||||
readonly property string slug: json.slug ? json.slug : ""
|
||||
|
||||
FileView {
|
||||
path: `${Quickshell.env("HOME")}/.config/stylix/palette.json`
|
||||
watchChanges: true
|
||||
blockLoading: true
|
||||
onFileChanged: reload()
|
||||
|
||||
JsonAdapter {
|
||||
id: json
|
||||
property string base00
|
||||
property string base01
|
||||
property string base02
|
||||
property string base03
|
||||
property string base04
|
||||
property string base05
|
||||
property string base06
|
||||
property string base07
|
||||
property string base08
|
||||
property string base09
|
||||
property string base0A
|
||||
property string base0B
|
||||
property string base0C
|
||||
property string base0D
|
||||
property string base0E
|
||||
property string base0F
|
||||
property string author
|
||||
property string scheme
|
||||
property string slug
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue