gist.githate.ru

Explore

  • All gists
  • Topics
  • Users
Telegram Git collection
Give feedback on the new UI Powered by Opengist ⋅ 9ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login
l

locale

Recently created Least recently created Recently updated Least recently updated
LittleGreenCat

LittleGreenCat / Detect locale

Last active 2 months ago locale

Как скриптом определить текущую раскладку клавиатуры

0 0 1
1 # для первой раскладки эта команда вернёт 0, для всех остальных - 1
2
3 xset -q | sed -rn 's/.*LED mask.*(.)[[:xdigit:]]{3}$/\1/p'
4
5 # Альтернативный вариант возвращающий en или ru:
6
7 xset -q|grep Group\ 2|awk {'print $4'}|sed 's/on/ru/g;s/off/en/g'