Sisyphus
: 5 2022 | : 17503 | : 24504334
en ru br
ALT
S:3.1-alt1
5.1: 3.0-alt2
4.1: 2.0-alt2.M41.3
4.0: 0.9-alt3.M40.3
3.0: 0.3-alt3
www.altlinux.org/Changes

:: //
: alterator-xkb

                   Gear   Bugs and FR  Repocop 

alterator-xkb-0.9/000075500000000000000000000000001105526343200141405ustar00rootroot00000000000000alterator-xkb-0.9/Makefile000064400000000000000000000014531105526343200156030ustar00rootroot00000000000000NAME=xkb
DESCRIPTION="X11 keyboard"

INSTALL=/usr/bin/install

all: build-tools
clean: clean-po clean-tools
install: install-backend install-ui install-po install-tools install-html

include /usr/share/alterator/build/po.mak
include /usr/share/alterator/build/ui2.mak
include /usr/share/alterator/build/fbi.mak
include /usr/share/alterator/build/html-messages.mak
include /usr/share/alterator/build/backend.mak

HTML_PO_TEMPLATE=ui/xkb/html-messages.scm

build-tools:
for i in tools/*; do [ ! -d $$i ] || make -C $$i; done;

clean-tools:
for i in tools/*; do [ ! -d $$i ] || make -C $$i clean; done;

install-tools:build-tools
for i in tools/*; do [ ! -d $$i ] || $(INSTALL) -Dpm 755 $$i/$${i##*/} $(bindir)/$${i##*/};done
for i in tools/*; do [ -d $$i ] || $(INSTALL) -Dpm 755 $$i $(bindir)/$${i##*/};done
alterator-xkb-0.9/applications/000075500000000000000000000000001105526343200166265ustar00rootroot00000000000000alterator-xkb-0.9/applications/xkb.desktop000064400000000000000000000004241105526343200210050ustar00rootroot00000000000000[Desktop Entry]
Encoding=UTF-8
Type=Application
Categories=X-Alterator-Xorg
Icon=xkb
Terminal=false
Name=Keyboard settings
Name[ru_RU]=Настройка клавиатуры
Name[uk_UA]=Налаштування клавіатури
X-Alterator-URI=/xkb
X-Alterator-Weight=10
alterator-xkb-0.9/backend3/000075500000000000000000000000001105526343200156125ustar00rootroot00000000000000alterator-xkb-0.9/backend3/template-xkb000075500000000000000000000012401105526343200201320ustar00rootroot00000000000000#!/bin/sh

_()
{
LANG=${in_language%%;*}.utf8 gettext "alterator-xkb" "$1"
}

#turn off auto expansion
set -f

. /usr/share/alterator/build/backend3.sh

on_message()
{
case "$in_action" in
template)
echo '('

if [ "$in__objects" = "avail_layout" ];then
echo ' template "card-index"'
echo ' url "xkb-layout.html"'
echo ' redirect "/xkb"'
else
echo ' template "form"'
if [ -n "$in_add" ];then
echo ' url-redirect "/xkb/avail_layout"'
else
echo ' url "xkb.html"'
fi
fi

echo ' translate "alterator-xkb"'
echo ' help "xkb.html"'
echo ')'
;;
*)
echo '#f'
esac
}

message_loop
alterator-xkb-0.9/backend3/xkb000075500000000000000000000106251105526343200163300ustar00rootroot00000000000000#!/bin/sh

#this module can work for all users, so I use common directories
CACHE_DIR="/tmp/alterator-xkb"
TICKETDIR="/var/lib/alterator/tickets"


make_cache()
{
[ -d "$CACHE_DIR/$1" ] && return

mkdir -p "$CACHE_DIR/$1"
cd "$CACHE_DIR/$1"; xkbdatadump "$1"; cd - >/dev/null
}

_()
{
LANG=${in_language%%;*}.utf8 gettext "alterator-xkb" "$1"
}

list_model()
{
cat "$CACHE_DIR/$1/models"|
simple_quote|
sed -r 's,^([^[:space:]]+)[[:space:]]+(.*),("\1" label "\2"),'
}

list_grp()
{
cat "$CACHE_DIR/$1/options"|
simple_quote|
sed -r 's,^([^[:space:]]+)[[:space:]]+(.*),("\1" label "\2"),'
}

list_layout()
{
cat "$CACHE_DIR/$1/layouts"|
simple_quote|
sed -nr 's,^([[:alnum:]]+)[[:space:]]+(.*),("\1" label "\2"),p'
}

list_variant()
{
cat "$CACHE_DIR/$1/layouts"|
simple_quote|
sed -nr "s,^$2(\\([^\\)]+\\))?[[:space:]]+(.+),(\"$2\\1\" label \"\\2\"),p"
}

read_current_layout()
{
if [ -f "$CACHE_DIR/current_layout" ];then
cat "$CACHE_DIR/current_layout"
else
xkbmapconf -l|tee "$CACHE_DIR/current_layout"
fi
}

