Pluggable Go server to generate Powerline segments

gowerline

Because Python is hard and I've always wanted to write my segments in Go.

Example

What is this ?

This is a deamon that generates and returns Powerline segments as described in the docs. This project has 2 parts:

  • The daemon that runs your go code and exposes an HTTP API
  • The powerline compatible code that glues it with the powerline-daemon

How does it work ?

This is a pluggable segment generating system. Essentially a very simple powerline "segment" in the sense of the python class, will call a Go server that will be in charge of generating the actual segments. It allows you to generate data that would be too long to generate if it had to be called every time you pop a shell, for instance do API calls to your favourite stock ticker or for example check the validity of an auth token every other minute.

Available plugins

Every plugin has a README.md file at the root of their directory detailing what they do and how they work

Plugin name Plugin description
Bash Renders segments that are the result of bash commands ran on a schedule
Finnhub Displays financial infos about a stock ticker (or many!) that you are interested in
Vault Gives you information about your current Hashicorp Vault token (display name, validity TTL & co)
Colourenv Renders environment variables in your terminal with different colourschemes depending on values (useful to not wreck production by mistake)

How does it work (on my system) ?

You have two parts to it:

  • The powerline extension, that bridges between poweline and the Go server
  • The Go server that will bridge between the python extension and the plugins.

Essentially, everytime you open a prompt, Powerline will call the various extensions of the server to fetch segments to render, it's as simple as this.

How do I install it ?

$ make install # Will install the python extension and the go binary
$ make install-systemd # Will install the userland systemd service to start the server
$ make install-full # will do both
# this will remove it
$ make uninstall

You might also need to pip install -r requirements.txt

How do I use it ?

Add the segment to powerline

This will use the time plugin. In your powerline theme, add the following:

{
    "function": "gowerline.gowerline.gwl",
    "priority": 10,
    "args": {
        "function": "time"
    }
}

Every plugin exposes one or more function that you have to reference in your powerline config. This will effectively be passed down to the Go code, as long as every other variable you add in this JSON.

The Gowerline config itself lives in ~/.gowerline/server.yaml

---
port: 6666
plugins:
- time
- finnhub
- vault
- colourenv

How do I extend it ?

Go have a look at the example plugin. It should be easy to understand. Feel free to copy it in the plugins/ directory and fill in the blanks.

The Makefile is designed so that if you run make plugins your new source will be picked up and compiled to bin/plugins/<plugin>

The plugins are complied as Go plugins (essentialy .so libraries) that are loaded by the main daemon.

Owner
Thomas Maurice
Sigh Reliability Engineer
Thomas Maurice
Similar Resources

Broadcast-server - A simple Go server that broadcasts any data/stream

broadcast A simple Go server that broadcasts any data/stream usage data You can

Oct 21, 2022

Videos2gether-server - Server for the Realtime video streaming app Videos2Gether

Videos Together server Server source code for the https://videos2gether.com Arch

Jan 9, 2022

JPRQ Customizer is a customizer that helps to use the JPRQ server code and make it compatible with your own server with custom subdomain and domain

JPRQ Customizer is a customizer that helps to use the JPRQ server code and make it compatible with your own server with custom subdomain and domain

JPRQ Customizer is a customizer that helps to use the JPRQ server code and make it compatible with your own server with custom subdomain and domain.You can upload the generated directory to your web server and expose user localhost to public internet. You can use this to make your local machine a command center for your ethical hacking purpose ;)

Jan 19, 2022

Envoy-eds-server - Envoy EDS server is a working Envoy Discovery Service implementation

envoy-eds-server Intro Envoy EDS server is a working Envoy Discovery Service imp

Apr 2, 2022

Http-server - A HTTP server and can be accessed via TLS and non-TLS mode

Application server.go runs a HTTP/HTTPS server on the port 9090. It gives you 4

Feb 3, 2022

Server - Dupman server written in Go

server dupman server written in Go Requirements Go (=1.17) Installation Usage C

Feb 22, 2022

“Dear Port80” is a zero-config TCP proxy server that hides SSH connection behind a HTTP server!

Dear Port80 About The Project: “Dear Port80” is a zero-config TCP proxy server that hides SSH connection behind a HTTP server! +---------------------

Jun 29, 2022

Generate CRUD gRPC backends from single YAML description.

Generate CRUD gRPC backends from single YAML description.

Pike Generate CRUD gRPC backends from single YAML description. Check out Playground! Pike generates: gRPC Protobuf service description with basic Crea

Dec 23, 2022

Generate types and service clients from protobuf definitions annotated with http rules.

protoc-gen-typescript-http Generates Typescript types and service clients from protobuf definitions annotated with http rules. The generated types fol

Nov 22, 2022
Comments
  • Bump certifi from 2021.5.30 to 2022.12.7

    Bump certifi from 2021.5.30 to 2022.12.7

    Bumps certifi from 2021.5.30 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

Judas is a pluggable phishing proxy.

Judas is a pluggable phishing proxy.

Jul 11, 2022
meek is a blocking-resistant pluggable transport for Tor.

meek is a blocking-resistant pluggable transport for Tor. It encodes a data stream as a sequence of HTTPS requests and responses. Requests are reflect

Nov 9, 2021
Generate Server and Client side code

Additional Information Generate Server and Client side code Pre-generated stub file is included in the go project. If you need to generate the stub fi

Nov 6, 2021
A Language Server Protocol (LSP) server for Jsonnet

Jsonnet Language Server Warning: This project is in active development and is likely very buggy. A Language Server Protocol (LSP) server for Jsonnet.

Nov 22, 2022
The server-pubsub is the main backend of DATAVOC project that manages all the other web-server modules of the same project such as the processor

server-pubsub The server-pubsub is the main backend of DATAVOC project that manages all the other web-server modules of the same project such as the p

Dec 3, 2021
server-to-server sync application, written in go/golang.

svcpy: server to server copy a basic server-to-server copy application. on a single binary, it can be a server or a client. example usage: on the serv

Nov 4, 2021
Server and client implementation of the grpc go libraries to perform unary, client streaming, server streaming and full duplex RPCs from gRPC go introduction

Description This is an implementation of a gRPC client and server that provides route guidance from gRPC Basics: Go tutorial. It demonstrates how to u

Nov 24, 2021
Pape-server - A small server written in golang to serve a random wallpaper.

pape-server I like to inject custom CSS themes into a lot of websites and electron apps, however browsers don't let websites access local disk through

Dec 31, 2021
Cert bound sts server - Certificate Bound Tokens using Security Token Exchange Server (STS)
Cert bound sts server - Certificate Bound Tokens using Security Token Exchange Server (STS)

Certificate Bound Tokens using Security Token Exchange Server (STS) Sample demonstration of Certificate Bound Tokens acquired from a Security Token Ex

Jan 2, 2022
Echo-server - An HTTP echo server designed for testing applications and proxies

echo-server An HTTP echo server designed for testing applications and proxies. R

Dec 20, 2022