Human Readable   

 

     
   
     

Some Scripts—Day 50

© Copyright Darrell Anderson.

I have been continually tinkering with WINE and making progress, but I also continue to tinker with my overall system. Every little tweak adds some measure of pleasure, either through improved performance or merely aesthetics.

One of the things I have done is synchronize my keyboard repeat rates between KDE, X, and console modes. In console, I added the following to my rc.local script:

# Adjust keyboard repeat rate
echo "[01;37mAdjusting keyboard typematic rate:[00m"
/usr/bin/kbdrate -r 30 -d 300

In KDE, I modifed the control panel with the same numbers. In xorg.conf, in my keyboard section, I added:

Option "AutoRepeat" "300 30"

Now I have the same response throughout my system.

I also am learning how to avoid path problems when installing new software. My solution is to create a sym link in my usr/local/bin directory. I use a separate partition for /usr/local. Thus, if I have to recreate my Slackware environment by hand, I reduce the amount of work because I have several items already installed. For example, all of my TrueType fonts are installed at /usr/local/share/ttf. This is one of the nice things about using a partition scheme. The sym links provide a way for me to avoid path and permission problems because all users have execute rights to /usr/local/bin. Thus, when I installed Firefox, I created a sym link. Now mortal users can run Firefox from the command line. True, they could already do this because of how Firefox is installed, but Ilike this extra help. I also created a sym link to ifconfig, a file that is stored in /sbin, a directory off limits to mortal users.

I also am slowly adding scripts to that location. One script helps me fine-tune my KDE aRtsd priority. From some online discussions I learned that bumping aRtsd to a higher priority improves performance. I am using aging hardware and although I am impressed with how well KDE runson my system, I am like most people who don’t mind adding a smidgeon of help here and there. Tweaking is almost always fun!

I named the script artsd_nice and the script renices priority to –15:

#! /bin/sh
# /usr/local/bin/artsd_nice
sleep 5s
artsd_pid=""
while [ "$artsd_pid" = "" ] ; do
  sleep 1s
  artsd_pid=`/sbin/pidof artsd`
done
renice -15 $artsd_pid
exit 0

The primary drawback to this solution is I have yet to discover a way to run this script during the KDE boot process. Process priorities can be changed only by root. So for now, I open a root Konsole and type artsd_nice. Placing the script in /usr/local/bin, which is already in my path, helps me avoid typing the full path.

For naysayers, yes, I do notice a slight improvement. I expect people on newer systems will argue otherwise, but us people on aging hardware do notice these kinds of tweaks.

In a similar effort, I also changed the “nice” priority of X. I edited /etc/X11/xdm/Xservers to boot X through the nice command:

:0 local /usr/bin/nice -n -10 /usr/X11R6/bin/X :0 vt7 -nolisten tcp
:1 local /usr/bin/nice -n -10 /usr/X11R6/bin/X :1 vt8 -nolisten tcp

I then edited /opt/kde/share/config/kdm/Xservers similarly:

:0 local@tty1 /usr/bin/nice -n -10 /usr/X11R6/bin/X :0 vt7 -nolisten tcp
:1 local@tty2 reserve /usr/bin/nice -n -10 /usr/X11R6/bin/X :1 vt8 -nolisten tcp

Again, people with fast hardware likely will notice no improvement, but on my system I notice a slight advantage. Nothing blatantly obvious, mind you, but nonetheless noticeable. The difference is barely perceptible, but does exist. These small tweaks help.

However, I have yet to find a way to add these same tweaks when starting X from the command line. Yes, manually running a script as root will solve the problem, but I’d like to find a way to improve the startx scripts.

One other curious note. When I start X from the command line as a mortal user, X starts with a priority of zero. When I start X from the command line as root, X starts with a priority of –1. I have yet to trace how this happens.

Finis.

Table of Contents