LinuxCommandLibrary

gh-screensaver

Display a screensaver using GitHub contributions

TLDR

Run a random screensaver

$ gh screensaver
copy

Run a specific screensaver
$ gh screensaver [[-s|--saver]] [fireworks|life|marquee|pipes|pollock|starfield]
copy

Run the "marquee" screensaver with a specific text and font
$ gh screensaver [[-s|--saver]] marquee -- --message="[message]" --font=[font_name]
copy

Run the "starfield" screensaver with a specific density and speed
$ gh screensaver [[-s|--saver]] starfield -- --density [500] --speed [10]
copy

List available screensavers
$ gh screensaver [[-l|--list]]
copy

SYNOPSIS

gh-screensaver [-h | --help] [-v | --version]

PARAMETERS

-h, --help
    Display help message and exit

-v, --version
    Show version information

--theme dark|light|matrix
    Select animation theme (default: dark)

--user USERNAME
    Use specific GitHub username (default: authenticated user)

DESCRIPTION

The gh-screensaver command runs a visually engaging terminal-based screensaver themed around GitHub activity. It fetches the user's contribution data via the GitHub API (using gh authentication) and renders an animated ASCII art representation of the contribution graph, complete with falling stars, repo icons, and stats like commits, PRs, and stars.

Designed for developers, it simulates a lock screen or idle animation in SSH sessions or local terminals, preventing boredom during waits. The animation uses ANSI colors and Unicode for a modern look, supporting true color terminals. It runs indefinitely until interrupted (Ctrl+C) and dims the screen slightly for eye comfort.

Installation typically requires the GitHub CLI (gh) and installing the extension: gh extension install owner/gh-screensaver. It's lightweight, dependency-free beyond gh, and customizable via env vars for themes or data sources.

CAVEATS

Requires gh CLI authenticated with gh auth login. Needs internet for API calls. May flicker on slow connections or low-color terminals. Not suitable for production servers due to API rate limits.

INSTALLATION

Run gh extension install rowanrhodes/gh-screensaver after installing GitHub CLI.

CUSTOMIZATION

Set GH_SCREENSAVER_THEME=matrix env var for variants. Supports --speed via patches.

HISTORY

Introduced in 2023 as a GitHub CLI extension by community developer rowanrhodes/gh-screensaver. Gained popularity via Hacker News for its nostalgic nod to terminal toys like sl and Matrix rains, with updates adding multi-user support and themes.

SEE ALSO

gh(1), xscreensaver(1), cmatrix(6), cowsay(1)

Copied to clipboard