all repos — quickshell @ 06c34b8d9c2dcb5b19a7a08cc4ea7c5623b9fc66

A desert-witch desktop shell

0
trickyni trickyniv56@gmail.com
Sun, 31 Aug 2025 16:09:30 +0300
commit

06c34b8d9c2dcb5b19a7a08cc4ea7c5623b9fc66

parent

4ed0758c7fa6305a3e9487b82bf7b96a64e79efb

A Icons.qml

@@ -0,0 +1,44 @@

+//Icons.qml +pragma Singleton +import QtQuick +import Quickshell +import Quickshell.Io + + +Singleton { + id: root + property var modules: { + "sunset": "󰖚", + "ram": "󰍛", + "tasklist": "", + "battery": "", + "headphones": "", + "mewi": "", + } + property var workspaces: { + "volume_mixer": "", + "download": "", + + } + property var volume: { + "mute": "", + "off": "", + "low": "", + "high": "", + } + property var network: { + "no_bar": "󰣾", + "one_bar": "󰣴", + "two_bar": "󰣶", + "three_bar": "󰣸", + "full_bar": "󰣺", + "crossed_full": "󰣼", + "crossed_empty":"󰣽", + "one_bar_alert": "󰣵", + "two_bar_alert": "󰣹", + "three_bar_alert": "󰣹", + "full_bar_alert": "󰣻", + } +} + +
M Resources.qmlResources.qml

@@ -24,18 +24,9 @@ "grey": "#868686"

} property var fontsize: { "topbar_text": 12, + "topbar_icon": 16, "bottombar_text": 8, - "topbar_icon": 16 - } - property var icons: { - "sunset": "󰖚", - "volume": "", - "volume_mixer": "", - "download": "", - "ram": "󰍛", - "tasklist": "", - "battery": "", - "headphones": "" + "bottombar_icon": 8, } }
M TODO.txtTODO.txt

@@ -1,32 +1,30 @@

-First: +Battery + - laptop battery on top + - charging indicator + - popup with more details? +Network +Low Priority + - resize indicator + - zen mode + + +UI/Animations: +- Fix proggyfont +- I think workspace icons are misaligned workspaces - animations - - buttons: - - - background - - - clickability volume - - mute indicator - - icons/colors change - - click to mute/unmute? + - mute animation + - size match text Battery - - headset battery - - laptop battery - - support for new batteries on the fly - -Second: - sunset timer - taskwarrior - ram - network - resize indicator - -low priority: - moon - zen mode + - UI + - animations +Sunset + - disappears at night expansion: - notification - app launcher - bluetooth launcher + - notifications + - app launcher + - bluetooth launcher + - Lock screen? -Fix proggyfont
M bar/Bar.qmlbar/Bar.qml

@@ -4,20 +4,28 @@ import QtQuick

import QtQuick.Layouts import ".." import "modules" as Module +import "classes" as Class Scope { TopBar { - TopbarLeft { + TopbarRight { Module.Timedate {} Module.Sunset {} Module.Volume {} - Module.MegaPlaceholder {} + Module.Moonphase {} + Module.Ram {} + Module.Taskwarrior {} } - Module.Workspaces {} + TopbarLeft { + Module.Workspaces {} + } } BottomBar { - BottombarLeft { - Module.HeadphonesBattery{} + BottombarRight { + Module.Battery{} + } + BottombarLeft{ + Module.Network{} } } }
M bar/BottomBar.qmlbar/BottomBar.qml

@@ -15,6 +15,6 @@ margins {

left: 8 right:8 } - implicitHeight: 8 + implicitHeight: 12 color: Resources.palette.bg }
M bar/BottombarLeft.qmlbar/BottombarLeft.qml

@@ -3,13 +3,13 @@ import Quickshell

import QtQuick import QtQuick.Layouts import ".." +import "classes" as Class RowLayout { id: bottom_left spacing: 2 - layoutDirection: Qt.RightToLeft anchors { - right: parent.right + left: parent.left verticalCenter: parent.verticalCenter } }
A bar/BottombarRight.qml

@@ -0,0 +1,14 @@

+//BottombarLeft.qml +import Quickshell +import QtQuick +import QtQuick.Layouts +import ".." +import "classes" as Class + +Class.RightRowLayout { + id: bottom_right + anchors { + right: parent.right + verticalCenter: parent.verticalCenter + } +}
M bar/TopBar.qmlbar/TopBar.qml

@@ -12,7 +12,7 @@ left: true

right: true } margins { - left: 8 + left: 0 right:8 } implicitHeight: 24
M bar/TopbarLeft.qmlbar/TopbarLeft.qml

