summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbh <qn+git@epicurus.dev>2026-04-17 23:27:29 +0800
committerbh <qn+git@epicurus.dev>2026-04-17 23:28:35 +0800
commit4b3c69834ba263ff527f323cd988959d791fd74a (patch)
tree9686dea9d4c9f011e71e91c8a22e39ec14963a7b
parent52a055967080efcf17032840baa0192cfed7efa8 (diff)
quickshell: stop hardcoding the window name clamping logic
-rw-r--r--packages.txt1
-rw-r--r--quickshell/.config/quickshell/shell.qml10
2 files changed, 6 insertions, 5 deletions
diff --git a/packages.txt b/packages.txt
index f804104..c6a5707 100644
--- a/packages.txt
+++ b/packages.txt
@@ -43,6 +43,7 @@ cmake
ninja
clang
gcc
+musl
rust
go
zig
diff --git a/quickshell/.config/quickshell/shell.qml b/quickshell/.config/quickshell/shell.qml
index 1281878..a64a472 100644
--- a/quickshell/.config/quickshell/shell.qml
+++ b/quickshell/.config/quickshell/shell.qml
@@ -62,6 +62,7 @@ PanelWindow {
// ║ 🏢 CENTER: WORKSPACES ║
// ╚══════════════════════════════════════════════════════════════╝
RowLayout {
+ id: workspacesRow
anchors.centerIn: parent
spacing: 12
@@ -257,6 +258,7 @@ PanelWindow {
// ── 🪟 Window Title ───────────────────────────────────────
Rectangle {
+ id: windowModule
color: root.bg2
Layout.fillHeight: true
implicitWidth: windowRow.implicitWidth + 16
@@ -278,11 +280,9 @@ PanelWindow {
color: root.fg
font.family: "Source Code Pro"
font.pixelSize: 14
- text: {
- var title = Hyprland.activeToplevel?.title ?? ""
- if (title.length > 50) return title.substring(0, 47) + "..."
- return title
- }
+ property string fullTitle: Hyprland.activeToplevel?.title ?? ""
+ property int maxChars: Math.max(5, Math.floor((workspacesRow.x - windowModule.x - 80) / 8))
+ text: fullTitle.length > maxChars ? fullTitle.substring(0, maxChars - 3) + "..." : fullTitle
}
}
}