summaryrefslogtreecommitdiff
path: root/dot/local/bin/asdf
blob: 56e3d977a7bd229f4cd02f811629cd8dd6b325aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

ASDF()
{
    python <<EOF
from ctypes import *
import subprocess

class Display(Structure):
    """ opaque struct """

X11 = cdll.LoadLibrary("libX11.so.6")
X11.XOpenDisplay.restype = POINTER(Display)

display = X11.XOpenDisplay(c_int(0))
X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(2), c_uint(0))
X11.XCloseDisplay(display)

EOF
}

opts='-option -option terminate:ctrl_alt_bksp -option caps:super'
arg0=${0##*/}
case "$arg0" in
    asdf) setxkbmap -layout ru,us -variant phonetic_winkeys, $opts -option grp:shifts_toggle ;;
    асдф|aoeu) setxkbmap -layout us $opts ;;
    ASDF) ASDF ;;
    qwer|dvorak) setxkbmap -layout us -variant dvorak $opts ;;
    *) ;;
esac