Add a no-animations mode, on by default in VMs (#13550)
A machine without a GPU, like most VMs, renders through llvmpipe on the CPU, where every animated frame and every translucent window costs. In a VM, opening and closing a terminal took ~5s of CPU; a panel ~3.4s. omarchy toggle animations (also under Toggle > Animations) places a Hyprland flag that turns off animations, blur and shadows and makes windows opaque. The shell follows Hyprland's animations:enabled, rereading it on every config reload: its one-shot animations run for Style.duration(ms), which is then 0, and its spinners, pulses and title marquee hold still. A new install in a VM starts with the flag in place. Measured in the ISO test VM (llvmpipe), CPU per interaction: terminal open+close 5000ms -> 481ms, workspace switch 1670ms -> 409ms, audio panel 3446ms -> 796ms, volume OSD 2324ms -> 584ms, menu 2028ms -> 1241ms. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
97a9fce54f
commit
b18ab4952b
41 files changed
+201
-79
No files matched your search
@@ -1,6 +1,7 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Io
|
||||
|
||||
// Shared structural style tokens for the shell. Color is the palette
|
||||
@@ -347,9 +348,19 @@ QtObject {
|
||||
readonly property int statusSlot: root.barToken("status-slot", 21)
|
||||
}
|
||||
|
||||
// Off with Hyprland's own animations, as `omarchy toggle animations` turns
|
||||
// them off for machines that render on the CPU. Every shell animation runs
|
||||
// for Style.duration(ms), which is then 0, so nothing is drawn in between.
|
||||
property bool reduceMotion: false
|
||||
|
||||
function duration(ms) {
|
||||
return reduceMotion ? 0 : ms
|
||||
}
|
||||
|
||||
function refresh() {
|
||||
hyprctlProc.running = true
|
||||
gapsOutProc.running = true
|
||||
animationsProc.running = true
|
||||
}
|
||||
|
||||
function scheduleRefresh() {
|
||||
@@ -448,6 +459,30 @@ QtObject {
|
||||
}
|
||||
}
|
||||
|
||||
property Process animationsProc: Process {
|
||||
id: animationsProc
|
||||
command: ["hyprctl", "-j", "getoption", "animations:enabled"]
|
||||
stdout: StdioCollector {
|
||||
waitForEnd: true
|
||||
onStreamFinished: {
|
||||
try {
|
||||
root.reduceMotion = JSON.parse(text || "{}").bool === false
|
||||
} catch (e) {
|
||||
// hyprctl missing / Hyprland not running — leave the previous value.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A reload is when the animations toggle, a theme or the user's own config
|
||||
// lands, and Hyprland only announces it once the new values are in effect.
|
||||
property Connections hyprlandEvents: Connections {
|
||||
target: Hyprland
|
||||
function onRawEvent(event) {
|
||||
if (event && String(event.name) === "configreloaded") root.refresh()
|
||||
}
|
||||
}
|
||||
|
||||
property Process gapsOutProc: Process {
|
||||
id: gapsOutProc
|
||||
command: ["hyprctl", "-j", "getoption", "general:gaps_out"]
|
||||
|
||||
Reference in new issue
Block a user