A recent mailing-list item gives a clue (Re: Newbie: XQuartz installation for FontForge questions):
I suggest you just move it aside. If you want to do things, drop scripts into ~/.xinitrc.d and set them executable.
and a little checking shows that if you put a script whose name suffixed ".sh" into your ~/.xinitrc.d
directory, you can put X commands (such as xset
) there. Be sure to end the commands with &
(to detach).
For example, your quick.sh
script might look like this:
xset r rate 10 &
However (noting comment), it is a little more involved than that. Xquartz resets the keyboard rate after running the scripts in /.xinitrc
. Possibly this is related to a bug report resolved by making Xquartz match the system preferences.
As a workaround, you could make the quick.sh
call a more complicated script:
pkill -9 rapid-keyboard $HOME/.xinitrc.d/rapid-keyboard &
and (putting the new script in the same directory for convenience), the contents of rapid-keyboard
could be like this:
#!/bin/sh export PATH=\ /usr/bin:\ /bin:\ /opt/X11/bin getvalue() { value=$(xset q |\ fgrep "$2" |\ sed -e 's/^.*'"$2"':[[:space:]]*//' -e 's/[[:space:]].*//') [ -z "$value" ] && value="not set" eval $1=$value } WANT_RATE=50 WANT_DELAY=280 LOGFILE=/tmp/rapid-keyboard.log rm -f $LOGFILE while : do X11_PID=$(pgrep Xquartz) if [ -n "$X11_PID" ] then getvalue XSET_RATE "repeat rate" getvalue XSET_DELAY "repeat delay" if [ "x$XSET_RATE" != "x$WANT_RATE" ] then echo "** rate was $XSET_RATE at $(date)" >>$LOGFILE xset r rate $WANT_DELAY $WANT_RATE elif [ "x$XSET_DELAY" != "x$WANT_DELAY" ] then echo "** delay was $XSET_RATE at $(date)" >>$LOGFILE xset r rate $WANT_DELAY $WANT_RATE fi fi sleep 1 done
The script logs its changes (not really needed except for demonstration purposes), and waits for Xquartz to change the settings again. In testing it, I see the settings change twice, during initialization, but not afterwards.