G2A Many GEOs
SHARE
TWEET

move-at-start.sh

a guest Aug 7th, 2012 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # invocation
  3. # move-at-start.sh <desktop> <prog> <prog args>
  4.  
  5. if [ $# -lt 2 ]; then
  6.     echo "invocation: move-at-start.sh <desktop> <prog> <prog args>"
  7.     exit 1
  8. fi
  9.  
  10. desk=$1
  11. prog=$2
  12. args=""
  13. shift
  14. shift
  15.  
  16. while (( "$#" )); do
  17.     args="$args ""$1"
  18.     shift
  19. done
  20.  
  21. $prog $args
  22.  
  23. windows=$(wmctrl -lp | grep -E "($(echo $(ps -C "$prog" -o pid,user | grep "`whoami`" | sed -E "s/^\ *//" | cut -d\  -f 1) | sed "s/\ /|/g"))" | cut -d\  -f 1)
  24.  
  25. for w in $windows; do
  26.     wmctrl -i -r $w -t $desk
  27. done
  28.  
  29. exit 0
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top