Self-sovereign infrastructure platform with secure, encrypted NixOS deployments
Keystone provides built-in screen recording capabilities using GPU-accelerated encoding. Record your screen with optional audio capture for documentation, tutorials, bug reports, and presentations.
Record your screen in 30 seconds:
Super+Escape to open the Keystone menu~/Videos/screenrecording-YYYY-MM-DD_HH-MM-SS.mp4Tip: The recording indicator appears in the center of your Waybar (status bar at the top). A single click stops recording.
The most discoverable method for first-time users:
Super+Escape (or press the power button)When recording is active, the Waybar shows a red indicator:
For advanced users and scripting:
# Start basic recording (video only)
keystone-screenrecord
# Start recording with desktop audio
keystone-screenrecord --with-desktop-audio
# Start recording with microphone
keystone-screenrecord --with-microphone-audio
# Start recording with both audio sources
keystone-screenrecord --with-desktop-audio --with-microphone-audio
# Stop active recording
keystone-screenrecord --stop
Toggle behavior: Running keystone-screenrecord when a recording is already active will stop the current recording.
Choose the right audio setup for your use case:
| Your Need | Command | Best For |
|---|---|---|
| Video only | keystone-screenrecord |
Bug reproduction, silent demos, screen captures without narration |
| Desktop audio | keystone-screenrecord --with-desktop-audio |
App demos with sound effects, gameplay, browser tab audio |
| Microphone | keystone-screenrecord --with-microphone-audio |
Tutorial voiceovers, presentations, explaining code |
| Both sources | keystone-screenrecord --with-desktop-audio --with-microphone-audio |
Full presentations, live coding with explanations |
Desktop Audio (--with-desktop-audio):
default_output deviceMicrophone Audio (--with-microphone-audio):
default_input deviceCombined Audio:
No audio needed? Just run keystone-screenrecord without flags. This keeps file sizes smaller and works perfectly for silent demonstrations.
Testing audio before recording: Use your system’s audio settings to verify input/output devices are working. Run pactl list sources and pactl list sinks to see available devices.
Muting specific applications: Use PipeWire audio controls (like pavucontrol or helvum) to mute specific application audio while recording desktop audio.
Recordings are saved to:
KEYSTONE_SCREENRECORD_DIR is set)~/Videos)~/Videos if neither is configuredFiles are automatically named with timestamps to prevent collisions:
screenrecording-YYYY-MM-DD_HH-MM-SS.mp4
Example:
~/Videos/screenrecording-2025-01-08_14-30-45.mp4
This format:
Set a custom directory for recordings using an environment variable:
# Temporary (current terminal session)
export KEYSTONE_SCREENRECORD_DIR=~/Projects/my-project/recordings
keystone-screenrecord
# Permanent (add to ~/.zshrc or ~/.bashrc)
echo 'export KEYSTONE_SCREENRECORD_DIR=~/Projects/my-project/recordings' >> ~/.zshrc
Important: The directory must exist before recording starts. Create it with:
mkdir -p ~/Projects/my-project/recordings
Recordings use these technical settings:
| Property | Value | Notes |
|---|---|---|
| Container | MP4 | Compatible with all major platforms |
| Video Codec | H.264 (AVC) | Hardware-accelerated GPU encoding |
| Frame Rate | 60 FPS | Smooth playback, captures fast motion |
| Resolution | Native monitor resolution | Matches your display (e.g., 1920x1080, 3840x2160) |
| Audio Codec | AAC | 128 kbps, standard quality |
| Encoding | GPU-accelerated | NVIDIA/Intel/AMD hardware encoder |
Goal: Capture your coding workflow for documentation or sharing with teammates.
Setup:
Steps:
export KEYSTONE_SCREENRECORD_DIR=~/Projects/my-project/docs/recordings
keystone-screenrecord
# Code and demonstrate
# Click Waybar indicator when done
Why no audio? Coding sessions often include background noise (Slack notifications, browser tabs) that can be distracting. Silent recordings keep the focus on the visual workflow.
Goal: Create an instructional video explaining how to use a feature or tool.
Setup:
Steps:
keystone-screenrecord --with-microphone-audioTip: Write a script or outline beforehand. This keeps explanations concise and reduces the need for editing.
Goal: Demonstrate an application that produces audio (music player, game, browser app).
Setup:
Steps:
keystone-screenrecord --with-desktop-audio
# Demonstrate the application
# Stop when done
Use case: Showing how a sound effect works, demonstrating audio playback, capturing game audio.
Goal: Record a complete presentation with your voice and any demo audio.
Setup:
Steps:
keystone-screenrecord --with-desktop-audio --with-microphone-audio
# Present with slides and demos
# Your voice is captured along with any demo audio
# Stop when finished
Best practices:
Problem: Recording fails immediately with this notification.
Solution:
KEYSTONE_SCREENRECORD_DIR is set correctly:
echo $KEYSTONE_SCREENRECORD_DIR
mkdir -p $KEYSTONE_SCREENRECORD_DIR
unset KEYSTONE_SCREENRECORD_DIR
Prevention: Always create custom directories before setting KEYSTONE_SCREENRECORD_DIR.
Problem: Video recorded successfully but no audio track exists.
Solutions:
If you forgot audio flags:
--with-desktop-audio or --with-microphone-audioIf you used audio flags but still no audio:
systemctl --user status pipewire
pactl list sources short # Microphone inputs
pactl list sinks short # Desktop audio outputs
arecord -f cd -d 5 test.wav && aplay test.wav
Common cause: Audio device was muted or disconnected during recording.
Problem: Recording process didn’t shut down cleanly.
What this means:
Solutions:
When it happens:
Problem: Clicking Waybar indicator or running command doesn’t stop recording.
Solution:
# Manually stop the recording process
keystone-screenrecord --stop
# If that fails, force-kill the process
pkill -9 gpu-screen-recorder
Note: Force-killing may result in corrupted video (see above).
Problem: Recording files are larger than expected.
Why this happens:
File size estimates:
Solutions:
Not a bug: Keystone prioritizes quality over file size. Use external tools for compression if needed.
Problem: Want to record just one window, but Keystone records entire screen.
Current limitation: Keystone records via Wayland portal, which provides:
Workarounds:
Future enhancement: Window-specific capture may be added in future versions.
For advanced users and contributors who need to understand the implementation:
Tool: gpu-screen-recorder
Portal interface: Uses Wayland portal protocol (-w portal)
The keystone-screenrecord script is a wrapper around gpu-screen-recorder with these flags:
gpu-screen-recorder \
-w portal \ # Wayland portal capture
-f 60 \ # 60 FPS
-encoder gpu \ # GPU hardware encoding
-o "$filename" \ # Output file path
-a default_output|default_input \ # Audio devices (optional)
-ac aac # AAC audio codec
Waybar Status Indicator:
RTMIN+8 (efficient, no polling)gpu-screen-recorder process is activekeystone-screenrecord (toggle behavior)Notification System:
libnotify for desktop notificationsProcess Management:
| Variable | Default | Description |
|---|---|---|
KEYSTONE_SCREENRECORD_DIR |
$XDG_VIDEOS_DIR or ~/Videos |
Custom output directory |
XDG_VIDEOS_DIR |
~/Videos |
Standard XDG user directory for videos |
MP4 Container Structure:
Codec Profiles:
Compatibility:
CPU Usage: <5% on average (GPU handles encoding) GPU Usage: 10-20% (depends on resolution and encoder) RAM Usage: ~50-100 MB for recording process Disk Write Speed: 5-15 MB/s (depends on resolution)
System Requirements:
Found an issue or have a feature request? See CLAUDE.md for contribution guidelines.
Common enhancement requests: