Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- COLOR ?= green
- PLUG_STATE ?= plugged
- export
- show:
- ./xacpi.py
- # make icons red, yellow and green for various states of charge
- icons/$(PLUG_STATE)_%.png:
- # convert number in 0-100 range to 40-0 pixels
- height=$$((((100 - $*) * 4) / 10)) && \
- top=$$(($$height + 4)) && \
- convert -size 48x48 \
- -transparent white xc:white \
- -fill white -stroke black -draw "rectangle 12,3 36,45" \
- -fill $(COLOR) -stroke $(COLOR) -draw "rectangle 13,$$top 35,44" $@
- icons:
- mkdir $@
- for number in $$(seq 0 100); do \
- $(MAKE) icons/plugged_$$number.png; \
- done
- for number in $$(seq 21 100); do \
- $(MAKE) COLOR=yellow PLUG_STATE=unplugged \
- icons/unplugged_$$number.png; \
- done
- for number in $$(seq 0 20); do \
- $(MAKE) COLOR=red PLUG_STATE=unplugged \
- icons/unplugged_$$number.png; \
- done
- clean:
- rm -rf icons *.pyc *.pyo
- link:
- if [ \! -e $(HOME)/bin/xacpi ]; then \
- cd $(HOME)/bin && ln -s $(PWD)/xacpi.py xacpi; \
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement