Coder Social home page Coder Social logo

swaybar's Introduction

Swaybar

A highly parallelized swaybar app written in Go.

List of components currently implemented included:

  • Date/Time
  • CPU Temperature
  • CPU Utilization
  • GPU Temperature
  • Network Throughput

Sample Output

D 977.58 Kbps U 36.79 Mbps | CPU 0.9% | CPU 26.0°C | GPU 58.0°C | Oct 23 16:14

How it Works

The modules (or components) are each responsible for populating the status bar with specific data. For example, the network component provides data throughput rates for a given interface. Similarly, the time component returns time and date values.

Each component runs in its own thread and reports updates on a specified interval. For example, the network component can be set to publish updates every second, millisecond, ten microseconds, etc.

Whenever an update is pushed, the status bar will get updated allowing each components report updates at different intervals.

                    +---------------+       +---------------+
                    |  Component 0  |  ...  |  Component N  |
                    +-------+-------+       +-------+-------+
                            |                       |
                            v                       v
                  +------------------------------------------+
                  |         Asynchronous Data Buffer         |
                  +---------------------+--------------------+
                                        |
                                        v
                                 +-------------+
                                 |   Renderer  |
                                 +------+------+
                                        |
                                        v
+------------------------------------------------------------------------------+
| D 97.58 Kbps U 6.79 Mbps | CPU 0.9% | CPU 26.0°C | GPU 58.0°C | Oct 23 16:14 |
+------------------------------------------------------------------------------+

Building

go build -v -o bin ./...

Testing

go test -v ./...

Installation

After building the code, copy the generated binary to a directory of your choice and update your sway config bar section to launch the code. In this example, the program is copied to $HOME/.config/sway/statusbar.

The program will look for a config.yml file in a config directory in the same location as the executable.

Configuration

Refer to the config/config.yml reference file for configuring the status bar.

bar {
    status_command $HOME/.config/sway/statusbar
}

swaybar's People

Contributors

freddiehaddad avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Forkers

evgenkud

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.