list_current_layout()
{
read_current_layout|
while read layout; do
local name="$(grep -m1 "^$layout[[:space:]]" "$CACHE_DIR/$1/layouts" | cut -f2)"
[ -n "$name" ] || name="$layout"
printf '("%s" label "%s")' "$layout" "$name"
done
}

write_add()
{
grep -qs "^$1\$" "$CACHE_DIR/current_layout" ||
echo "$1" >>"$CACHE_DIR/current_layout"
}

write_remove()
{
ed -s "$CACHE_DIR/current_layout" 2>/dev/null <<EOF
/$1/d
wq
EOF
}

write_up()
{
ed -s "$CACHE_DIR/current_layout" 2>/dev/null <<EOF
/$1/m/$1/--
wq
EOF
}

write_down()
{
ed -s "$CACHE_DIR/current_layout" 2>/dev/null <<EOF
/$1/m/$1/+
wq
EOF
}

### tickets
clear_ticket()
{
find "$TICKETDIR" -mindepth 1 -maxdepth 1 -type f -name 'xkb-ticket-*' -delete
}

find_ticket()
{
find "$TICKETDIR" -mindepth 1 -maxdepth 1 -type f -name 'xkb-ticket-*' -print -quit
}

make_ticket()
{
[ -d "$TICKETDIR" ] || install -d -m755 "$TICKETDIR"

name="$TICKETDIR/xkb-ticket-$(uuidgen)"

cat>"$name"<<EOF
#!/bin/sh
setxkbmap -option && setxkbmap \$(cat /etc/X11/xinit/Xkbmap)
EOF
chmod 755 "$name"
echo "$name"
}

get_ticket()
{
local ticket="$(find_ticket)"
[ -n "$ticket" ] || ticket="$(make_ticket)"

echo "${ticket##*/}"
}


read_firefox()
{
local ticket="$(get_ticket)"

printf 'alt-exec-description "%s"' "`_ "Apply saved keyboard settings"`"
printf 'alt-exec-error-message "%s"' "`_ "Apply failed"`"
printf 'alt-exec-command "%s"' "${ticket};`_ "Apply"`"
}


### main part

exit_handler()
{
local rc=$?
trap - EXIT

clear_ticket
rm -rf "$CACHE_DIR"

exit $rc
}

trap exit_handler HUP INT QUIT TERM EXIT

#turn off auto expansion
set -f

clear_ticket
rm -rf "$CACHE_DIR"

. /usr/share/alterator/build/backend3.sh

on_message()
{
case "$in_action" in
list)
[ -n "$in_language" ] || in_language="en_US"
local lang="${in_language%%;*}"

make_cache "$lang"

echo '('
case "$in__objects" in
avail_model) list_model "$lang" ;;
avail_grp) list_grp "$lang" ;;
avail_layout) list_layout "$lang" ;;
avail_layout/*)
local layout="${in__objects%%/avail_variant}"
layout="${layout##*/}"
list_variant "$lang" "$layout"
;;
current_layout) list_current_layout "$lang";;
esac
echo ')'
;;
read)
echo '('

read_firefox

printf 'model "%s"' "$(xkbmapconf -m)"
printf 'grp "%s"' "$(xkbmapconf -g)"
[ -s "$CACHE_DIR/selected_layout" ] &&
printf 'layout "%s"' "$(cat "$CACHE_DIR/selected_layout")"
echo ')'
;;
write)
case "$in__objects" in
avail_layout*)
write_add "$in_variant"
;;
*)
[ -n "$in_layout" ] && echo "$in_layout" >"$CACHE_DIR/selected_layout"
if [ -n "$in_remove" ];then
write_remove "$in_layout"
elif [ -n "$in_up" ];then
write_up "$in_layout"
elif [ -n "$in_down" ];then
write_down "$in_layout"
elif [ -n "$in_submit" ];then
xkbmapconf -s -- \
-model "$in_model" \
-option "$in_grp" \
-layout "$(cat "$CACHE_DIR/current_layout" | tr '\n' ','| sed s/,$//)"
[ "$in_update" = "#t" ] &&
setxkbmap -option &&
setxkbmap $(cat /etc/X11/xinit/Xkbmap) >/dev/null 2>/dev/null
fi
;;
esac
echo '()'
;;
*)
echo '#f'
esac
}

message_loop
alterator-xkb-0.9/html/000075500000000000000000000000001105526343200151045ustar00rootroot00000000000000alterator-xkb-0.9/html/fbi/000075500000000000000000000000001105526343200156445ustar00rootroot00000000000000alterator-xkb-0.9/html/fbi/xkb-layout.html000064400000000000000000000021131105526343200206260ustar00rootroot00000000000000<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<!-- kerberos administration module -->
<html>
<head>
<title>Kerberos principals - ALT Linux Console</title>
<link type="text/css" rel="stylesheet" href="/fbi/styles/card-index.css"/>

