LINUX.ORG.RU

Узнать раскладку из терминала


0

1

Здрасте.

Выхлопы setxkbmap -print

debasher@deb:~$ setxkbmap -print 
xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete+ledscroll(group_lock)"        };
        xkb_symbols   { include "pc+us+ru:2+inet(evdev)+capslock(grouplock)"    };
        xkb_geometry  { include "pc(pc105)"     };
};

и xset -q

Keyboard Control:
  auto repeat:  on    key click percent:  0    LED mask:  00001004
  XKB indicators:
    00: Caps Lock:   off    01: Num Lock:    off    02: Scroll Lock: on 
    03: Compose:     off    04: Kana:        off    05: Sleep:       off
    06: Suspend:     off    07: Mute:        off    08: Misc:        off
    09: Mail:        off    10: Charging:    off    11: Shift Lock:  off
    12: Group 2:     on     13: Mouse Keys:  off
  auto repeat delay:  660    repeat rate:  25
  auto repeating keys:  00ffffffdffffbbf
                        fadfffefffedffff
                        9fffffffffffffff
                        fff7ffffffffffff
  bell percent:  50    bell pitch:  400    bell duration:  100
Pointer Control:
  acceleration:  2/1    threshold:  4
Screen Saver:
  prefer blanking:  yes    allow exposures:  yes
  timeout:  600    cycle:  600
Colors:
  default colormap:  0x20    BlackPixel:  0x0    WhitePixel:  0xffffff
Font Path:
  /usr/share/fonts/X11/misc,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Typ
e1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins
DPMS (Energy Star):
  Standby: 600    Suspend: 600    Off: 600
  DPMS is Enabled
  Monitor is On

не говорят нужного.

debasher@deb:~$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux wheezy/sid"
NAME="Debian GNU/Linux"
ID=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="http://bugs.debian.org/"
debasher@deb:~$ uname -a
Linux deb 3.6-trunk-686-pae #1 SMP Debian 3.6.4-1~experimental.1 i686 GNU/Linux

Как быть и что делать?

★★★★★

Ответ на: комментарий от Debasher

У него есть метод D-Bus, возвращающий номер группы. Название вроде тоже можно.

Homura_Akemi ()
mkdir skb
cd skb
wget http://plhk.ru/static/skb/skb-0.3.tar.gz
tar -xf skb-0.3.tar.gz
cd skb-0.3
make



.bashrc

function NLS () {
if [ x$DISPLAY = "x" ];
  then 
    xNLS=""
  else
    xNLS=`skb 1`
    if [ $xNLS = "Rus" ]; then echo -e "\e[1;31mRUS\e[0m" ; fi
    if [ $xNLS = "USA" ]; then echo -e "\e[01;32mUSA\e[0m"; fi
  fi
}
export PS1='\[\033[35m\]\t\[\033[m\]-\[\033[33;1m\]\w\[\033[m\]\n\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h\[\033[m\]:`NLS`\$ '

anonymous ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.