autoformatting
This commit is contained in:
parent
d30e14f611
commit
50ddd2916c
3 changed files with 55 additions and 53 deletions
|
|
@ -145,7 +145,6 @@ Singleton {
|
||||||
widget.use12HourClock = widget.use12HourClock !== undefined ? widget.use12HourClock : adapter.location.use12HourClock
|
widget.use12HourClock = widget.use12HourClock !== undefined ? widget.use12HourClock : adapter.location.use12HourClock
|
||||||
widget.reverseDayMonth = widget.reverseDayMonth !== undefined ? widget.reverseDayMonth : adapter.location.reverseDayMonth
|
widget.reverseDayMonth = widget.reverseDayMonth !== undefined ? widget.reverseDayMonth : adapter.location.reverseDayMonth
|
||||||
if (widget.showDate !== undefined) {
|
if (widget.showDate !== undefined) {
|
||||||
console.log("HELLLO")
|
|
||||||
widget.displayFormat = "time-date"
|
widget.displayFormat = "time-date"
|
||||||
} else if (widget.showSeconds) {
|
} else if (widget.showSeconds) {
|
||||||
widget.displayFormat = "time-seconds"
|
widget.displayFormat = "time-seconds"
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ RowLayout {
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
smooth: true
|
smooth: true
|
||||||
visible: source !== ""
|
visible: source !== ""
|
||||||
|
|
||||||
// Handle loading errors gracefully
|
// Handle loading errors gracefully
|
||||||
onStatusChanged: {
|
onStatusChanged: {
|
||||||
if (status === Image.Error) {
|
if (status === Image.Error) {
|
||||||
|
|
@ -204,4 +204,4 @@ RowLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ Singleton {
|
||||||
|
|
||||||
// Debounce timer for updates
|
// Debounce timer for updates
|
||||||
property Timer updateTimer: Timer {
|
property Timer updateTimer: Timer {
|
||||||
interval: 50 // 50ms debounce
|
interval: 50 // 50ms debounce
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
try {
|
try {
|
||||||
|
|
@ -101,6 +101,7 @@ Singleton {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
||||||
// Hyprland not available
|
// Hyprland not available
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -134,8 +135,7 @@ Singleton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupHyprlandConnections() {
|
function setupHyprlandConnections() {// Connections are set up at the top level, this function just marks that Hyprland is ready
|
||||||
// Connections are set up at the top level, this function just marks that Hyprland is ready
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateHyprlandWorkspaces() {
|
function updateHyprlandWorkspaces() {
|
||||||
|
|
@ -145,7 +145,7 @@ Singleton {
|
||||||
workspaces.clear()
|
workspaces.clear()
|
||||||
try {
|
try {
|
||||||
const hlWorkspaces = Hyprland.workspaces.values
|
const hlWorkspaces = Hyprland.workspaces.values
|
||||||
|
|
||||||
// Determine occupied workspace ids from current toplevels
|
// Determine occupied workspace ids from current toplevels
|
||||||
const occupiedIds = {}
|
const occupiedIds = {}
|
||||||
try {
|
try {
|
||||||
|
|
@ -165,26 +165,28 @@ Singleton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e2) {
|
} catch (e2) {
|
||||||
|
|
||||||
// ignore occupancy errors; fall back to false
|
// ignore occupancy errors; fall back to false
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0; i < hlWorkspaces.length; i++) {
|
for (var i = 0; i < hlWorkspaces.length; i++) {
|
||||||
const ws = hlWorkspaces[i]
|
const ws = hlWorkspaces[i]
|
||||||
if (!ws) continue
|
if (!ws)
|
||||||
|
continue
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Only append workspaces with id >= 1
|
// Only append workspaces with id >= 1
|
||||||
if (ws.id >= 1) {
|
if (ws.id >= 1) {
|
||||||
workspaces.append({
|
workspaces.append({
|
||||||
"id": i,
|
"id": i,
|
||||||
"idx": ws.id,
|
"idx": ws.id,
|
||||||
"name": ws.name || "",
|
"name": ws.name || "",
|
||||||
"output": ws.monitor?.name || "",
|
"output": ws.monitor?.name || "",
|
||||||
"isActive": ws.active === true,
|
"isActive": ws.active === true,
|
||||||
"isFocused": ws.focused === true,
|
"isFocused": ws.focused === true,
|
||||||
"isUrgent": ws.urgent === true,
|
"isUrgent": ws.urgent === true,
|
||||||
"isOccupied": occupiedIds[ws.id] === true
|
"isOccupied": occupiedIds[ws.id] === true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} catch (workspaceError) {
|
} catch (workspaceError) {
|
||||||
Logger.warn("Compositor", "Error processing workspace at index", i, ":", workspaceError)
|
Logger.warn("Compositor", "Error processing workspace at index", i, ":", workspaceError)
|
||||||
|
|
@ -226,6 +228,7 @@ Singleton {
|
||||||
appId = String(toplevel.appId)
|
appId = String(toplevel.appId)
|
||||||
}
|
}
|
||||||
} catch (propertyError) {
|
} catch (propertyError) {
|
||||||
|
|
||||||
// Ignore property access errors and continue with empty appId
|
// Ignore property access errors and continue with empty appId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -237,6 +240,7 @@ Singleton {
|
||||||
appId = String(ipcData.class || ipcData.initialClass || ipcData.appId || ipcData.wm_class || "")
|
appId = String(ipcData.class || ipcData.initialClass || ipcData.appId || ipcData.wm_class || "")
|
||||||
}
|
}
|
||||||
} catch (ipcError) {
|
} catch (ipcError) {
|
||||||
|
|
||||||
// Ignore errors when accessing lastIpcObject
|
// Ignore errors when accessing lastIpcObject
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -272,13 +276,12 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
windowsList.push({
|
windowsList.push({
|
||||||
"id": windowId,
|
"id": windowId,
|
||||||
"title": windowTitle,
|
"title": windowTitle,
|
||||||
"appId": appId,
|
"appId": appId,
|
||||||
"workspaceId": workspaceId,
|
"workspaceId": workspaceId,
|
||||||
"isFocused": isActivated
|
"isFocused": isActivated
|
||||||
})
|
})
|
||||||
|
|
||||||
} catch (toplevelError) {
|
} catch (toplevelError) {
|
||||||
// Log the error but continue processing other toplevels
|
// Log the error but continue processing other toplevels
|
||||||
Logger.warn("Compositor", "Error processing toplevel at index", i, ":", toplevelError)
|
Logger.warn("Compositor", "Error processing toplevel at index", i, ":", toplevelError)
|
||||||
|
|
@ -351,23 +354,23 @@ Singleton {
|
||||||
|
|
||||||
for (const ws of workspacesData) {
|
for (const ws of workspacesData) {
|
||||||
workspacesList.push({
|
workspacesList.push({
|
||||||
"id": ws.id,
|
"id": ws.id,
|
||||||
"idx": ws.idx,
|
"idx": ws.idx,
|
||||||
"name": ws.name || "",
|
"name": ws.name || "",
|
||||||
"output": ws.output || "",
|
"output": ws.output || "",
|
||||||
"isFocused": ws.is_focused === true,
|
"isFocused": ws.is_focused === true,
|
||||||
"isActive": ws.is_active === true,
|
"isActive": ws.is_active === true,
|
||||||
"isUrgent": ws.is_urgent === true,
|
"isUrgent": ws.is_urgent === true,
|
||||||
"isOccupied": ws.active_window_id ? true : false
|
"isOccupied": ws.active_window_id ? true : false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
workspacesList.sort((a, b) => {
|
workspacesList.sort((a, b) => {
|
||||||
if (a.output !== b.output) {
|
if (a.output !== b.output) {
|
||||||
return a.output.localeCompare(b.output)
|
return a.output.localeCompare(b.output)
|
||||||
}
|
}
|
||||||
return a.idx - b.idx
|
return a.idx - b.idx
|
||||||
})
|
})
|
||||||
|
|
||||||
// Update the workspaces ListModel
|
// Update the workspaces ListModel
|
||||||
workspaces.clear()
|
workspaces.clear()
|
||||||
|
|
@ -472,12 +475,12 @@ Singleton {
|
||||||
const windowsList = []
|
const windowsList = []
|
||||||
for (const win of windowsData) {
|
for (const win of windowsData) {
|
||||||
windowsList.push({
|
windowsList.push({
|
||||||
"id": win.id,
|
"id": win.id,
|
||||||
"title": win.title || "",
|
"title": win.title || "",
|
||||||
"appId": win.app_id || "",
|
"appId": win.app_id || "",
|
||||||
"workspaceId": win.workspace_id || null,
|
"workspaceId": win.workspace_id || null,
|
||||||
"isFocused": win.is_focused === true
|
"isFocused": win.is_focused === true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
windowsList.sort((a, b) => a.id - b.id)
|
windowsList.sort((a, b) => a.id - b.id)
|
||||||
|
|
@ -542,12 +545,12 @@ Singleton {
|
||||||
const windowsList = []
|
const windowsList = []
|
||||||
for (const win of windowsData) {
|
for (const win of windowsData) {
|
||||||
windowsList.push({
|
windowsList.push({
|
||||||
"id": win.id,
|
"id": win.id,
|
||||||
"title": win.title || "",
|
"title": win.title || "",
|
||||||
"appId": win.app_id || "",
|
"appId": win.app_id || "",
|
||||||
"workspaceId": win.workspace_id || null,
|
"workspaceId": win.workspace_id || null,
|
||||||
"isFocused": win.is_focused === true
|
"isFocused": win.is_focused === true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
windowsList.sort((a, b) => a.id - b.id)
|
windowsList.sort((a, b) => a.id - b.id)
|
||||||
|
|
@ -652,4 +655,4 @@ Singleton {
|
||||||
function suspend() {
|
function suspend() {
|
||||||
Quickshell.execDetached(["systemctl", "suspend"])
|
Quickshell.execDetached(["systemctl", "suspend"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue