home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / linux / puppy-barebones-2.01r2.iso / pup_201.sfs / usr / sbin / fixPuppyPin < prev    next >
Encoding:
Text File  |  2005-12-19  |  942 b   |  39 lines

  1. #!/bin/sh
  2. #(c) Copyright Barry Kauler 2006 www.puppylinux.com
  3.  
  4. PUPPYPIN="$1"
  5. [ "$PUPPYPIN" = "" ] && PUPPYPIN="/root/Choices/ROX-Filer/PuppyPin"
  6.  
  7. SCREENX=""
  8. if [ "`readlink /usr/X11R6/bin/X`" = "Xorg" ];then
  9.  SCREENX=`xrandr | grep '\*' | tr -s " " | cut -f 2 -d " "`
  10. else
  11.  if [ -f /etc/videomode ];then #used by Xvesa.
  12.   SCREENX=`cat /etc/videomode | cut -f 2 -d " " | cut -f 1 -d "x"`
  13.  fi
  14. fi
  15.  
  16. if [ ! "$SCREENX" = "" ];then
  17.  
  18.  #find out current right side in PuppyPin...
  19.  RIGHTX="`cat $PUPPYPIN | grep "Xlock" | cut -f 2 -d '"'`"
  20.  
  21.  #all icons on right side of screen will be relocated to correct right side...
  22.  NEWRIGHTX=`expr $SCREENX - 32`
  23.  if [ $NEWRIGHTX ];then #precaution.
  24.   if [ ! "$RIGHTX" = "$NEWRIGHTX" ];then
  25.    APATTERN="s/x=\"${RIGHTX}\"/x=\"${NEWRIGHTX}\"/g"
  26.    cat $PUPPYPIN | sed -e "$APATTERN" > /tmp/PuppyPin
  27.    sync
  28.    cp -f /tmp/PuppyPin $PUPPYPIN
  29.   fi
  30.  fi
  31.  
  32. fi
  33.  
  34. echo "$SCREENX"
  35. echo "$RIGHTX"
  36. echo "$NEWRIGHTX"
  37.  
  38. ###END###
  39.