Add matugen config for quickshell and add futures box
This commit is contained in:
@@ -71,3 +71,7 @@ output_path = '~/linux-dotfiles/qt6ct/colors/matugen.conf'
|
|||||||
[templates.rofi]
|
[templates.rofi]
|
||||||
input_path = '~/linux-dotfiles/matugen/templates/rofi-colors.rasi'
|
input_path = '~/linux-dotfiles/matugen/templates/rofi-colors.rasi'
|
||||||
output_path = '~/linux-dotfiles/rofi/colors.rasi'
|
output_path = '~/linux-dotfiles/rofi/colors.rasi'
|
||||||
|
|
||||||
|
[templates.quickshell]
|
||||||
|
input_path = '~/linux-dotfiles/matugen/templates/quickshell-colors.json'
|
||||||
|
output_path = '~/.local/state/quickshell/generated/colors.json'
|
||||||
|
|||||||
11
matugen/templates/quickshell-colors.json
Normal file
11
matugen/templates/quickshell-colors.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"md3": {<* for name, color in colors *>
|
||||||
|
"{{ name }}": "{{ color.default.hex }}"<* if {{ loop.last }} *><* else *>,<* endif *><* endfor *>
|
||||||
|
},
|
||||||
|
"palette": {<* for name, palette in palettes *><* for shade, color in palette *>
|
||||||
|
"{{ name }}{{ shade }}": "{{ color.hex }}"<* if {{ loop.last }} *><* else *>,<* endif *><* endfor *><* if {{ loop.last }} *><* else *>,<* endif *><* endfor *>
|
||||||
|
},
|
||||||
|
"base16": {<* for name, color in base16 *>
|
||||||
|
"{{ name }}": "{{ color.default.hex }}"<* if {{ loop.last }} *><* else *>,<* endif *><* endfor *>
|
||||||
|
}
|
||||||
|
}
|
||||||
212
quickshell/constants/Colors.qml
Normal file
212
quickshell/constants/Colors.qml
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
|
|
||||||
|
Singleton {
|
||||||
|
property alias md3: jsonAdapter.md3
|
||||||
|
property alias base16: jsonAdapter.base16
|
||||||
|
property alias palette: jsonAdapter.palette
|
||||||
|
|
||||||
|
FileView {
|
||||||
|
path: Quickshell.env("HOME") + "/.local/state/quickshell/generated/colors.json"
|
||||||
|
watchChanges: true
|
||||||
|
onFileChanged: reload()
|
||||||
|
|
||||||
|
JsonAdapter {
|
||||||
|
id: jsonAdapter
|
||||||
|
|
||||||
|
readonly property Md3 md3: Md3 {}
|
||||||
|
readonly property Base16 base16: Base16 {}
|
||||||
|
readonly property Palette palette: Palette {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
component Md3: JsonObject {
|
||||||
|
property string background: "transparent"
|
||||||
|
property string error: "transparent"
|
||||||
|
property string error_container: "transparent"
|
||||||
|
property string inverse_on_surface: "transparent"
|
||||||
|
property string inverse_primary: "transparent"
|
||||||
|
property string inverse_surface: "transparent"
|
||||||
|
property string on_background: "transparent"
|
||||||
|
property string on_error: "transparent"
|
||||||
|
property string on_error_container: "transparent"
|
||||||
|
property string on_primary: "transparent"
|
||||||
|
property string on_primary_container: "transparent"
|
||||||
|
property string on_primary_fixed: "transparent"
|
||||||
|
property string on_primary_fixed_variant: "transparent"
|
||||||
|
property string on_secondary: "transparent"
|
||||||
|
property string on_secondary_container: "transparent"
|
||||||
|
property string on_secondary_fixed: "transparent"
|
||||||
|
property string on_secondary_fixed_variant: "transparent"
|
||||||
|
property string on_surface: "transparent"
|
||||||
|
property string on_surface_variant: "transparent"
|
||||||
|
property string on_tertiary: "transparent"
|
||||||
|
property string on_tertiary_container: "transparent"
|
||||||
|
property string on_tertiary_fixed: "transparent"
|
||||||
|
property string on_tertiary_fixed_variant: "transparent"
|
||||||
|
property string outline: "transparent"
|
||||||
|
property string outline_variant: "transparent"
|
||||||
|
property string primary: "transparent"
|
||||||
|
property string primary_container: "transparent"
|
||||||
|
property string primary_fixed: "transparent"
|
||||||
|
property string primary_fixed_dim: "transparent"
|
||||||
|
property string scrim: "transparent"
|
||||||
|
property string secondary: "transparent"
|
||||||
|
property string secondary_container: "transparent"
|
||||||
|
property string secondary_fixed: "transparent"
|
||||||
|
property string secondary_fixed_dim: "transparent"
|
||||||
|
property string shadow: "transparent"
|
||||||
|
property string surface: "transparent"
|
||||||
|
property string surface_bright: "transparent"
|
||||||
|
property string surface_container: "transparent"
|
||||||
|
property string surface_container_high: "transparent"
|
||||||
|
property string surface_container_highest: "transparent"
|
||||||
|
property string surface_container_low: "transparent"
|
||||||
|
property string surface_container_lowest: "transparent"
|
||||||
|
property string surface_dim: "transparent"
|
||||||
|
property string surface_tint: "transparent"
|
||||||
|
property string surface_variant: "transparent"
|
||||||
|
property string tertiary: "transparent"
|
||||||
|
property string tertiary_container: "transparent"
|
||||||
|
property string tertiary_fixed: "transparent"
|
||||||
|
property string tertiary_fixed_dim: "transparent"
|
||||||
|
}
|
||||||
|
|
||||||
|
component Palette: JsonObject {
|
||||||
|
property string error0: "transparent"
|
||||||
|
property string error5: "transparent"
|
||||||
|
property string error10: "transparent"
|
||||||
|
property string error15: "transparent"
|
||||||
|
property string error20: "transparent"
|
||||||
|
property string error25: "transparent"
|
||||||
|
property string error30: "transparent"
|
||||||
|
property string error35: "transparent"
|
||||||
|
property string error40: "transparent"
|
||||||
|
property string error50: "transparent"
|
||||||
|
property string error60: "transparent"
|
||||||
|
property string error70: "transparent"
|
||||||
|
property string error80: "transparent"
|
||||||
|
property string error90: "transparent"
|
||||||
|
property string error95: "transparent"
|
||||||
|
property string error98: "transparent"
|
||||||
|
property string error99: "transparent"
|
||||||
|
property string error100: "transparent"
|
||||||
|
|
||||||
|
property string neutral0: "transparent"
|
||||||
|
property string neutral5: "transparent"
|
||||||
|
property string neutral10: "transparent"
|
||||||
|
property string neutral15: "transparent"
|
||||||
|
property string neutral20: "transparent"
|
||||||
|
property string neutral25: "transparent"
|
||||||
|
property string neutral30: "transparent"
|
||||||
|
property string neutral35: "transparent"
|
||||||
|
property string neutral40: "transparent"
|
||||||
|
property string neutral50: "transparent"
|
||||||
|
property string neutral60: "transparent"
|
||||||
|
property string neutral70: "transparent"
|
||||||
|
property string neutral80: "transparent"
|
||||||
|
property string neutral90: "transparent"
|
||||||
|
property string neutral95: "transparent"
|
||||||
|
property string neutral98: "transparent"
|
||||||
|
property string neutral99: "transparent"
|
||||||
|
property string neutral100: "transparent"
|
||||||
|
|
||||||
|
property string neutral_variant0: "transparent"
|
||||||
|
property string neutral_variant5: "transparent"
|
||||||
|
property string neutral_variant10: "transparent"
|
||||||
|
property string neutral_variant15: "transparent"
|
||||||
|
property string neutral_variant20: "transparent"
|
||||||
|
property string neutral_variant25: "transparent"
|
||||||
|
property string neutral_variant30: "transparent"
|
||||||
|
property string neutral_variant35: "transparent"
|
||||||
|
property string neutral_variant40: "transparent"
|
||||||
|
property string neutral_variant50: "transparent"
|
||||||
|
property string neutral_variant60: "transparent"
|
||||||
|
property string neutral_variant70: "transparent"
|
||||||
|
property string neutral_variant80: "transparent"
|
||||||
|
property string neutral_variant90: "transparent"
|
||||||
|
property string neutral_variant95: "transparent"
|
||||||
|
property string neutral_variant98: "transparent"
|
||||||
|
property string neutral_variant99: "transparent"
|
||||||
|
property string neutral_variant100: "transparent"
|
||||||
|
|
||||||
|
property string primary0: "transparent"
|
||||||
|
property string primary5: "transparent"
|
||||||
|
property string primary10: "transparent"
|
||||||
|
property string primary15: "transparent"
|
||||||
|
property string primary20: "transparent"
|
||||||
|
property string primary25: "transparent"
|
||||||
|
property string primary30: "transparent"
|
||||||
|
property string primary35: "transparent"
|
||||||
|
property string primary40: "transparent"
|
||||||
|
property string primary50: "transparent"
|
||||||
|
property string primary60: "transparent"
|
||||||
|
property string primary70: "transparent"
|
||||||
|
property string primary80: "transparent"
|
||||||
|
property string primary90: "transparent"
|
||||||
|
property string primary95: "transparent"
|
||||||
|
property string primary98: "transparent"
|
||||||
|
property string primary99: "transparent"
|
||||||
|
property string primary100: "transparent"
|
||||||
|
|
||||||
|
property string secondary0: "transparent"
|
||||||
|
property string secondary5: "transparent"
|
||||||
|
property string secondary10: "transparent"
|
||||||
|
property string secondary15: "transparent"
|
||||||
|
property string secondary20: "transparent"
|
||||||
|
property string secondary25: "transparent"
|
||||||
|
property string secondary30: "transparent"
|
||||||
|
property string secondary35: "transparent"
|
||||||
|
property string secondary40: "transparent"
|
||||||
|
property string secondary50: "transparent"
|
||||||
|
property string secondary60: "transparent"
|
||||||
|
property string secondary70: "transparent"
|
||||||
|
property string secondary80: "transparent"
|
||||||
|
property string secondary90: "transparent"
|
||||||
|
property string secondary95: "transparent"
|
||||||
|
property string secondary98: "transparent"
|
||||||
|
property string secondary99: "transparent"
|
||||||
|
property string secondary100: "transparent"
|
||||||
|
|
||||||
|
property string tertiary0: "transparent"
|
||||||
|
property string tertiary5: "transparent"
|
||||||
|
property string tertiary10: "transparent"
|
||||||
|
property string tertiary15: "transparent"
|
||||||
|
property string tertiary20: "transparent"
|
||||||
|
property string tertiary25: "transparent"
|
||||||
|
property string tertiary30: "transparent"
|
||||||
|
property string tertiary35: "transparent"
|
||||||
|
property string tertiary40: "transparent"
|
||||||
|
property string tertiary50: "transparent"
|
||||||
|
property string tertiary60: "transparent"
|
||||||
|
property string tertiary70: "transparent"
|
||||||
|
property string tertiary80: "transparent"
|
||||||
|
property string tertiary90: "transparent"
|
||||||
|
property string tertiary95: "transparent"
|
||||||
|
property string tertiary98: "transparent"
|
||||||
|
property string tertiary99: "transparent"
|
||||||
|
property string tertiary100: "transparent"
|
||||||
|
}
|
||||||
|
|
||||||
|
component Base16: JsonObject {
|
||||||
|
property string base00: "transparent"
|
||||||
|
property string base01: "transparent"
|
||||||
|
property string base02: "transparent"
|
||||||
|
property string base03: "transparent"
|
||||||
|
property string base04: "transparent"
|
||||||
|
property string base05: "transparent"
|
||||||
|
property string base06: "transparent"
|
||||||
|
property string base07: "transparent"
|
||||||
|
property string base08: "transparent"
|
||||||
|
property string base09: "transparent"
|
||||||
|
property string base0a: "transparent"
|
||||||
|
property string base0b: "transparent"
|
||||||
|
property string base0c: "transparent"
|
||||||
|
property string base0d: "transparent"
|
||||||
|
property string base0e: "transparent"
|
||||||
|
property string base0f: "transparent"
|
||||||
|
}
|
||||||
|
}
|
||||||
33
quickshell/services/FortuneService.qml
Normal file
33
quickshell/services/FortuneService.qml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import QtQuick
|
||||||
|
import Quickshell.Io
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: fortuneService
|
||||||
|
|
||||||
|
property string fortuneText: "Loading..."
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: fortuneProcess
|
||||||
|
command: ["fortune"]
|
||||||
|
|
||||||
|
stdout: StdioCollector {
|
||||||
|
onStreamFinished: {
|
||||||
|
fortuneService.fortuneText = this.text.trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
fortuneProcess.running = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
interval: 60000 // update fortune every minute
|
||||||
|
repeat: true
|
||||||
|
running: true
|
||||||
|
|
||||||
|
onTriggered: {
|
||||||
|
fortuneProcess.running = true; // run the process again to get a new fortune
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -50,6 +50,19 @@ ShellRoot {
|
|||||||
memUsage: stats.memUsage
|
memUsage: stats.memUsage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
model: Quickshell.screens
|
||||||
|
|
||||||
|
FortuneBox {
|
||||||
|
id: fortuneBox
|
||||||
|
anchors.right: true
|
||||||
|
anchors.bottom: true
|
||||||
|
margins.right: 10
|
||||||
|
margins.bottom: 10
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
77
quickshell/ui/FortuneBox.qml
Normal file
77
quickshell/ui/FortuneBox.qml
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import QtQuick.Window
|
||||||
|
|
||||||
|
import "../services"
|
||||||
|
import "../constants"
|
||||||
|
|
||||||
|
PanelWindow {
|
||||||
|
id: fortuneBox
|
||||||
|
|
||||||
|
required property ShellScreen modelData
|
||||||
|
screen: modelData
|
||||||
|
property int horizontalPadding: 12
|
||||||
|
property int verticalPadding: 8
|
||||||
|
property real backgroundOpacity: 0.8
|
||||||
|
implicitWidth: fortuneText.implicitWidth + (horizontalPadding * 2)
|
||||||
|
implicitHeight: fortuneText.implicitHeight + (verticalPadding * 2)
|
||||||
|
aboveWindows: false
|
||||||
|
|
||||||
|
color: Qt.alpha(Colors.md3.on_secondary, backgroundOpacity)
|
||||||
|
|
||||||
|
FortuneService {
|
||||||
|
id: fortuneService
|
||||||
|
}
|
||||||
|
|
||||||
|
// Canvas {
|
||||||
|
// id: gradientCanvas
|
||||||
|
// anchors.fill: parent
|
||||||
|
|
||||||
|
// onPaint: {
|
||||||
|
// var ctx = getContext("2d");
|
||||||
|
// ctx.reset();
|
||||||
|
|
||||||
|
// var grad = ctx.createLinearGradient(0, 0, width, height);
|
||||||
|
// grad.addColorStop(0.0, "rgba(0, 0, 0, 0.0)");
|
||||||
|
// grad.addColorStop(0.3, "rgba(0, 0, 0, 0.55)");
|
||||||
|
// grad.addColorStop(1.0, "rgba(0, 0, 0, 0.80)");
|
||||||
|
|
||||||
|
// ctx.fillStyle = grad;
|
||||||
|
// ctx.fillRect(0, 0, width, height);
|
||||||
|
|
||||||
|
// // Fade all sides out so panel edges are not visible.
|
||||||
|
// var edgeFade = Math.max(10, Math.min(width, height) * 0.4);
|
||||||
|
|
||||||
|
// ctx.globalCompositeOperation = "destination-in";
|
||||||
|
|
||||||
|
// var maskX = ctx.createLinearGradient(0, 0, width, 0);
|
||||||
|
// maskX.addColorStop(0.0, "rgba(0, 0, 0, 0.0)");
|
||||||
|
// maskX.addColorStop(edgeFade / width, "rgba(0, 0, 0, 1.0)");
|
||||||
|
// maskX.addColorStop(1.0 - (edgeFade / width), "rgba(0, 0, 0, 1.0)");
|
||||||
|
// maskX.addColorStop(1.0, "rgba(0, 0, 0, 0.0)");
|
||||||
|
// ctx.fillStyle = maskX;
|
||||||
|
// ctx.fillRect(0, 0, width, height);
|
||||||
|
|
||||||
|
// var maskY = ctx.createLinearGradient(0, 0, 0, height);
|
||||||
|
// maskY.addColorStop(0.0, "rgba(0, 0, 0, 0.0)");
|
||||||
|
// maskY.addColorStop(edgeFade / height, "rgba(0, 0, 0, 0.6)");
|
||||||
|
// maskY.addColorStop(1.0 - (edgeFade / height), "rgba(0, 0, 0, 0.6)");
|
||||||
|
// maskY.addColorStop(1.0, "rgba(0, 0, 0, 0.0)");
|
||||||
|
// ctx.fillStyle = maskY;
|
||||||
|
// ctx.fillRect(0, 0, width, height);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// onWidthChanged: requestPaint()
|
||||||
|
// onHeightChanged: requestPaint()
|
||||||
|
// }
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: fortuneText
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: fortuneService.fortuneText
|
||||||
|
color: Colors.md3.primary
|
||||||
|
font.pixelSize: 12
|
||||||
|
font.family: Constants.fontFamily
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@ configuration {
|
|||||||
display-filebrowser: "files";
|
display-filebrowser: "files";
|
||||||
display-emoji: "emoji";
|
display-emoji: "emoji";
|
||||||
drun-display-format: "{name}";
|
drun-display-format: "{name}";
|
||||||
font: "JetBrainsMono Nerd Font 10";
|
font: "BrainsMono Nerd Font 10";
|
||||||
// show-icons: true;
|
// show-icons: true;
|
||||||
icon-theme: "Colloid";
|
icon-theme: "Colloid";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user