<!-- ajax selector -->
<script src="/fbi/scripts/submit.js"/>
<script src="/fbi/scripts/card-index.js"/>
</head>
<body>
<h1><span translate="_">Available layouts</span></h1>
<form method="POST" class="selector-chooser" id="ajax-selector">
<label for="name"><span translate="_">Country</span></label>
<select name="name"/>
<input type="submit" name="card-index-select" value="Select" class="btn"/>
</form>
<form method="POST" class="selector-data">
<div class="selector-name"/>
<select optionlist="avail_variant" name="variant" size="10" style="width:50%"/><br/>
<input type="submit" name="card-index-apply" value="Apply" class="btn"/>
&nbsp;
<input type="reset" name="card-index-reset" value="Reset" class="btn"/>
</form>
</body>
</html>
alterator-xkb-0.9/html/fbi/xkb.html000064400000000000000000000033061105526343200173200ustar00rootroot00000000000000<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<!-- xkb administration module -->
<html>
<head>
<title>Keyboard settings - ALT Linux Console</title>
</head>
<body>
<h1><span translate="_">Keyboard settings</span></h1>

<!-- information for extension -->
<input type="hidden" name="alt-exec-description"/>
<input type="hidden" name="alt-exec-command"/>
<input type="hidden" name="alt-exec-error-message"/>

<form method="POST">
<table>
<tbody>
<tr>
<td><label for="model"><span translate="_">Model</span></label></td>
<td><select optionlist="avail_model" name="model"/></td>
</tr>
<tr>
<td colspan="2">
<label for="layout"><span translate="_">Layouts</span></label><br/>
<select optionlist="current_layout"
name="layout"
size="5"
style="width:100%"/>
</td>
</tr>
<tr>
<td style="text-align:left">
<input type="submit" name="add" value="Add" class="btn"/>
&nbsp;
<input type="submit" name="remove" value="Remove" class="btn"/>
</td>
<td style="text-align:right">
<input type="submit" name="up" value="Up" class="btn"/>
&nbsp;
<input type="submit" name="down" value="Down" class="btn"/>
</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
<td><label for="grp"><span translate="_">Layout switching</span></label></td>
<td><select optionlist="avail_grp" name="grp" style="width:100%"/></td>
</tr>
</tbody>
</table>
<input type="submit" name="submit" value="Apply" class="btn"/>
&nbsp;
<input type="reset" value="Reset" class="btn"/>
</form>
</body>
</html>
alterator-xkb-0.9/po/000075500000000000000000000000001105526343200145565ustar00rootroot00000000000000alterator-xkb-0.9/po/alterator-xkb.pot000064400000000000000000000042311105526343200200610ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-06-19 18:25+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: ui/xkb/index.scm:49
msgid "default"
msgstr ""

#: ui/xkb/index.scm:208 ui/xkb/html-messages.scm:11
msgid "Up"
msgstr ""

#: ui/xkb/index.scm:209 ui/xkb/html-messages.scm:12
msgid "Down"
msgstr ""

#: ui/xkb/index.scm:213 ui/xkb/html-messages.scm:9
msgid "Add"
msgstr ""

#: ui/xkb/index.scm:214 ui/xkb/html-messages.scm:10
msgid "Remove"
msgstr ""

#: ui/xkb/index.scm:219 ui/xkb/index.scm:229 ui/xkb/html-messages.scm:8
msgid "Layouts"
msgstr ""

#: ui/xkb/index.scm:220 ui/xkb/html-messages.scm:7
msgid "Model"
msgstr ""

#: ui/xkb/index.scm:231
msgid "Available Layouts:"
msgstr ""

#: ui/xkb/index.scm:242
msgid "Variant:"
msgstr ""

#: ui/xkb/index.scm:245
msgid "Switch"
msgstr ""

#: ui/xkb/index.scm:272 ui/xkb/html-messages.scm:4 ui/xkb/html-messages.scm:14
#: backend3/xkb2:130
msgid "Apply"
msgstr ""

#: ui/xkb/index.scm:275
msgid "Quit"
msgstr ""

#: ui/xkb/html-messages.scm:1
msgid "Available layouts"
msgstr ""

#: ui/xkb/html-messages.scm:2
msgid "Country"
msgstr ""

#: ui/xkb/html-messages.scm:3
msgid "Select"
msgstr ""

#: ui/xkb/html-messages.scm:5 ui/xkb/html-messages.scm:15
msgid "Reset"
msgstr ""

#: ui/xkb/html-messages.scm:6 backend3/template-xkb:21
msgid "Keyboard settings"
msgstr ""

#: ui/xkb/html-messages.scm:13
msgid "Layout switching"
msgstr ""

#: backend3/template-xkb:5 backend3/template-xkb2:5 backend3/xkb2:18
msgid "alterator-xkb"
msgstr ""

#: backend3/template-xkb:20
msgid "Keyboard"
msgstr ""

#: backend3/template-xkb:22
msgid "Graphical interface"
msgstr ""

