Skip to content

Commit 44fd0d8

Browse files
committed
System updates
1 parent 45dc201 commit 44fd0d8

6 files changed

Lines changed: 531 additions & 18 deletions

File tree

dot_files/quickshell/GlobalStates.qml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ Singleton {
118118
property bool sidebarLeftOpen: false
119119
property bool sidebarRightOpen: false
120120

121+
// Left sidebar view mode: "apps", "updates"
122+
property string sidebarLeftView: "apps"
123+
121124
// Right sidebar view mode: "default", "bluetooth", "audio", "calendar", "notifications"
122125
property string sidebarRightView: "default"
123126

@@ -183,11 +186,14 @@ Singleton {
183186
}
184187

185188
// Function to toggle panels (accepts screen to show on)
186-
function toggleSidebarLeft(screen) {
187-
if (sidebarLeftOpen && activeScreen === screen) {
189+
function toggleSidebarLeft(screen, view) {
190+
const targetView = view || "apps"
191+
if (sidebarLeftOpen && activeScreen === screen && sidebarLeftView === targetView) {
188192
sidebarLeftOpen = false
193+
sidebarLeftView = "apps"
189194
} else {
190195
activeScreen = screen
196+
sidebarLeftView = targetView
191197
sidebarLeftOpen = true
192198
}
193199
}
@@ -207,6 +213,7 @@ Singleton {
207213
function closeAll() {
208214
sidebarLeftOpen = false
209215
sidebarRightOpen = false
216+
sidebarLeftView = "apps"
210217
sidebarRightView = "default"
211218
settingsOpen = false
212219
}

dot_files/quickshell/modules/bar/StatusBar.qml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ PanelWindow {
4949
Rectangle {
5050
anchors.fill: parent
5151
radius: Common.Appearance.rounding.small
52-
color: button.highlighted
53-
? Common.Appearance.m3colors.primaryContainer
54-
: (button.containsMouse
55-
? Common.Appearance.m3colors.surfaceVariant
56-
: "transparent")
52+
color: button.containsMouse
53+
? Common.Appearance.m3colors.surfaceVariant
54+
: "transparent"
5755

5856
Behavior on color {
5957
ColorAnimation { duration: 150 }
@@ -70,7 +68,7 @@ PanelWindow {
7068
name: button.icon
7169
size: Common.Appearance.sizes.iconMedium
7270
color: button.highlighted
73-
? Common.Appearance.m3colors.onPrimaryContainer
71+
? Common.Appearance.m3colors.primary
7472
: button.textColor
7573
}
7674

@@ -80,7 +78,7 @@ PanelWindow {
8078
font.family: Common.Appearance.fonts.main
8179
font.pixelSize: Common.Appearance.fontSize.normal
8280
color: button.highlighted
83-
? Common.Appearance.m3colors.onPrimaryContainer
81+
? Common.Appearance.m3colors.primary
8482
: button.textColor
8583
}
8684
}
@@ -141,7 +139,20 @@ PanelWindow {
141139
visible: root.isLeftmost
142140
icon: Common.Icons.icons.apps
143141
tooltip: "Applications"
144-
onClicked: Root.GlobalStates.toggleSidebarLeft(root.targetScreen)
142+
onClicked: Root.GlobalStates.toggleSidebarLeft(root.targetScreen, "apps")
143+
}
144+
145+
// Updates button (only on leftmost screen, shows indicator when attention needed)
146+
BarButton {
147+
visible: root.isLeftmost
148+
icon: Services.Updates.needsAttention
149+
? Common.Icons.icons.download
150+
: Common.Icons.icons.checkCircle
151+
tooltip: Services.Updates.preinstallCompleted
152+
? Services.Updates.summary()
153+
: "Setup required"
154+
highlighted: Services.Updates.needsAttention
155+
onClicked: Root.GlobalStates.toggleSidebarLeft(root.targetScreen, "updates")
145156
}
146157

147158
// Spacer

dot_files/quickshell/modules/common/Config.qml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ Singleton {
6262
launcher: {
6363
maxResults: 50,
6464
showCategories: true
65+
},
66+
system: {
67+
preinstallCompleted: false
6568
}
6669
})
6770

@@ -108,6 +111,9 @@ Singleton {
108111
property int launcherMaxResults: defaults.launcher.maxResults
109112
property bool launcherShowCategories: defaults.launcher.showCategories
110113

114+
// System settings
115+
property bool preinstallCompleted: defaults.system.preinstallCompleted
116+
111117
// Load config synchronously at startup
112118
FileView {
113119
id: configFile
@@ -198,6 +204,11 @@ Singleton {
198204
launcherShowCategories = config.launcher.showCategories ?? launcherShowCategories
199205
}
200206

207+
// System
208+
if (config.system) {
209+
preinstallCompleted = config.system.preinstallCompleted ?? preinstallCompleted
210+
}
211+
201212
console.log("Config: Loaded from", root.configPath)
202213
} catch (e) {
203214
console.error("Config: Failed to parse:", e)
@@ -266,6 +277,9 @@ Singleton {
266277
addIfChanged(config, "launcher", "maxResults", launcherMaxResults, defaults.launcher.maxResults)
267278
addIfChanged(config, "launcher", "showCategories", launcherShowCategories, defaults.launcher.showCategories)
268279

280+
// System
281+
addIfChanged(config, "system", "preinstallCompleted", preinstallCompleted, defaults.system.preinstallCompleted)
282+
269283
// Only write if there are changes
270284
if (Object.keys(config).length === 0) {
271285
console.log("Config: No changes from defaults, skipping save")

dot_files/quickshell/modules/sidebars/SidebarLeft.qml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,19 @@ PanelWindow {
4444
)
4545
}
4646

47-
// Application View (default and only view for now)
47+
// Application View (shown when sidebarLeftView === "apps")
4848
Loader {
4949
anchors.fill: parent
5050
anchors.margins: Common.Appearance.spacing.medium
51-
active: Root.GlobalStates.sidebarLeftOpen
51+
active: Root.GlobalStates.sidebarLeftView === "apps"
5252
source: "ApplicationView.qml"
5353
}
54+
55+
// Update View (shown when sidebarLeftView === "updates")
56+
Loader {
57+
anchors.fill: parent
58+
anchors.margins: Common.Appearance.spacing.medium
59+
active: Root.GlobalStates.sidebarLeftView === "updates"
60+
source: "UpdateView.qml"
61+
}
5462
}

0 commit comments

Comments
 (0)