DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Davor has posted 5 posts at DZone. View Full User Profile

Console Keyboard Scheme Switcher

04.12.2006
| 4721 views |
  • submit to reddit
        Switches between us and swedish (or any other)
keyboard-scheme in the console. Default is US.

#!/bin/sh
# Keyboard switcher script
# Written in 2006 by Davor Babic <davorb@gmail.com>
# This software is realeased into public domain

case $1 in
sv)
    echo "Switching to swedish keyboard layout."
    loadkeys /usr/share/keymaps/i386/qwerty/se-latin1.kmap.gz
    ;;
us)
    echo "Switching to US keyboard layout."
    loadkeys /usr/share/keymaps/i386/qwerty/us.kmap.gz
    ;;
default)
    echo "None selected. Loading US..."
    loadkeys /usr/share/keymaps/i386/qwerty/us.kmap.gz
    ;;
esac