A← Index

A self-updating desktop agenda

A desktop agenda rendered from HTML and refreshed inside my Hyprland session.

Tags
Linux Tooling Hyprland Headless Chrome Bash

IThe goal

I wanted my laptop screen to show the day’s tasks without opening another application. My external monitor could keep rotating wallpapers while the laptop displayed an agenda.

The agenda needed a clear task list, calendar, and space for artwork. I used the browser’s layout engine to arrange those elements before rendering an image.

The rendered daily-agenda wallpaper: a large date and day of week, a numbered task list, a rotating quote, three tinted art panels, and a full month calendar with today highlighted, all in an electric-blue poster layout.
The generated poster: today's date, a numbered task list, a rotating quote, and a month calendar, regenerated at login and every 10 minutes.

IIRendering the poster

The design uses a grid, large numerals, and an accent colour. HTML and CSS let me work with those elements directly instead of placing each item through an image library.

So the poster is just a web page. A Bash script builds an HTML document (inline CSS, plus a tiny inline script that draws the month grid and highlights today), and then headless Chrome screenshots it into a 1920×1080 PNG.

google-chrome-stable --headless=new --hide-scrollbars \
  --window-size=1920,1080 --force-device-scale-factor=1 \
  --virtual-time-budget=4000 \
  --screenshot=poster.png "file://$(pwd)/poster.html"

I used --force-device-scale-factor=1 to control capture scaling and --virtual-time-budget=4000 to give the page time to load. Earlier captures sometimes ran before the artwork appeared.

IIIWiring It Into the Desktop

The wallpaper also needed to stay on the intended screen. My existing cycler rotated both monitors and would replace the agenda after the next interval.

The fix was to teach the cycler to skip one output, a SKIP_MONITORS setting for the laptop panel, so the agenda owns that screen while the external monitor keeps its rotation. Then a single line in the Hyprland config renders at login and refreshes on a timer:

exec-once = bash -c 'while :; do task-wallpaper; sleep 600; done'

I used a loop launched by Hyprland so the refresh command ran inside the desktop session. Every 10 minutes, it rereads the task file and refreshes the artwork and quote. This also picks up task edits during the day.

IVA grid sizing bug

The layout has a content row above a fixed-height calendar bar. A tall image exposed a sizing problem: the content row grew and pushed the calendar below the viewport.

The content item’s automatic minimum height prevented it from shrinking into the available grid track. The fix was to allow it to shrink:

.content-row { min-height: 0; }  /* let the track win, not the image */

With min-height: 0, the content fits within its grid track. The image clips inside that space instead of pushing the calendar out of view.

VValidating quote data

The rotating quote introduced another requirement: external text needed validation and a local fallback.

Developer quotes come from a local file. Stoic quotes come from a public API, which sometimes returns fragments, truncated text, or social handles as author names.

The script checks each fetched quote for an author separator, length, an initial capital letter, and the absence of an @ handle:

QTEXT="${QLINE%%|*}"
if [[ -n "$QLINE" && "$QLINE" != *"null"* && "$QLINE" == *"|"* \
      && "$QLINE" != *"@"* && ${#QLINE} -le 160 \
      && ${#QTEXT} -ge 25 && "$QTEXT" =~ ^[A-Z] ]]; then
  # clean enough -> use it, and append to the local cache
fi

Accepted quotes enter a local cache. If the request fails or the result fails validation, the script uses the cache, then a bundled quote file.

Readable in the background

Tasks could overlap the quote on busy days. I kept the quote grey and added a paper-coloured text-shadow around task text. This made the task list readable where the two overlapped.

VIWhat It Actually Is

This tool is specific to my Arch and Hyprland setup. It depends on the wallpaper daemon and desktop session I use.

The reusable parts are the rendering and fallback patterns. A browser can turn an HTML layout into an image. An external feed can be validated, cached, and backed by local content.

A small tool for my own desktop gave me a way to test both patterns in daily use.

The full source (script, quote pools, and setup notes) is on GitHub: github.com/mrwick1/daily-agenda-wallpaper.

SignedArjun