@@ -3,14 +3,14 @@ import Quickshell

import QtQuick import QtQuick.Layouts import ".." +import "classes" as Class RowLayout { id: topbar_left spacing: 2 - layoutDirection: Qt.RightToLeft anchors { - right: parent.right + left: parent.left verticalCenter: parent.verticalCenter } }
A bar/TopbarRight.qml

@@ -0,0 +1,15 @@

+//TopbarRight.qml +import Quickshell +import QtQuick +import QtQuick.Layouts +import ".." +import "classes" as Class + + +Class.RightRowLayout { + id: topbar_right + anchors { + right: parent.right + verticalCenter: parent.verticalCenter + } +}
A bar/classes/BotSep.qml

@@ -0,0 +1,11 @@

+//BotSep.qml +import QtQuick +import Quickshell +import ".." +import "../.." + +BottombarText { + id: separator + text: "|" + color: Resources.palette.sand +}
A bar/classes/BottombarIcon.qml

@@ -0,0 +1,14 @@

+//BottombarIcon.qml +import QtQuick +import Quickshell +import QtQuick.Layouts +import ".." +import "../.." + +Text { + font.pixelSize: Resources.fontsize.bottombar_icon + color: Resources.palette.orange + font.family: font_icon.name +} + +
A bar/classes/RightRowLayout.qml

@@ -0,0 +1,11 @@

+//RightRowLayout.qml +import QtQuick +import Quickshell +import QtQuick.Layouts +import ".." +import "../.." + +RowLayout { + spacing: 2 + layoutDirection: Qt.RightToLeft +}
A bar/modules/Battery.qml

@@ -0,0 +1,24 @@

+//HeadphonesBattery.qml +import QtQuick +import Quickshell +import QtQuick.Layouts +import Quickshell.Services.UPower +import "../.." +import "../classes" as Class + + +Repeater { + model: UPower.devices.values + Class.RightRowLayout { + Class.BottombarText { + text: modelData.percentage*100+"%" + } + Class.BottombarIcon { + text: (({ + "Jupiter of the Monkey": Icons.modules.headphones, + "mix4": Icons.modules.mewi, + })[modelData.model] ?? modelData.model)+" " + } + Class.BotSep{} + } +}
D bar/modules/HeadphonesBattery.qml

@@ -1,19 +0,0 @@

-//HeadphonesBattery.qml -import QtQuick -import Quickshell -import QtQuick.Layouts -import Quickshell.Services.UPower -import ".." -import "../classes" as Class - - -RowLayout { - id: headphones_battery - property var jotm: "/org/freedesktop/UPower/devices/headset_dev_AC_80_0A_2E_C9_07" - spacing: 2 - layoutDirection: Qt.RightToLeft - Class.BottombarText { - // text: UPower.devices["jotm"].percentage + "%" - text:"placeholder!" - } -}
D bar/modules/LaptopBattery.qml

@@ -1,16 +0,0 @@

-//LaptopBattery.qml -import QtQuick -import Quickshell -import QtQuick.Layouts -import Quickshell.Services.UPower -import ".." -import "../classes" as Class - -RowLayout { - id: laptop_battery - spacing:2 - layoutDirection: Qt.RightToLeft - Class.BottombarText { - text: UPower.displayBattery.percentage + "%" - } -}
D bar/modules/MegaPlaceholder.qml

@@ -1,40 +0,0 @@

-// MegaPlaceholder.qml -import QtQuick -import Quickshell -import QtQuick.Layouts -import "../../" -import "../classes" as Class - -RowLayout { - spacing: 2 - layoutDirection: Qt.RightToLeft - Class.TopbarIcon { - text: "" - color: Resources.palette.grey - } - Class.TopSep{ - color: Resources.palette.grey - } - Class.TopbarText { - text: " 20%" - color: Resources.palette.grey - } - Class.TopbarIcon { - text: Resources.icons.ram - color: Resources.palette.grey - } - Class.TopSep{ - color: Resources.palette.grey - } - Class.TopbarText { - text: "do all the things" - color: Resources.palette.grey - } - Class.TopbarIcon { - text: Resources.icons.tasklist - color: Resources.palette.grey - } - Class.TopSep{ - color: Resources.palette.grey - } -}
A bar/modules/Moonphase.qml

@@ -0,0 +1,34 @@

