aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/Settings.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-30 20:16:22 +0100
committerDanilo M. <danix@danix.xyz>2026-10-30 20:16:22 +0100
commitcfad2b0218dd05676a9a520f21911e49e5e4e5b9 (patch)
tree35d4881c7a7d3f9d69e6949306b124e0621f118c /desktop/Settings.qml
parentab537892a9337a13c4d802185e5565ca70027679 (diff)
downloadquickshell-cfad2b0218dd05676a9a520f21911e49e5e4e5b9.tar.gz
quickshell-cfad2b0218dd05676a9a520f21911e49e5e4e5b9.zip
settings: show each monitor on the landing page
One section per monitor from hyprctl monitors -j, read in the same pass as the system facts: make, model, resolution, refresh, scale, rotation, diagonal and position. The description is left out because it carries the panel's serial number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/Settings.qml')
-rw-r--r--desktop/Settings.qml21
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