All Projects → Stargarth → Goblocks

Stargarth / Goblocks

Licence: GPL-2.0 license
Status bar for dwm

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to Goblocks

rsblocks
A fast status-bar for dwm window manager written in Rust 🦀
Stars: ✭ 30 (-40%)
Mutual labels:  dwm, dwmstatus, dwmbar
patches
Collection of patches for dwm, st and dmenu
Stars: ✭ 202 (+304%)
Mutual labels:  dwm, suckless
dwm-vanitygaps
My dwm vanitygaps build (incl. individual patches)
Stars: ✭ 26 (-48%)
Mutual labels:  dwm, suckless
chadwm
Making dwm as beautiful as possible!
Stars: ✭ 619 (+1138%)
Mutual labels:  dwm, suckless
voidwm
voidwm • sanely patched dwm
Stars: ✭ 32 (-36%)
Mutual labels:  dwm, suckless
dotfiles
My dotfiles with dwm, qtile and awesome.
Stars: ✭ 178 (+256%)
Mutual labels:  dwm
dotfiles
rice repo
Stars: ✭ 71 (+42%)
Mutual labels:  dwm
dwm-ipc
A DWM patch that allows IPC communication through a UNIX socket
Stars: ✭ 55 (+10%)
Mutual labels:  dwm
CleanDmenu
🚀 Floating and enhanced dmenu build
Stars: ✭ 25 (-50%)
Mutual labels:  suckless
dotfiles
Current dotfiles and scripts
Stars: ✭ 35 (-30%)
Mutual labels:  dwm
sent
a simple plaintext presentation tool
Stars: ✭ 22 (-56%)
Mutual labels:  suckless
freeshooter
This is old-school tool for taking screenshots without bloatware features, simple as life, light as air.
Stars: ✭ 102 (+104%)
Mutual labels:  dwm
cfg
my dotfiles
Stars: ✭ 26 (-48%)
Mutual labels:  dwm
ssu
Extremely simple su utility
Stars: ✭ 56 (+12%)
Mutual labels:  suckless
dotfiles
Salonia Matteo's dotfiles (GNU/Linux configuration)
Stars: ✭ 19 (-62%)
Mutual labels:  dwm
dotfiles
.foos for foos & more
Stars: ✭ 21 (-58%)
Mutual labels:  dwm
polybar-dwm-module
A dwm module for polybar
Stars: ✭ 91 (+82%)
Mutual labels:  dwm
dotfiles
Config files for wm and terminal apps
Stars: ✭ 15 (-70%)
Mutual labels:  dwm
torjail
🔒 download, verify & run torbrowser in a sandbox
Stars: ✭ 14 (-72%)
Mutual labels:  dwm
libudev-zero
Daemonless replacement for libudev
Stars: ✭ 157 (+214%)
Mutual labels:  suckless

Goblocks

Goblocks is a dwm status bar program partially inspired by dwmblocks.

Goblocks in action

It is lightweight, fast, multithreaded, well(-ish) documented and easily customizable. It is also one of very few status bars done correctly. Most of them "naively" scan for changes every 1s or so, whereas goblocks only updates when there are updates to be done.

Installation

Pull this repo and run:

make install

This will build this project and generate default config file at $HOME/.config/goblocks.json. After that you can simply run it with

goblocks &!

If you want to uninstall it, just run.

make uninstall

Customization

You can add your own blocks in config file. Just remember to modify config at ~/.config/ goblocks.json. After you have applied your changes, just re run the aplication.

In order to add new block to the bar add new action object to actions array in goblocks.json:

"actions":
	[
		{
			"prefix": "🗓 ",
			"updateSignal": "35",
			"command": "#Date",
			"format": "Monday 02/01/2006 15:04:05",
			"timer": "1s"
		},
		{
			"prefix": "🔊 ",
			"updateSignal": "36",
			"command": "amixer get Master | awk ' \/%\/ {print $5 $6}' | head -1 | sed -e 's\/]\\[\/ \/g'",
			"timer": "0"
		},
		{
			"prefix": "Mem: ",
			"updateSignal": "37",
			"command": "#Memory",
			"suffix": "%",
			"format": "%.2f",	
			"timer": "2s"
		},
		{
			"prefix": "CPU: ",
			"updateSignal": "38",
			"command": "#Cpu",
			"suffix": "%",
			"format": "%.2f",	
			"timer": "2s"
		}
	]

Config properties

  1. prefix(optional):text that will be displayed before the output of command.
  2. updateSignal: signal that can be sent to goblocks to re-run the command and refresh output in bar. This value must be in range 34-64 inclusive.
  3. command: functionality that will produce the text for status bar. If it starts with hash-tag goblocks will try to invoke corresponding built-in function. If it doesn't then goblocks will run command in shell(sh) and put it's output in status bar.
  4. suffix(optional): Text that will be displayed after the output of command
  5. Timer: Time period after which command is being re-run and text in status bar refreshed. s for seconds(1s), m for minutes(1m), h for hours(1h). When set to 0 the block will only update at startup and when updateSignal is sent to goblocks.

Signaling Blocks

Blocks can be updated immediately by sending the corresponding updateSignal to the goblocks process. For example, kill -35 $(pidof goblocks) will update the block with updateSignal 35. Alternatively, you can signal a block with pkill -RTMIN+<x> goblocks where x is the updateSignal minus 34. So pkill -RTMIN+1 goblocks will update blocks with updateSignal 35.

Note if multiple blocks are assigned the same updateSignal only the first will be updated.

Miscellaneous

Formating date with #Date built in program

Format a reference layout parameter (Mon Jan 2 15:04:05 MST 2006) in a way that you would like to have your time formatted. If you have trouble check out this guideline.

Escape sh commands

Some sh commands have characters (e.g. \) which have a special meaning in JSON format. To easily escape them just dump your sh commands to json formatter.

TODO

  1. Create a block that displays weather condition. Done
  2. Add implementation documentation Code is pretty readable and has comments. This should be enough
  3. Add support for colour text in blocks.

Feedback

Your feedback is more than welcome and if you have some questions/issues/feature ideas just post them on issues page.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].