#: backend3/xkb2:128
msgid "Apply saved keyboard settings"
msgstr ""

#: backend3/xkb2:129
msgid "Apply failed"
msgstr ""
alterator-xkb-0.9/po/be.po000064400000000000000000000052121105526343200155040ustar00rootroot00000000000000# Belarusian translation of PACKAGE.
# Copyright (C) 2005 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Vital Khilko (aka dojlid) <vk@altlinux.ru>, 2005.
# , fuzzy
#
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-06-19 18:25+0400\n"
"PO-Revision-Date: 2005-07-21 15:00+0300\n"
"Last-Translator: Vital Khilko (aka dojlid) <vk@altlinux.ru>\n"
"Language-Team: Belarusian <i18n@mova.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: ui/xkb/index.scm:49
msgid "default"
msgstr "дапомна"

#: ui/xkb/index.scm:208 ui/xkb/html-messages.scm:11
msgid "Up"
msgstr "Вышэй"

#: ui/xkb/index.scm:209 ui/xkb/html-messages.scm:12
msgid "Down"
msgstr "Ніжэй"

#: ui/xkb/index.scm:213 ui/xkb/html-messages.scm:9
msgid "Add"
msgstr "Дадаць"

#: ui/xkb/index.scm:214 ui/xkb/html-messages.scm:10
msgid "Remove"
msgstr "Выдаліць"

#: ui/xkb/index.scm:219 ui/xkb/index.scm:229 ui/xkb/html-messages.scm:8
msgid "Layouts"
msgstr "Раскладкі"

#: ui/xkb/index.scm:220 ui/xkb/html-messages.scm:7
msgid "Model"
msgstr "Мадэль"

#: ui/xkb/index.scm:231
msgid "Available Layouts:"
msgstr "Даступныя раскладкі:"

#: ui/xkb/index.scm:242
msgid "Variant:"
msgstr "Варыянты:"

#: ui/xkb/index.scm:245
msgid "Switch"
msgstr ""

#: ui/xkb/index.scm:272 ui/xkb/html-messages.scm:4 ui/xkb/html-messages.scm:14
#: backend3/xkb2:130
msgid "Apply"
msgstr ""

#: ui/xkb/index.scm:275
msgid "Quit"
msgstr ""

#: ui/xkb/html-messages.scm:1
#, fuzzy
msgid "Available layouts"
msgstr "Даступныя раскладкі:"

#: ui/xkb/html-messages.scm:2
msgid "Country"
msgstr ""

#: ui/xkb/html-messages.scm:3
msgid "Select"
msgstr ""

#: ui/xkb/html-messages.scm:5 ui/xkb/html-messages.scm:15
msgid "Reset"
msgstr ""

#: ui/xkb/html-messages.scm:6 backend3/template-xkb:21
msgid "Keyboard settings"
msgstr ""

#: ui/xkb/html-messages.scm:13
#, fuzzy
msgid "Layout switching"
msgstr "Раскладкі"

#: backend3/template-xkb:5 backend3/template-xkb2:5 backend3/xkb2:18
msgid "alterator-xkb"
msgstr ""

#: backend3/template-xkb:20
#, fuzzy
msgid "Keyboard"
msgstr "Клявіятура X11"

#: backend3/template-xkb:22
msgid "Graphical interface"
msgstr ""

#: backend3/xkb2:128
msgid "Apply saved keyboard settings"
msgstr ""

#: backend3/xkb2:129
msgid "Apply failed"
msgstr ""

#, fuzzy
#~ msgid "Default"
#~ msgstr "дапомна"

#~ msgid "Advanced"
#~ msgstr "Адмысловае"

#~ msgid "Not implemented yet"
#~ msgstr "Яшчэ нерэалізаванае"
alterator-xkb-0.9/po/ru.po000064400000000000000000000052371105526343200155530ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-06-19 18:25+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: ui/xkb/index.scm:49
msgid "default"
msgstr "по умолчанию"

#: ui/xkb/index.scm:208 ui/xkb/html-messages.scm:11
msgid "Up"
msgstr "Поднять"

#: ui/xkb/index.scm:209 ui/xkb/html-messages.scm:12
msgid "Down"
msgstr "Опустить"

#: ui/xkb/index.scm:213 ui/xkb/html-messages.scm:9
msgid "Add"
msgstr "Добавить"

#: ui/xkb/index.scm:214 ui/xkb/html-messages.scm:10
msgid "Remove"
msgstr "Удалить"

#: ui/xkb/index.scm:219 ui/xkb/index.scm:229 ui/xkb/html-messages.scm:8
msgid "Layouts"
msgstr "Раскладки"

#: ui/xkb/index.scm:220 ui/xkb/html-messages.scm:7
msgid "Model"
msgstr "Модель"

#: ui/xkb/index.scm:231
msgid "Available Layouts:"
msgstr "Доступные раскладки:"

#: ui/xkb/index.scm:242
msgid "Variant:"
msgstr "Вариант:"

