🍫 A customisable, universally compatible terminal status bar

Shox: Terminal Status Bar

Travis Build Status GoReportCard Github Release

A customisable terminal status bar with universal shell/terminal compatibility. Currently works on Mac/Linux.

Installation

NOTE This is still very experimental. I'm using it locally without any problems right now, but there's still a lot of testing and tweaking to do. Feel free to try it out, but get ready for some potential bugginess!

curl -s "https://raw.githubusercontent.com/liamg/shox/master/scripts/install.sh" | sudo bash

If you don't like to pipe to sudo - as well you shouldn't - you can remove the sudo above, but you'll have to add the shox dir to your PATH env var manually, as instructed by the installer.

Configuration

The shox config file should be created at $XDG_CONFIG_HOME/shox/config.yaml, which is usually ~/.config/shox/config.yaml. You can alternatively create it at ~/.shox.yaml

The config file looks like the following:

shell: /bin/bash
bar:
    format: "{time}||CPU: {cpu} MEM: {memory}"
    colours: 
      bg: red
      fg: white
    padding: 0

Shox will use your SHELL environment variable to determine the shell to run if a shell is not specified in the config file, but if your SHELL is set to shox, it'll default to /bin/bash to prevent a horrible recursive mess.

Bar Configuration

Bar configuration is done using a simple string format. Helpers are encased in braces e.g. {time}, alignment is done using pipes (see below), and any other text will be written to the bar.

Alignment

You can use pipes to align content within the status bar. All content before the first pipe will be aligned to the left, all content between the first and second will be centre aligned, and all content after the second pipe will be right aligned.

For example, to display a bar that centre aligns the time, you could use |{time}|

Colours

The following colours are available: black, white, red, green, yellow, blue, magenta, cyan, darkgrey, lightgrey, lightred, lightgreen, lightyellow, lightblue, lightmagenta, lightcyan.

Helpers

Helpers create dynamic output in your status bar. You can use one by adding it to your bar format config. The following is a list of available helpers.

