dwmblocks/slstatus-like program written in go
  • Go 93.2%
  • Nix 6.8%
Find a file
2025-03-08 02:01:45 +01:00
blocks remove bat module 2025-02-20 08:32:28 +01:00
.gitignore config dir 2025-01-29 20:45:47 +01:00
config.example.toml add global interval setting 2025-02-07 08:28:15 +01:00
default.nix pkgname 2025-03-08 02:01:45 +01:00
go.mod specify different config 2025-01-30 08:01:53 +01:00
go.sum specify different config 2025-01-30 08:01:53 +01:00
LICENSE add license 2025-01-29 23:40:53 +01:00
main.go fmt 2025-03-05 10:25:40 +01:00
README.md idk 2025-02-07 08:28:31 +01:00

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