#: ui/xkb/index.scm:245
msgid "Switch"
msgstr "Переключатель"

#: ui/xkb/index.scm:272 ui/xkb/html-messages.scm:4 ui/xkb/html-messages.scm:14
#: backend3/xkb2:130
msgid "Apply"
msgstr "Применить"

#: ui/xkb/index.scm:275
msgid "Quit"
msgstr "Выход"

#: ui/xkb/html-messages.scm:1
msgid "Available layouts"
msgstr "Доступные раскладки"

#: ui/xkb/html-messages.scm:2
msgid "Country"
msgstr "Страна"

#: ui/xkb/html-messages.scm:3
msgid "Select"
msgstr "Выбрать"

#: ui/xkb/html-messages.scm:5 ui/xkb/html-messages.scm:15
msgid "Reset"
msgstr "Сброс"

#: ui/xkb/html-messages.scm:6 backend3/template-xkb:21
msgid "Keyboard settings"
msgstr "Настройка клавиатуры"

#: ui/xkb/html-messages.scm:13
msgid "Layout switching"
msgstr "Переключение раскладок"

#: backend3/template-xkb:5 backend3/template-xkb2:5 backend3/xkb2:18
msgid "alterator-xkb"
msgstr ""

#: backend3/template-xkb:20
msgid "Keyboard"
msgstr "Клавиатура"

#: backend3/template-xkb:22
msgid "Graphical interface"
msgstr "Графический интерфейс"

#: backend3/xkb2:128
msgid "Apply saved keyboard settings"
msgstr "Применить сохранённые настройки клавиатуры"

#: backend3/xkb2:129
msgid "Apply failed"
msgstr "Ошибка"
alterator-xkb-0.9/po/uk.po000064400000000000000000000052261105526343200155420ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-06-19 18:25+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: ui/xkb/index.scm:49
msgid "default"
msgstr "типово"

#: ui/xkb/index.scm:208 ui/xkb/html-messages.scm:11
msgid "Up"
msgstr "Підняти"

#: ui/xkb/index.scm:209 ui/xkb/html-messages.scm:12
msgid "Down"
msgstr "Опустити"

#: ui/xkb/index.scm:213 ui/xkb/html-messages.scm:9
msgid "Add"
msgstr "Додати"

#: ui/xkb/index.scm:214 ui/xkb/html-messages.scm:10
msgid "Remove"
msgstr "Вилучити"

#: ui/xkb/index.scm:219 ui/xkb/index.scm:229 ui/xkb/html-messages.scm:8
msgid "Layouts"
msgstr "Розкладки"

#: ui/xkb/index.scm:220 ui/xkb/html-messages.scm:7
msgid "Model"
msgstr "Модель"

#: ui/xkb/index.scm:231
msgid "Available Layouts:"
msgstr "Доступні розкладки:"

#: ui/xkb/index.scm:242
msgid "Variant:"
msgstr "Варіант:"

#: ui/xkb/index.scm:245
msgid "Switch"
msgstr "Перемикач"

#: ui/xkb/index.scm:272 ui/xkb/html-messages.scm:4 ui/xkb/html-messages.scm:14
#: backend3/xkb2:130
msgid "Apply"
msgstr "Застосувати"

#: ui/xkb/index.scm:275
msgid "Quit"
msgstr "Вихід"

#: ui/xkb/html-messages.scm:1
msgid "Available layouts"
msgstr "Доступні розкладки"

#: ui/xkb/html-messages.scm:2
msgid "Country"
msgstr "Країна"

#: ui/xkb/html-messages.scm:3
msgid "Select"
msgstr "Вибрати"

#: ui/xkb/html-messages.scm:5 ui/xkb/html-messages.scm:15
msgid "Reset"
msgstr "Скинути"

#: ui/xkb/html-messages.scm:6 backend3/template-xkb:21
msgid "Keyboard settings"
msgstr "Налаштування клавіатури"

#: ui/xkb/html-messages.scm:13
msgid "Layout switching"
msgstr "Перемикання розкладки"

#: backend3/template-xkb:5 backend3/template-xkb2:5 backend3/xkb2:18
msgid "alterator-xkb"
msgstr ""

#: backend3/template-xkb:20
msgid "Keyboard"
msgstr "Клавіатура"

#: backend3/template-xkb:22
msgid "Graphical interface"
msgstr "Графічний інтерфейс"

#: backend3/xkb2:128
msgid "Apply saved keyboard settings"
msgstr "Застосувати збережені налаштування клавіатури"

#: backend3/xkb2:129
msgid "Apply failed"
msgstr "Помилка"
alterator-xkb-0.9/tools/000075500000000000000000000000001105526343200153005ustar00rootroot00000000000000alterator-xkb-0.9/tools/xkbdatadump/000075500000000000000000000000001105526343200176045ustar00rootroot00000000000000alterator-xkb-0.9/tools/xkbdatadump/Makefile000064400000000000000000000001431105526343200212420ustar00rootroot00000000000000CFLAGS=-Wall -pedantic $(RPM_OPT_FLAGS)
LDLIBS= -lexpat

