Giter VIP home page Giter VIP logo

monkeywidgets's Introduction

monkeywidgets

A low effort attempt to build a hackish but functional AwesomeWM widget system for linux systems the easy way. If you know what you're doing, you better don't use this and rather use Lain, Vicious or build your own. This system is made purely by my own preferences and might not work for you (without touching the code). The goal is to write the widget code as short as possible while keeping it somewhat readable.

preview

Available Widgets:

  • Battery
  • Volume (pulse)
  • Backlight
  • WiFi
  • Nightlight

Install

git clone https://github.com/shagu/monkeywidgets .config/awesome/monkeywidgets

Dependencies

Some modules require system tools to be installed in order to query and/or set specific values.

  • battery: acpi
  • volume: pamixer
  • backlight: brightnessctl
  • wifi: wireless_tools (iwconfig)
  • night: xorg-xrandr

Usage

An example usage in rc.lua would look as following:

local widgets = require("monkeywidgets")
widgets.tick_size = 1

[...]

local monkeybattery = widgets.battery('BAT1')

[...]

s.mywibox:setup {
  layout = wibox.layout.align.horizontal,
  { -- left
    layout = wibox.layout.fixed.horizontal,
    s.mytaglist,
    s.mypromptbox,
  },
  { -- middle
    layout = wibox.layout.fixed.horizontal,
    s.mytasklist,
  },
  { -- right
    layout = wibox.layout.fixed.horizontal,
    monkeybattery.icon,
    monkeybattery,
    mytextclock,
  },
}

Internals

the internal core widget allows 6 arguments, where the last two are optional:

widgets.create = function(icon, cmd, timer, callback, buttons, tooltip)
  • icon: the icon shown up beside bar
  • cmd: the command that runs periodically
  • timer: the interval the function should run
  • callback: the code that runs on each call
  • buttons: an awesomeWM button table
  • tooltip: a function that shall run on mouse-over

Some module default setting can be overwritten from within the rc.lua (See Usage):

widgets.width = 14
widgets.height = nil
widgets.vertical = true
widgets.ticks = true
widgets.tick_size = 1

widgets.background = '#222222'
widgets.border     = '#444444'
widgets.color      = '#33ffcc'

Those should be self explanatory. If not, change them and see the results.

Credits

The widget icons are taken from Google's Material Design Icons repository.

monkeywidgets's People

Contributors

shagu avatar

Stargazers

 avatar

Watchers

 avatar  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.