xscripts

Scripts for .xsession or .xinit
git clone git://git.swab.dev/xscripts.git
Log | Files | Refs

status.sh (625B)


      1 #!/bin/sh
      2 # sStatus is a simple status display for the terminal.
      3 
      4 # Kill status bar if it's currently running:
      5 statusPID=$(pgrep "$HOME/repos/sstatus/main.sh" | cut -f 1 -d " " | tr -d '\n')
      6 if [ "$statusPID" != "" ]; then
      7 	kill "$statusPID";
      8 fi
      9 
     10 while true
     11 do
     12 battery=$(apm | grep 'Battery state:' | cut -f 4 -d " ")
     13 	time=$(date "+%H:%M")
     14 	audioLevel=$(sndioctl output.level | cut -f 2 -d "=" | cut -f 2 -d "." | cut -c 1,2)
     15 
     16 	# Set the desired order of information:
     17 	status="Vol: $audioLevel% | Bat: $battery | $time "
     18 
     19 	# Default for DWM. Change the line below for other displays.
     20 	xsetroot -name "$status"
     21 	sleep 1
     22 done