udate_toggle.sh 385 B

123456
  1. #!/bin/sh
  2. ## This is my (demuredemeanor) polybar script for toggling UDate.
  3. ## This script handles the awk toggle for UDate, since polybar doesn't like the raw command for its click execs
  4. awk -v TEMP=/tmp/i3_polybar_utc_${USER} 'BEGIN {{FILE=getline < TEMP < 0 ? "0" : "1"} {if($0==1){STATE=1} else {STATE=0}} {if(STATE==0){system("echo 1 > "TEMP)} else {system("echo 0 > "TEMP)}} }'