dotfiles

<-- duh.
git clone https://hhvn.uk/dotfiles
git clone git://hhvn.uk/dotfiles
Log | Files | Refs | Submodules | LICENSE

dwmbar (571B)


      1 #!/bin/rc
      2 
      3 cd `{dirname $0}
      4 
      5 mkdir -p /tmp/blocks
      6 cd /tmp/blocks
      7 
      8 fn block {
      9 	val = `$nl{dwmbar/$1} {
     10 		if (~ $val () || ~ $val '') {
     11 			rm /tmp/blocks/$1
     12 		} else {
     13 			printf '%s' $val > /tmp/blocks/$1
     14 		}
     15 	} &
     16 }
     17 
     18 fn sigexit {
     19 	for (p in $apids) {
     20 		kill $p
     21 	}
     22 }
     23 
     24 block vol
     25 while (true) {
     26 	block bat
     27 	block cpu
     28 	block mem
     29 	sleep 3
     30 } &
     31 
     32 while (true) {
     33 	block time
     34 	sleep 1
     35 } &
     36 
     37 while (true) {
     38 	block date
     39 	sleep 900
     40 } &
     41 
     42 printf ' ' > sep
     43 while (true) {
     44 	sleep 0.1
     45 	xsetroot -name ``(''){cat bat sep cpu sep mem sep vol sep date sep time sep >[2]/dev/null | tr -d '\n'}
     46 }