Permalink
Browse files

sh files for notis

  • Loading branch information...
intrntbrn
intrntbrn committed May 1, 2012
0 parents commit c7cca5a37681d6c295af29ceb5a09e050ef64a6c
Showing with 258 additions and 0 deletions.
  1. 0 README
  2. +104 −0 bright.sh
  3. +154 −0 vol.sh
0 README
No changes.
104 bright.sh
@@ -0,0 +1,104 @@
+#!/bin/bash
+
+# get brightness
+bright=`cat /sys/class/backlight/acpi_video0/actual_brightness`
+
+# calc percent
+#perc=`expr $bright "*" 100 "/" 15`
+
+if [[ $bright == 15 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_15.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 14 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_14.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 13 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_13.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 12 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_12.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 11 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_11.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 10 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_10.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 9 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_9.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 8 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_8.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 7 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_7.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 6 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_6.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 5 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_5.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 4 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_4.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 3 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_3.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 2 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_2.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 1 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_1.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+
+if [[ $bright == 0 ]]; then
+ echo 'brightnotiicon="/home/intrntbrn/icons/noti/brightbar/bar_0.png"' | awesome-client
+ echo 'brightnoti()' | awesome-client
+ return 0
+fi
+exit 0
154 vol.sh
@@ -0,0 +1,154 @@
+#!/bin/bash
+
+STEP="5"
+UNIT="%"
+
+SETVOL="/usr/bin/amixer -q sset Master"
+STATE=$(amixer get Master | grep Left | egrep 'Playback.*?\[o' | egrep -o '\[o.+\]')
+
+case "$1" in
+ "up")
+ if [[ $STATE == '[off]' ]]; then
+ $SETVOL unmute
+ fi
+ $SETVOL $STEP$UNIT+
+ ;;
+ "down")
+ $SETVOL $STEP$UNIT-
+ ;;
+ "mute")
+ $SETVOL toggle
+ ;;
+esac
+
+STATE=$(amixer get Master | grep Left | egrep 'Playback.*?\[o' | egrep -o '\[o.+\]')
+VOLUME=$(amixer get Master | grep 'Front Left:' | grep -E -o "[0-9]+%" | tr -d %)
+
+
+if [[ $VOLUME == 0 ]] || [[ $STATE == '[off]' ]]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_00.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+else
+ if [ $VOLUME -gt 95 ] && [ $VOLUME -le 999 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_100.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 0 ] && [ $VOLUME -le 5 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_05.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 5 ] && [ $VOLUME -le 10 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_10.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 10 ] && [ $VOLUME -le 15 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_15.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 15 ] && [ $VOLUME -le 20 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_20.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 20 ] && [ $VOLUME -le 25 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_25.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 25 ] && [ $VOLUME -le 30 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_30.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 30 ] && [ $VOLUME -le 35 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_35.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 35 ] && [ $VOLUME -le 40 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_40.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 40 ] && [ $VOLUME -le 45 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_45.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 45 ] && [ $VOLUME -le 50 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_50.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 50 ] && [ $VOLUME -le 55 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_55.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 55 ] && [ $VOLUME -le 60 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_60.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 60 ] && [ $VOLUME -le 65 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_65.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 65 ] && [ $VOLUME -le 70 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_70.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 70 ] && [ $VOLUME -le 75 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_75.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 75 ] && [ $VOLUME -le 80 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_80.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 80 ] && [ $VOLUME -le 85 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_85.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 85 ] && [ $VOLUME -le 90 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_90.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+ if [ $VOLUME -gt 90 ] && [ $VOLUME -le 95 ]; then
+ echo 'volnotiicon="/usr/share/awesome/icons/noti/volbar/bar_95.png"' | awesome-client
+ echo 'volnoti()' | awesome-client
+ return 0
+ fi
+
+fi
+
+exit 0

0 comments on commit c7cca5a

Please sign in to comment.