Show the date and time in the top-right corner of the screen for a few
seconds, like the time command of ratpoison
(bound to C-t a), on sway and other wlroots-based
Wayland compositors.
+------------------------------+ | Sun Oct 4 08:46:59 2026 | <- top-right corner, 3 s, then gone +------------------------------+
swaytime is a small wlr-layer-shell client. It draws on the overlay layer,
takes no keyboard focus and lets pointer input through, so binding it to a
key never disturbs the focused window. Defaults follow ratpoison's message
bar: ctime(3) text, black on white, 1 px border, Mono 11.
Dependencies: wayland-client, wayland-protocols, wayland-scanner,
pango (pangocairo), cairo, pkg-config, GNU make, a C11 compiler.
make
sudo make install # PREFIX=/usr/local by default
make PREFIX="$HOME/.local" installThe build is strict: all warnings are errors and GCC's -fanalyzer is on.
With a compiler lacking it (clang), use make ANALYZER=.
swaytime [-f format] [-F font] [-t ms] [-V] [-h] -f format strftime(3) format, default "%a %b %e %H:%M:%S %Y" (ctime) -F font Pango font description, default "Mono 11" -t ms display time in milliseconds, default 3000
sway, with a ratpoison-like prefix:
mode "prefix" { bindsym a exec swaytime, mode "default" bindsym Escape mode "default" } bindsym Control+t mode "prefix"
- Drawn at scale 1: on a scaled output the compositor upscales the buffer.
- Shown on the focused output only (the compositor's choice).
MIT, see LICENSE. protocol/wlr-layer-shell-unstable-v1.xml is taken
unmodified from sway 1.10 and keeps its own copyright notice.