linux - Bash Script Positioning -


i'm new bash scripting, don't know much. want open on 100k xclocks , scatter them randomly across screen (it's fun, not malicious intent). have xclock commands inserted, open in 1 spot on screen.

so, how 100k clocks randomly disperse screen?

code far (really basic):

#! \bin\bash xclock & 

this goes on 100k lines.

this use xrandr or xdpyinfo detect screen resolution:

#!/bin/bash  if [[ -x $(which xrandr) ]];   res=$(xrandr | awk '/\*/ {print $1}') else   if [[ -x $(which xdpyinfo) ]];     res=$(xdpyinfo | awk '/dimensions/ {print $2}')   else     echo "can not detect screen resolution"     exit 1   fi fi  x=${res%x*}; y=${res#*x} in {1..100}; xclock -geometry 120x120+$(($random%$x-120))+$(($random%$y-120)) & done 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -