GithubHelp home page GithubHelp logo

waybar-modules's Introduction

waybar-modules

A repository of programs I use for custom waybar modules.

The font used for icons is ttf-material-design-icons from the AUR. You can easily patch the source files if you have a different font/icon you wish to use.

Installation

Arch Linux

AUR releases are signed so you'll need to import my GPG key:

<[email protected]> B46B 3262 73E4 A1D2 1AAA 3F6F 529A C100 50BD 24EF

Then install the modules with my PKGBUILD:

$ git clone https://github.com/krathalan/pkgbuilds
$ cd pkgbuilds/krathalans-waybar-modules/
$ nano --view PKGBUILD # Always inspect PKGBUILDS before running makepkg!
$ makepkg -i

Other distros

You can simply build with make release in the module directory of your choosing. AppArmor profiles are provided in the apparmor-profiles/ folder.

battery (C)

example battery module

A battery module that displays the current power draw in watts. Displays an additional charging icon when charging. Does not display current power draw in watts when charging.

The program will return, as json data to Waybar, the percentage of the battery. This allows changing the icon based on the battery percentage in your Waybar config.

The program will also return the current state of the battery (charging/discharging), in lowercase. This allows changing the theme based on battery states in your waybar.css.

Here's two example outputs from the program:

{"text": "4W ", "class": "discharging", "percentage": 86}
{"text": "", "class": "charging", "percentage": 86}

Here's an example module in my Waybar config:

  "custom/battery": {
    "interval": 8,
    "tooltip": false,
    "format": "{percentage}% {}{icon}",
    "format-icons": ["", "", "", "", "", "", ""],
    "return-type": "json",
    "exec": "$HOME/path/to/binary/battery"
  },

Here's some example Waybar css for this battery module:

#custom-battery {
    padding: 0 5px;
    margin: 0 4px;
    background-color: transparent;
    border-bottom: 2px solid #bff874;
    color: #ffffff;
}

#custom-battery.charging {
  border-bottom: 2px solid #00ff96;
}

update-count (Bash)

A wrapper on checkupdates from pacman-contrib that can optionally turn critical when an update is available for one or more user-defined critical packages (specified on separate lines in ~/.config/waybar-modules/packages).

Warning: this script pings my personal domain krathalan.net to check if an internet connection is available.

vpn (C)

example vpn module

This program takes the name of a VPN interface, like "mullvad-us3", and returns json data containing information on the state of the VPN connection. This information can be used to change the theme based on the state of your VPN connection in your waybar.css.

Here's an example module in my Waybar config:

"custom/vpn": {
  "interval": 5,
  "tooltip": false,
  "format": "{}",
  "return-type": "json",
  "exec": "$HOME/path/to/binary/vpn mullvad-us5"
},

Here's some example Waybar css for this VPN module:

#custom-vpn {
    padding: 0 5px;
    margin: 0 4px;
    background-color: transparent;
    border-bottom: 2px solid #00ff96;
    color: #ffffff;
}

#custom-vpn.down {
  border-bottom: 2px solid #dd2241;
}

waybar-modules's People

Contributors

krathalan avatar

Watchers

James Cloos avatar  avatar

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.