xmakemap revision 919
542N/A#! /bin/sh
542N/A#
542N/A# Copyright 1992 Sun Microsystems, Inc. All rights reserved.
919N/A# Use is subject to license terms.
542N/A#
542N/A# Permission is hereby granted, free of charge, to any person obtaining a
919N/A# copy of this software and associated documentation files (the "Software"),
919N/A# to deal in the Software without restriction, including without limitation
919N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A# and/or sell copies of the Software, and to permit persons to whom the
919N/A# Software is furnished to do so, subject to the following conditions:
919N/A#
919N/A# The above copyright notice and this permission notice (including the next
919N/A# paragraph) shall be included in all copies or substantial portions of the
919N/A# Software.
919N/A#
919N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A# DEALINGS IN THE SOFTWARE.
542N/A#
542N/A#
542N/A
542N/A# xmakemap -- make a keyboard mapping to be used as input to xmodmap
542N/A#
542N/A# Usage: xmakemap > $HOME/.xmodmaprc
542N/A#
542N/A# Notes:
542N/A# OpenWindows (i.e., an X server) must be running to use xmakemap.
542N/A# Run xmakemap and edit $HOME/.xmodmaprc to customize it as desired
542N/A# (read "Notes" in $HOME/.xmodmaprc).
542N/A#
542N/A
542N/Aecho '! File:
542N/A! .xmodmaprc
542N/A!
542N/A! Goal:
542N/A! Customize keyboard mappings
542N/A!
542N/A! Location (where to put this file):
542N/A! $HOME/.xmodmaprc
542N/A!
542N/A! Usage:
542N/A! xmodmap $HOME/.xmodmaprc
542N/A!
542N/A! Notes:
542N/A! - If you would like your keytable to be customized each time OW
542N/A! is run, you should place the appropriate command in $HOME/.xinitrc.
542N/A! For example:
542N/A!
542N/A! if [ -f $HOME/.xmodmaprc ]; then
542N/A! xmodmap $HOME/.xmodmaprc
542N/A! fi
542N/A!
542N/A! - This file should be customized as desired, commenting out each
542N/A! unneeded entry with '!'. Note that all clients will be notified
542N/A! when the keytable changes and the keytable will be distributed to
542N/A! all clients upon their request. Since distribution takes time for
542N/A! each client, users should place the command *first* in .xinitrc
542N/A! (before most clients are running) and should *not* place the
542N/A! command in the background.
542N/A!
542N/A! - Refer to man page for xmodmap(1) for more information.
542N/A!
542N/A
542N/A!
542N/A! clear modifier groups
542N/A!
542N/A
542N/Aclear shift
542N/Aclear lock
542N/Aclear control
542N/Aclear mod1
542N/Aclear mod2
542N/Aclear mod3
542N/Aclear mod4
542N/Aclear mod5
542N/A
542N/A!
542N/A! set up keys
542N/A!
542N/A! Key Unshifted Shifted AltGraph AltGraph-Shifted
542N/A! --- --------------- --------------- --------------- ----------------
542N/A'
542N/Axmodmap -pk | awk ' { \
542N/A { \
542N/A x = $1; \
542N/A if (x >= 7 && x <= 132 && NF > 1) { \
542N/A $3 = substr($3, 2, length($3)-2); \
542N/A $5 = substr($5, 2, length($5)-2); \
542N/A $7 = substr($7, 2, length($7)-2); \
542N/A $9 = substr($9, 2, length($9)-2); \
542N/A printf("keycode %3s = %-15s %-15s %-15s %-15s\n",$1,$3,$5,$7,$9); \
542N/A } \
542N/A } \
542N/A} '
542N/A
542N/Aecho '
542N/A!
542N/A! set modifier groups
542N/A!
542N/A'
542N/Axmodmap | awk ' { \
542N/A if ($1 == "shift") { \
542N/A printf "add %-7s = %s %s %s %s\n", $1, $2, $4, $6, $8 \
542N/A } \
542N/A if ($1 == "lock") {
542N/A printf "add %-7s = %s %s %s %s\n", $1, $2, $4, $6, $8 \
542N/A } \
542N/A if ($1 == "control") {
542N/A printf "add %-7s = %s %s %s %s\n", $1, $2, $4, $6, $8 \
542N/A } \
542N/A if ($1 == "mod1") {
542N/A printf "add %-7s = %s %s %s %s\n", $1, $2, $4, $6, $8 \
542N/A } \
542N/A if ($1 == "mod2") {
542N/A printf "add %-7s = %s %s %s %s\n", $1, $2, $4, $6, $8 \
542N/A } \
542N/A if ($1 == "mod3") {
542N/A printf "add %-7s = %s %s %s %s\n", $1, $2, $4, $6, $8 \
542N/A } \
542N/A if ($1 == "mod4") {
542N/A printf "add %-7s = %s %s %s %s\n", $1, $2, $4, $6, $8 \
542N/A } \
542N/A if ($1 == "mod5") {
542N/A printf "add %-7s = %s %s %s %s\n", $1, $2, $4, $6, $8 \
542N/A } \
542N/A} '