Replace Hyprland transform enum references with numeric constants
The Hyprland.Monitor.Transform enum values are not reliably accessible in this context. Using the documented numeric values (0 for NORMAL, 3 for 270° rotation) avoids runtime lookup issues and keeps the rotation logic working for both portrait and landscape modes.
This commit is contained in:
@@ -61,8 +61,8 @@ class ScreenRotator {
|
||||
|
||||
const transform =
|
||||
rotation === "landscape"
|
||||
? Hyprland.Monitor.Transform.NORMAL
|
||||
: Hyprland.Monitor.Transform.ROTATE_270_DEG
|
||||
? 0 // Hyprland transform: NORMAL
|
||||
: 3 // Hyprland transform: ROTATE_270_DEG (portrait)
|
||||
|
||||
// Hyprland expects keyword monitor <name>,transform,<value>
|
||||
await execAsync([
|
||||
@@ -231,7 +231,7 @@ function PinenoteShell() {
|
||||
const monitor = focusedMonitor()
|
||||
if (!monitor) return "auto"
|
||||
const t = monitor.transform
|
||||
return t === Hyprland.Monitor.Transform.NORMAL ? "landscape" : "portrait"
|
||||
return t === 0 ? "landscape" : "portrait"
|
||||
})
|
||||
|
||||
const status = createComputed(() => `Rotation: ${transform()} | Brightness: ${brightnessLevel()}%`)
|
||||
|
||||
Reference in New Issue
Block a user