statusbar-scripts

Simple shell scripts for status bars.
git clone http://git.efe.kim/statusbar-scripts.git
Log | Files | Refs

commit da1bad76d21012347329b390cc5cc8d4a6f12229
Author: Sunur Efe Vural <efe@efe.kim>
Date:   Tue, 23 Apr 2019 18:19:05 -0400

Initialize

Diffstat:
Abat.sh | 3+++
Acpu.sh | 8++++++++
Adisk.sh | 3+++
Alayout.sh | 3+++
Amem.sh | 3+++
Atemp.sh | 3+++
Atime.sh | 3+++
Atorrent.sh | 12++++++++++++
Avol.sh | 3+++
Awifi.sh | 3+++
10 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/bat.sh b/bat.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +sed 's/$/%/' /sys/class/power_supply/BAT0/capacity diff --git a/cpu.sh b/cpu.sh @@ -0,0 +1,8 @@ +#!/bin/sh +{ grep '^cpu ' /proc/stat ; sleep 1 ; grep '^cpu ' /proc/stat +} | awk -v RS="" '{printf "%.1f%\n", ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)}' + + +##!/bin/bash +# +#cat <(grep 'cpu ' /proc/stat) <(sleep 1 && grep 'cpu ' /proc/stat) | awk -v RS="" '{printf "%.2f%\n", ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)}' diff --git a/disk.sh b/disk.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +df -h | awk '/ \/home$/{ print $4 }' diff --git a/layout.sh b/layout.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +setxkbmap -query | awk '/^layout:/{ print $2 }' diff --git a/mem.sh b/mem.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +free -h | awk '( NR == 2 ){ print $3 }' diff --git a/temp.sh b/temp.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +sed 's/000$/°C/' /sys/class/thermal/thermal_zone0/temp diff --git a/time.sh b/time.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +date +"%d/%m  %H:%M" diff --git a/torrent.sh b/torrent.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +pgrep -x transmission-da >/dev/null || exit 0 +transmission-remote -t active -l | [ $(wc -l) -le 2 ] && exit 0 + +transmission-remote -t active -l | awk ' + /^Sum:/{ + if ( $4 != "0.0" && $5 != "0.0" ) ORS=" " + if ( $4 != "0.0" ) print " " $4 + if ( $4 == "0.0" || $5 == "0.0" ) ORS="\n" + if ( $5 != "0.0" ) print " " $5 } +' diff --git a/vol.sh b/vol.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +command=amixer get Master | awk -F'[][]' 'END{ gsub("on","",$6); gsub("off","",$6); print $6 " " $2 }' diff --git a/wifi.sh b/wifi.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +sed 's/up//;s/down//' /sys/class/net/wlp3s0/operstate