Helper Description Example Config Example Output
time Show current time {time} 11:58:17
cpu Show current CPU usage {cpu} 20%
memory Show current memory usage % {memory} 20%
battery Show current battery charge % {battery} 20%
bash Run a custom bash command {bash:echo hi} hi
weather Show current weather (provided by http://wttr.in) {weather:1} 🌧 +6°C
until Show time remaining until a given unix timestamp {until:1583255109} 13m26s

Ideally this list would be much longer - please feel free to PR more helpers! You can see simple examples here.

Weather

The configuration section of the weather helper holds the display format. For all available display formats please visit chubin/wttr.in#one-line-output The default value is 1 which only shows the weather

NOTE: You don't need to URL-encode the weather format, i.e. use %l: %c %t instead of %l:+%c+%t

Uninstallation

If installed with sudo

Remove the binary from /usr/local/bin

rm /usr/local/bin/shox

If installed without sudo

Remove the binary from the shox installation dir $HOME/bin

rm $HOME/bin/shox

NOTE: Don't forget to remove any configuration files you've created should you decide you don't need them

Why?

I frequently needed a way to have a quick overview of several things without cramming them into my PS1, and to update those things dynamicly.

How does it work?

Shox sits between the terminal and your shell and proxies all data sent between them. It identifies ANSI commands which contain coordinates and dimensions and adjusts them accordingly, so that the status bar can be drawn efficiently without interfering with the shell and it's child programs.

Owner
Liam Galvin
Security Engineer @form3tech
Liam Galvin
Comments
  • Install script depends on jq and fails when not installed

    Install script depends on jq and fails when not installed

    --- shox/scripts ‹master› » bash install.sh                                                                                                                                                                                                                                                                                                                           127 ↵
    Determining platform...
    Finding latest release...
    install.sh: line 8: jq: command not found
    (23) Failed writing body
    
  • 100% CPU usage

    100% CPU usage

    Hi,

    Using the install script, I've got the latest release of shox in ~/bin, but when run it eats up one/two threads on a dual-core HT machine. I haven't let it run long or tested it otherwise. Any idea as to why this could be?

    I'm running Debian 10, with Linux 5.5.0, zsh 5.7.1 with oh-my-zsh. Please let me know if you need any more information.

    image

  • max one bash helper supported

    max one bash helper supported

    When multiple {bash} helpers are in a format string, the output of the first command is repeated for the rest.

    This example produces a status bar with three segments, each printing 1.

    format: "{bash: echo 1}|{bash: echo 2}|{bash: echo 3}"

    (Neat project!)

  • Scrollback often times ends up being unusable. The nature of the tool, or is there possibly a way to minimize it?

    Scrollback often times ends up being unusable. The nature of the tool, or is there possibly a way to minimize it?

    Hey there, I was just checking out this utility, and it seems like I would like to use it, but there is one possibly overpowering issue. When using certain commands, it seems ones that scroll the screen a bit slower, and I try to scroll back to look at prior text, well, you can see demonstrated below.

    For quicker commands that dump to the screen, it is not so bad, but you will see when I run my update && upgrade command where the issue resides.

    Is there perhaps anything that can be done to eliminate this, or possibly minimize it at least, or is this just what I would have to deal with?

    Thanks, -MH

  • Current install instructions seem to be broken.

    Current install instructions seem to be broken.

    Hi!

    This seemed like a nice project and I was looking to trying it. That said, it looks like the install instructions might be outaded.

    Looking at https://raw.githubusercontent.com/liamg/shox/master/scripts/install.sh

    #!/bin/bash
    
    set -e
    
    echo "Determining platform..."
    platform=$(uname | tr '[:upper:]' '[:lower:]')
    echo "Finding latest release..."
    asset=$(curl --silent https://api.github.com/repos/liamg/shox/releases/latest | grep -o "https://github.com/liamg/shox/releases/download/.*/shox-$platform-amd64" | head -n1)
    echo "Downloading latest release for your platform..."
    curl -s -L -H "Accept: application/octet-stream" "${asset}" --output ./shox
    echo "Installing shox..."
    chmod +x ./shox
    installdir="${HOME}/bin/"
    if [ "$EUID" -eq 0 ]; then
      installdir="/usr/local/bin/"
    fi
    mkdir -p $installdir
    mv ./shox "${installdir}/shox"
    which shox &> /dev/null || (echo "Please add ${installdir} to your PATH to complete installation!" && exit 1)
    echo "Installation complete!"
    

    This https://api.github.com/repos/liamg/shox/releases/latest seems to return

    {
      "url": "https://api.github.com/repos/liamg/shox/releases/29853635",
      "assets_url": "https://api.github.com/repos/liamg/shox/releases/29853635/assets",
      "upload_url": "https://uploads.github.com/repos/liamg/shox/releases/29853635/assets{?name,label}",
      "html_url": "https://github.com/liamg/shox/releases/tag/v0.0.18",
      "id": 29853635,
      "node_id": "MDc6UmVsZWFzZTI5ODUzNjM1",
      "tag_name": "v0.0.18",
      "target_commitish": "master",
      "name": "v0.0.18",
      "draft": false,
      "author": {
        "login": "liamg",
        "id": 1187060,
        "node_id": "MDQ6VXNlcjExODcwNjA=",
        "avatar_url": "https://avatars1.githubusercontent.com/u/1187060?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/liamg",
        "html_url": "https://github.com/liamg",
        "followers_url": "https://api.github.com/users/liamg/followers",
        "following_url": "https://api.github.com/users/liamg/following{/other_user}",
        "gists_url": "https://api.github.com/users/liamg/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/liamg/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/liamg/subscriptions",
        "organizations_url": "https://api.github.com/users/liamg/orgs",
        "repos_url": "https://api.github.com/users/liamg/repos",
        "events_url": "https://api.github.com/users/liamg/events{/privacy}",
        "received_events_url": "https://api.github.com/users/liamg/received_events",
        "type": "User",
        "site_admin": false
      },
      "prerelease": false,
      "created_at": "2020-08-19T09:03:07Z",
      "published_at": "2020-08-19T09:03:39Z",
      "assets": [
    
      ],
      "tarball_url": "https://api.github.com/repos/liamg/shox/tarball/v0.0.18",
      "zipball_url": "https://api.github.com/repos/liamg/shox/zipball/v0.0.18",
      "body": "- Fix rendering on OSX and IntelliJ"
    }
    

    And this grep -o "https://github.com/liamg/shox/releases/download/.*/shox-$platform-amd64" | head -n1 wont match anything :cry:

  • weather plugin not working ?

    weather plugin not working ?

    Can someone point me to right direction with weather helper. I just cant make it work, i have tried various formats but none of them working.

    im sending it as : {weather:%l: %t %c}

  • ANSI escape sequence visible after running clear

    ANSI escape sequence visible after running clear

    After running clear I can see an ANSI character sequence printed to my terminal which I presume should be getting interpreted properly, also my prompt appears half way down the screen, this behaviour occurred in kitty and urxvt.

    1582790167_Feb27_18:26:07

  • Flickers on Simple Terminal (st)

    Flickers on Simple Terminal (st)

    I'm not certain if this is a problem that you are able to fix or if this just a problem with the way that st handles rendering. However, every time the bar update there is a very noticeable flicker. I have only experienced this problem with shox so I suspect that you may be able to fix it.

A simple visualization from the terminal of tintin++ bot status.
A simple visualization from the terminal of tintin++ bot status.

Kalterm A simple visualization from the terminal of tintin++ bot status. It uses kalterm.tin (in the tintin directory) to create a #port session on 95

Oct 27, 2022
A really basic thread-safe progress bar for Golang applications
A really basic thread-safe progress bar for Golang applications

progressbar A very simple thread-safe progress bar which should work on every OS without problems. I needed a progressbar for croc and everything I tr

Jan 1, 2023
Console progress bar for Golang

Terminal progress bar for Go Installation go get github.com/cheggaaa/pb/v3 Documentation for v1 bar available here Quick start package main import (

Jan 9, 2023
multi progress bar for Go cli applications

Multi Progress Bar mpb is a Go lib for rendering progress bars in terminal applications. Features Multiple Bars: Multiple progress bars are supported

Dec 28, 2022
Go simple progress bar writing to output
Go simple progress bar writing to output

?? progress-go Go simple progress bar writing to output ?? ABOUT Contributors: Rafał Lorenz Want to contribute ? Feel free to send pull requests! Have

Oct 30, 2022
A cli that shows a GitHub-like language usage statistics bar.
A cli that shows a GitHub-like language usage statistics bar.

barley A cli that shows a GitHub-like language usage statistics bar. barley analyses the programming languages used in a directory and creates a used

Jan 8, 2022
Custom i3status bar built with Barista.

Custom i3status Customized i3status command built with Barista. Includes a Barista module for strongSwan. Install go install enr0n.net/i3status/cmd/i3

Jan 10, 2022
🎨 Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows.
🎨 Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows.

?? Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows. GO CLI 控制台颜色渲染工具库,支持16色,256色,RGB色彩渲染输出,使用类似于 Print/Sprintf,兼容并支持 Windows 环境的色彩渲染

Dec 30, 2022
A set of Go scripts to monitor YAGPDB status via the command-line.
A set of Go scripts to monitor YAGPDB status via the command-line.

A set of Go scripts to monitor YAGPDB status by making GET requests to the YAGPDB status endpoint.

Apr 20, 2022
Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. 🔍 📊
Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. 🔍 📊

askgit is a command-line tool for running SQL queries on git repositories. It's meant for ad-hoc querying of git repositories on disk through a common interface (SQL), as an alternative to patching together various shell commands.

Jan 3, 2023
Battery - cross-platform get battery status

battery Cross-platform get battery status. Tested on Arch Linux, Debian, Ubuntu, Windows, macOS. import "github.com/caiguanhao/battery" battery.GetSt

Dec 31, 2021
Dwmstatus - Simple modular dwm status thing made in go

dwm status simple modular dwm status command made in go that has drop in plugins

Oct 31, 2022
Stonks is a terminal based stock visualizer and tracker that displays realtime stocks in graph format in a terminal.
Stonks is a terminal based stock visualizer and tracker that displays realtime stocks in graph format in a terminal.

Stonks is a terminal based stock visualizer and tracker. Installation Requirements: golang >= 1.13 Manual Clone the repo Run make && make install Pack

Dec 16, 2022
A client for managing authzed or any API-compatible system from your command line.

zed A client for managing authzed or any API-compatible system from your command line. Installation zed is currently packaged by as a head-only Homebr

Dec 31, 2022
contaiNERD CTL - Docker-compatible CLI for containerd, with support for Compose, Rootless, eStargz, OCIcrypt, IPFS, ...

contaiNERD CTL - Docker-compatible CLI for containerd, with support for Compose, Rootless, eStargz, OCIcrypt, IPFS, ...

Jan 4, 2023
CLI tool to upload object to s3-compatible storage backend and set download policy for it.
CLI tool to upload object to s3-compatible storage backend and set download policy for it.

typora-s3 CLI tool to upload object to s3-compatible storage backend and set download policy for it. Build $ git clone https://github.com/fengxsong/ty

Dec 29, 2021
Command-line utility for Postgres-compatible SCRAM-SHA-256 passwords

scram-password -- Command-line utility for Postgres-compatible SCRAM-SHA-256 passwords SCRAM-SHA-256 (see RFC-7677, Salted Challenge Response Authenti

Jan 21, 2022
Trzsz-go - A simple file transfer tools, similar to lrzsz ( rz / sz ), and compatible with tmux

Trzsz-go - A simple file transfer tools, similar to lrzsz ( rz / sz ), and compatible with tmux

Dec 31, 2022
archy is an static binary to determine current kernel and machine architecture, with backwards compatible flags to uname, and offers alternative output format of Go runtime (i.e. GOOS, GOARCH).

archy archy is an simple binary to determine current kernel and machine architecture, which wraps uname and alternatively can read from Go runtime std

Mar 18, 2022