From 53008538e5bef961e9ceb5abc5c5ee05a559e97d Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Thu, 15 Jan 2026 16:53:43 -0500 Subject: update qs config --- .config/quickshell/Bar.qml | 231 ------------------ .config/quickshell/Battery.qml | 33 --- .config/quickshell/Brightness.qml | 18 -- .config/quickshell/Cava.qml | 20 -- .config/quickshell/Flexoki.qml | 32 --- .config/quickshell/Modules/Bar.qml | 162 +++++++++++++ .config/quickshell/Modules/Music.qml | 298 ++++++++++++++++++++++++ .config/quickshell/Modules/Wall.qml | 53 +++++ .config/quickshell/Services/Battery.qml | 33 +++ .config/quickshell/Services/Brightness.qml | 18 ++ .config/quickshell/Services/Cava.qml | 21 ++ .config/quickshell/Services/Flexoki.qml | 32 +++ .config/quickshell/Services/HyprlandService.qml | 11 + .config/quickshell/Services/Song.qml | 45 ++++ .config/quickshell/Services/Tags.qml | 18 ++ .config/quickshell/Services/Time.qml | 15 ++ .config/quickshell/Services/Uptime.qml | 63 +++++ .config/quickshell/Services/Volume.qml | 22 ++ .config/quickshell/Services/Wifi.qml | 30 +++ .config/quickshell/Song.qml | 31 --- .config/quickshell/Tags.qml | 18 -- .config/quickshell/Time.qml | 15 -- .config/quickshell/Uptime.qml | 63 ----- .config/quickshell/Volume.qml | 22 -- .config/quickshell/Wall.qml | 52 ----- .config/quickshell/Wifi.qml | 26 --- .config/quickshell/shell.qml | 11 + 27 files changed, 832 insertions(+), 561 deletions(-) delete mode 100644 .config/quickshell/Bar.qml delete mode 100644 .config/quickshell/Battery.qml delete mode 100644 .config/quickshell/Brightness.qml delete mode 100644 .config/quickshell/Cava.qml delete mode 100644 .config/quickshell/Flexoki.qml create mode 100644 .config/quickshell/Modules/Bar.qml create mode 100644 .config/quickshell/Modules/Music.qml create mode 100644 .config/quickshell/Modules/Wall.qml create mode 100644 .config/quickshell/Services/Battery.qml create mode 100644 .config/quickshell/Services/Brightness.qml create mode 100644 .config/quickshell/Services/Cava.qml create mode 100644 .config/quickshell/Services/Flexoki.qml create mode 100644 .config/quickshell/Services/HyprlandService.qml create mode 100644 .config/quickshell/Services/Song.qml create mode 100644 .config/quickshell/Services/Tags.qml create mode 100644 .config/quickshell/Services/Time.qml create mode 100644 .config/quickshell/Services/Uptime.qml create mode 100644 .config/quickshell/Services/Volume.qml create mode 100644 .config/quickshell/Services/Wifi.qml delete mode 100644 .config/quickshell/Song.qml delete mode 100644 .config/quickshell/Tags.qml delete mode 100644 .config/quickshell/Time.qml delete mode 100644 .config/quickshell/Uptime.qml delete mode 100644 .config/quickshell/Volume.qml delete mode 100644 .config/quickshell/Wall.qml delete mode 100644 .config/quickshell/Wifi.qml diff --git a/.config/quickshell/Bar.qml b/.config/quickshell/Bar.qml deleted file mode 100644 index 02b8781..0000000 --- a/.config/quickshell/Bar.qml +++ /dev/null @@ -1,231 +0,0 @@ -import Quickshell -import QtQuick -import QtQuick.Layouts - -Variants { - model: Quickshell.screens; - - delegate: Component { - PanelWindow { - id: root - - required property var modelData - screen: modelData - - property string fontFamily: "FiraCode Nerd Font" - property int fontSize: 14 - - anchors { - top: true - left: true - right: true - } - - implicitHeight: 36 + 8 - - color: "transparent" - - Rectangle { - anchors { - fill: parent - topMargin: 8 - leftMargin: 8 - rightMargin: 8 - } - implicitHeight: 36 - color: "transparent" - - Rectangle { - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - implicitWidth: tags.implicitWidth + 12*2 - height: parent.height - color: Flexoki.bg - radius: 18 - - RowLayout { - id: tags - anchors.centerIn: parent - implicitHeight: parent.implicitHeight - spacing: 6 - - Repeater { - model: Tags.tags - - delegate: Rectangle { - required property bool focused - required property bool occupied - - width: 20 - height: 20 - radius: 10 - - color: { - if (focused) { - if (occupied) { - return Flexoki.re - } else { - return Flexoki.ui3 - } - } else { - return "transparent" - } - } - - border.width: 2 - border.color: occupied ? Flexoki.re : Flexoki.ui3 - } - } - } - } - - RowLayout { - anchors.centerIn: parent - implicitHeight: parent.implicitHeight - spacing: 4 - - Rectangle { - implicitWidth: song.implicitWidth + 16*2 - height: parent.height - color: Flexoki.bg - - bottomLeftRadius: 18 - topLeftRadius: 18 - bottomRightRadius: 4 - topRightRadius: 4 - - Text { - id: song - anchors.centerIn: parent - text: { - var text = Song.artist + " – " + Song.title - if (text.length > 60) { - text = text.substring(0, 60) + "…" - } - return text - } - color: Flexoki.tx - font { family: root.fontFamily; pixelSize: root.fontSize } - } - } - - Rectangle { - implicitWidth: cava.implicitWidth + 16*2 - height: parent.height - color: Flexoki.bg - - bottomLeftRadius: 4 - topLeftRadius: 4 - bottomRightRadius: 18 - topRightRadius: 18 - - Row { - id: cava - anchors.centerIn: parent - height: 15 + 4 - spacing: 2 - - Repeater { - model: Cava.heights - - delegate: Rectangle { - required property int modelData - y: 15 - modelData - width: 8 - height: modelData + 4 - radius: 4 - color: Flexoki.tx - - Behavior on height { - NumberAnimation { duration: 1000 / 30; easing.type: Easing.Linear } - } - Behavior on y { - NumberAnimation { duration: 1000 / 30; easing.type: Easing.Linear } - } - } - } - } - } - } - - Rectangle { - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - implicitWidth: status.implicitWidth + 12*2 - height: parent.height - color: Flexoki.bg - radius: 18 - - RowLayout { - id: status - anchors.centerIn: parent - implicitHeight: parent.implicitHeight - spacing: 24 - - Text { - text: { - //     - var icon - if (Volume.volume == 0) { - icon = " " - } else if (Volume.volume < 50) { - icon = " " - } else { - icon = " " - } - return icon + Volume.volume + "%" - } - color: Flexoki.re - font { family: root.fontFamily; pixelSize: root.fontSize } - } - - Text { - text: Wifi.ssid == "" ? "󰖪 " : "󰖩 " + Wifi.ssid - color: Flexoki.or - font { family: root.fontFamily; pixelSize: root.fontSize } - } - - Text { - text: " " + Brightness.brightness + "%" - color: Flexoki.ye - font { family: root.fontFamily; pixelSize: root.fontSize } - } - - Text { - text: { - var icon - var i = Math.round((Battery.capacity - 1) / 10) - switch (Battery.status) { - case "Full": - icon = "󰂄" - break - case "Discharging": - icon = ["󰁺","󰁻","󰁼","󰁽","󰁾","󰁿","󰂀","󰂁","󰂂","󰁹"][i] - break - case "Charging": - icon = ["󰢜","󰂆","󰂇","󰂈","󰢝","󰂉","󰢞","󰂊","󰂋","󰂅"][i] - break - } - return icon + " " + Battery.capacity + "%" - } - color: Flexoki.gr - font { family: root.fontFamily; pixelSize: root.fontSize } - } - - Text { - text: " " + Qt.formatDateTime(Time.time, "MMM d hh:mm:ss") - color: Flexoki.bl - font { family: root.fontFamily; pixelSize: root.fontSize } - } - - Text { - text: "󰐥" - color: Flexoki.pu - font { family: root.fontFamily; pixelSize: root.fontSize * 1.5 } - } - } - } - } - } - } -} diff --git a/.config/quickshell/Battery.qml b/.config/quickshell/Battery.qml deleted file mode 100644 index 0d6213c..0000000 --- a/.config/quickshell/Battery.qml +++ /dev/null @@ -1,33 +0,0 @@ -pragma Singleton - -import Quickshell -import Quickshell.Io -import QtQuick - -Singleton { - id: root - property string status: "Discharging" - property int capacity: 0 - - FileView { - id: statusFile - path: "/sys/class/power_supply/BAT0/status" - onLoaded: root.status = this.text().trim() - } - - FileView { - id: capacityFile - path: "/sys/class/power_supply/BAT0/capacity" - onLoaded: root.capacity = parseInt(this.text().trim()) - } - - Timer { - interval: 10000 - running: true - repeat: true - onTriggered: { - statusFile.reload() - capacityFile.reload() - } - } -} diff --git a/.config/quickshell/Brightness.qml b/.config/quickshell/Brightness.qml deleted file mode 100644 index 80a8d1f..0000000 --- a/.config/quickshell/Brightness.qml +++ /dev/null @@ -1,18 +0,0 @@ -pragma Singleton - -import Quickshell -import Quickshell.Io -import QtQuick - -Singleton { - id: root - property int brightness - - Process { - command: ["brightctl", "-l"] - running: true - stdout: SplitParser { - onRead: line => root.brightness = parseInt(line) - } - } -} diff --git a/.config/quickshell/Cava.qml b/.config/quickshell/Cava.qml deleted file mode 100644 index 2067a11..0000000 --- a/.config/quickshell/Cava.qml +++ /dev/null @@ -1,20 +0,0 @@ -pragma Singleton - -import Quickshell -import Quickshell.Io -import QtQuick - -Singleton { - id: root - property var heights - - Process { - command: ["cava", "-p", "/home/samn/.config/quickshell/cava.ini"] - running: true - stdout: SplitParser { - onRead: line => { - root.heights = line.substring(0, line.length - 1).split(';').map(x => parseInt(x)) - } - } - } -} diff --git a/.config/quickshell/Flexoki.qml b/.config/quickshell/Flexoki.qml deleted file mode 100644 index 1c467b5..0000000 --- a/.config/quickshell/Flexoki.qml +++ /dev/null @@ -1,32 +0,0 @@ -pragma Singleton - -import Quickshell - -Singleton { - readonly property string bg: "#100F0F" - readonly property string bg2: "#1C1B1A" - readonly property string ui: "#282726" - readonly property string ui2: "#343331" - readonly property string ui3: "#403E3C" - readonly property string tx3: "#575653" - readonly property string tx2: "#878580" - readonly property string tx: "#CECDC3" - - readonly property string re: "#D14D41" - readonly property string or: "#DA702C" - readonly property string ye: "#D0A215" - readonly property string gr: "#879A39" - readonly property string cy: "#3AA99F" - readonly property string bl: "#4385BE" - readonly property string pu: "#8B7EC8" - readonly property string ma: "#CE5D97" - - readonly property string re2: "#AF3029" - readonly property string or2: "#BC5215" - readonly property string ye2: "#AD8301" - readonly property string gr2: "#66800B" - readonly property string cy2: "#24837B" - readonly property string bl2: "#205EA6" - readonly property string pu2: "#5E409D" - readonly property string ma2: "#A02F6F" -} diff --git a/.config/quickshell/Modules/Bar.qml b/.config/quickshell/Modules/Bar.qml new file mode 100644 index 0000000..3120574 --- /dev/null +++ b/.config/quickshell/Modules/Bar.qml @@ -0,0 +1,162 @@ +import Quickshell +import Quickshell.Hyprland +import QtQuick +import QtQuick.Layouts +import qs.Services + +Variants { + model: Quickshell.screens; + + delegate: Component { + PanelWindow { + id: root + + required property var modelData + screen: modelData + + property string fontFamily: "FiraCode Nerd Font" + property int fontSize: 14 + + anchors { + top: true + left: true + right: true + } + + implicitHeight: 36 + 8 + + color: "transparent" + + Rectangle { + anchors { + fill: parent + topMargin: 8 + leftMargin: 8 + rightMargin: 8 + } + implicitHeight: 36 + color: "transparent" + + Rectangle { + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + implicitWidth: workspaces.implicitWidth + 12*2 + height: parent.height + color: Flexoki.bg + radius: 18 + + Row { + id: workspaces + anchors.centerIn: parent + height: 20 + spacing: 6 + + Repeater { + model: ScriptModel { + values: Hyprland.workspaces.values.filter(ws => ws.id >= 0).sort((a, b) => a.id - b.id) + } + + delegate: Rectangle { + required property HyprlandWorkspace modelData + property bool focused: modelData.focused + property bool occupied: modelData.toplevels.values.length > 0 + + width: 20 + height: 20 + radius: 10 + + color: { + if (!focused) return "transparent" + return occupied ? Flexoki.re : Flexoki.ui3 + } + + border.width: 2 + border.color: occupied ? Flexoki.re : Flexoki.ui3 + } + } + } + } + + Music {} + + Rectangle { + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + implicitWidth: status.implicitWidth + 12*2 + height: parent.height + color: Flexoki.bg + radius: 18 + + RowLayout { + id: status + anchors.centerIn: parent + implicitHeight: parent.implicitHeight + spacing: 24 + + Text { + text: { + //     + var icon + if (Volume.volume == 0) { + icon = " " + } else if (Volume.volume < 50) { + icon = " " + } else { + icon = " " + } + return icon + Volume.volume + "%" + } + color: Flexoki.re + font { family: root.fontFamily; pixelSize: root.fontSize } + } + + Text { + text: Wifi.ssid == "" ? "󰖪 " : "󰖩 " + Wifi.ssid + color: Flexoki.or + font { family: root.fontFamily; pixelSize: root.fontSize } + } + + Text { + text: " " + Brightness.brightness + "%" + color: Flexoki.ye + font { family: root.fontFamily; pixelSize: root.fontSize } + } + + Text { + text: { + var icon + var i = Math.floor((Battery.capacity - 1) / 10) + switch (Battery.status) { + case "Full": + icon = "󰂄" + break + case "Discharging": + icon = ["󰁺","󰁻","󰁼","󰁽","󰁾","󰁿","󰂀","󰂁","󰂂","󰁹"][i] + break + case "Charging": + icon = ["󰢜","󰂆","󰂇","󰂈","󰢝","󰂉","󰢞","󰂊","󰂋","󰂅"][i] + break + } + return icon + " " + Battery.capacity + "%" + } + color: Flexoki.gr + font { family: root.fontFamily; pixelSize: root.fontSize } + } + + Text { + text: " " + Qt.formatDateTime(Time.time, "MMM d hh:mm:ss") + color: Flexoki.bl + font { family: root.fontFamily; pixelSize: root.fontSize } + } + + Text { + text: "󰐥" + color: Flexoki.pu + font { family: root.fontFamily; pixelSize: root.fontSize * 1.5 } + } + } + } + } + } + } +} diff --git a/.config/quickshell/Modules/Music.qml b/.config/quickshell/Modules/Music.qml new file mode 100644 index 0000000..efb717e --- /dev/null +++ b/.config/quickshell/Modules/Music.qml @@ -0,0 +1,298 @@ +import Quickshell +import QtQuick +import qs.Services + +MouseArea { + id: root + anchors.centerIn: parent + height: parent.implicitHeight + width: musicRow.implicitWidth + state: "POPUP_CLOSED" + + hoverEnabled: true + onEntered: state = "POPUP_OPEN" + + property string fontFamily: "FiraCode Nerd Font" + property int fontSize: 14 + + property int contractAnimDuration: 150 + + states: [ + State { + name: "POPUP_CLOSED" + PropertyChanges { target: popup; visible: false } + PropertyChanges { target: musicRow; visible: true; spacing: 4 } + PropertyChanges { target: songContainer; bottomRightRadius: 4; topRightRadius: 4 } + PropertyChanges { target: cavaContainer; bottomLeftRadius: 4; topLeftRadius: 4 } + PropertyChanges { target: song; opacity: 1 } + PropertyChanges { target: cava; opacity: 1 } + PropertyChanges { + target: popupRect + width: musicRow.width + height: 36 + border.color: Flexoki.bg + } + }, + State { + name: "POPUP_OPEN" + PropertyChanges { target: popup; visible: true } + PropertyChanges { target: musicRow; visible: false; spacing: -1 } + PropertyChanges { target: songContainer; bottomRightRadius: 0; topRightRadius: 0 } + PropertyChanges { target: cavaContainer; bottomLeftRadius: 0; topLeftRadius: 0 } + PropertyChanges { target: song; opacity: 0 } + PropertyChanges { target: cava; opacity: 0 } + PropertyChanges { + target: popupRect + width: 700 + height: 500 + border.color: Flexoki.ui2 + } + } + ] + + transitions: [ + Transition { + from: "POPUP_CLOSED" + to: "POPUP_OPEN" + + SequentialAnimation { + ParallelAnimation { + NumberAnimation { + target: songContainer + properties: "bottomRightRadius,topRightRadius" + duration: root.contractAnimDuration + easing.type: Easing.InQuad + } + + NumberAnimation { + target: cavaContainer + properties: "bottomLeftRadius,topLeftRadius" + duration: root.contractAnimDuration + easing.type: Easing.InQuad + } + + NumberAnimation { + target: musicRow + property: "spacing" + duration: root.contractAnimDuration + easing.type: Easing.OutQuad + } + + NumberAnimation { + targets: [song, cava] + property: "opacity" + duration: root.contractAnimDuration + easing.type: Easing.OutQuad + } + } + + PropertyAction { target: popup; property: "visible" } + PropertyAction { target: musicRow; property: "visible" } + + ParallelAnimation { + NumberAnimation { + target: popupRect + property: "width" + duration: 250 + easing.type: Easing.OutQuad + } + + SpringAnimation { + target: popupRect + property: "height" + spring: 5 + mass: 0.5 + damping: 0.2 + epsilon: 0.25 + } + + ColorAnimation { + target: popupRect + property: "border.color" + duration: 250 + easing.type: Easing.OutQuad + } + } + } + }, + Transition { + from: "POPUP_OPEN" + to: "POPUP_CLOSED" + + SequentialAnimation { + ParallelAnimation { + NumberAnimation { + target: popupRect + property: "width" + duration: 250 + easing.type: Easing.OutQuad + } + + NumberAnimation { + target: popupRect + property: "height" + duration: 250 + easing.type: Easing.OutQuad + } + + ColorAnimation { + target: popupRect + property: "border.color" + duration: 250 + easing.type: Easing.OutQuad + } + } + + PropertyAction { target: musicRow; property: "visible" } + PropertyAction { target: popup; property: "visible" } + + ParallelAnimation { + NumberAnimation { + target: songContainer + properties: "bottomRightRadius,topRightRadius" + duration: root.contractAnimDuration + easing.type: Easing.InQuad + } + + NumberAnimation { + target: cavaContainer + properties: "bottomLeftRadius,topLeftRadius" + duration: root.contractAnimDuration + easing.type: Easing.InQuad + } + + NumberAnimation { + target: musicRow + property: "spacing" + duration: root.contractAnimDuration + easing.type: Easing.OutQuad + } + + NumberAnimation { + targets: [song, cava] + property: "opacity" + duration: root.contractAnimDuration + easing.type: Easing.OutQuad + } + } + } + }, + ] + + PopupWindow { + id: popup + anchor.item: root + anchor.rect.x: root.width / 2 - width / 2 + anchor.rect.y: 0 + implicitWidth: 1920 + implicitHeight: 600 + color: "transparent" + visible: false + + + Rectangle { + id: popupRect + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + width: 700 + height: 36 + color: Flexoki.bg + border.color: Flexoki.ui + border.width: 2 + radius: 18 + + MouseArea { + anchors.fill: parent + hoverEnabled: true + onExited: root.state = "POPUP_CLOSED" + } + + Text { + visible: false + anchors.centerIn: parent + color: Flexoki.tx + text: "Hello world!" + } + } + } + + Row { + id: musicRow + anchors.centerIn: parent + height: parent.height + spacing: 4 + + Rectangle { + id: songContainer + implicitWidth: song.implicitWidth + 16*2 + height: parent.height + color: Flexoki.bg + + bottomLeftRadius: 18 + topLeftRadius: 18 + bottomRightRadius: 4 + topRightRadius: 4 + + Text { + id: song + anchors.centerIn: parent + text: { + if (!Song.file) return "Not playing" + var text = Song.file + if (Song.title) { + if (Song.artist) { + text = Song.artist + " – " + Song.title + } else { + text = Song.title + } + } + if (text.length > 60) { + text = text.substring(0, 60) + "…" + } + return text + } + color: Flexoki.tx + font { family: root.fontFamily; pixelSize: root.fontSize } + } + } + + Rectangle { + id: cavaContainer + implicitWidth: cava.implicitWidth + 16*2 + height: parent.height + color: Flexoki.bg + + bottomLeftRadius: 4 + topLeftRadius: 4 + bottomRightRadius: 18 + topRightRadius: 18 + + Row { + id: cava + anchors.centerIn: parent + height: 15 + 4 + spacing: 2 + + Repeater { + model: Cava.heights + + delegate: Rectangle { + required property int modelData + y: 15 - modelData + width: 8 + height: modelData + 4 + radius: 4 + color: Flexoki.tx + + Behavior on height { + NumberAnimation { duration: 1000 / 30; easing.type: Easing.Linear } + } + Behavior on y { + NumberAnimation { duration: 1000 / 30; easing.type: Easing.Linear } + } + } + } + } + } + } +} diff --git a/.config/quickshell/Modules/Wall.qml b/.config/quickshell/Modules/Wall.qml new file mode 100644 index 0000000..b585c2e --- /dev/null +++ b/.config/quickshell/Modules/Wall.qml @@ -0,0 +1,53 @@ +import Quickshell +import QtQuick +import QtQuick.Layouts +import qs.Services + +Variants { + model: Quickshell.screens; + + delegate: Component { + PanelWindow { + id: root + + required property var modelData + screen: modelData + + property string fontFamily: "Poppins" + property int fontSize: 14 + + anchors { + top: true + bottom: true + left: true + right: true + } + aboveWindows: false + + color: "transparent" + + ColumnLayout { + x: 32 + y: 80 + + Text { + text: Qt.formatDateTime(Time.time, "hh:mm") + color: Flexoki.bg + font { family: root.fontFamily; weight: 800; pixelSize: root.fontSize * 7 } + } + + Text { + text: Qt.formatDateTime(Time.time, "MMMM d, yyyy") + color: Flexoki.bg + font { family: root.fontFamily; weight: 300; pixelSize: root.fontSize * 2.25 } + } + + Text { + text: Uptime.uptime + color: Flexoki.bg + font { family: root.fontFamily; weight: 300; pixelSize: root.fontSize * 1.75 } + } + } + } + } +} diff --git a/.config/quickshell/Services/Battery.qml b/.config/quickshell/Services/Battery.qml new file mode 100644 index 0000000..0d6213c --- /dev/null +++ b/.config/quickshell/Services/Battery.qml @@ -0,0 +1,33 @@ +pragma Singleton + +import Quickshell +import Quickshell.Io +import QtQuick + +Singleton { + id: root + property string status: "Discharging" + property int capacity: 0 + + FileView { + id: statusFile + path: "/sys/class/power_supply/BAT0/status" + onLoaded: root.status = this.text().trim() + } + + FileView { + id: capacityFile + path: "/sys/class/power_supply/BAT0/capacity" + onLoaded: root.capacity = parseInt(this.text().trim()) + } + + Timer { + interval: 10000 + running: true + repeat: true + onTriggered: { + statusFile.reload() + capacityFile.reload() + } + } +} diff --git a/.config/quickshell/Services/Brightness.qml b/.config/quickshell/Services/Brightness.qml new file mode 100644 index 0000000..80a8d1f --- /dev/null +++ b/.config/quickshell/Services/Brightness.qml @@ -0,0 +1,18 @@ +pragma Singleton + +import Quickshell +import Quickshell.Io +import QtQuick + +Singleton { + id: root + property int brightness + + Process { + command: ["brightctl", "-l"] + running: true + stdout: SplitParser { + onRead: line => root.brightness = parseInt(line) + } + } +} diff --git a/.config/quickshell/Services/Cava.qml b/.config/quickshell/Services/Cava.qml new file mode 100644 index 0000000..96cb918 --- /dev/null +++ b/.config/quickshell/Services/Cava.qml @@ -0,0 +1,21 @@ +pragma Singleton + +import Quickshell +import Quickshell.Io +import QtQuick + +Singleton { + id: root + property list heights + + Process { + command: ["cava", "-p", "/home/samn/.config/quickshell/cava.ini"] + running: true + stdout: SplitParser { + onRead: line => { + var heights = line.substring(0, line.length - 1).split(';').map(x => parseInt(x)) + if (heights !== root.heights) root.heights = heights + } + } + } +} diff --git a/.config/quickshell/Services/Flexoki.qml b/.config/quickshell/Services/Flexoki.qml new file mode 100644 index 0000000..1c467b5 --- /dev/null +++ b/.config/quickshell/Services/Flexoki.qml @@ -0,0 +1,32 @@ +pragma Singleton + +import Quickshell + +Singleton { + readonly property string bg: "#100F0F" + readonly property string bg2: "#1C1B1A" + readonly property string ui: "#282726" + readonly property string ui2: "#343331" + readonly property string ui3: "#403E3C" + readonly property string tx3: "#575653" + readonly property string tx2: "#878580" + readonly property string tx: "#CECDC3" + + readonly property string re: "#D14D41" + readonly property string or: "#DA702C" + readonly property string ye: "#D0A215" + readonly property string gr: "#879A39" + readonly property string cy: "#3AA99F" + readonly property string bl: "#4385BE" + readonly property string pu: "#8B7EC8" + readonly property string ma: "#CE5D97" + + readonly property string re2: "#AF3029" + readonly property string or2: "#BC5215" + readonly property string ye2: "#AD8301" + readonly property string gr2: "#66800B" + readonly property string cy2: "#24837B" + readonly property string bl2: "#205EA6" + readonly property string pu2: "#5E409D" + readonly property string ma2: "#A02F6F" +} diff --git a/.config/quickshell/Services/HyprlandService.qml b/.config/quickshell/Services/HyprlandService.qml new file mode 100644 index 0000000..9d35866 --- /dev/null +++ b/.config/quickshell/Services/HyprlandService.qml @@ -0,0 +1,11 @@ +pragma Singleton + +import Quickshell +import Quickshell.Hyprland +import QtQuick + +Singleton { + id: root + property int activeWorkspace + +} diff --git a/.config/quickshell/Services/Song.qml b/.config/quickshell/Services/Song.qml new file mode 100644 index 0000000..a4dc969 --- /dev/null +++ b/.config/quickshell/Services/Song.qml @@ -0,0 +1,45 @@ +pragma Singleton + +import Quickshell +import Quickshell.Io +import QtQuick + +Singleton { + id: root + property string file + property string artist + property string title + property string coverPath: "/home/samn/Music/cover.jpg" + + Process { + id: songProc + command: ["rmpc", "song"] + running: true + stdout: StdioCollector { + onStreamFinished: { + var oldFile = root.file + var obj = JSON.parse(this.text); + + root.file = obj.file + root.artist = obj.metadata.artist + root.title = obj.metadata.title + + if (obj.file !== oldFile) { + coverProc.exec(["ffmpeg", "-y", "-i", "/home/samn/Music/" + obj.file, "-an", "-c:v", "copy", "/home/samn/Music/cover.jpg"]) + } + } + } + } + + Process { + id: coverProc + running: false + } + + Timer { + interval: 5000 + running: true + repeat: true + onTriggered: songProc.running = true + } +} diff --git a/.config/quickshell/Services/Tags.qml b/.config/quickshell/Services/Tags.qml new file mode 100644 index 0000000..66aadaa --- /dev/null +++ b/.config/quickshell/Services/Tags.qml @@ -0,0 +1,18 @@ +pragma Singleton + +import Quickshell +import Quickshell.Io +import QtQuick + +Singleton { + id: root + property var tags: [] + + Process { + command: ["river-bedload", "-minified", "-watch", "tags"] + running: true + stdout: SplitParser { + onRead: line => root.tags = JSON.parse(line).filter(tag => tag.id < 10) + } + } +} diff --git a/.config/quickshell/Services/Time.qml b/.config/quickshell/Services/Time.qml new file mode 100644 index 0000000..7af1b1f --- /dev/null +++ b/.config/quickshell/Services/Time.qml @@ -0,0 +1,15 @@ +pragma Singleton + +import Quickshell +import Quickshell.Io +import QtQuick + +Singleton { + id: root + readonly property var time: clock.date + + SystemClock { + id: clock + precision: SystemClock.Seconds + } +} diff --git a/.config/quickshell/Services/Uptime.qml b/.config/quickshell/Services/Uptime.qml new file mode 100644 index 0000000..155be44 --- /dev/null +++ b/.config/quickshell/Services/Uptime.qml @@ -0,0 +1,63 @@ +pragma Singleton + +import Quickshell +import Quickshell.Io +import QtQuick + +Singleton { + id: root + property string uptime + + Process { + id: uptimeProc + command: ["uptime"] + running: true + stdout: StdioCollector { + onStreamFinished: { + var t = this.text.trim().split(" up ")[1] + + var days = 0 + if (t.includes("day")) { + var [d, t] = t.split(" day") + days = parseInt(d.trim()) + t = t.split(", ")[1] + } + t = t.split(", ")[0] + + var hours = 0 + var minutes = 0 + + if (t.includes("min")) { + minutes = parseInt(t.split(' min')[0]) + } else { + var [h, m] = t.split(":") + hours = parseInt(h.trim()) + minutes = parseInt(m.trim()) + } + + var uptime = "Up "; + if (days > 0) { + uptime += days + " day" + if (days != 1) uptime += "s" + uptime += ", " + } + if (hours > 0) { + uptime += hours + " hour" + if (hours != 1) uptime += "s" + uptime += ", " + } + uptime += minutes + " minute" + if (minutes != 1) uptime += "s" + + root.uptime = uptime + } + } + } + + Timer { + interval: 60000 + running: true + repeat: true + onTriggered: uptimeProc.running = true + } +} diff --git a/.config/quickshell/Services/Volume.qml b/.config/quickshell/Services/Volume.qml new file mode 100644 index 0000000..875f1c9 --- /dev/null +++ b/.config/quickshell/Services/Volume.qml @@ -0,0 +1,22 @@ +pragma Singleton + +import QtQuick +import Quickshell +import Quickshell.Services.Pipewire + +Singleton { + id: root + property int volume + + PwObjectTracker { + objects: [ Pipewire.defaultAudioSink ] + } + + Connections { + target: Pipewire.defaultAudioSink?.audio + + function onVolumeChanged() { + root.volume = Math.round(Pipewire.defaultAudioSink?.audio.volume * 100) + } + } +} diff --git a/.config/quickshell/Services/Wifi.qml b/.config/quickshell/Services/Wifi.qml new file mode 100644 index 0000000..a438471 --- /dev/null +++ b/.config/quickshell/Services/Wifi.qml @@ -0,0 +1,30 @@ +pragma Singleton + +import Quickshell +import Quickshell.Hyprland +import Quickshell.Io +import QtQuick + +Singleton { + id: root + property string ssid + + Process { + id: netProc + command: ["sh", "-c", "iwctl station wlan0 get-networks | awk -F' ' '/>/ {print $3}'"] + running: true + stdout: StdioCollector { + onStreamFinished: { + root.ssid = this.text.trim() + // Hyprland.refreshWorkspaces() + } + } + } + + Timer { + interval: 5000 + running: true + repeat: true + onTriggered: netProc.running = true + } +} diff --git a/.config/quickshell/Song.qml b/.config/quickshell/Song.qml deleted file mode 100644 index 14d7704..0000000 --- a/.config/quickshell/Song.qml +++ /dev/null @@ -1,31 +0,0 @@ -pragma Singleton - -import Quickshell -import Quickshell.Io -import QtQuick - -Singleton { - id: root - property string artist - property string title - - Process { - id: songProc - command: ["rmpc", "song"] - running: true - stdout: StdioCollector { - onStreamFinished: { - var obj = JSON.parse(this.text); - root.artist = obj.metadata.artist - root.title = obj.metadata.title - } - } - } - - Timer { - interval: 5000 - running: true - repeat: true - onTriggered: songProc.running = true - } -} diff --git a/.config/quickshell/Tags.qml b/.config/quickshell/Tags.qml deleted file mode 100644 index 66aadaa..0000000 --- a/.config/quickshell/Tags.qml +++ /dev/null @@ -1,18 +0,0 @@ -pragma Singleton - -import Quickshell -import Quickshell.Io -import QtQuick - -Singleton { - id: root - property var tags: [] - - Process { - command: ["river-bedload", "-minified", "-watch", "tags"] - running: true - stdout: SplitParser { - onRead: line => root.tags = JSON.parse(line).filter(tag => tag.id < 10) - } - } -} diff --git a/.config/quickshell/Time.qml b/.config/quickshell/Time.qml deleted file mode 100644 index 7af1b1f..0000000 --- a/.config/quickshell/Time.qml +++ /dev/null @@ -1,15 +0,0 @@ -pragma Singleton - -import Quickshell -import Quickshell.Io -import QtQuick - -Singleton { - id: root - readonly property var time: clock.date - - SystemClock { - id: clock - precision: SystemClock.Seconds - } -} diff --git a/.config/quickshell/Uptime.qml b/.config/quickshell/Uptime.qml deleted file mode 100644 index 155be44..0000000 --- a/.config/quickshell/Uptime.qml +++ /dev/null @@ -1,63 +0,0 @@ -pragma Singleton - -import Quickshell -import Quickshell.Io -import QtQuick - -Singleton { - id: root - property string uptime - - Process { - id: uptimeProc - command: ["uptime"] - running: true - stdout: StdioCollector { - onStreamFinished: { - var t = this.text.trim().split(" up ")[1] - - var days = 0 - if (t.includes("day")) { - var [d, t] = t.split(" day") - days = parseInt(d.trim()) - t = t.split(", ")[1] - } - t = t.split(", ")[0] - - var hours = 0 - var minutes = 0 - - if (t.includes("min")) { - minutes = parseInt(t.split(' min')[0]) - } else { - var [h, m] = t.split(":") - hours = parseInt(h.trim()) - minutes = parseInt(m.trim()) - } - - var uptime = "Up "; - if (days > 0) { - uptime += days + " day" - if (days != 1) uptime += "s" - uptime += ", " - } - if (hours > 0) { - uptime += hours + " hour" - if (hours != 1) uptime += "s" - uptime += ", " - } - uptime += minutes + " minute" - if (minutes != 1) uptime += "s" - - root.uptime = uptime - } - } - } - - Timer { - interval: 60000 - running: true - repeat: true - onTriggered: uptimeProc.running = true - } -} diff --git a/.config/quickshell/Volume.qml b/.config/quickshell/Volume.qml deleted file mode 100644 index 875f1c9..0000000 --- a/.config/quickshell/Volume.qml +++ /dev/null @@ -1,22 +0,0 @@ -pragma Singleton - -import QtQuick -import Quickshell -import Quickshell.Services.Pipewire - -Singleton { - id: root - property int volume - - PwObjectTracker { - objects: [ Pipewire.defaultAudioSink ] - } - - Connections { - target: Pipewire.defaultAudioSink?.audio - - function onVolumeChanged() { - root.volume = Math.round(Pipewire.defaultAudioSink?.audio.volume * 100) - } - } -} diff --git a/.config/quickshell/Wall.qml b/.config/quickshell/Wall.qml deleted file mode 100644 index fc47161..0000000 --- a/.config/quickshell/Wall.qml +++ /dev/null @@ -1,52 +0,0 @@ -import Quickshell -import QtQuick -import QtQuick.Layouts - -Variants { - model: Quickshell.screens; - - delegate: Component { - PanelWindow { - id: root - - required property var modelData - screen: modelData - - property string fontFamily: "Poppins" - property int fontSize: 14 - - anchors { - top: true - bottom: true - left: true - right: true - } - aboveWindows: false - - color: "transparent" - - ColumnLayout { - x: 32 - y: 80 - - Text { - text: Qt.formatDateTime(Time.time, "hh:mm") - color: Flexoki.bg - font { family: root.fontFamily; weight: 800; pixelSize: root.fontSize * 7 } - } - - Text { - text: Qt.formatDateTime(Time.time, "MMMM d, yyyy") - color: Flexoki.bg - font { family: root.fontFamily; weight: 300; pixelSize: root.fontSize * 2.25 } - } - - Text { - text: Uptime.uptime - color: Flexoki.bg - font { family: root.fontFamily; weight: 300; pixelSize: root.fontSize * 1.75 } - } - } - } - } -} diff --git a/.config/quickshell/Wifi.qml b/.config/quickshell/Wifi.qml deleted file mode 100644 index 76ff2b5..0000000 --- a/.config/quickshell/Wifi.qml +++ /dev/null @@ -1,26 +0,0 @@ -pragma Singleton - -import Quickshell -import Quickshell.Io -import QtQuick - -Singleton { - id: root - property string ssid - - Process { - id: netProc - command: ["sh", "-c", "iwctl station wlan0 get-networks | awk -F' ' '/>/ {print $3}'"] - running: true - stdout: StdioCollector { - onStreamFinished: root.ssid = this.text.trim() - } - } - - Timer { - interval: 5000 - running: true - repeat: true - onTriggered: netProc.running = true - } -} diff --git a/.config/quickshell/shell.qml b/.config/quickshell/shell.qml index 7a27cf2..4285ded 100644 --- a/.config/quickshell/shell.qml +++ b/.config/quickshell/shell.qml @@ -1,6 +1,17 @@ import Quickshell +import Quickshell.Hyprland +import QtQuick +import qs.Modules Scope { Bar {} Wall {} + + Connections { + target: Hyprland + function onRawEvent(event) { + throw new Exception('hyprland event') + Hyprland.refreshWorkspaces() + } + } } -- cgit v1.2.3