all:xkbdatadump
clean:
$(RM) xkbdatadump
alterator-xkb-0.9/tools/xkbdatadump/xkbdatadump.c000064400000000000000000000111721105526343200222560ustar00rootroot00000000000000#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <error.h>
#include <errno.h>

#include <unistd.h>
#include <fcntl.h>

#include <expat.h>

const char datafile[]="/usr/share/X11/xkb/rules/xorg.xml";
const char english[]="en_US";
const char *user_language;

typedef struct user_data_struct {
char *el;
char *lang;
FILE *file;

int mode;

char *layname;
char *name;

char *laydescription;
char *llaydescription;
char *description;
char *ldescription;
} user_data;

void
do_free(char **item)
{
if (*item) free(*item);
*item = 0;
}

void
do_assign(char **target,const char *destination,int len)
{
do_free(target);

if (destination && (len > 0))
{
*target=malloc(len+1);
strncpy(*target,destination,len);
(*target)[len]=0;
}
}

const char *
get_lang(const char **attr)
{
for (;*attr;attr+=2)
{
const char *name = *attr;
const char *value = *(attr + 1);
if (!strcmp(name,"xml:lang")) return value;
}
return english;
}

FILE *
xfopen(const char *name,const char *mode)
{
FILE *f=fopen(name,mode);
if (!f)
error(EXIT_FAILURE,errno,"unable to open file %s for writing",name);
return f;
}

void
do_reset(user_data *u)
{
do_free(&u->description);
do_free(&u->ldescription);
}

static void XMLCALL
element_start(void *data, const char *el, const char **attr)
{
user_data *u = data;

u->el = strdup(el);
u->lang = strdup(get_lang(attr));

if (!strcmp(el,"modelList"))
u->file = xfopen("./models","w");
else if (!strcmp(el,"layoutList"))
u->file = xfopen("./layouts","w");
else if (!strcmp(el,"optionList"))
u->file = xfopen("./options","w");
else if (!strcmp(el,"layout") || !strcmp(el,"group"))
u->mode = 1;
else if (!strcmp(el,"variant") || !strcmp(el,"option"))
u->mode = 0;
}

static void XMLCALL
element_stop(void *data, const char *el)
{
user_data *u = data;

do_free(&u->el);
do_free(&u->lang);

if (!strcmp(el,"modelList") || !strcmp(el,"layoutList") || !strcmp(el,"optionList"))
fclose(u->file);
else if (!strcmp(el,"layout"))
{
fprintf(u->file,"%s\t%s\n",
u->layname,
u->llaydescription?u->llaydescription:u->laydescription);
do_reset(u);
}
else if (!strcmp(el,"variant"))
{
u->mode = 1;
fprintf(u->file,"%s(%s)\t%s - %s\n",
u->layname,
u->name,
u->llaydescription?u->llaydescription:u->laydescription,
u->ldescription?u->ldescription:u->description);
do_reset(u);
}
else if (!strcmp(el,"option") && !strcmp(u->layname,"grp"))
{
u->mode = 1;
fprintf(u->file,"%s\t%s\n",
u->name,
u->ldescription?u->ldescription:u->description);
do_reset(u);
}
else if (!strcmp(el,"model"))
{
fprintf(u->file,"%s\t%s\n",
u->name,
u->ldescription?u->ldescription:u->description);
do_reset(u);
}
}

static void XMLCALL
cdata_handler(void *data,const char *buffer, int len)
{
user_data *u = data;

if (!u->el) return;

if (!strcmp(u->el,"name"))
do_assign(u->mode?&u->layname:&u->name,buffer,len);
else if (!strcmp(u->el,"description") &&
!strcmp(u->lang,english))
do_assign(u->mode?&u->laydescription:&u->description,buffer,len);
else if (!strcmp(u->el,"description") &&
!strcmp(u->lang,user_language))
do_assign(u->mode?&u->llaydescription:&u->ldescription,buffer,len);
else if (!strcmp(u->el,"description") &&
!strncmp(u->lang,user_language,2))
do_assign(u->mode?&u->llaydescription:&u->ldescription,buffer,len);
}

int
main(int argc,char **argv)
{
int fd;
char buffer[BUFSIZ];
size_t len;
XML_Parser parser;
user_data *data;

if (argc >= 2)
user_language=argv[1];
else
user_language=english;

if (!(parser = XML_ParserCreate(NULL)))
error(EXIT_FAILURE,0,"couldn't allocate memory for parser");

if (!(data = calloc(1,sizeof(user_data))))
error(EXIT_FAILURE,errno,"couldn't allocate memory for user_data");

if ((fd = open(datafile,O_RDONLY)) < 0)
error(EXIT_FAILURE,errno,"unable to open database file %s",datafile);

XML_SetElementHandler(parser, element_start, element_stop);
XML_SetCharacterDataHandler(parser,cdata_handler);
XML_SetUserData(parser, data);

while ((len = read(fd,buffer,(sizeof buffer) - 1)) > 0)
{
if (XML_Parse(parser, buffer, len, XML_FALSE) == XML_STATUS_ERROR)
{
fprintf(stderr,"Parse error at line %lu:%s",
XML_GetCurrentLineNumber(parser),
XML_ErrorString(XML_GetErrorCode(parser)));
return EXIT_FAILURE;
}
}
XML_Parse(parser, buffer, 0, XML_TRUE);
XML_ParserFree(parser);

return EXIT_SUCCESS;
}
alterator-xkb-0.9/tools/xkbmapconf000075500000000000000000000056001105526343200173570ustar00rootroot00000000000000#!/bin/sh

