slackfetch displays a compact summary of system information.
Find a file
2026-05-18 16:12:00 -03:00
LICENSE initial commit 2026-03-05 13:05:32 -03:00
README Simplify OS age detection and fully honor NO_COLOR 2026-05-18 16:12:00 -03:00
slackfetch Simplify OS age detection and fully honor NO_COLOR 2026-05-18 16:12:00 -03:00

SLACKFETCH

slackfetch is a small, readable system information script focused exclusively
on Slackware Linux.

It is derived from ufetch by J. Schillinger, with Slackware-specific
behavior and a deliberately conservative design: no guessing, no heavy
dependencies, and no fragile heuristics.


OVERVIEW

slackfetch displays a compact summary of system information, intended for
interactive use, screenshots, and login shells.

It aims to be:

- small and easy to read
- easy to audit and modify
- predictable in behavior
- friendly to minimal and traditional X11 setups
- suitable for servers and desktops alike


DISPLAYED INFORMATION

slackfetch shows:

- user and hostname
- operating system (from /etc/slackware-version)
- kernel version
- system uptime
- OS age (days since installation)
- shell (pretty-printed, with multiplexer if active)
- editor (from EDITOR environment variable)
- window manager (with display server suffix when detected)


DESIGN PRINCIPLES

slackfetch intentionally avoids heuristic detection methods.

In particular:

- no parsing of .xinitrc, .xsession, or startup scripts
- no guessing based on running processes
- no fallback chains that may produce misleading results

If information cannot be determined reliably, it is left empty unless
explicitly provided by the user.


OS AGE DETECTION

OS age shows the number of days since the system was installed.

The primary method uses the birth time of the root filesystem, obtained
via stat(1). This requires kernel and filesystem support for inode
creation timestamps (supported on ext4 with Linux 4.11+).

If the birth time is unavailable (unsupported filesystem or older kernel),
the field is left empty.


WINDOW MANAGER DETECTION

Window manager detection relies exclusively on X11 EWMH properties,
queried via xprop.

Specifically, slackfetch reads:

- _NET_SUPPORTING_WM_CHECK
- _NET_WM_NAME

When detection succeeds, the display server is appended in parentheses
(currently always "X11", since only X11 detection is supported).

This works correctly for EWMH-compliant window managers such as:

- pekwm
- fluxbox
- icewm
- openbox
- many others

When SLACKFETCH_WM is used to specify the window manager manually,
no suffix is shown, since the detection method is unknown.


NON-EWMH WINDOW MANAGERS

Minimal or legacy window managers (for example: mwm, twm) do not expose
EWMH properties.

In these cases, the window manager name can be specified explicitly via
an environment variable:

export SLACKFETCH_WM="mwm"

slackfetch will then display the value of SLACKFETCH_WM as the window manager.


SHELL DETECTION

The shell is detected via the SHELL environment variable.

Common shells are displayed with a friendly name when possible
(e.g. "GNU bash" instead of "bash").

If a terminal multiplexer is active, it is appended to the shell name.
Detection uses $TMUX (tmux) and $STY (screen). If neither is set,
nothing is appended.


EDITOR DETECTION

The editor is detected via the EDITOR environment variable.

If EDITOR contains arguments (for example: "vim -u NONE"),
only the executable name is displayed.

If EDITOR is unset, the editor field is left empty.


EXAMPLE OUTPUT

Running slackfetch on a Slackware system with an EWMH-compliant window manager:

$ slackfetch

     ________    r1w1s1@RachaelTyrell.dev.local
    /  ______|   os:        Slackware 15.0+
    | |______    kernel:    Linux 6.18.1 (x86_64)
    \______  \   uptime:    2 days, 7 hours, 25 minutes
     ______| |   age:       293d
  | |________/   shell:     GNU bash
  |____________  editor:    nvi
                 wm:        pekwm (X11)


Running slackfetch on a system using a non-EWMH window manager
(with manual override):

$ export SLACKFETCH_WM="mwm"
$ slackfetch

     ________    r1w1s1@RachaelTyrell.dev.local
    /  ______|   os:        Slackware 15.0+
    | |______    kernel:    Linux 6.18.1 (x86_64)
    \______  \   uptime:    2 days, 7 hours, 25 minutes
     ______| |   age:       293d
  | |________/   shell:     GNU bash
  |____________  editor:    nvi
                 wm:        mwm

No suffix is shown for manually specified window managers, since the
detection method is unknown.


Running slackfetch on a headless or server system (no X11):

$ slackfetch

     ________    user@jumpbox
    /  ______|   os:        Slackware 15.0
    | |______    kernel:    Linux 5.15.19 (x86_64)
    \______  \   uptime:    12 days, 3 hours
     ______| |   age:       57d
  | |________/   shell:     GNU bash
  |____________  editor:    vi
                 wm:


Running slackfetch with color output disabled:

$ NO_COLOR=1 slackfetch

     ________    user@darkstar
    /  ______|   os:        Slackware 15.0+
    | |______    kernel:    Linux 6.18.1 (x86_64)
    \______  \   uptime:    1 day, 4 hours, 12 minutes
     ______| |   age:       180d
  | |________/   shell:     GNU bash
  |____________  editor:    nvi
                 wm:        dwm (X11)


Running slackfetch inside a terminal multiplexer (screen or tmux):

$ slackfetch

     ________    r1w1s1@RachaelTyrell.dev.local
    /  ______|   os:        Slackware 15.0+
    | |______    kernel:    Linux 6.19.11 (x86_64)
    \______  \   uptime:    1 day, 14 hours, 31 minutes
     ______| |   age:       325d
  | |________/   shell:     GNU bash (screen)
  |____________  editor:    nvi
                 wm:        dwm (X11)

When a terminal multiplexer is active, slackfetch appends its name to
the shell field. Detection is environment-based: $STY for screen,
$TMUX for tmux. If neither is set, nothing is appended.


DEPENDENCIES

slackfetch relies only on tools available in a standard Slackware X11
installation.

Required:

- POSIX shell (/bin/sh)
- coreutils
- X11
- xprop

xprop is included in the X11 series on Slackware 14.2, 15.0, and
-current. No additional packages are required on a typical X11 system.

On headless systems or installs without X11, window manager detection
will be unavailable unless SLACKFETCH_WM is set manually.


INSTALLATION

slackfetch is a single shell script.

To install locally:

install -m 0755 slackfetch ~/.local/bin/slackfetch

Or system-wide:

install -m 0755 slackfetch /usr/bin/slackfetch


USAGE

Run directly:

slackfetch

Optional window manager override:

export SLACKFETCH_WM="mwm"
slackfetch


COLOR CONTROL

slackfetch respects the NO_COLOR environment variable.

When set, all color and bold formatting is suppressed:

NO_COLOR=1 slackfetch

This follows the convention described at:

https://no-color.org/


ORIGIN AND CREDITS

slackfetch is derived from ufetch by J. Schillinger.

https://gitlab.com/jschx/ufetch


LICENSE

This project follows the same license as the original ufetch project.
See the upstream repository for details.