+// Moonphase.qml TODO +import QtQuick +import Quickshell +import Quickshell.Io +import QtQuick.Layouts +import "../../" +import "../classes" as Class + +Class.RightRowLayout { + Class.TopbarText { + id: moonphase + color: Resources.palette.saffron + + Process { + id: moonphase_script + command: ["bar/scripts/moon.sh"] + workingDirectory: Quickshell.shellDir + + running: true + stdout: StdioCollector { + onStreamFinished: moonphase.text = this.text.trim() + } + } + + Timer { + interval: 10000 + running: true + repeat: true + onTriggered: moonphase_script.running = true + } + } + Class.TopSep {} +} +
A bar/modules/Network.qml

@@ -0,0 +1,12 @@

+//Network.qml +import QtQuick +import Quickshell +import QtQuick.Layouts +import Quickshell.Services.UPower +import "../.." +import "../classes" as Class + +Class.BottombarIcon { + text: Icons.network.crossed_empty +" MI_10023" + color: Resources.palette.grey +}
M bar/modules/Ram.qmlbar/modules/Ram.qml

@@ -1,7 +1,37 @@

-// Ram.qml +// Ram.qml TODO import QtQuick import Quickshell import Quickshell.Io import QtQuick.Layouts import "../../" import "../classes" as Class + +Class.RightRowLayout { + id: ram_module + Class.TopbarText { + id: ram + // Layout.alignment: Qt.AlignBottom + // anchors.bottom: ram_module.top + Process { + id: ram_script + command: ["bar/scripts/ram.sh"] + workingDirectory: Quickshell.shellDir + running: true + stdout: StdioCollector { + onStreamFinished: ram.text = this.text.trim() +"%" + } + } + + Timer { + interval: 1000 + running: true + repeat: true + onTriggered: ram_script.running = true + } + } + Class.TopbarIcon { + text: Icons.modules.ram + } + Class.TopSep {} +} +
M bar/modules/Sunset.qmlbar/modules/Sunset.qml

@@ -1,27 +1,24 @@

-// Timedate.qml +// Sunset.qml import QtQuick import Quickshell import Quickshell.Io import QtQuick.Layouts import "../../" import "../classes" as Class -// import "../scripts/suntime.sh" as Sunset -RowLayout { - spacing: 2 - layoutDirection: Qt.RightToLeft - +Class.RightRowLayout { + id: sunset_module Class.TopbarText { id: sunset - color: Resources.palette.scarlet - + // Layout.alignment: Qt.AlignBottom + // anchors.bottom: sunset_module.top Process { id: sunset_script - command: ["sh","suntime.sh"] + command: ["bar/scripts/suntime.sh"] + workingDirectory: Quickshell.shellDir running: true stdout: StdioCollector { - // onStreamFinished: sunset.text = this.text - onStreamFinished: sunset.text = this.text + onStreamFinished: sunset.text = this.text.trim() } }

@@ -33,9 +30,7 @@ onTriggered: sunset_script.running = true

} } Class.TopbarIcon { - text: Resources.icons.sunset - color: Resources.palette.scarlet - } - Class.TopSep { + text: Icons.modules.sunset } + Class.TopSep {} }
A bar/modules/Taskwarrior.qml

@@ -0,0 +1,38 @@

+// taskwarrior.qml +import QtQuick +import Quickshell +import Quickshell.Io +import QtQuick.Layouts +import "../../" +import "../classes" as Class + +Class.RightRowLayout { + id: taskwarrior_module + Class.TopbarText { + id: taskwarrior + // Layout.alignment: Qt.AlignBottom + // anchors.bottom: taskwarrior_module.top + Process { + id: taskwarrior_script + command: ["task", "rc.verbose:", "rc.report.next.columns:description", "rc.report.next.labels:1", "limit:1 next"] + workingDirectory: Quickshell.shellDir + running: true + stdout: StdioCollector { + onStreamFinished: taskwarrior.text = this.text.trim() + } + } + + Timer { + interval: 1000 + running: true + repeat: true + onTriggered: taskwarrior_script.running = true + } + } + Class.TopbarIcon { + text: Icons.modules.tasklist + } + Class.TopSep {} +} + +// "task", "rc.verbose:", "rc.report.next.columns:description", "rc.report.next.labels:1", "limit:1 next"
M bar/modules/Timedate.qmlbar/modules/Timedate.qml

@@ -5,10 +5,9 @@ import QtQuick.Layouts

