summaryrefslogtreecommitdiffhomepage
path: root/examples/status.sh
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-08-09 23:48:44 +0100
committerjao <jao@gnu.org>2022-08-09 23:48:44 +0100
commit63303977071f34d8142709960e8dae97cea1951e (patch)
tree19ea7c2704548f64d01619d9418581156f35dea9 /examples/status.sh
parent474a7ebbe2589ae6b03f13c8318f36e9d3fde00b (diff)
downloadxmobar-63303977071f34d8142709960e8dae97cea1951e.tar.gz
xmobar-63303977071f34d8142709960e8dae97cea1951e.tar.bz2
examples -> etc
Diffstat (limited to 'examples/status.sh')
-rwxr-xr-xexamples/status.sh56
1 files changed, 0 insertions, 56 deletions
diff --git a/examples/status.sh b/examples/status.sh
deleted file mode 100755
index 151728b..0000000
--- a/examples/status.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-
-STATUSPIPE="/tmp/xmobar_status_jrk"
-
-function isMuted () {
- # retrieve mute status
- # return an arbitrary string for true or nothing at all
- echo
-}
-
-function getPercent () {
- # somehow retrieve the percent value as plain int (e.g. "66")
- echo "66"
-}
-
-function percentBar () {
- local i=1 res=
- normal=47 high=80
- fgColor='#657b83' mutedColor='#cb4b16'
- lowColor='#859900' midColor='#b58900'
- highColor='#cb4b16'
-
- bar="$(echo -ne "\u2588")"
- percent="$( getPercent )"
- muted="$( isMuted )"
-
- if [ -n "$muted" ]; then
- res="<fc=$mutedColor>"
- else
- res="<fc=$lowColor>"
- fi
-
- while [ $i -lt $percent ]; do
- if [ $i -eq $normal -a -z "$muted" ]; then
- res+="</fc><fc=$midColor>"
- elif [ $i -eq $high -a -z "$muted" ]; then
- res+="</fc><fc=$highColor>"
- fi
-
- res+=$bar
- i=$((i+1))
- done
-
- res+="</fc><fc=$fgColor>"
-
- while [ $i -lt 100 ]; do
- res+='-'
- i=$((i+1))
- done
-
- echo "$res</fc>"
-}
-
-[[ -p $STATUSPIPE ]] || mkfifo $STATUSPIPE
-
-echo "$( percentBar )" > "$STATUSPIPE"