#!/bin/sh if [ "$(echo $LANG)" = "ru_RU.UTF-8" ]; then table=( "'Shift_R'" "Control + Правый Shift" "'Shift_L'" "Control + Левый Shift" "'Shift'" "Control + Shift" "'Shift_R'" "Alt + Правый Shift" "'Shift_L'" "Alt + Левый Shift" "'Shift'" "Alt + Shift" "'Space'" "Ctrl + Пробел" "'Space'" "Alt + Пробел" ) TITLE="Переключение на другую расладку" TEXT="Выберите комбинацию клавиш для переключения на другую раскладку" else table=( "'Shift_R'" "Control + Right Shift" "'Shift_L'" "Control + Left Shift" "'Shift'" "Control + Shift" "'Shift_R'" "Alt + Right Shift" "'Shift_L'" "Alt + Left Shift" "'Shift'" "Alt + Shift" "'Space'" "Ctrl + Space" "'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 = "'Shift'" ]; then switch_input_source="'Shift_L'" switch_input_source_backward="'Shift_R'" elif [ $KEYS = "'Shift'" ]; then switch_input_source="'Shift_L'" switch_input_source_backward="'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 "['space', 'XF86Keyboard']" gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "[$KEYS]" fi