• Stars
    star
    700
  • Rank 62,400 (Top 2 %)
  • Language
    Go
  • License
    The Unlicense
  • Created about 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🍫 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.

More Repositories

1

traitor

⬆️ ☠️ πŸ”₯ Automatic Linux privesc via exploitation of low-hanging fruit e.g. gtfobins, pwnkit, dirty pipe, +w docker.sock
Go
6,501
star
2

darktile

🌘 Darktile is a GPU rendered terminal emulator designed for tiling window managers.
Go
2,743
star
3

gitjacker

πŸ”ͺ :octocat: Leak git repositories from misconfigured websites
Go
1,532
star
4

tml

πŸŒˆπŸ’»πŸŽ¨ A tiny markup language for terminal output. Makes formatting output in CLI apps easier!
Go
729
star
5

dismember

πŸ”ͺ Scan memory for secrets and more. Maybe eventually a full /proc toolkit.
Go
593
star
6

furious

😠 Go IP/port scanner with SYN (stealth) scanning and device manufacturer identification
Go
569
star
7

scout

πŸ”­ Lightweight URL fuzzer and spider: Discover a web server's undisclosed files, directories and VHOSTs
Go
516
star
8

memit

πŸš«πŸ’Ύ Run binaries straight from memory in Linux
Go
305
star
9

grace

πŸͺ› It's strace, with colours.
Go
250
star
10

bearings

🧭 A fast, clean, customisable shell prompt for zsh, bash, fish, and more...
Go
194
star
11

siphon

βš—οΈ Intercept stdin/stdout/stderr for any process
Go
187
star
12

pax

πŸ’€ πŸ”“ CLI tool for PKCS7 padding oracle attacks
Go
135
star
13

comet

β˜„οΈ Command line tool to help you use conventional commit messages (https://www.conventionalcommits.org)
Go
109
star
14

memoryfs

🧠 πŸ—„οΈ In-memory filesystem implementation of io/fs.FS
Go
87
star
15

extrude

πŸ•΅οΈ Analyse binaries for missing security features, information disclosure and more...
Go
69
star
16

gifwrap

πŸ™ GIFs in your terminal
Go
54
star
17

flinch

A collection of terminal-based widgets for richer Golang CLI apps.
Go
44
star
18

loading

A collection of highly customisable loading bars for Go CLI apps.
Go
34
star
19

guerrilla

πŸ“¨πŸ‘€ Guerilla Mail CLI + Go module
Go
28
star
20

sunder

βœ‚οΈ terminal multiplexer in golang // a minimalist tmux alternative
Go
27
star
21

magic

πŸŽ©πŸ‡ Toolkit for detecting and verifying file type using magic bytes in pure Golang
Go
24
star
22

peridot

Developer machine management for Linux/OSX. Think Terraform/Ansible for your dotfiles/packages! βš™οΈπŸ 
Go
20
star
23

clinch

Go CLI toolkit πŸ”¨
Go
19
star
24

github-profile-terminal-action

Create a GitHub profile README nested inside a terminal nested inside a GIF
Go
17
star
25

gobless

Build beautiful terminal dashboards/GUIs in golang.
Go
16
star
26

lyric

🎡 Song lyrics in your terminal via Genius
Go
16
star
27

js-nes-emulator

NES emulator in javascript.
JavaScript
13
star
28

lambo

Test your API gateway routed lambdas locally and in CI
Go
8
star
29

sshotp

Enter passwords to commands non-interactively
Go
8
star
30

hackerone

Go HackerOne API Client
Go
8
star
31

raytracing

3D Raytracing in Go
Go
8
star
32

thisisfine

This is fine.
Makefile
7
star
33

darktile-themes

A repository of themes for https://github.com/liamg/darktile
Shell
7
star
34

jfather

JSON parsing with extra metadata
Go
6
star
35

liamg

GitHub profile (auto-updated every 4 hours)
6
star
36

gomoon

🌚 πŸŒ’ πŸŒ“ πŸŒ” 🌝 πŸŒ– πŸŒ— 🌘 🌚
Go
6
star
37

happen

Go
5
star
38

termutil

Terminal utilities
Go
4
star
39

philter

Personal home DNS with ad blocking
Go
4
star
40

iris-layout

A UK coding layout for the Iris rev4 keyboard
C
4
star
41

bfc

A compiler for brainfuck by someone who has no idea how compilers work
Go
4
star
42

waitforhttp

Tiny package to wait for an HTTP server to be up
Go
4
star
43

iamgo

Parse/assemble AWS IAM policy documents and their various quirks
Go
4
star
44

fontinfo

Go package to list/match available fonts on a Linux system
Go
4
star
45

rope

〰️ A rope data-structure implementation designed for UTF-8 text manipulation.
Go
3
star
46

dotfiles

Shell
2
star
47

lcd

Go module for driving (non-I2C) LCD devices
Go
2
star
48

nvim-config

Lua
2
star
49

go-project-template-cli

A template for my Go CLI projects
Makefile
2
star
50

ecs

Entity Component System architecture implementation in Go
Go
2
star
51

golume

Go
1
star
52

dnsaur

DNS client/server components in node.
JavaScript
1
star
53

postMessageSniffer

Simple chrome extension to console.log all received postMessage payloads.
JavaScript
1
star
54

reversing

Reverse engineering challenge hackery
C
1
star
55

adtechblogs

The Best Ad Tech Blogs
1
star
56

torrentialjs

BitTorrent library in Node
JavaScript
1
star
57

gca

πŸ”¬πŸŽ² Go Cellular Automata
Go
1
star
58

.github

My default .github miscellany
1
star
59

sidestep

↔️ Tunnel TCP/UDP over DNS: Evade firewalls for fun and profit
1
star
60

tls

πŸ”’ Custom TLS implementation for no good reason
Go
1
star
61

dijits

JavaScript library to convert between numbers and words: 407 -> Four hundred and seven
JavaScript
1
star
62

gomega

A Sega Mega Drive (Genesis) Emulator in Go.
1
star
63

writeups

1
star
64

xu

Modern Hex Editor
Go
1
star