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 / set-xftdpi < prev    next >
Encoding:
Text File  |  2005-12-12  |  1.8 KB  |  68 lines

  1. #!/bin/sh
  2.  
  3. echo '#!/usr/bin/wish
  4.  
  5. set CURRINDEX $argv
  6.  
  7. proc funcchoice {} {
  8.  global .f1.list
  9.  set i [ .f1.list curselection ]
  10.  set mychoice [ .f1.list get $i ]
  11.  puts $mychoice
  12.  exit
  13. }
  14.  
  15. label .l1 -justify left -text "Please choose dpi (dots per inch) for the screen.\nThe larger the value, the bigger that antialiased\nfonts will render on the screen. Adjust up or down if\nfonts are rendering to small or to big on the screen.\nNote1: Some apps do not use antialiased rendering and\n       will not be affected by this setting.\nNote2: Change will only take affect after restarting X."
  16.  
  17. frame .f1 -relief groove -borderwidth 3 -background orange
  18. #listbox .f1.list -height 10 -yscrollcommand ".f1.scrb set"
  19. listbox .f1.list -height 11 -width 10
  20. .f1.list insert end "48"
  21. .f1.list insert end "54"
  22. .f1.list insert end "60"
  23. .f1.list insert end "66"
  24. .f1.list insert end "72"
  25. .f1.list insert end "78"
  26. .f1.list insert end "84"
  27. .f1.list insert end "90"
  28. .f1.list insert end "96"
  29. .f1.list insert end "102"
  30. .f1.list insert end "108"
  31.  
  32. #scrollbar .f1.scrb -command ".list yview"
  33.  
  34. .f1.list selection set $CURRINDEX
  35.  
  36. frame .f2
  37. button .f2.b1 -text "OK" -command { funcchoice }
  38. button .f2.b2 -text "Cancel" -command { exit }
  39.  
  40. pack .l1
  41. pack .f1
  42. #pack .f1.scrb -side right -fill y
  43. pack .f1.list -side left
  44. pack .f2
  45. pack .f2.b1 -side left
  46. pack .f2.b2 -side right
  47. ' > /tmp/set-dpi
  48.  
  49. chmod 755 /tmp/set-dpi
  50.  
  51.  
  52. #bash/ash code starts here...
  53.  
  54. CURRDPI=`cat /root/.Xresources | grep "Xft\\.dpi:" | tr -s ' ' | cut -f 2 -d ' '`
  55. [ ! "$CURRDPI" ] && CURRDPI=78
  56. CURRINDEX=`expr $CURRDPI \/ 6`
  57. CURRINDEX=`expr $CURRINDEX - 8`
  58.  
  59. NEWDPI=`/tmp/set-dpi $CURRINDEX`
  60. [ ! $NEWDPI ] && exit
  61.  
  62. TMP1="`cat /root/.Xresources | grep -v "Xft\\.dpi:"`"
  63. echo "$TMP1" > /root/.Xresources
  64. echo "Xft.dpi: $NEWDPI" >> /root/.Xresources
  65. sync
  66.  
  67. ##END##
  68.