Skip to main content

Thread: Help with loop script.


i wrote script output current desktop when using compiz virtual desktops used conky.
code:
#!/bin/bash    #set -x  ###############################################################  ##  script output desktop number when running compiz  ##  ##   4x1 virtual desktops , 1680x1050 resolution.     ##  ###############################################################    # use wmctrl -d | awk '{print $6}' determine coordinates each virtual desktop if use 2x2    sleep 3    ##wait conky load  while true; do	  sleep 2        coordinate=$(wmctrl -d | awk '{print $6}')    if [ "$coordinate" == "0,0" ];  		echo 1 > ~/.desktop.txt    	elif [ "$coordinate" == "1680,0" ];  		echo 2 > ~/.desktop.txt    	elif [ "$coordinate" == "3360,0" ];  		echo 3 > ~/.desktop.txt    	elif [ "$coordinate" == "5040,0" ];  		echo 4 > ~/.desktop.txt  fi        done
i added script startup applications found remained running when
logged out , started instance upon login.

fixed changing...
code:
while true; do
to
code:
while pidof conky; do
just wondered if putting in startup applications not correct way
start kind of script
or
there supposed add script exits when logging out.



Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Help with loop script.


Ubuntu

Comments

Popular posts from this blog

how to devide a circle into equal parts

"Could not fill because there are not enough opaque source pixels" - not solved by any other thread

Why can't I change the billing info for my account?