PROG="${0##*/}"

SYSTEM_CONFIG="/etc/X11/xinit/Xkbmap"
LOCAL_CONFIG="$HOME/.Xkbmap"

### config

cat_config()
{
touch "$SYSTEM_CONFIG" 2>/dev/null
if [ -w "$SYSTEM_CONFIG" ];then
cat "$SYSTEM_CONFIG"
else
cat "$LOCAL_CONFIG"
fi
}

echo_config()
{
if [ -w "$SYSTEM_CONFIG" ];then
echo "$@" > "$SYSTEM_CONFIG"
else
echo "$@" > "$LOCAL_CONFIG"
fi
}

### read operations

read_layout()
{
local layout="$1";shift
local variant="$1";shift
local count=1

local IFS=,
set -- $variant

for lay in $layout;do
local var="$(eval echo \$$count)"
if [ -n "$var" ];then
printf '%s(%s)\n' "$lay" "$var"
else
printf '%s\n' "$lay"
fi
count=$((count + 1))
done
}

read_grp()
{
local IFS=,
set -- $1
for i in "$@";do
if [ "$i" != "${i#grp:}" ];then
echo "$i"
break
fi
done
}

read_config()
{
local action="$1"
local layout= variant= model= option=
eval set -- $(cat_config)

while [ $# -gt 0 ];do
case "$1" in
-layout) layout="$2";shift;shift;;
-variant) variant="$2";shift;shift;;
-model) model="$2";shift;shift;;
-option) option="$2";shift;shift;;
esac
done

case "$action" in
model) echo "$model";;
grp) read_grp "$option";;
layout) read_layout "$layout" "$variant";;
esac

exit
}

# write operations

write_variant()
{
echo "$1"|sed -r 's/([^,()]+)\(?([^,()]*)\)?/\2/g'
}

write_layout()
{
echo "$1"|sed -r 's/([^,()]+)\(?([^,()]*)\)?/\1/g'
}

write_config()
{
local layout= variant=

while [ $# -gt 0 ];do
case "$1" in
-layout) layout="$2";shift;shift;;
-variant) variant="$2";shift;shift;;
*) args="$args $1 $2";shift;shift;;
esac
done

#try to extract variant from layout
if [ -z "$variant" -a -n "$layout" ];then
args="$args -variant $(write_variant "$layout")"
args="$args -layout $(write_layout "$layout")"
else
[ -z "$variant" ] || args="$args -variant $variant"
[ -z "$layout" ] || args="$args -layout $layout"
fi

eval echo_config $args
}

show_help()
{
cat <<EOF
xkbmapconf - read and write ~/.Xkbmap and /etc/X11/xinit/Xkbmap config files

Usage: $PROG [option]

Read options

-h, --help show this text and exit;

-m, --get-model read keyboard model;
-g, --get-grp read keyboard switch;
-l, --get-layout read keyboard layout;

-s, --save save parameters.

Report bugs to http://bugs.altlinux.ru/

EOF
exit
}

### main

save=
short_opt="h,m,l,g,s"
long_opt="help,get-model,get-layout,get-grp,save"
temp=`getopt -n $PROG -o "$short_opt" -l "$long_opt" -- "$@"` || show_help
eval set -- "$temp"

while :; do
case "$1" in
-h|--help) show_help;;
-m|--get-model) read_config "model";;
-l|--get-layout) read_config "layout";;
-g|--get-grp) read_config "grp";;
-s|--save) save=1;;
--)shift; break ;;
*) echo "$1";show_help;;
esac
shift
done
[ -n "$save" ] && write_config "$@"
alterator-xkb-0.9/ui/000075500000000000000000000000001105526343200145555ustar00rootroot00000000000000alterator-xkb-0.9/ui/xkb/000075500000000000000000000000001105526343200153415ustar00rootroot00000000000000alterator-xkb-0.9/ui/xkb/avail_layout.scm000064400000000000000000000034571105526343200205470ustar00rootroot00000000000000(document:surround "/std/frame")
(document:insert "/std/functions")
(document:envelop with-translation _ "alterator-xkb")

;;; functions

