Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installation

There are four ways to install catnap. Pick the one that fits your situation:

MethodGood for
Quick installGood for most users. Gets you running in under a minute
From sourceContributors and developers who want the latest code
GitHub release (manual)Installing without the script, or scripting your own setup
Static build from sourceBuilding a fully self-contained binary yourself

Quick install

The easiest and fastest way to install catnap is using the release install helper script. It detects your architecture, downloads the right static binary and config files from the latest GitHub release, and puts everything in place. The binaries are statically linked, so catnap has no runtime dependencies after install. The script itself requires bash, curl, and tar to be available on your system.

# Download the install script
curl -Lo install.sh https://raw.githubusercontent.com/iinsertNameHere/catnap/main/install.sh

# Install catnap
sudo bash ./install.sh

Warning

As a general rule, always review scripts before running them as root. You can read the install script on GitHub before downloading.

Updating: Run the script again. It will show your currently installed version alongside the latest and ask before proceeding:

sudo bash install.sh

Uninstalling:

sudo bash install.sh uninstall

From source

Build catnap yourself if you want the latest unreleased changes or plan to contribute. This produces a dynamically linked binary that depends on pcre and usbutils at runtime.

Dependencies:

DependencyPurpose
nimBuild toolchain (v2.x+)
gzipBuild toolchain
pcreRuntime (regex)
usbutilsRuntime (hardware info)

1. Clone the repository:

git clone https://github.com/iinsertNameHere/catnap.git
cd catnap

2. Build and install:

nim install

This compiles catnap in release mode, installs the binary to /usr/local/bin/, and copies the default config files to ~/.config/catnap/:

~/.config/catnap/
├── config.cat
├── distros.cat
└── themes/
    └── catppuccin-mocha.cat

Note

nim install requires sudo to write to /usr/local/bin/. To install without sudo, run nim setup instead. It builds the binary (placed in bin/catnap locally) and copies the config files to ~/.config/catnap/. This lets you place the binary wherever you like.

3. Verify:

catnap

Updating: Pull the latest changes and reinstall:

git pull
nim install

Your config files in ~/.config/catnap/ are not overwritten by nim install. Only the binary is replaced.

Warning

If you have local edits in the cloned source config/ directory, git pull may produce merge conflicts there. Your installed config in ~/.config/catnap/ is always separate and is not affected by git operations.


Manual install from a GitHub release

Pre-built statically linked binaries are published on the GitHub releases page. They have no external runtime dependencies.

Available binaries:

FileArchitecture
catnap-{version}-x86_6464-bit x86 - most desktops and laptops
catnap-{version}-aarch6464-bit ARM - Raspberry Pi 4+, ARM servers
catnap-{version}-armv7l32-bit ARM
catnap-{version}-i68632-bit x86

1. Download the binary for your architecture and move it to your PATH. Replace x86_64 with your arch if needed:

VERSION=$(curl -Ls -o /dev/null -w '%{url_effective}' https://github.com/iinsertNameHere/catnap/releases/latest | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+')
curl -Lo catnap "https://github.com/iinsertNameHere/catnap/releases/download/${VERSION}/catnap-${VERSION}-x86_64"
chmod +x catnap
sudo mv catnap /usr/local/bin/

2. Download the config tarball from the same release and copy the files into place:

VERSION=$(catnap -v | cut -d' ' -f2)
curl -Lo catnap-config.tar.gz \
  "https://github.com/iinsertNameHere/catnap/releases/download/${VERSION}/catnap-${VERSION}-config.tar.gz"
tar xf catnap-config.tar.gz
mkdir -p ~/.config/catnap/themes
cp config/config.cat   ~/.config/catnap/
cp config/distros.cat  ~/.config/catnap/
cp config/themes/*.cat ~/.config/catnap/themes/

3. Verify:

catnap

Note

The default config uses Nerd Font glyphs for icons. Set a Nerd Font as your terminal font or the icons will show as boxes. The weather stat also requires a font with emoji support.

Updating: Download the new binary and replace the old one:

VERSION=$(curl -Ls -o /dev/null -w '%{url_effective}' https://github.com/iinsertNameHere/catnap/releases/latest | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+')
curl -Lo catnap "https://github.com/iinsertNameHere/catnap/releases/download/${VERSION}/catnap-${VERSION}-x86_64"
chmod +x catnap
sudo mv catnap /usr/local/bin/

Config files are not touched by a binary update. If a new release adds new config variables, the defaults built into the binary apply automatically.


Static build from source

This produces a fully self-contained binary with no runtime dependencies, built using musl libc. Useful if you want a portable binary you can move between systems or distribute yourself.

Dependencies:

DependencyPurpose
nimBuild toolchain (v2.x+)
musl-toolsProvides musl-gcc for native x86_64 static builds

1. Clone the repository:

git clone https://github.com/iinsertNameHere/catnap.git
cd catnap

2. Build the static PCRE libraries (only needed once):

nim installPcre
nim installPcre2

3. Build the static binary:

nim static_release

The binary is placed at bin/catnap.

4. Install the binary and config files:

nim install_cfg
sudo nim install_bin

5. Verify:

catnap

Note

If musl-gcc is not on your PATH, set the MUSLCC environment variable before building: MUSLCC=x86_64-linux-musl-gcc nim static_release

Updating: Pull and rebuild:

git pull
nim static_release
sudo nim install_bin

The PCRE libraries only need to be rebuilt if you switch musl toolchains or the pcre version changes.