GithubHelp home page GithubHelp logo

luxraider / dwm-status Goto Github PK

View Code? Open in Web Editor NEW

This project forked from s1n7ax/dwm-status

0.0 0.0 0.0 2.6 MB

simple and flexible dwm status bar application

License: MIT License

Python 100.00%

dwm-status's Introduction

dwm-status

dwm-status is a simple python program for setting dwm status bar. One special thing about dwm-status is, it loads or reads resources only when needed. If I'm reading CPU usage in every second it doesn't mean I have to read or load all the other resources (storage for example) each and every second right? So every dwm-status-component reads/load details independently from others.

Requirements

Install following packages:

python3 (dwm-status is a python3 program)
lm_sensors (for reading CPU details)
amixer (for reading volume)

Internet connection: this is required to get the weather details (weather details are removed from the status bar when failed to get details)

Weather Location Details:

This uses http://wttr.in/<location> endpoint to get weather details. So the location passed to Weather constructor will be replace <location> in the URL.

dwm_status.py

status_list = [
    Weather("Colombo"),
]

Volume Controls:

Volume component is listening to SIGUSR1 custom signal and triggers set_details() method. Because it's using @trigger_change_event decorator, call to this method will trigger update_status()

@on_signal
@trigger_change_event
def set_details(self):
	self.resources = self.get_details()

So if you run kill -SIGUSR1 $(pgrep dwm_status.py) in a terminal window will trigger @on_signal methods. So I automated this process using sxhkd as follows

.config/sxhkd/sxhkdrc

#------------------------------------------------------------------------------#
#                              independent hotkeys                             #
#------------------------------------------------------------------------------#
# make sxhkd reload its configuration files:
alt + Escape
	pkill -USR1 -x sxhkd

# runs when increase/decrease volume function keys are pressed
XF86Audio{Raise,Lower}Volume
    pactl set-sink-volume @DEFAULT_SINK@ {+10%,-10%} && kill -SIGUSR1 $(pgrep dwm_status.py)

Running

make sure you got the permissions to execute

chmod -R u+x dwm-status/*

run dwm_status.py in a start up script (.xinirc)

.xinitrc

<path to dir>/dwm_status.py &

Screenshots

screenshot

dwm-status's People

Contributors

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