diff --git a/Services/FocusedWindowService.qml b/Services/FocusedWindowService.qml index bbfb9c03..101525a9 100644 --- a/Services/FocusedWindowService.qml +++ b/Services/FocusedWindowService.qml @@ -44,35 +44,8 @@ Singleton { function getDisplayName(appId) { if (!appId) return ""; - - const appNames = { - "com.mitchellh.ghostty": "Ghostty", - "org.mozilla.firefox": "Firefox", - "org.gnome.Nautilus": "Files", - "org.gnome.TextEditor": "Text Editor", - "com.google.Chrome": "Chrome", - "org.telegram.desktop": "Telegram", - "com.spotify.Client": "Spotify", - "org.kde.konsole": "Konsole", - "org.gnome.Terminal": "Terminal", - "code": "VS Code", - "code-oss": "VS Code", - "org.mozilla.Thunderbird": "Thunderbird", - "org.libreoffice.LibreOffice": "LibreOffice", - "org.gimp.GIMP": "GIMP", - "org.blender.Blender": "Blender", - "discord": "Discord", - "slack": "Slack", - "zoom": "Zoom" - }; - if (appNames[appId]) - return appNames[appId]; - - - let cleanName = appId.replace(/^(org\.|com\.|net\.|io\.)/, '').replace(/\./g, ' ').split(' ').map((word) => { - return word.charAt(0).toUpperCase() + word.slice(1); - }).join(' '); - return cleanName; + const desktopEntry = DesktopEntries.byId(appId); + return desktopEntry && desktopEntry.name ? desktopEntry.name : ""; } Component.onCompleted: { diff --git a/Services/SysMonitorService.qml b/Services/SysMonitorService.qml index ff01bb24..50aa2a04 100644 --- a/Services/SysMonitorService.qml +++ b/Services/SysMonitorService.qml @@ -358,6 +358,10 @@ Singleton { return (mem / (1024 * 1024)).toFixed(1) + " GB"; } + function getCpuTempCentigrade() { + cpuTempProcess.running = true; + } + Timer { id: updateTimer interval: root.updateInterval @@ -589,4 +593,18 @@ printf "}\\n"` } } } + + Process { + id: cpuTempProcess + command: ["bash", "-c", "grep -l 'coretemp\\|k10temp\\|k8temp\\|cpu_thermal\\|soc_thermal' /sys/class/hwmon/hwmon*/name | sed 's/name$/temp1_input/' | xargs cat | awk '{print $1/1000}'"] + running: false + stdout: StdioCollector { + onStreamFinished: { + const temp = parseFloat(text.trim()); + if (!isNaN(temp)) { + cpuTemperature = temp; + } + } + } + } } \ No newline at end of file