Advertisement
Guest User

lazy dwmstart

a guest
Jan 10th, 2013
6,378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.79 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #if egrep -iq 'touchpad' /proc/bus/input/devices; then
  4.    # synclient VertEdgeScroll=1 &
  5.    # synclient TapButton1=1 &
  6. #fi
  7.  
  8.  
  9. CUNT=1 #for bat indicator
  10. CZ=1
  11. CA=1
  12. YI=1
  13.  
  14. #EXEC DROPBOX
  15. #exec ~/.dropbox-dist/dropboxd &
  16.  
  17. xset fp rehash &
  18. xset fp+ /home/zyal/.fonts &
  19.  
  20.  
  21. xcompmgr -f -l 0.038 -O 0.040 -D 3 -F -C -n &
  22.  
  23.  
  24.  
  25.  
  26. nitrogen --restore &
  27. #redshift -l 43.4:79.4 -o &
  28. #redshift-diag &
  29.  
  30. dunst &
  31. #sleep 2s
  32.  
  33.  
  34.  
  35. sleep 1
  36. nm-applet &
  37.  
  38. CMAS () {
  39. artest=$( cmus-remote -Q | grep "tag artist" | sed s/"tag artist"/""/g | sed '1s/^.//')
  40. title=$( cmus-remote -Q | grep "tag title" | sed s/"tag title"/""/g )
  41. status=$( cmus-remote -Q | grep "status" | sed s/"tag title"/""/g )
  42. #touch .cmtemp
  43. track=$( echo -e "$artest -$title")
  44. if  [[ "$status" != "status playing" ]]; then
  45. cm=""
  46. cmcolor=$(echo -e "\x07$cm\x05")
  47. else
  48. #echo "$track" >> .cmptemp
  49. #cp .cmptemp .cmusinfo
  50. #rm .cmptemp
  51. trackc=$( echo -e "\x07$track \x05")
  52. echo "$trackc"
  53. fi
  54. }
  55.  
  56.  
  57. GREET () {
  58.  
  59. if [ $( date +%H ) -ge "6"  ] && [ $( date +%H ) -le "12" ] && [ "$CA" = 1 ]; then
  60. notify-send "Good Morning Lazy~"
  61. CA=2
  62. fi
  63.  
  64.  
  65. if [ $( date +%H ) -ge "13"  ] && [ $( date +%H ) -le "18" ] && [ "$CA" = 1 ]; then
  66. notify-send "Good Afternoon Lazy~"
  67. CA=2
  68. fi
  69.  
  70.  
  71. if [ $( date +%H ) -ge "19"  ] && [ "$CA" = 1 ]; then
  72. notify-send "Good Evening Lazy~"
  73. CA=2
  74. fi
  75.  
  76. }
  77.  
  78. player () {
  79. np=$(mpc current)
  80. npcolor=$(echo -e "\x07$np\x05")
  81. echo "$npcolor"
  82. }
  83.  
  84.  
  85. timex () {
  86. BATT=$( acpi -b | sed 's/.*[charging|unknown], \([0-9]*\)%.*/\1/gi' )
  87. STATUS=$( acpi -b | sed 's/.*: \([a-zA-Z]*\),.*/\1/gi' )
  88.  
  89.  
  90. if [[ "$BATT" -le "10" ]]; then
  91. batnot="\x06"
  92. fi
  93.  
  94.  
  95. if [ $BATT -le "30" ] && [ $BATT -gt 10 ]; then
  96. batnot="\x08"
  97. else
  98. batnot="\x01"
  99. fi
  100.  
  101. if [ $STATUS == "Charging" ]; then
  102. batnot="\x03"
  103. fi
  104. battlev=$( acpi -b | awk '{ print $3$4 }' | tr -d ','| sed s/"Discharging"/"-"/g | sed s/"Charging"/"+"/g | sed s/"Full"/""/g )
  105. numtasks=$( wc -l TODO | egrep "[0-9]{1,}" -o)
  106. timef=$( date +"%R" )
  107. timecolor=$(echo -e "\x05 $timef")
  108. #timecolor=$(echo -e "\x05 $timef\x01\x05$batnot[$battlev]")
  109. echo "$timecolor"
  110. }
  111.  
  112. BCHECK () {
  113. BATT=$( acpi -b | sed 's/.*[charging|unknown], \([0-9]*\)%.*/\1/gi' )
  114. if [ "$BATT" -lt "100" ] && [ "$CUNT" = "1" ]; then
  115.    STATUS=$( acpi -b | sed 's/.*: \([a-zA-Z]*\),.*/\1/gi' )
  116.     if [ $BATT -le "5" ] && [ $STATUS == 'Discharging' ]; then
  117.     notify-send "Battery Critical"
  118.     CUNT=2
  119.     fi
  120.  
  121. else
  122. if [[ "$BATT" -ge "11" ]]; then
  123. CUNT=1
  124. fi
  125.  
  126. fi
  127.  
  128. if [ "$BATT" -le "30" ] && [ "$YI" = "1" ]; then
  129.     notify-send -u critical "Warning: 2/3 Battery Drained"
  130.         mplayer /home/lazy/bin/sc/wd.mp3 >/dev/null 2>&1
  131.     if [ "$BATT" -le "30" ]; then
  132.     YI=2
  133.     fi
  134. fi
  135.  
  136.  
  137. }
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144. while true; do
  145. BCHECK
  146. GREET
  147. xsetroot -name "`CMAS``timex`"
  148. #xsetroot -name "test"
  149. sleep 3s
  150.  
  151. done &
  152.  
  153.  
  154.  
  155. exec dwm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement