Skip to content

Commit 16a1485

Browse files
committed
Block style UX
1 parent 94b9124 commit 16a1485

5 files changed

Lines changed: 109 additions & 73 deletions

File tree

dot_files/quickshell/modules/bar/StatusBar.qml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ PanelWindow {
4747
return "NORMAL"
4848
}
4949

50+
// Display text for mode indicator (shows all active workspaces when in NORMAL mode)
51+
property string modeDisplayText: currentMode === "NORMAL" ? Services.Hyprland.allWorkspaces : currentMode
52+
5053
property color modeColor: {
5154
if (currentMode === "NORMAL") return Common.Appearance.colors.modeNormal
5255
if (currentMode === "APPS" || currentMode === "UPDATES") return Common.Appearance.colors.modeInsert
@@ -192,7 +195,7 @@ PanelWindow {
192195
anchors.left: parent.left
193196
anchors.right: parent.right
194197
anchors.bottom: parent.bottom
195-
height: 1
198+
height: 0
196199
color: Common.Appearance.colors.border
197200
}
198201
}
@@ -216,7 +219,7 @@ PanelWindow {
216219
Text {
217220
id: modeText
218221
anchors.centerIn: parent
219-
text: root.currentMode
222+
text: root.modeDisplayText
220223
font.family: Common.Appearance.fonts.mono
221224
font.pixelSize: Common.Appearance.fontSize.small
222225
font.bold: true
@@ -296,7 +299,7 @@ PanelWindow {
296299
// Separator after left section
297300
Rectangle {
298301
visible: root.isLeftmost
299-
width: 1
302+
width: 0
300303
height: parent.height
301304
color: Common.Appearance.colors.border
302305
}
@@ -313,7 +316,7 @@ PanelWindow {
313316
// Separator before right section
314317
Rectangle {
315318
visible: root.isRightmost
316-
width: 1
319+
width: 0
317320
height: parent.height
318321
color: Common.Appearance.colors.border
319322
}
@@ -424,7 +427,7 @@ PanelWindow {
424427
// Separator
425428
Rectangle {
426429
visible: root.isRightmost && SystemTray.items.length > 0
427-
width: 1
430+
width: 0
428431
height: parent.height
429432
color: Common.Appearance.colors.border
430433
}
@@ -534,7 +537,7 @@ PanelWindow {
534537
// Separator before clock
535538
Rectangle {
536539
visible: root.isRightmost
537-
width: 1
540+
width: 0
538541
height: parent.height
539542
color: Common.Appearance.colors.border
540543
}
@@ -651,7 +654,7 @@ PanelWindow {
651654
// Separator before power
652655
Rectangle {
653656
visible: root.isRightmost
654-
width: 1
657+
width: 0
655658
height: parent.height
656659
color: Common.Appearance.colors.border
657660
}

dot_files/quickshell/modules/sidebars/SidebarLeft.qml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ PanelWindow {
2121
left: true
2222
}
2323

24-
margins.top: Common.Appearance.sizes.barHeight + Common.Appearance.spacing.small
2524
margins.bottom: Common.Appearance.spacing.small
26-
margins.left: Common.Appearance.spacing.small
2725

2826
implicitWidth: Common.Appearance.sizes.sidebarWidth
2927
color: "transparent"
@@ -43,13 +41,6 @@ PanelWindow {
4341
// TUI Panel container
4442
Common.TuiPanel {
4543
anchors.fill: parent
46-
title: Root.GlobalStates.sidebarLeftView === "apps" ? "[ Applications ]" : "[ System Updates ]"
47-
keyHints: [
48-
{ key: "Esc", action: "close" },
49-
{ key: "/", action: "search" },
50-
{ key: "j/k", action: "navigate" },
51-
{ key: "Enter", action: "select" }
52-
]
5344

5445
// Application View
5546
Loader {

dot_files/quickshell/modules/sidebars/SidebarRight.qml

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ PanelWindow {
2121
right: true
2222
}
2323

24-
margins.top: Common.Appearance.sizes.barHeight + Common.Appearance.spacing.small
2524
margins.bottom: Common.Appearance.spacing.small
26-
margins.right: Common.Appearance.spacing.small
2725

2826
implicitWidth: Common.Appearance.sizes.sidebarWidth
2927
color: "transparent"
@@ -34,64 +32,9 @@ PanelWindow {
3432
WlrLayershell.layer: WlrLayer.Overlay
3533
WlrLayershell.namespace: "sidebar"
3634

37-
// Get title based on current view
38-
property string viewTitle: {
39-
switch (Root.GlobalStates.sidebarRightView) {
40-
case "network": return "[ Network ]"
41-
case "bluetooth": return "[ Bluetooth ]"
42-
case "audio": return "[ Audio ]"
43-
case "calendar": return "[ Calendar ]"
44-
case "notifications": return "[ Notifications ]"
45-
case "power": return "[ Power ]"
46-
case "weather": return "[ Weather ]"
47-
default: return "[ Settings ]"
48-
}
49-
}
50-
51-
// Get keyboard hints based on current view
52-
property var viewHints: {
53-
switch (Root.GlobalStates.sidebarRightView) {
54-
case "network":
55-
return [
56-
{ key: "Esc", action: "close" },
57-
{ key: "j/k", action: "navigate" },
58-
{ key: "Enter", action: "connect" }
59-
]
60-
case "bluetooth":
61-
return [
62-
{ key: "Esc", action: "close" },
63-
{ key: "j/k", action: "navigate" },
64-
{ key: "Enter", action: "pair" }
65-
]
66-
case "audio":
67-
return [
68-
{ key: "Esc", action: "close" },
69-
{ key: "m", action: "mute" },
70-
{ key: "+/-", action: "volume" }
71-
]
72-
case "notifications":
73-
return [
74-
{ key: "Esc", action: "close" },
75-
{ key: "d", action: "dismiss" },
76-
{ key: "D", action: "clear all" }
77-
]
78-
case "power":
79-
return [
80-
{ key: "Esc", action: "close" },
81-
{ key: "s", action: "suspend" },
82-
{ key: "r", action: "reboot" },
83-
{ key: "p", action: "poweroff" }
84-
]
85-
default:
86-
return [{ key: "Esc", action: "close" }]
87-
}
88-
}
89-
9035
// TUI Panel container
9136
Common.TuiPanel {
9237
anchors.fill: parent
93-
title: root.viewTitle
94-
keyHints: root.viewHints
9538

9639
// Network View
9740
Loader {
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
pragma Singleton
2+
3+
import QtQuick
4+
import Quickshell
5+
import Quickshell.Io
6+
7+
// Hyprland workspace tracking service
8+
Singleton {
9+
id: root
10+
11+
// Map of monitor name -> active workspace info
12+
property var workspaces: ({})
13+
14+
// Revision counter to force binding updates
15+
property int revision: 0
16+
17+
// All active workspaces as a formatted string (e.g., "1 | 3")
18+
property string allWorkspaces: {
19+
void revision // Force re-evaluation
20+
let ids = []
21+
for (const mon in workspaces) {
22+
if (workspaces[mon] && workspaces[mon].id) {
23+
ids.push(workspaces[mon].id)
24+
}
25+
}
26+
ids.sort((a, b) => a - b)
27+
return ids.length > 0 ? ids.join(" | ") : "1"
28+
}
29+
30+
// Get workspace ID as string for a specific monitor
31+
// Note: Include revision in bindings to ensure updates: Services.Hyprland.revision, Services.Hyprland.getWorkspace(...)
32+
function getWorkspace(monitorName: string): string {
33+
if (workspaces[monitorName]) {
34+
// Prefer numeric ID over name (names can be things like "DP-1" in some configs)
35+
return String(workspaces[monitorName].id)
36+
}
37+
return "1"
38+
}
39+
40+
// Get workspace ID for a specific monitor
41+
function getWorkspaceId(monitorName: string): int {
42+
if (workspaces[monitorName]) {
43+
return workspaces[monitorName].id || 1
44+
}
45+
return 1
46+
}
47+
48+
// Query monitors to get active workspaces
49+
Process {
50+
id: monitorProcess
51+
command: ["hyprctl", "monitors", "-j"]
52+
53+
property string output: ""
54+
55+
stdout: SplitParser {
56+
splitMarker: ""
57+
onRead: data => {
58+
monitorProcess.output += data
59+
}
60+
}
61+
62+
onExited: {
63+
try {
64+
const monitors = JSON.parse(monitorProcess.output)
65+
let newWorkspaces = {}
66+
67+
for (const mon of monitors) {
68+
if (mon.activeWorkspace) {
69+
newWorkspaces[mon.name] = {
70+
id: mon.activeWorkspace.id,
71+
name: mon.activeWorkspace.name
72+
}
73+
}
74+
}
75+
76+
root.workspaces = newWorkspaces
77+
root.revision++
78+
} catch (e) {
79+
console.log("Failed to parse monitor workspace data:", e)
80+
}
81+
monitorProcess.output = ""
82+
}
83+
}
84+
85+
// Refresh workspace data
86+
function refresh() {
87+
monitorProcess.running = true
88+
}
89+
90+
// Poll for workspace changes
91+
Timer {
92+
interval: 250
93+
running: true
94+
repeat: true
95+
triggeredOnStart: true
96+
onTriggered: root.refresh()
97+
}
98+
}

dot_files/quickshell/services/qmldir

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ singleton Notifications 1.0 Notifications.qml
1212
singleton Power 1.0 Power.qml
1313
singleton Privacy 1.0 Privacy.qml
1414
singleton Updates 1.0 Updates.qml
15+
singleton Hyprland 1.0 Hyprland.qml
1516
singleton Weather 1.0 Weather.qml
1617
singleton Windows 1.0 Windows.qml

0 commit comments

Comments
 (0)