(define *country-list* (make-cell '()))
(define *variant-list* (make-cell '()))

(define (init-default url storage lst)
(let ((items (woo-list/name+label url)))
(cell-set! storage items)
(lst rows (map cdr items)
current 0)))

(define (current-text lst storage)
(let ((num (lst current)))
(and (>= num 0)
(car (list-ref (cell-ref storage) num)))))

(define (update-variant)
(let ((item (current-text country *country-list*)))
(and item
(init-default (string-append "/xkb/avail_layout/" item "/avail_variant")
*variant-list*
variant))))

(define (write-variant)
(let ((item (current-text variant *variant-list*)))
(and item
(woo-write "/xkb/avail_layout/any-country/" 'variant item))))


;;; ui

width 650
height 400


(gridbox columns "5;90;5"
(spacer)
(hbox (label (_ "Country")) (document:id country (combobox)))
(spacer)

(spacer)
(document:id variant (listbox header (vector (_ "Available layouts"))))
(spacer))

(hbox (document:id ok-button (button (_ "OK")))
(document:id cancel-button (button (_ "Cancel"))))



;;; logic

(document:root (when loaded
(woo-catch/message
(thunk
(ok-button (when clicked
(woo-catch/message write-variant)
(document:end #t)))
(cancel-button (when clicked (document:end #f)))
(init-default "/xkb/avail_layout" *country-list* country)
(country (when selected (update-variant)))
(country selected)))))

alterator-xkb-0.9/ui/xkb/html-messages.scm000064400000000000000000000003271105526343200206200ustar00rootroot00000000000000(_ "Available layouts")
(_ "Country")
(_ "Select")
(_ "Apply")
(_ "Reset")
(_ "Keyboard settings")
(_ "Model")
(_ "Layouts")
(_ "Add")
(_ "Remove")
(_ "Up")
(_ "Down")
(_ "Layout switching")
(_ "Apply")
(_ "Reset")
alterator-xkb-0.9/ui/xkb/index.scm000064400000000000000000000071611105526343200171610ustar00rootroot00000000000000(document:surround "/std/frame")
(document:insert "/std/functions")
(document:envelop with-translation _ "alterator-xkb")


;;; functions

(define *model-list* (make-cell '()))
(define *grp-list* (make-cell '()))
(define *layout-list* (make-cell '()))

(define (default-index x lst)
(or (list-index (lambda(y) (string=? (car y) x))
lst)
0))

(define (init-default url storage lst def)
(let ((items (woo-list/name+label url)))
(cell-set! storage items)
(lst rows (map cdr items)
current (default-index def items))))

(define (current-text lst storage)
(let ((num (lst current)))
(and (>= num 0)
(car (list-ref (cell-ref storage) num)))))

(define (update-layout)
(let ((data (woo-read-first "/xkb")))
(init-default "/xkb/current_layout"
*layout-list*
layout
(woo-get-option data 'layout))))

(define (do- action)
(let ((item (current-text layout *layout-list*)))
(and item
(woo-write "/xkb" action #t 'layout item)
(update-layout))))

(define (do-up) (do- 'up))
(define (do-down) (do- 'down))
(define (do-remove) (do- 'remove))

(define (do-add)
(and (document:popup "/xkb/avail_layout")
(update-layout)))

(define (do-apply)
(let ((grp-text (current-text grp *grp-list*))
(model-text (current-text model *model-list*)))
(and grp-text
model-text
(woo-write "/xkb"
'submit #t
'update #t
'grp grp-text
'model model-text))))

;;; ui

(gridbox columns "10;80;10"
(spacer)
(hbox (label (_ "Model")) (document:id model (combobox)))
(spacer)

(spacer)
(document:id layout (listbox header (vector (_ "Layouts"))))
(spacer)

(spacer)
(hbox
(document:id add-button (button (_ "Add") align "left"))
(document:id remove-button (button (_ "Remove") align "left"))
(spacer)
(document:id up-button (button (_ "Up") align "right"))
(document:id down-button (button (_ "Down") align "right")))
(spacer)

(spacer)
(label "")
(spacer)

(spacer)
(hbox (label (_ "Layout switching")) (document:id grp (combobox)))
(spacer))

(hbox (document:id apply-button (button (_ "Apply")))
(document:id quit-button (button (_ "Quit"))))

;;; logic

(document:root (when loaded
(woo-catch/message
(thunk
(let ((data (woo-read-first "/xkb")))
(init-default "/xkb/avail_model"
*model-list*
model
(woo-get-option data 'model))
(init-default "/xkb/avail_grp"
*grp-list*
grp
(woo-get-option data 'grp))
(init-default "/xkb/current_layout"
*layout-list*
layout
(woo-get-option data 'layout))
(up-button (when clicked (woo-catch/message do-up)))
(down-button (when clicked (woo-catch/message do-down)))
(add-button (when clicked (woo-catch/message do-add)))
(remove-button (when clicked (woo-catch/message do-remove)))
(apply-button (when clicked (woo-catch/message do-apply)))
(quit-button (when clicked (document:end))) )))))
 
: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
: Michael Shigorin