Arctis

bar.sh

Feb 12th, 2015
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.76 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. background="$(grep "*background" "$HOME/.Xresources" | tail -c 7)"
  4. foreground="$(grep "*foreground" "$HOME/.Xresources" | tail -c 7)"
  5. gray="$(grep "*background" "$HOME/.Xresources" | tail -c 7)"
  6.  
  7. font=-*-dina-medium-r-*-*-10-*-*-*-*-*-*-*
  8.  
  9. storage="$HOME/.scripts/storage"
  10. me=$(id -u -n & hostname & uname -r)
  11.  
  12.  
  13. while true; do
  14.     battery=$(acpi --battery | awk -F, '{print $2 $3}' | sed "s/%/%%/" | sed "s/until charged/charging/")
  15.     ip=$(hostname --ip-address)
  16.     backlight=$(xbacklight -get | sed 's/\([a-zA-Z: \t]\)//g' | cut -d . -f 1)
  17.     mem=$(free -m | awk '{print $3}' | sed "s/free/Mem Used:/" | sed "s/\b[^\s]\b//
  18.    ")
  19.     pavo=$(ponymix get-volume)
  20.     time=$(date +"%A, %I:%M %p")
  21.     CURRENT=`mpc current`
  22.     if [[ `cat $storage` = "1" ]]
  23.     then
  24.        # echo %{c}%{F#FF$gray}%{F#FF$foreground}%{A:counter:} $CURRENT %{A}
  25.         echo %{c}%{F#FF$gray}%{F#FF$foreground}%{A:counter:} $me %{A}
  26.     elif [[ `cat $storage` = "2" ]]
  27.     then
  28.         echo %{c}%{F#FF$gray}%{F#FF$foreground}%{A:counter:} Bat:$battery %{A}
  29.     elif [[ `cat $storage` = "3" ]]
  30.     then
  31.          echo %{c}%{F#FF$gray}%{F#FF$foreground}%{A:counter:} $ip %{A}
  32.      elif [[ `cat $storage` = "4" ]]
  33.      then
  34.          echo %{c}%{F#FF$gray}%{F#FF$foreground}%{A:counter:}Backlight: $backlight%% %{A}
  35.      elif [[ `cat $storage` = "5" ]]
  36.      then
  37.         echo %{c}%{F#FF$gray}%{F#FF$foreground}%{A:counter:} $mem mb %{A}
  38.     elif [[ `cat $storage` = "0" ]]
  39.     then
  40.         echo %{c}%{F#FF$gray}%{F#FF$foreground}%{A:counter:}Volume: $pavo%% %{A}
  41.     elif [[ `cat $storage` = "6" ]]
  42.     then
  43.         echo %{c}%{F#FF$gray}%{F#FF$foreground}%{A:counter:}$time %{A}
  44.     fi
  45.     sleep 1
  46. done | bar -p -g 199x40+1155+717 -d -f $font -B \#FF$background | bash
Advertisement
Add Comment
Please, Sign In to add comment