diff options
Diffstat (limited to 'desktop/Settings.qml')
| -rw-r--r-- | desktop/Settings.qml | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/desktop/Settings.qml b/desktop/Settings.qml index e73445c..2ba8cb6 100644 --- a/desktop/Settings.qml +++ b/desktop/Settings.qml @@ -374,6 +374,7 @@ Scope { + "printf 'memory\\t%s\\n' \"$(sed -n 's/^MemTotal: *\\([0-9]*\\).*/\\1/p' /proc/meminfo)\"\n" + "printf 'hyprland\\t%s\\n' \"$(hyprctl version -j | jq -r .version)\"\n" + "printf 'quickshell\\t%s\\n' \"$(qs --version | cut -d' ' -f2)\"\n" + + "printf 'monitors\\t%s\\n' \"$(hyprctl monitors -j | jq -c .)\"\n" // name-version-arch-build. The version must start // with a digit, so gcc does not also match gcc-g++, // and stops at an underscore, so qt6's snapshot @@ -399,6 +400,24 @@ Scope { return s < 172800 ? Math.floor(s / 3600) + "h" : Math.floor(s / 86400) + "d"; } function pkgs(list) { return list.map(p => [p[0], sys["pkg:" + p[1]] ?? "-"]); } + // One section per monitor, as Hyprland reports them. + // Transforms 4 to 7 are the same turns, flipped. + function monitors() { + let list = []; + try { list = JSON.parse(sys.monitors ?? "[]"); } catch (e) {} + return list.map(m => ({ title: "Monitor " + m.name, rows: [ + ["Make", m.make], + ["Model", m.model], + ["Resolution", m.width + " x " + m.height], + ["Refresh", m.refreshRate.toFixed(2) + " Hz"], + ["Scale", m.scale], + ["Rotation", (m.transform % 4) * 90 + "\u00b0" + (m.transform >= 4 ? ", flipped" : "")], + ["Size", m.physicalWidth > 0 + ? (Math.hypot(m.physicalWidth, m.physicalHeight) / 25.4).toFixed(1) + "\"" + : "-"], + ["Position", m.x + ", " + m.y], + ] })); + } readonly property real now: Date.now() / 1000 readonly property real changelogAge: sys.changelog > 0 ? now - sys.changelog : -1 readonly property var sections: [ @@ -417,7 +436,7 @@ Scope { ] }, { title: "Base libraries", rows: pkgs(base) }, { title: "Development", rows: pkgs(dev) }, - ] + ].concat(monitors()) Flickable { id: landingFlick |