import ".." import "../classes" as Class -RowLayout { +Class.RightRowLayout { id: timedate - spacing: 2 - layoutDirection: Qt.RightToLeft + Class.TopbarText { id: time text: Qt.formatDateTime(clock.date, "hh:mm")

@@ -18,9 +17,10 @@ Class.TopbarText {

id: date text: Qt.formatDateTime(clock.date, "MMM dd") } - Class.TopSep {} SystemClock { id: clock precision: SystemClock.Seconds } + Class.TopSep{} + }
M bar/modules/Volume.qmlbar/modules/Volume.qml

@@ -1,27 +1,46 @@

// Volume.qml import QtQuick import Quickshell +import QtQuick.Controls.Basic import QtQuick.Layouts import Quickshell.Services.Pipewire import "../classes" as Class import "../../" -RowLayout { - id: volume - spacing:2 - layoutDirection: Qt.RightToLeft - Layout.alignment: Qt.AlignVCenter +Button { PwObjectTracker { objects: [ Pipewire.defaultAudioSink ] } - Class.TopbarText { - id: vol_indicator - text: Math.round((Pipewire.defaultAudioSink?.audio.volume ?? 0) * 100) + "%" + padding: 0 + onClicked: Pipewire.defaultAudioSink.audio.muted = !Pipewire.defaultAudioSink.audio.muted + background: Rectangle { + // implicitWidth: 0 + // implicitHeight: 0 + color: Resources.palette.bg } - Class.TopbarIcon { - id: vol_icon - text: Resources.icons.volume //TODO make icon change based on volume levels - rightPadding: 4 +contentItem: Class.RightRowLayout { + id: volume_module + Layout.alignment: Qt.AlignVCenter + Class.TopbarText { + id: volume_indicator + property var vol: Math.round((Pipewire.defaultAudioSink?.audio.volume ?? 0) * 100) + text: (Pipewire.defaultAudioSink?.audio.muted) ? "" :vol + "%" + color: (Pipewire.defaultAudioSink?.audio.muted) ? Resources.palette.grey : Resources.palette.fg + } + Class.TopbarIcon { + text: if (Pipewire.defaultAudioSink?.audio.muted) { + Icons.volume.mute + } else if (volume_indicator.vol == 0) { + Icons.volume.off + } else if (volume_indicator.vol <= 50) { + Icons.volume.low + } else if (volume_indicator.vol > 50) { + Icons.volume.high + } else { + Icons.volume.low + } + color: (Pipewire.defaultAudioSink?.audio.muted) ? Resources.palette.scarlet : Resources.palette.orange + } + Class.TopSep{} } - Class.TopSep {} }
M bar/modules/Workspaces.qmlbar/modules/Workspaces.qml

@@ -6,19 +6,29 @@ import QtQuick.Layouts

import "../classes" as Class import "../../" RowLayout { - spacing: 8 + spacing: 0 id: workspaces - Layout.alignment: Qt.alignVCenter | Qt.alignLeft - // anchors.left: parent.left - // anchors.verticalCenter: parent.verticalCenter - property var ws_list: I3.workspaces.values property var ws_focused: I3.focusedWorkspace?.number Repeater { - model: parent.ws_list - Text { - id: wsLabel - text: (modelData.name == "12") ? Resources.icons.volume_mixer : (modelData.name == "11") ? Resources.icons.download : modelData.name - color: (modelData.name == ws_focused) ? Resources.palette.orange : Resources.palette.fg + model: I3.workspaces.values + Button { + padding: 2 + onClicked: I3.dispatch(`workspace number `+modelData.number); + background: Rectangle { + implicitWidth: 6 + implicitHeight: 8 + color: (modelData.name == ws_focused) ? Resources.palette.orange : Resources.palette.bg + } + contentItem: Text { + id: wsLabel + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: ({ + "11": Icons.workspaces.download, + "12": Icons.workspaces.volume_mixer + })[modelData.name] ?? modelData.name + color: (modelData.name == ws_focused) ? Resources.palette.bg : Resources.palette.fg + } } } }
M bar/scripts/moon.shbar/scripts/moon.sh

@@ -1,4 +1,4 @@

-#!/usr/bin/env bash +#!/bin/sh moon-phases -t # cargo install moon-phases
A bar/scripts/ram.sh

@@ -0,0 +1,2 @@

+#!/usr/bin/env bash +free -m | grep Mem | awk '{print ($3/$2)*100}' | tr '.' ' ' | awk '{print $1}'
M bar/scripts/suntime.shbar/scripts/suntime.sh

@@ -1,4 +1,4 @@

-#! /bin/sh +#!/bin/bash if [ ! -e '~/.location' ]; then coordinates=$(cat ~/.location) else
M shell.qmlshell.qml

@@ -1,3 +1,4 @@

+//@ pragma Env QT_QPA_PLATFORM=wayland //@ pragma Env QT_QPA_PLATFORM=wayland import Quickshell import Quickshell.Io