diff options
Diffstat (limited to 'quickshell')
| -rw-r--r-- | quickshell/AppLauncher.qml | 242 | ||||
| -rw-r--r-- | quickshell/BatteryInfo.qml | 139 | ||||
| -rw-r--r-- | quickshell/IconButton.qml | 41 | ||||
| -rw-r--r-- | quickshell/NotificationOverlay.qml | 121 | ||||
| -rw-r--r-- | quickshell/Procs.qml | 137 | ||||
| -rw-r--r-- | quickshell/items/DataBus.qml | 23 | ||||
| -rw-r--r-- | quickshell/items/Electrons.qml | 27 | ||||
| -rw-r--r-- | quickshell/items/Latch.qml | 23 | ||||
| -rw-r--r-- | quickshell/items/LowEnergy.qml | 28 | ||||
| -rw-r--r-- | quickshell/items/Photons.qml | 32 | ||||
| -rw-r--r-- | quickshell/items/Radiation.qml | 23 | ||||
| -rw-r--r-- | quickshell/items/Radio.qml | 29 | ||||
| -rw-r--r-- | quickshell/items/Spin.qml | 45 | ||||
| -rw-r--r-- | quickshell/items/Waves.qml | 23 | ||||
| -rw-r--r-- | quickshell/items/Workspace.qml | 22 | ||||
| -rw-r--r-- | quickshell/scripts/battery-info.py | 39 | ||||
| -rwxr-xr-x | quickshell/scripts/battery-info.sh | 17 | ||||
| -rwxr-xr-x | quickshell/scripts/battery.sh | 3 | ||||
| -rwxr-xr-x | quickshell/scripts/bluetooth.sh | 9 | ||||
| -rwxr-xr-x | quickshell/scripts/brightness.sh | 4 | ||||
| -rwxr-xr-x | quickshell/scripts/cpu_temp.sh | 2 | ||||
| -rwxr-xr-x | quickshell/scripts/list-apps.sh | 115 | ||||
| -rwxr-xr-x | quickshell/scripts/network.sh | 2 | ||||
| -rw-r--r-- | quickshell/shell.qml | 253 |
24 files changed, 0 insertions, 1399 deletions
diff --git a/quickshell/AppLauncher.qml b/quickshell/AppLauncher.qml deleted file mode 100644 index f903f1f..0000000 --- a/quickshell/AppLauncher.qml +++ /dev/null @@ -1,242 +0,0 @@ -import QtQuick -import QtQuick.Controls -import Quickshell -import Quickshell.Io - -Rectangle { - id: appLauncher - - width: 400 - height: 600 - color: shellRoot.black - antialiasing: true - - property bool isVisible: false - property int hoverIndex: 0 - property var apps: [] - - signal requestClose() - - focus: true - - Keys.onEscapePressed: requestClose() - - Keys.onUpPressed: { - hoverIndex--; - if (hoverIndex < 0) hoverIndex += appListModel.count; - listView.positionViewAtIndex(hoverIndex, ListView.Contain); - } - - Keys.onDownPressed: { - hoverIndex = (hoverIndex + 1) % appListModel.count; - listView.positionViewAtIndex(hoverIndex, ListView.Contain); - } - - Keys.onReturnPressed: { - if (hoverIndex >= 0 && hoverIndex < appListModel.count) { - launchApp(appListModel.get(hoverIndex).appCommand) - console.log(appListModel.get(hoverIndex).appCommand) - } - } - - Keys.onEnterPressed: { - if (hoverIndex >= 0 && hoverIndex < appListModel.count) { - launchApp(appListModel.get(hoverIndex).appCommand) - console.log(appListModel.get(hoverIndex).appCommand) - } - } - - onIsVisibleChanged: { - if (!isVisible) return; - hoverIndex = 0; - appLauncher.forceActiveFocus(); - searchInput.forceActiveFocus(); - } - - Process { - id: appLoader - running: false - command: ["sh", "-c", "~/.config/quickshell/scripts/list-apps.sh"] - - stdout: SplitParser { - onRead: data => { - const lines = data.split('\n'); - for (const line of lines) { - if (line.trim().length === 0) continue; - - const parts = line.split('|'); - if (parts.length < 4) continue; - - apps.push({ - appName: parts[0], - appDescription: parts[1], - appIcon: parts[2], - appCommand: parts[3] - }); - } - - applySearch(""); - } - } - - onRunningChanged: { - if (running) return; - appLoader.running = false; - } - } - - function loadApps() { - appLoader.running = true; - } - - function applySearch(searchString) { - appListModel.clear(); - for (const app of apps) { - if (app.appName.toLowerCase().includes(searchString.toLowerCase())) { - appListModel.append(app); - } - } - } - - Component.onCompleted: { - loadApps(); - } - - Column { - anchors.fill: parent - anchors.margins: 12 - spacing: 8 - - Rectangle { - width: parent.width - height: 36 - color: "transparent" - - Text { - anchors.centerIn: parent - text: "Applications" - font.family: shellRoot.fontFamily - font.pixelSize: 20 - font.weight: Font.Medium - color: shellRoot.white - } - - Rectangle { - width: 28 - height: 28 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - radius: 6 - color: closeMouseArea.containsMouse ? shellRoot.red : "transparent" - - Text { - anchors.centerIn: parent - text: "✕" - font.family: shellRoot.fontFamily - font.pixelSize: 16 - font.weight: Font.Bold - color: closeMouseArea.containsMouse ? shellRoot.white : shellRoot.red - } - - MouseArea { - id: closeMouseArea - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - onClicked: appLauncher.requestClose() - } - } - } - - Rectangle { - width: parent.width - height: 36 - color: shellRoot.black - border.color: shellRoot.green - border.width: 1 - - TextInput { - id: searchInput - width: parent.width - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: 8 - anchors.rightMargin: 8 - anchors.verticalCenter: parent.verticalCenter - color: "white" - font.pixelSize: 14 - onTextEdited: { - applySearch(searchInput.text); - hoverIndex = 0; - } - } - } - - ListView { - id: listView - width: parent.width - height: parent.height - 88 - spacing: 8 - clip: true - - model: ListModel { - id: appListModel - } - - delegate: Rectangle { - width: listView.width - height: 30 - color: { - if (appLauncher.hoverIndex === index) return shellRoot.lightgray; - return shellRoot.gray; - } - - Row { - anchors.fill: parent - anchors.leftMargin: 12 - anchors.rightMargin: 12 - anchors.topMargin: 8 - anchors.bottomMargin: 8 - spacing: 12 - - Text { - width: parent.width - 62 - anchors.centerIn: parent - text: model.appName - font.family: shellRoot.fontFamily - font.pixelSize: 14 - font.weight: Font.Medium - color: { - return shellRoot.white; - } - elide: Text.ElideRight - } - } - - MouseArea { - id: mouseArea - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - - onEntered: { - appLauncher.hoverIndex = index; - } - - onClicked: { - launchApp(model.appCommand); - } - } - } - } - } - - function launchApp(command) { - appLauncher.requestClose() - - // Use a small delay before launching to ensure the window closes properly - Qt.callLater(() => { - Quickshell.execDetached(["sh", "-c", command + " &"]) - }) - } -} diff --git a/quickshell/BatteryInfo.qml b/quickshell/BatteryInfo.qml deleted file mode 100644 index 72e4f3b..0000000 --- a/quickshell/BatteryInfo.qml +++ /dev/null @@ -1,139 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import Quickshell -import Quickshell.Io - -Rectangle { - id: batteryInfoRect - - width: 300 - height: 120 - Layout.fillWidth: true - Layout.fillHeight: true - color: shellRoot.black - antialiasing: true - topLeftRadius: 10 - topRightRadius: 10 - property var energy: "" - property var voltage: "" - property var capacity: "" - - Timer { - interval: 5000 - running: true - repeat: false - onTriggered: { - fetchProc.running = true; - } - } - - signal requestClose() - focus: true - Keys.onEscapePressed: requestClose() - - Process { - id: fetchProc - command: ["sh", "-c", "~/.config/quickshell/scripts/battery-info.sh"] - - stdout: SplitParser { - onRead: data => { - if (data.includes("energy")) { - energy = data.split(":")[1] - return - } - if (data.includes("voltage")) { - voltage = data.split(":")[1] - return - } - if (data.includes("capacity")) { - capacity = data.split(":")[1] - return - } - } - - } - Component.onCompleted: running = true - } - - RowLayout { - anchors.centerIn: parent - ColumnLayout { - anchors.left: parent - Text { - text: "Energy" - font.family: shellRoot.fontFamily - font.pixelSize: 20 - font.weight: Font.Medium - color: shellRoot.green - MouseArea { - anchors.fill: parent - onClicked: { - } - } - } - Text { - text: "Capacity" - font.family: shellRoot.fontFamily - font.pixelSize: 20 - font.weight: Font.Medium - color: shellRoot.green - MouseArea { - anchors.fill: parent - onClicked: { - } - } - } - Text { - text: "Voltage" - font.family: shellRoot.fontFamily - font.pixelSize: 20 - font.weight: Font.Medium - color: shellRoot.green - MouseArea { - anchors.fill: parent - onClicked: { - } - } - } - } - ColumnLayout { - anchors.right: parent - Text { - text: energy - font.family: shellRoot.fontFamily - font.pixelSize: 20 - font.weight: Font.Medium - color: shellRoot.white - MouseArea { - anchors.fill: parent - onClicked: { - } - } - } - Text { - text: capacity - font.family: shellRoot.fontFamily - font.pixelSize: 20 - font.weight: Font.Medium - color: shellRoot.white - MouseArea { - anchors.fill: parent - onClicked: { - } - } - } - Text { - text: voltage - font.family: shellRoot.fontFamily - font.pixelSize: 20 - font.weight: Font.Medium - color: shellRoot.white - MouseArea { - anchors.fill: parent - onClicked: { - } - } - } - } - } -} diff --git a/quickshell/IconButton.qml b/quickshell/IconButton.qml deleted file mode 100644 index 96c4c7f..0000000 --- a/quickshell/IconButton.qml +++ /dev/null @@ -1,41 +0,0 @@ -import QtQuick - -MouseArea { - id: iconButton - - property string icon: "" - property string tooltip: "" - - width: 32 - height: 32 - - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - enabled: true - z: 10 - - Rectangle { - anchors.fill: parent - color: "transparent" - radius: 6 - - Behavior on color { - ColorAnimation { duration: 200 } - } - - Text { - id: iconText - anchors.centerIn: parent - text: iconButton.icon - font.family: shellRoot.fontFamily - font.pixelSize: 22 - color: shellRoot.white - - Component.onCompleted: { - console.log("IconButton text:", iconButton.icon, "length:", iconButton.icon.length) - } - } - } - - -} diff --git a/quickshell/NotificationOverlay.qml b/quickshell/NotificationOverlay.qml deleted file mode 100644 index d54f8f6..0000000 --- a/quickshell/NotificationOverlay.qml +++ /dev/null @@ -1,121 +0,0 @@ -import Quickshell -import Quickshell.Services.Notifications -import Quickshell.Wayland -import QtQuick - -PanelWindow { - id: root - - anchors { - top: true - left: true - } - - margins { - top: 15 - left: 15 - } - - implicitWidth: 360 - implicitHeight: notificationColumn.implicitHeight - - color: "transparent" - exclusiveZone: 0 - - WlrLayershell.layer: WlrLayer.Overlay - - NotificationServer { - id: server - - bodySupported: true - imageSupported: false - actionsSupported: true - - onNotification: notification => { - notification.tracked = true - } - } - - Column { - id: notificationColumn - - spacing: 10 - - Repeater { - model: server.trackedNotifications - - Rectangle { - id: notification - - width: 360 - height: Math.max(content.implicitHeight + 24, 80) - - color: "#000000" - - border.width: 1 - border.color: "#404040" - - opacity: 0 - - Behavior on y { - NumberAnimation { - duration: 200 - easing.type: Easing.OutCubic - } - } - - Behavior on opacity { - NumberAnimation { - duration: 150 - } - } - - Component.onCompleted: opacity = shellRoot.dnd ? 0 : 0.8 - - Timer { - interval: 2000 - running: true - repeat: false - - onTriggered: { - notification.opacity = 0 - destroyTimer.start() - } - } - - Timer { - id: destroyTimer - - interval: 150 - running: false - repeat: false - - onTriggered: { - modelData.dismiss() - } - } - - Column { - id: content - - anchors.fill: parent - anchors.margins: 12 - - spacing: 4 - - Text { - text: modelData.summary - color: "white" - font.bold: true - } - - Text { - text: modelData.body - color: "white" - wrapMode: Text.Wrap - } - } - } - } - } -} diff --git a/quickshell/Procs.qml b/quickshell/Procs.qml deleted file mode 100644 index 6442bfb..0000000 --- a/quickshell/Procs.qml +++ /dev/null @@ -1,137 +0,0 @@ -import Quickshell -import Quickshell.Io -import QtQuick - -Scope { - Timer { - interval: 5000 - running: true - repeat: true - onTriggered: { - cpuProc.running = true - memProc.running = true - brightnessProc.running = true - volumeProc.running = true - batteryProc.running = true - networkProc.running = true - bluetoothProc.running = true - temperatureProc.running = true - } - } - - Process { - id: cpuProc - command: ["sh", "-c", "head -1 /proc/stat"] - - stdout: SplitParser { - onRead: data => { - var p = data.trim().split(/\s+/) - var idle = parseInt(p[4]) + parseInt(p[5]) - var total = p.slice(1, 8).reduce((a, b) => a + parseInt(b), 0) - if (lastCpuTotal > 0) { - cpuUsage = Math.round(100 * (1 - (idle - lastCpuIdle) / (total - lastCpuTotal))) - } - lastCpuTotal = total - lastCpuIdle = idle - } - } - Component.onCompleted: running = true - } - - Process { - id: memProc - command: ["sh", "-c", "free | grep Mem"] - stdout: SplitParser { - onRead: data => { - var parts = data.trim().split(/\s+/) - var total = parseInt(parts[1]) || 1 - var used = parseInt(parts[2]) || 0 - memUsage = Math.round(100 * used / total) - } - } - Component.onCompleted: running = true - } - - Process { - id: temperatureProc - command: ["sh", "-c", "~/.config/quickshell/scripts/cpu_temp.sh"] - stdout: SplitParser { - onRead: data => { - cpu_temperature = parseInt(data.trim()) || 0 - } - } - Component.onCompleted: running = true - } - - Process { - id: brightnessProc - command: ["sh", "-c", "~/.config/quickshell/scripts/brightness.sh"] - stdout: SplitParser { - onRead: data => { - var parts = data.trim().split(/\s+/) - brightness = parseInt(parts[0]) || 100 - temperature = parseInt(parts[1]) || 6000 - } - } - Component.onCompleted: running = true - } - - Process { - id: volumeProc - command: ["sh", "-c", "wpctl get-volume @DEFAULT_AUDIO_SINK@"] - stdout: SplitParser { - onRead: data => { - var parts = data.trim().split(/\s+/) - if (parts.length == 3) { - volume_muted = true; - } else { - volume_muted = false; - } - volume = (parseFloat(parts[1].trim()) || 0) * 100 - } - } - Component.onCompleted: running = true - } - - Process { - id: batteryProc - command: ["sh", "-c", "~/.config/quickshell/scripts/battery.sh"] - stdout: SplitParser { - onRead: data => { - var parts = data.trim().split(/\s+/) - battery = parseInt(parts[0]) || 0 - batteryCharging = parseInt(parts[1]) || false - } - } - Component.onCompleted: running = true - } - - Process { - id: networkProc - command: ["sh", "-c", "~/.config/quickshell/scripts/network.sh"] - stdout: SplitParser { - onRead: data => { - var parts = data.trim().split(/\s+/) - wifiName = parts[0]; - } - } - Component.onCompleted: running = true - } - - Process { - id: bluetoothProc - command: ["sh", "-c", "~/.config/quickshell/scripts/bluetooth.sh"] - stdout: SplitParser { - onRead: data => { - data = data.trim() - if (data == "Offline") { - bluetoothName = "Offline" - return - } - var parts = data.split(" ") - bluetoothName = parts.slice(2).join(" ") - } - } - Component.onCompleted: running = true - } -} diff --git a/quickshell/items/DataBus.qml b/quickshell/items/DataBus.qml deleted file mode 100644 index ef9f952..0000000 --- a/quickshell/items/DataBus.qml +++ /dev/null @@ -1,23 +0,0 @@ -import QtQuick -import QtQuick.Layouts - -RowLayout { - spacing: 0 - Text { - text: " Data Bus:" - color: shellRoot.white - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - } - } - Text { - text: cpuUsage - color: shellRoot.orange - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - bold: true - } - } -} diff --git a/quickshell/items/Electrons.qml b/quickshell/items/Electrons.qml deleted file mode 100644 index f75c126..0000000 --- a/quickshell/items/Electrons.qml +++ /dev/null @@ -1,27 +0,0 @@ -import QtQuick -import QtQuick.Layouts - -RowLayout { - spacing: 0 - Text { - text: " Electrons:" - color: shellRoot.white - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - } - } - Text { - text: (batteryCharging ? ("AC/DC(" + battery + ")") : battery) - color: (battery <= redBatteryPoint) ? shellRoot.red : ((battery <= orangeBatteryPoint) ? shellRoot.orange : shellRoot.green) - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - bold: true - } - } - MouseArea { - anchors.fill: parent - onClicked: shellRoot.batteryInfo = !shellRoot.batteryModeConfig - } -} diff --git a/quickshell/items/Latch.qml b/quickshell/items/Latch.qml deleted file mode 100644 index 5cc6487..0000000 --- a/quickshell/items/Latch.qml +++ /dev/null @@ -1,23 +0,0 @@ -import QtQuick -import QtQuick.Layouts - -RowLayout { - spacing: 0 - Text { - text: " Latch:" - color: shellRoot.white - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - } - } - Text { - text: memUsage - color: shellRoot.orange - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - bold: true - } - } -} diff --git a/quickshell/items/LowEnergy.qml b/quickshell/items/LowEnergy.qml deleted file mode 100644 index bfd33ab..0000000 --- a/quickshell/items/LowEnergy.qml +++ /dev/null @@ -1,28 +0,0 @@ -import QtQuick -import QtQuick.Layouts - -RowLayout { - spacing: 0 - opacity: !shellRoot.dnd - Text { - text: " Low Energy:" - color: shellRoot.white - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - } - } - Text { - text: bluetoothName - color: bluetoothName == "Offline" ? shellRoot.red : shellRoot.green - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - bold: true - } - } - MouseArea { - anchors.fill: parent - onClicked: bluetoothManagerProc.running = true - } -} diff --git a/quickshell/items/Photons.qml b/quickshell/items/Photons.qml deleted file mode 100644 index 0ba94ee..0000000 --- a/quickshell/items/Photons.qml +++ /dev/null @@ -1,32 +0,0 @@ -import QtQuick -import QtQuick.Layouts - -RowLayout { - spacing: 0 - Text { - text: " Photons:" - color: shellRoot.white - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - } - } - Text { - text: brightness - color: shellRoot.orange - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - bold: true - } - } - Text { - text: "(" + temperature + "K)" - color: shellRoot.red - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - bold: true - } - } -} diff --git a/quickshell/items/Radiation.qml b/quickshell/items/Radiation.qml deleted file mode 100644 index e2a6c09..0000000 --- a/quickshell/items/Radiation.qml +++ /dev/null @@ -1,23 +0,0 @@ -import QtQuick -import QtQuick.Layouts - -RowLayout { - spacing: 0 - Text { - text: " Radiation:" - color: shellRoot.white - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - } - } - Text { - text: cpu_temperature + "K" - color: shellRoot.orange - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - bold: true - } - } -} diff --git a/quickshell/items/Radio.qml b/quickshell/items/Radio.qml deleted file mode 100644 index 77e542e..0000000 --- a/quickshell/items/Radio.qml +++ /dev/null @@ -1,29 +0,0 @@ -import QtQuick -import QtQuick.Layouts - -RowLayout { - spacing: 0 - opacity: !shellRoot.dnd - - Text { - text: " Radio:" - color: shellRoot.white - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - } - } - Text { - text: wifiName - color: wifiName == "Offline" ? shellRoot.red : shellRoot.green - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - bold: true - } - } - MouseArea { - anchors.fill: parent - onClicked: networkManagerProc.running = true - } -} diff --git a/quickshell/items/Spin.qml b/quickshell/items/Spin.qml deleted file mode 100644 index 72e6105..0000000 --- a/quickshell/items/Spin.qml +++ /dev/null @@ -1,45 +0,0 @@ -import QtQuick -import QtQuick.Layouts - -RowLayout { - spacing: 0 - Text { - text: " Spin:" - color: shellRoot.white - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - } - } - Text { - property var formatMode: "HH:mm:ss" - - id: clock - text: Qt.formatDateTime(new Date(), clock.formatMode) - color: shellRoot.purple - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - bold: true - } - - Timer { - interval: 1000 - running: true - repeat: true - onTriggered: clock.text = Qt.formatDateTime(new Date(), clock.formatMode) - } - - MouseArea { - anchors.fill: parent - onClicked: { - if (clock.formatMode === "HH:mm:ss") { - clock.formatMode = "yyyy/MM/dd, dddd" - } else { - clock.formatMode = "HH:mm:ss" - } - clock.text = Qt.formatDateTime(new Date(), clock.formatMode) - } - } - } -} diff --git a/quickshell/items/Waves.qml b/quickshell/items/Waves.qml deleted file mode 100644 index f8c0359..0000000 --- a/quickshell/items/Waves.qml +++ /dev/null @@ -1,23 +0,0 @@ -import QtQuick -import QtQuick.Layouts - -RowLayout { - spacing: 0 - Text { - text: " Waves:" - color: shellRoot.white - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - } - } - Text { - text: volume - color: volume_muted ? shellRoot.red : shellRoot.green - font { - family: shellRoot.fontFamily - pixelSize: shellRoot.fontSize - bold: true - } - } -} diff --git a/quickshell/items/Workspace.qml b/quickshell/items/Workspace.qml deleted file mode 100644 index f793850..0000000 --- a/quickshell/items/Workspace.qml +++ /dev/null @@ -1,22 +0,0 @@ -import QtQuick -import Quickshell.Hyprland - -Repeater { - model: 5 - - Text { - property bool isActive: Hyprland.focusedWorkspace?.id === (index + 1) - - text: index + 1 - color: isActive ? shellRoot.green : shellRoot.white - font { - pixelSize: shellRoot.fontSize; - bold: true; - } - - MouseArea { - anchors.fill: parent - onClicked: Hyprland.dispatch("workspace " + (index + 1)) - } - } -} diff --git a/quickshell/scripts/battery-info.py b/quickshell/scripts/battery-info.py deleted file mode 100644 index c3958f7..0000000 --- a/quickshell/scripts/battery-info.py +++ /dev/null @@ -1,39 +0,0 @@ -# this script was used to generate the battery-info.sh via chatgpt - -import subprocess - -output = subprocess.run( - ["upower", "--enumerate"], - capture_output=True -).stdout.decode('utf-8') - -target = None - -for line in output.split("\n"): - if "BAT" not in line: - continue - target = line - break - -print(line) - -output = subprocess.run( - ["upower", "-i", line], - capture_output=True -).stdout.decode('utf-8') - -energy = None -voltage = None -capacity = None - -for line in output.split("\n"): - if energy is None and "energy:" in line: - energy = line.split(":")[1].strip() - if voltage is None and "voltage:" in line: - voltage = line.split(":")[1].strip() - if capacity is None and "capacity:" in line: - capacity = line.split(":")[1].strip() - -print("energy:", energy) -print("voltage:", voltage) -print("capacity:", capacity) diff --git a/quickshell/scripts/battery-info.sh b/quickshell/scripts/battery-info.sh deleted file mode 100755 index 414d168..0000000 --- a/quickshell/scripts/battery-info.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -target=$(upower --enumerate | awk '/BAT/ { print; exit }') - -upower -i "$target" | awk -F: ' -/energy:/ && !e { e=$2 } -/voltage:/ && !v { v=$2 } -/capacity:/ && !c { c=$2 } -END { - gsub(/^[ \t]+/, "", e) - gsub(/^[ \t]+/, "", v) - gsub(/^[ \t]+/, "", c) - - print "energy:", e - print "voltage:", v - print "capacity:", c -}' diff --git a/quickshell/scripts/battery.sh b/quickshell/scripts/battery.sh deleted file mode 100755 index 77f800a..0000000 --- a/quickshell/scripts/battery.sh +++ /dev/null @@ -1,3 +0,0 @@ -battery=$(cat /sys/class/power_supply/BAT1/capacity) -charging=$(cat /sys/class/power_supply/ACAD/online) -echo "$battery $charging" diff --git a/quickshell/scripts/bluetooth.sh b/quickshell/scripts/bluetooth.sh deleted file mode 100755 index 861e4a3..0000000 --- a/quickshell/scripts/bluetooth.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -connected="$(bluetoothctl devices Connected)" - -if [ -z "$connected" ]; then - echo "Offline" -else - echo "$connected" -fi diff --git a/quickshell/scripts/brightness.sh b/quickshell/scripts/brightness.sh deleted file mode 100755 index a39b85d..0000000 --- a/quickshell/scripts/brightness.sh +++ /dev/null @@ -1,4 +0,0 @@ -brightness=$(cat /sys/class/backlight/acpi_video0/actual_brightness) -temp=$(hyprctl hyprsunset temperature 2>/dev/null | grep -o '[0-9]\+') -if [ -z "$temp" ]; then temp=6000; fi -echo "$brightness $temp" diff --git a/quickshell/scripts/cpu_temp.sh b/quickshell/scripts/cpu_temp.sh deleted file mode 100755 index de73d7d..0000000 --- a/quickshell/scripts/cpu_temp.sh +++ /dev/null @@ -1,2 +0,0 @@ -temp=$(sensors | awk '/^Package id 0:/ {print int($4) + 273}') -echo "$temp" diff --git a/quickshell/scripts/list-apps.sh b/quickshell/scripts/list-apps.sh deleted file mode 100755 index bac48b6..0000000 --- a/quickshell/scripts/list-apps.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh -# List desktop applications for the launcher - -# Blacklist - apps to hide (add desktop file basenames here) -BLACKLIST=( - # "xfce4-about.desktop" - # "avahi-discover.desktop" - # "bssh.desktop" - # "bvnc.desktop" - # "qv4l2.desktop" - # "qvidcap.desktop" - # "lstopo.desktop" - # "uuctl.desktop" - # "codium.desktop" # Hide regular VSCodium (keep Wayland version) - # "xgps.desktop" # Hide Xgps - # "xgpsspeed.desktop" # Hide Xgpsspeed -) - -# Search paths for .desktop files (local first so overrides work) -XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" -IFS=':' read -ra SEARCH_PATHS <<< "$XDG_DATA_DIRS" - -# Function to find icon path -find_icon() { - local icon_name="$1" - - # If it's already a path, return it - if [[ "$icon_name" == /* ]]; then - echo "$icon_name" - return - fi - - # Common icon sizes to try - local sizes=(48 32 64 128 256) - - # Icon theme paths - local icon_paths=( - "$HOME/.local/share/icons" - "$HOME/.icons" - "/usr/share/icons" - "/usr/share/pixmaps" - ) - - # Try to find the icon - for path in "${icon_paths[@]}"; do - # Try with extensions - for ext in png svg xpm; do - # Direct match in pixmaps - if [ -f "$path/$icon_name.$ext" ]; then - echo "$path/$icon_name.$ext" - return - fi - - # Try in hicolor theme with different sizes - for size in "${sizes[@]}"; do - if [ -f "$path/hicolor/${size}x${size}/apps/$icon_name.$ext" ]; then - echo "$path/hicolor/${size}x${size}/apps/$icon_name.$ext" - return - fi - done - done - done - - # If not found, just return the icon name - echo "$icon_name" -} - -# Collect all desktop files and process, avoiding duplicates -# We use process substitution to avoid subshell issues with arrays -declare -A seen_apps - -for dir in "${SEARCH_PATHS[@]}"; do - [ ! -d "$dir" ] && continue - - while IFS= read -r desktop_file; do - basename_file=$(basename "$desktop_file") - - # Skip duplicates (local overrides system) - [[ -n "${seen_apps[$basename_file]}" ]] && continue - seen_apps[$basename_file]=1 - - # Skip blacklisted - skip=0 - for blacklisted in "${BLACKLIST[@]}"; do - if [[ "$basename_file" == "$blacklisted" ]]; then - skip=1 - break - fi - done - [[ $skip -eq 1 ]] && continue - - # Skip if NoDisplay=true - grep -q "^NoDisplay=true" "$desktop_file" 2>/dev/null && continue - - # Extract fields - name=$(grep "^Name=" "$desktop_file" | head -1 | cut -d= -f2-) - comment=$(grep "^Comment=" "$desktop_file" | head -1 | cut -d= -f2-) - icon=$(grep "^Icon=" "$desktop_file" | head -1 | cut -d= -f2-) - exec=$(grep "^Exec=" "$desktop_file" | head -1 | cut -d= -f2- | sed 's/%[uUfF]//g' | sed 's/%[cdnNvmki]//g') - - # Skip if no name or exec - [ -z "$name" ] && continue - [ -z "$exec" ] && continue - - # Default comment if empty - [ -z "$comment" ] && comment="Application" - - # Find icon path - icon_path=$(find_icon "$icon") - - # Output in format: name|comment|icon_path|exec - echo "$name|$comment|$icon_path|$exec" - - done < <(find -L "$dir" -name "*.desktop" -type f 2>/dev/null) -done | sort -u diff --git a/quickshell/scripts/network.sh b/quickshell/scripts/network.sh deleted file mode 100755 index f50707e..0000000 --- a/quickshell/scripts/network.sh +++ /dev/null @@ -1,2 +0,0 @@ -connections=$(nmcli connection show --active | sed -n '2 p') -echo "$connections" diff --git a/quickshell/shell.qml b/quickshell/shell.qml deleted file mode 100644 index 2396ea8..0000000 --- a/quickshell/shell.qml +++ /dev/null @@ -1,253 +0,0 @@ -import "./items" -import Quickshell -import Quickshell.Wayland -import Quickshell.Hyprland -import Quickshell.Io -import QtQuick -import QtQuick.Layouts - -ShellRoot { - id: shellRoot - - property int redBatteryPoint: 15 - property int orangeBatteryPoint: 30 - - property color black: "#000000" - property color gray: "#202020" - property color lightgray: "#404040" - property color white: "#ffffff" - property color green: "#28CD41" - property color red: "#FF4040" - property color orange: "#FFA500" - property color purple: "#BF00FF" - property color blue: "#00FFFF" - property string fontFamily: "JetBrainsMono Nerd Font" - property int fontSize: 18 - - property bool appLauncherVisible: false - property bool barVisible: true - property bool calendarVisible: false - property bool dnd: false - property bool batteryInfo: false - property bool blink: false - - GlobalShortcut { - id: barShortcut - name: "toggleBar" - onPressed: { - barVisible = !barVisible - } - } - GlobalShortcut { - id: launcherShortcut - name: "toggleLauncher" - onPressed: { - appLauncherVisible = !appLauncherVisible - } - } - GlobalShortcut { - id: dndShortCut - name: "toggleDnd" - onPressed: { - dnd = !dnd - } - } - - Variants { - model: Quickshell.screens - PanelWindow { - id: root - // don't render this if shell.navVisible is false - visible: shellRoot.barVisible - - property int cpuUsage: 0 - property int lastCpuTotal: 0 - property int lastCpuIdle: 0 - property int memUsage: 0 - property int cpu_temperature: 6000 - property int brightness: 100 - property int temperature: 6000 - property int volume: 12 - property bool volume_muted: false - property int battery: 12 - property bool batteryCharging: false - property string wifiName: "Offline" - property string bluetoothName: "Offline" - - Procs {} - Process { - id: networkManagerProc - command: ["foot", "-e", "nmtui"] - Component.onCompleted: running = false - } - Process { - id: bluetoothManagerProc - command: ["foot", "-e", "bluetui"] - Component.onCompleted: running = false - } - - anchors.bottom: true - anchors.left: true - anchors.right: true - implicitHeight: 32 - color: shellRoot.black - - RowLayout { - anchors.fill: parent - anchors.margins: 0 - anchors.leftMargin: 10 - anchors.rightMargin: 10 - - - Workspace {} - Item { Layout.fillWidth: true } - Radio {} - LowEnergy {} - Electrons {} - Waves {} - Photons {} - Radiation {} - DataBus {} - Latch {} - Spin {} - } - } - } - Variants { - model: Quickshell.screens - - PanelWindow { - visible: shellRoot.appLauncherVisible - - anchors { - top: true - left: true - } - - margins { - top: 5 - left: Screen.width/2 - 200 - } - - implicitWidth: 400 - implicitHeight: 600 - - color: "transparent" - exclusiveZone: 0 - - WlrLayershell.layer: WlrLayer.Overlay - WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand - - Behavior on height { - NumberAnimation { duration: 200; easing.type: Easing.OutCubic } - } - - AppLauncher { - anchors.fill: parent - isVisible: shellRoot.appLauncherVisible - - onRequestClose: { - shellRoot.appLauncherVisible = false - } - } - } - } - - Variants { - model: Quickshell.screens - - PanelWindow { - visible: shellRoot.batteryInfo - - anchors { - bottom: true - left: true - } - - margins { - top: 0 - left: Screen.width / 2 - 100 - } - - implicitWidth: 300 - implicitHeight: 120 - - color: "transparent" - exclusiveZone: 0 - - WlrLayershell.layer: WlrLayer.Overlay - WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand - - Behavior on height { - NumberAnimation { duration: 200; easing.type: Easing.OutCubic } - } - - BatteryInfo { - onRequestClose: { - shellRoot.batteryInfo = false - } - } - } - } - - NotificationOverlay {} - - Timer { - interval: 1000 * 60 * 30 - running: true - repeat: true - onTriggered: { - if (dnd) return; - shellRoot.blink = true; - } - } - - Variants { - model: Quickshell.screens - - PanelWindow { - visible: shellRoot.blink - - margins { - top: 0 - left: 0 - } - - implicitWidth: 800 - implicitHeight: 400 - - color: "transparent" - exclusiveZone: 0 - - WlrLayershell.layer: WlrLayer.Overlay - WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand - - Behavior on height { - NumberAnimation { duration: 200; easing.type: Easing.OutCubic } - } - - Rectangle { - id: blinkRect - - width: 800 - height: 400 - Layout.fillWidth: true - Layout.fillHeight: true - color: shellRoot.black - antialiasing: true - radius: 10 - focus: true - Keys.onEscapePressed: shellRoot.blink = false; - - Text { - anchors.centerIn: parent - text: "BLINK" - font.family: shellRoot.fontFamily - font.weight: 800 - font.pixelSize: 200 - color: shellRoot.white - } - } - } - } -} |
