From 9067a68703ecdef466161dcf13250fa2e0a824cc Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Tue, 29 Jul 2025 13:37:26 +0200 Subject: [PATCH 1/2] Workspace fix (veeeeery sure it is fixed) --- Services/WorkspaceManager.qml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Services/WorkspaceManager.qml b/Services/WorkspaceManager.qml index b5dc29c..5df82e3 100644 --- a/Services/WorkspaceManager.qml +++ b/Services/WorkspaceManager.qml @@ -50,10 +50,11 @@ Singleton { // Initialize Hyprland integration function initHyprland() { - try { + try { + // Fixes the odd workspace issue. Hyprland.refreshWorkspaces(); - hlWorkspaces = Hyprland.workspaces.values; - updateHyprlandWorkspaces(); + // hlWorkspaces = Hyprland.workspaces.values; + // updateHyprlandWorkspaces(); return true; } catch (e) { console.error("Error initializing Hyprland:", e); @@ -149,4 +150,4 @@ Singleton { console.warn("No supported compositor detected for workspace switching"); } } -} +} \ No newline at end of file From 6d0ad0da5eb221c30262ebda5c97b946f5200369 Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Tue, 29 Jul 2025 15:01:37 +0200 Subject: [PATCH 2/2] Fix issue #45 (WiFi) probably --- Widgets/Sidebar/Panel/WifiPanel.qml | 70 ++++++++++++++--------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/Widgets/Sidebar/Panel/WifiPanel.qml b/Widgets/Sidebar/Panel/WifiPanel.qml index 7a45f31..008a3c1 100644 --- a/Widgets/Sidebar/Panel/WifiPanel.qml +++ b/Widgets/Sidebar/Panel/WifiPanel.qml @@ -90,14 +90,12 @@ Item { property string connectSecurity: "" property var pendingConnect: null property string detectedInterface: "" - property var connectionsToDelete: [] function profileNameForSsid(ssid) { return "quickshell-" + ssid.replace(/[^a-zA-Z0-9]/g, "_"); } - function disconnectAndDeleteNetwork(ssid) { + function disconnectNetwork(ssid) { var profileName = wifiLogic.profileNameForSsid(ssid); - console.log('WifiPanel: disconnectAndDeleteNetwork called for SSID', ssid, 'profile', profileName); disconnectProfileProcess.connectionName = profileName; disconnectProfileProcess.running = true; } @@ -129,6 +127,9 @@ Item { wifiLogic.pendingConnect = null; } } + function isSecured(security) { + return security && security.trim() !== "" && security.trim() !== "--"; + } } // Disconnect, delete profile, refresh @@ -137,18 +138,6 @@ Item { property string connectionName: "" running: false command: ["nmcli", "connection", "down", "id", connectionName] - onRunningChanged: { - if (!running) { - deleteProfileProcess.connectionName = connectionName; - deleteProfileProcess.running = true; - } - } - } - Process { - id: deleteProfileProcess - property string connectionName: "" - running: false - command: ["nmcli", "connection", "delete", "id", connectionName] onRunningChanged: { if (!running) { wifiLogic.refreshNetworks(); @@ -159,24 +148,43 @@ Item { Process { id: listConnectionsProcess running: false - command: ["nmcli", "-t", "-f", "NAME,SSID", "connection", "show"] + command: ["nmcli", "-t", "-f", "NAME", "connection", "show"] stdout: StdioCollector { onStreamFinished: { var params = wifiLogic.pendingConnect; var lines = text.split("\n"); - var toDelete = []; + var expectedProfile = wifiLogic.profileNameForSsid(params.ssid); + var foundProfile = null; for (var i = 0; i < lines.length; ++i) { - var parts = lines[i].split(":"); - if (parts.length === 2 && parts[1] === params.ssid) { - toDelete.push(parts[0]); + if (lines[i] === expectedProfile) { + foundProfile = lines[i]; + break; } } - wifiLogic.connectionsToDelete = toDelete; - if (toDelete.length > 0) { - deleteProfileProcess.connectionName = toDelete[0]; - deleteProfileProcess.running = true; + if (foundProfile) { + // Profile exists, just bring it up (no password prompt) + upConnectionProcess.profileName = foundProfile; + upConnectionProcess.running = true; } else { - wifiLogic.doConnect(); + // No profile: check if secured + if (wifiLogic.isSecured(params.security)) { + if (params.password && params.password.length > 0) { + // Password provided, proceed to connect + wifiLogic.doConnect(); + } else { + // No password yet, prompt for it + wifiLogic.passwordPromptSsid = params.ssid; + wifiLogic.passwordInput = ""; + wifiLogic.showPasswordPrompt = true; + wifiLogic.connectStatus = ""; + wifiLogic.connectStatusSsid = ""; + wifiLogic.connectError = ""; + wifiLogic.connectSecurity = params.security; + } + } else { + // Open, connect directly + wifiLogic.doConnect(); + } } } } @@ -565,17 +573,9 @@ Item { hoverEnabled: true onClicked: { if (modelData.connected) { - wifiLogic.disconnectAndDeleteNetwork(modelData.ssid); - } else if (modelData.security && modelData.security !== "--") { - wifiLogic.passwordPromptSsid = modelData.ssid; - wifiLogic.passwordInput = ""; - wifiLogic.showPasswordPrompt = true; - wifiLogic.connectStatus = ""; - wifiLogic.connectStatusSsid = ""; - wifiLogic.connectError = ""; - wifiLogic.connectSecurity = modelData.security; + wifiLogic.disconnectNetwork(modelData.ssid); } else { - wifiLogic.connectNetwork(modelData.ssid, modelData.security) + wifiLogic.connectNetwork(modelData.ssid, modelData.security); } } }