From dcfd734112dfbff3ad24c6bdbdea46b9f7919369 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Sun, 1 Mar 2015 14:09:52 +0100 Subject: firefox + panel update --- ratpoison/panel/cpu | 3 --- ratpoison/panel/load | 7 +++++++ ratpoison/panel/monce | 25 +++++++++++++++++++++++++ ratpoison/panel/music | 38 +++++++++++++++++++++++++++++++++----- ratpoison/panel/panel | 5 +++-- ratpoison/panel/panel_bar | 13 +++++++++++-- ratpoison/panel/signal | 19 +++++++++++++++++++ 7 files changed, 98 insertions(+), 12 deletions(-) delete mode 100755 ratpoison/panel/cpu create mode 100755 ratpoison/panel/load create mode 100755 ratpoison/panel/monce create mode 100755 ratpoison/panel/signal (limited to 'ratpoison/panel') diff --git a/ratpoison/panel/cpu b/ratpoison/panel/cpu deleted file mode 100755 index fe018a5..0000000 --- a/ratpoison/panel/cpu +++ /dev/null @@ -1,3 +0,0 @@ -while true; do -mpstat -P ALL 2 1 | grep "Average.*all" | awk '{print "C"$3+$5}' -done diff --git a/ratpoison/panel/load b/ratpoison/panel/load new file mode 100755 index 0000000..3977bee --- /dev/null +++ b/ratpoison/panel/load @@ -0,0 +1,7 @@ +#!/bin/bash +while true; do +cpu=`mpstat -P ALL 2 1 | grep "Average.*all" | awk '{print $3+$5}'` +mem=`free | grep Mem | awk '{print $3/$2 * 100.0}'` +printf "C%.*f\n" 1 $cpu +printf "R%.*f\n" 0 $mem +done diff --git a/ratpoison/panel/monce b/ratpoison/panel/monce new file mode 100755 index 0000000..caa316c --- /dev/null +++ b/ratpoison/panel/monce @@ -0,0 +1,25 @@ +#!/bin/sh + + +f=1 +d=30 # width + +new=`mpc current` +if [ "$old" != "$new" ];then +f=1; +old="$new" +fi + + +e=$(expr $f + $d) + +if mpc | grep -q playing; then +symbol='p' +else +symbol='P' +fi + +echo "$symbol`echo $new | cut --bytes $f-$e`" +echo "K`mpc -h 127.0.0.1 volume | perl -pe 's/^volume://' | perl -pe 's/%$//' | perl -pe 's/^ //'`" + + diff --git a/ratpoison/panel/music b/ratpoison/panel/music index 6190dbc..a01ad03 100755 --- a/ratpoison/panel/music +++ b/ratpoison/panel/music @@ -1,11 +1,39 @@ +#!/bin/sh + + +f=1 +d=30 # width + while true;do + +new=`mpc current` +if [ "$old" != "$new" ];then +f=1; +old="$new" +fi + + +e=$(expr $f + $d) + +if [ $e -gt ${#new} ];then +e=${#new} +f=$(expr $e - $d) +fi + if mpc | grep -q playing; then -echo "p`mpc current`" | cut --bytes 1-40 -echo "K`mpc -h 127.0.0.1 volume | perl -pe 's/^volume://' | perl -pe 's/%$//' | perl -pe 's/^ //'`" +symbol='p' else -echo "P`mpc current`" | cut --bytes 1-40 -sleep 1; +symbol='P' +fi + +echo "$symbol`echo $new | cut --bytes $f-$e`" echo "K`mpc -h 127.0.0.1 volume | perl -pe 's/^volume://' | perl -pe 's/%$//' | perl -pe 's/^ //'`" + +f=$(expr $d / 2 + $f) + +if [ $e == ${#new} ];then +f=1; fi -sleep 5; + +sleep 2; done diff --git a/ratpoison/panel/panel b/ratpoison/panel/panel index 08c7df4..95b8aa4 100755 --- a/ratpoison/panel/panel +++ b/ratpoison/panel/panel @@ -12,9 +12,10 @@ xtitle -sf 'T%s' > "$PANEL_FIFO" & essid -sf 'E%s' -i 3 -w wlp2s0 > "$PANEL_FIFO" & volume -i 10 -sf 'V%i' > "$PANEL_FIFO" & battery -i 5 -sf 'B%i' > "$PANEL_FIFO" & -clock -sf 'S%d %a %H:%M' > "$PANEL_FIFO" & +clock -sf 'Z%d %a %H:%M' > "$PANEL_FIFO" & ./music > "$PANEL_FIFO" & -./cpu > "$PANEL_FIFO" & +./load > "$PANEL_FIFO" & +./signal > "$PANEL_FIFO" & source ./panel_colors diff --git a/ratpoison/panel/panel_bar b/ratpoison/panel/panel_bar index 5015464..6ccf74b 100755 --- a/ratpoison/panel/panel_bar +++ b/ratpoison/panel/panel_bar @@ -12,6 +12,15 @@ source ./panel_colors # playing mpc cpu="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} C:${line#?} %{B-}%{F-}" ;; + R*) + # playing mpc + ram="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} R:${line#?} %{B-}%{F-}" + ;; + + S*) + # playing mpc + signal="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} S:${line#?} %{B-}%{F-}" + ;; p*) # playing mpc @@ -50,7 +59,7 @@ source ./panel_colors fi ;; - S*) + Z*) # clock output time_infos="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${line#?} %{B-}%{F-}" ;; @@ -112,5 +121,5 @@ source ./panel_colors done ;; esac - printf "%s\n" "%{l}${wm_infos}${title}%{r}${playing}${paused}${cpu}${essid}${volume}${musicvol}${battery}${time_infos} " + printf "%s\n" "%{l}${wm_infos}${title}%{r}${playing}${paused}${cpu}${ram}${essid}${signal}${volume}${musicvol}${battery}${time_infos} " done diff --git a/ratpoison/panel/signal b/ratpoison/panel/signal new file mode 100755 index 0000000..75ec253 --- /dev/null +++ b/ratpoison/panel/signal @@ -0,0 +1,19 @@ +#!/bin/sh +while true;do +signal=`iwconfig wlp2s0 | grep Signal| perl -pe 's/.*level=//; s/ dBm.*//'` +#convert to Quality + + if [ $signal -le -100 ];then + quality=0; + elif [ $signal -ge -50 ];then + quality=100; + elif [ -z $signal ];then + quality=0; + else + quality=$(( 2 * ( $signal + 100 ))); + fi + +echo "S$quality"; +sleep 3; +done + -- cgit v1.2.3-54-g00ecf