From 2c6ae8a4287ffad33a8c41b08ef47b62494a67dd Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Wed, 14 Jan 2026 14:47:59 -0500 Subject: Add quickshell config --- .config/quickshell/.editorconfig | 8 ++ .config/quickshell/Bar.qml | 218 ++++++++++++++++++++++++++++++++++++++ .config/quickshell/Battery.qml | 33 ++++++ .config/quickshell/Brightness.qml | 18 ++++ .config/quickshell/Cava.qml | 20 ++++ .config/quickshell/Flexoki.qml | 32 ++++++ .config/quickshell/Song.qml | 31 ++++++ .config/quickshell/Tags.qml | 18 ++++ .config/quickshell/Time.qml | 15 +++ .config/quickshell/Volume.qml | 22 ++++ .config/quickshell/Wifi.qml | 26 +++++ .config/quickshell/cava.ini | 8 ++ .config/quickshell/shell.qml | 5 + 13 files changed, 454 insertions(+) create mode 100644 .config/quickshell/.editorconfig create mode 100644 .config/quickshell/Bar.qml create mode 100644 .config/quickshell/Battery.qml create mode 100644 .config/quickshell/Brightness.qml create mode 100644 .config/quickshell/Cava.qml create mode 100644 .config/quickshell/Flexoki.qml create mode 100644 .config/quickshell/Song.qml create mode 100644 .config/quickshell/Tags.qml create mode 100644 .config/quickshell/Time.qml create mode 100644 .config/quickshell/Volume.qml create mode 100644 .config/quickshell/Wifi.qml create mode 100644 .config/quickshell/cava.ini create mode 100644 .config/quickshell/shell.qml (limited to '.config/quickshell') diff --git a/.config/quickshell/.editorconfig b/.config/quickshell/.editorconfig new file mode 100644 index 0000000..e18f182 --- /dev/null +++ b/.config/quickshell/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 diff --git a/.config/quickshell/Bar.qml b/.config/quickshell/Bar.qml new file mode 100644 index 0000000..b7ec963 --- /dev/null +++ b/.config/quickshell/Bar.qml @@ -0,0 +1,218 @@ +import Quickshell +import Quickshell.Io +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: Song.artist + " - " + Song.title + 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: 8 + + delegate: Rectangle { + y: 15 - Cava.heights[index] + width: 8 + height: Cava.heights[index] + 4 + radius: 4 + color: Flexoki.tx + } + } + } + } + } + + 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: " " + Time.time + 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 new file mode 100644 index 0000000..0d6213c --- /dev/null +++ b/.config/quickshell/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/Brightness.qml b/.config/quickshell/Brightness.qml new file mode 100644 index 0000000..80a8d1f --- /dev/null +++ b/.config/quickshell/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/Cava.qml b/.config/quickshell/Cava.qml new file mode 100644 index 0000000..2067a11 --- /dev/null +++ b/.config/quickshell/Cava.qml @@ -0,0 +1,20 @@ +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 new file mode 100644 index 0000000..1c467b5 --- /dev/null +++ b/.config/quickshell/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/Song.qml b/.config/quickshell/Song.qml new file mode 100644 index 0000000..14d7704 --- /dev/null +++ b/.config/quickshell/Song.qml @@ -0,0 +1,31 @@ +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 new file mode 100644 index 0000000..66aadaa --- /dev/null +++ b/.config/quickshell/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/Time.qml b/.config/quickshell/Time.qml new file mode 100644 index 0000000..b54b12f --- /dev/null +++ b/.config/quickshell/Time.qml @@ -0,0 +1,15 @@ +pragma Singleton + +import Quickshell +import Quickshell.Io +import QtQuick + +Singleton { + id: root + readonly property string time: Qt.formatDateTime(clock.date, "MMM d hh:mm:ss") + + SystemClock { + id: clock + precision: SystemClock.Seconds + } +} diff --git a/.config/quickshell/Volume.qml b/.config/quickshell/Volume.qml new file mode 100644 index 0000000..875f1c9 --- /dev/null +++ b/.config/quickshell/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/Wifi.qml b/.config/quickshell/Wifi.qml new file mode 100644 index 0000000..76ff2b5 --- /dev/null +++ b/.config/quickshell/Wifi.qml @@ -0,0 +1,26 @@ +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/cava.ini b/.config/quickshell/cava.ini new file mode 100644 index 0000000..ce42439 --- /dev/null +++ b/.config/quickshell/cava.ini @@ -0,0 +1,8 @@ +[general] +framerate=30 +bars=8 +[output] +method=raw +raw_target=/dev/stdout +data_format=ascii +ascii_max_range=15 diff --git a/.config/quickshell/shell.qml b/.config/quickshell/shell.qml new file mode 100644 index 0000000..6bd7760 --- /dev/null +++ b/.config/quickshell/shell.qml @@ -0,0 +1,5 @@ +import Quickshell + +Scope { + Bar {} +} -- cgit v1.2.3