- Go 93.2%
- Nix 6.8%
| blocks | ||
| .gitignore | ||
| config.example.toml | ||
| default.nix | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
blks
blks is a slstatus/dwmblocks/dwlblocks-like program that reads a configuration and pipes stdout in the specified intervals.
[!INFO] I wrote this program just for fun, it doesn't aim to be better than any of the other stdout status programs, although one of the motivators was that I had some issues where dwlblocks randomly stopped working for me, probably a skill issue on my end, who knows...
Configuration
The configuration is written in toml, and should be placed at $XDG_CONFIG_HOME/blks/config.toml
this usually means ~/.config/blks/config.toml.
Parameters
- separator:
string, the character(s) printed in between blocks - interval:
number, the frequency in which the program will output to stdout (in seconds)
Blocks
Clock
- type:
"clock" - interval:
number, the frequency in which the block will be updated (seconds) - format:
- Y: Year (number)
- M: Month (number)
- B: Month (name)
- D: Day (number)
- h: hour (24h format)
- m: minute
- s: second
Cmd
- type:
"cmd" - interval:
number - args: command to run
- format:
- output: The output of the command
Cpu
- type:
"cpu" - interval:
number - format:
- freq: Cpu clock frequency
- freqType: Mhz
- model: Cpu model
- cores: Number of cores
- usagePerc: Usage percentage
Disk
- type:
"disk" - interval:
number - format:
- fs: Fylesystem type
- path: Disk mountpoint
- total: Total disk size
- totalType: MB/GB/TB...
- used: Amount of disk used
- usedType: MB/BG/TB...
- usedPerc: Percentage of disk used
Microphone
- type:
"mic" - interval:
number - format:
- perc: Volume percentage
Network
- type:
"net" - interval:
number - args: The name of the card
- format:
- name: The name of the card
- addr: The ip of the card
- hwAddr: The mac of the card
Ram
- type:
"ram" - interval:
number - format:
- used: Amount used
- usedType: KB/MB/GB...
- usedPerc: Percentage of ram used
- total: Total amount of ram
- totalType: KB/MB/GB...
Volume
- type:
"vol" - interval:
number - format:
- perc: Volume percentage
Usage
The program will search for a config file at $XDG_CONFIG_HOME/blks/config.toml, if
the variable is not set it will default to ~/.config/blks/config.toml, you can also
specify a different location by using the -c flag followed by the new config path when
running the program, like so:
# run with default config path
blks
# override default config
blks -c some/other/dir/config.toml
TODO
- add documentation
- add battery block
- add volume block
- add network block