From 9a51a080b0d70e3f907c13014ea6d6911f48b09d Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Thu, 15 Jan 2026 20:27:18 -0500 Subject: update qs config --- .config/quickshell/Services/HyprlandService.qml | 11 ----------- .config/quickshell/Services/Song.qml | 19 +++++++++++++++++-- .config/quickshell/Services/Wifi.qml | 9 +++++---- .config/quickshell/Services/Workspaces.qml | 11 +++++++++++ 4 files changed, 33 insertions(+), 17 deletions(-) delete mode 100644 .config/quickshell/Services/HyprlandService.qml create mode 100644 .config/quickshell/Services/Workspaces.qml (limited to '.config/quickshell/Services') diff --git a/.config/quickshell/Services/HyprlandService.qml b/.config/quickshell/Services/HyprlandService.qml deleted file mode 100644 index 9d35866..0000000 --- a/.config/quickshell/Services/HyprlandService.qml +++ /dev/null @@ -1,11 +0,0 @@ -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 index a4dc969..7c632be 100644 --- a/.config/quickshell/Services/Song.qml +++ b/.config/quickshell/Services/Song.qml @@ -8,8 +8,12 @@ Singleton { id: root property string file property string artist + property string album property string title - property string coverPath: "/home/samn/Music/cover.jpg" + readonly property string coverPath: "/home/samn/Music/cover.jpg" + + signal songChanged() + signal coverLoaded() Process { id: songProc @@ -17,15 +21,25 @@ Singleton { running: true stdout: StdioCollector { onStreamFinished: { + if (!this.text) { + root.file = "" + root.artist = "" + root.album = "" + root.title = "" + return + } + var oldFile = root.file var obj = JSON.parse(this.text); root.file = obj.file root.artist = obj.metadata.artist + root.album = obj.metadata.album 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"]) + root.songChanged() + coverProc.exec(["ffmpeg", "-y", "-i", "/home/samn/Music/" + obj.file, "-an", "-c:v", "copy", root.coverPath]) } } } @@ -34,6 +48,7 @@ Singleton { Process { id: coverProc running: false + onExited: root.coverLoaded() } Timer { diff --git a/.config/quickshell/Services/Wifi.qml b/.config/quickshell/Services/Wifi.qml index a438471..c8fd54b 100644 --- a/.config/quickshell/Services/Wifi.qml +++ b/.config/quickshell/Services/Wifi.qml @@ -1,7 +1,6 @@ pragma Singleton import Quickshell -import Quickshell.Hyprland import Quickshell.Io import QtQuick @@ -11,12 +10,14 @@ Singleton { Process { id: netProc - command: ["sh", "-c", "iwctl station wlan0 get-networks | awk -F' ' '/>/ {print $3}'"] + command: ["iwctl", "station", "wlan0", "get-networks"] running: true stdout: StdioCollector { onStreamFinished: { - root.ssid = this.text.trim() - // Hyprland.refreshWorkspaces() + var line = this.text.split("\n").find(line => line.includes(">")) + // remove ANSI escape sequences + line = line.replace(/\x1b\[.*?[@A-Z\[\\\]^_`a-z\{\|\}~]/g, '') + root.ssid = line.split(" ").filter(x => x != "")[1] } } } diff --git a/.config/quickshell/Services/Workspaces.qml b/.config/quickshell/Services/Workspaces.qml new file mode 100644 index 0000000..9d35866 --- /dev/null +++ b/.config/quickshell/Services/Workspaces.qml @@ -0,0 +1,11 @@ +pragma Singleton + +import Quickshell +import Quickshell.Hyprland +import QtQuick + +Singleton { + id: root + property int activeWorkspace + +} -- cgit v1.2.3