Goblocks is a dwm status bar program partially inspired by dwmblocks.
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.
Requires xsetroot
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
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"
}
]
- prefix(optional):text that will be displayed before the output of command.
- 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.
- 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.
- suffix(optional): Text that will be displayed after the output of command
- 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.
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.
Comming soon!
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.
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.
Create a block that displays weather condition.Done- Add implementation documentation
- Add support for colour text in blocks.
Your feedback is more than welcome and if you have some questions/issues/feature ideas just post them on issues page.