parent
5e7a08c3da
commit
3b518ee85d
@ -0,0 +1,66 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$(echo $LANG)" = "ru_RU.UTF-8" ]; then
|
||||
table=(
|
||||
"'<Control>Shift_R'" "Control + Правый Shift"
|
||||
"'<Control>Shift_L'" "Control + Левый Shift"
|
||||
"'<Control>Shift'" "Control + Shift"
|
||||
"'<Alt>Shift_R'" "Alt + Правый Shift"
|
||||
"'<Alt>Shift_L'" "Alt + Левый Shift"
|
||||
"'<Alt>Shift'" "Alt + Shift"
|
||||
"'<Ctrl>Space'" "Ctrl + Пробел"
|
||||
"'<Alt>Space'" "Alt + Пробел"
|
||||
)
|
||||
|
||||
TITLE="Переключение на другую расладку"
|
||||
TEXT="Выберите комбинацию клавиш для переключения на другую раскладку"
|
||||
else
|
||||
table=(
|
||||
"'<Control>Shift_R'" "Control + Right Shift"
|
||||
"'<Control>Shift_L'" "Control + Left Shift"
|
||||
"'<Control>Shift'" "Control + Shift"
|
||||
"'<Alt>Shift_R'" "Alt + Right Shift"
|
||||
"'<Alt>Shift_L'" "Alt + Left Shift"
|
||||
"'<Alt>Shift'" "Alt + Shift"
|
||||
"'<Ctrl>Space'" "Ctrl + Space"
|
||||
"'<Alt>Space'" "Alt + Space"
|
||||
)
|
||||
|
||||
TITLE="Switch to another layout"
|
||||
TEXT="Choose shortcut to switch keyboard layout"
|
||||
fi
|
||||
|
||||
|
||||
KEYS=$(zenity \
|
||||
--list \
|
||||
--title="$TITLE" \
|
||||
--text="$TEXT" \
|
||||
--print-column=1 \
|
||||
--hide-column=1 \
|
||||
--height=500 \
|
||||
--column="Layout:HD" \
|
||||
--column="Description" \
|
||||
--hide-header \
|
||||
"${table[@]}"
|
||||
)
|
||||
|
||||
if [ -z $KEYS ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $KEYS = "'<Alt>Shift'" ]; then
|
||||
switch_input_source="'<Alt>Shift_L'"
|
||||
switch_input_source_backward="'<Alt>Shift_R'"
|
||||
elif [ $KEYS = "'<Control>Shift'" ]; then
|
||||
switch_input_source="'<Control>Shift_L'"
|
||||
switch_input_source_backward="'<Control>Shift_R'"
|
||||
fi
|
||||
|
||||
if [ "${switch_input_source}" != "" -a "${switch_input_source_backward}" != "" ]; then
|
||||
echo ME
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-input-source "[${switch_input_source}]"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "[${switch_input_source_backward}]"
|
||||
else
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Super>space', 'XF86Keyboard']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "[$KEYS]"
|
||||
fi
|
@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Name[ru]=Настройка клавиатуры
|
||||
Name=Keyboard Setup
|
||||
Comment=Easy setup of shortcuts to switch keyboard layouts
|
||||
Comment[ru]=Быстрая настройка клавиатурной комбинации для смены раскладок
|
||||
Exec=sphere-keyboard-config
|
||||
Icon=org.gnome.Characters
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=System;Settings;
|
||||
StartupNotify=true
|
Loading…
Reference in new issue