home *** CD-ROM | disk | FTP | other *** search
Wrap
#!/bin/sh echo '#!/usr/bin/wish set CURRINDEX $argv proc funcchoice {} { global .f1.list set i [ .f1.list curselection ] set mychoice [ .f1.list get $i ] puts $mychoice exit } 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." frame .f1 -relief groove -borderwidth 3 -background orange #listbox .f1.list -height 10 -yscrollcommand ".f1.scrb set" listbox .f1.list -height 11 -width 10 .f1.list insert end "48" .f1.list insert end "54" .f1.list insert end "60" .f1.list insert end "66" .f1.list insert end "72" .f1.list insert end "78" .f1.list insert end "84" .f1.list insert end "90" .f1.list insert end "96" .f1.list insert end "102" .f1.list insert end "108" #scrollbar .f1.scrb -command ".list yview" .f1.list selection set $CURRINDEX frame .f2 button .f2.b1 -text "OK" -command { funcchoice } button .f2.b2 -text "Cancel" -command { exit } pack .l1 pack .f1 #pack .f1.scrb -side right -fill y pack .f1.list -side left pack .f2 pack .f2.b1 -side left pack .f2.b2 -side right ' > /tmp/set-dpi chmod 755 /tmp/set-dpi #bash/ash code starts here... CURRDPI=`cat /root/.Xresources | grep "Xft\\.dpi:" | tr -s ' ' | cut -f 2 -d ' '` [ ! "$CURRDPI" ] && CURRDPI=78 CURRINDEX=`expr $CURRDPI \/ 6` CURRINDEX=`expr $CURRINDEX - 8` NEWDPI=`/tmp/set-dpi $CURRINDEX` [ ! $NEWDPI ] && exit TMP1="`cat /root/.Xresources | grep -v "Xft\\.dpi:"`" echo "$TMP1" > /root/.Xresources echo "Xft.dpi: $NEWDPI" >> /root/.Xresources sync ##END##