Improve e-ink support with forced refreshes and no animations

- Add `einkRefresh()` helper calling `pdlc-cli --refresh` after rotation,
  brightness changes, waveform changes, and when the widget opens
- Disable CSS transitions and animations globally to reduce ghosting
- Remove button hover transform and transition effects
- Update README with e-ink-specific guidance and tuning notes
This commit is contained in:
2026-07-13 13:38:46 +02:00
parent 4938bb472b
commit 05b18bdade
3 changed files with 38 additions and 4 deletions
+22 -1
View File
@@ -4,7 +4,7 @@ import app from "ags/gtk3/app"
import { Astal, Gtk, Gdk } from "ags/gtk3"
import { execAsync } from "ags/process"
import { readFile } from "ags/file"
import { createBinding, createState, createComputed } from "ags"
import { createBinding, createState, createComputed, createEffect } from "ags"
import Hyprland from "gi://AstalHyprland"
import Brightness from "gi://AstalBrightness"
@@ -20,6 +20,14 @@ const notify = (msg) => execAsync(["notify-send", msg]).catch(console.error)
const toTitleCase = (str) =>
str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.slice(1).toLowerCase())
// --- e-ink helpers --------------------------------------------------------
function einkRefresh() {
// Trigger a full display refresh after actions that cause large visual changes.
// Silently ignore failures if pdlc-cli is not installed.
execAsync(["pdlc-cli", "--refresh"]).catch(() => {})
}
// --- managers --------------------------------------------------------------
class BrightnessController {
@@ -36,6 +44,8 @@ class BrightnessController {
set(level) {
if (!this.screen) return
this.screen.brightness = level / 100
// PineNote: force an e-ink refresh so the brightness change is visible
einkRefresh()
}
}
@@ -63,6 +73,8 @@ class ScreenRotator {
])
notify(`Screen rotated to ${rotation}`)
// PineNote: e-ink needs an explicit refresh after rotation
einkRefresh()
} catch (err) {
notify(`Failed to rotate screen: ${err.message}`)
}
@@ -139,6 +151,9 @@ class WaveformController {
execAsync(["pdlc-cli", "--waveform", waveform]).catch((err) =>
console.log(`Could not apply waveform: ${err.message}`),
)
// PineNote: refresh after changing waveform mode
einkRefresh()
}
}
@@ -155,6 +170,12 @@ function PinenoteShell() {
const [visible, setVisible] = createState(false)
// PineNote: when the widget is shown, force an e-ink refresh so the
// overlay draws cleanly on the slow display.
createEffect(() => {
if (visible()) einkRefresh()
})
const brightnessLevel = brightness.screen
? createBinding(brightness.screen, "brightness")((v) => Math.round((v || 0) * 100))
: createState(100)[0]