A concurrent, hackable bar/panel for X written in Go.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
box Little improvements Jan 15, 2019
.editorconfig
.gitignore Implement popups, better error checking, use packr Dec 27, 2018
LICENSE.md Initial commit Jul 11, 2017
README.md Many minor popup improvements, add weather popup Dec 30, 2018
TODO.md Little improvements Jan 15, 2019
bar.go Little improvements Jan 15, 2019
block.go Implement popups, better error checking, use packr Dec 27, 2018
blocks.go Little improvements Jan 15, 2019
main.go Little improvements Jan 15, 2019
popup.go Little improvements Jan 15, 2019
popups.go
util.go Many minor popup improvements, add weather popup Dec 30, 2018
x.go Little improvements Jan 15, 2019

README.md

Go Report Card

melonbar - A concurrent, hackable bar/panel for X written in Go.

INSTALLATION

go get github.com/onodera-punpun/melonbar

Or for a binary that includes embedded static files:

packr2 get github.com/onodera-punpun/melonbar

melonbar depends on Go 1.9 or newer, gnuplot, and packr2.

USAGE

The idea is that this bar is very "simple" to configure by just modifying the source code, à la suckless.

Users can configure the position, width, height and font of the bar in main.go. A bar consist of various blocks that display info, these blocks are functions definded in blocks.go and exectured in a goroutine in main.go.

CREATING BLOCK FUNCTIONS

On top of each block function you should run bar.initBlock(), this generates a block object, and is where most of the configuration happens. Here is a short explanation of each parameter from left to right:

  • The name of the block, this is gets used as the name of the block map key. (string)
  • The initial string the block should display. (string)
  • The width of the block. (int)
  • The aligment of the text, this can be 'l' for left aligment, 'c' for center aligment 'r' for right aligment and 'a' for absolute center aligment. (rune)
  • Additional x offset to further tweak the location of the text. (int)
  • The foreground color of the block in hexadecimal. (string)
  • The background color of the block in hexadecimal. (string)

It is possible to bind mousebindings to a block using using:

block.actions["buttonN"] = func() {
	// Do stuff.
}

When you've gathered all information you can update the block values using for example block.bg = "#FF0000" or block.txt = "Hello World!" and executing bar.redraw <- block.

AUTHORS

Camille Scholtz