feat: hrvatski raspored tipkovnice za RDP (hr-hr-qwertz)
Guacamole isporucuje 22 rasporeda, hrvatskog nema. Rasporedi se kompajliraju u libguac-client-rdp, pa se ne mogu dodati naknadno — guacd se mora ponovno prevesti. guacd-hr/hr_hr_qwertz.keymap Izveden iz X11 "hr" rasporeda na stvarnom sustavu (hr -> rs(latin): rs(common) za brojcani red, rs(latalpha) za s/d/c/c/z s dijakriticima, rs(latlevel3) za AltGr), ne po sjecanju. Strukturno prati cs-cz-qwertz jer njegov caps model dira samo slova, dok de_de_qwertz izvrce i brojcani red. guacd-hr/build.sh Preuzme sluzbeni izvor tražene verzije, ubaci keymap u keymaps/ i u popis rdp_keymaps, pa gradi koristeci Dockerfile koji dolazi uz taj izvor. Namjerno se ne prepisuje upstream receptura, da nadogradnja bude "./build.sh 1.7.0" umjesto odrzavanja vlastitog builda. Ovisnosti su zakljucane jer ih upstream gradi iz gita i bira najnoviji tag, pa gradnja pukne sama od sebe: libwebsockets v5 trazi GnuTLS kojeg build okruzenje 1.6.0 nema, a FreeRDP 2.x je odmakao na razvojne tagove koje configure odbija. Zakljucani su na v4.x i 2.11.7 — ono sto nosi sluzbeni guacd:1.6.0 — i pregazivi su preko env varijabli. install.sh Novo pitanje pri instalaciji; ako se prihvati, gradi image i compose koristi njega umjesto sluzbenog guacd-a. Postojeci image se ne gradi ponovno. Provjereno cistom instalacijom na Ubuntu 24.04: gradnja prolazi u sklopu installera, image sadrzi hr-hr-qwertz uz svih 22 standardnih, FreeRDP je 2.11.7 kao u sluzbenom, i svih 9 GUI stranica vraca 200. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Executable
+81
@@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Gradi guacd image s dodanim hrvatskim rasporedom tipkovnice.
|
||||
#
|
||||
# Rasporedi se kompajliraju u libguac-client-rdp, pa se ne mogu dodati
|
||||
# naknadno — guacd se mora ponovno prevesti. Skripta namjerno koristi
|
||||
# Dockerfile koji dolazi uz sluzbeni izvor tražene verzije umjesto da
|
||||
# recepturu prepisuje, da nadogradnja na novi Guacamole ne trazi
|
||||
# odrzavanje ovdje.
|
||||
#
|
||||
# ./build.sh [verzija] npr. ./build.sh 1.7.0
|
||||
#
|
||||
set -euo pipefail
|
||||
|
||||
GUAC_VERSION="${1:-1.6.0}"
|
||||
IMAGE="guacd:${GUAC_VERSION}-hr"
|
||||
KEYMAP="hr_hr_qwertz.keymap"
|
||||
SRC_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
[[ -f "${SRC_DIR}/${KEYMAP}" ]] || { echo "Nedostaje ${KEYMAP}" >&2; exit 1; }
|
||||
command -v docker >/dev/null || { echo "Docker nije pronaden" >&2; exit 1; }
|
||||
|
||||
WORK=$(mktemp -d)
|
||||
trap 'rm -rf "$WORK"' EXIT
|
||||
|
||||
echo "==> Preuzimanje izvora guacamole-server ${GUAC_VERSION}"
|
||||
TARBALL="guacamole-server-${GUAC_VERSION}.tar.gz"
|
||||
for base in "https://downloads.apache.org/guacamole" \
|
||||
"https://archive.apache.org/dist/guacamole"; do
|
||||
if curl -fsSL -o "${WORK}/${TARBALL}" \
|
||||
"${base}/${GUAC_VERSION}/source/${TARBALL}"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
[[ -s "${WORK}/${TARBALL}" ]] || { echo "Izvor ${GUAC_VERSION} nije pronaden" >&2; exit 1; }
|
||||
|
||||
tar -xzf "${WORK}/${TARBALL}" -C "$WORK"
|
||||
BUILD_CTX="${WORK}/guacamole-server-${GUAC_VERSION}"
|
||||
[[ -f "${BUILD_CTX}/Dockerfile" ]] || { echo "Izvor nema Dockerfile" >&2; exit 1; }
|
||||
|
||||
echo "==> Ugradnja ${KEYMAP}"
|
||||
cp "${SRC_DIR}/${KEYMAP}" "${BUILD_CTX}/src/protocols/rdp/keymaps/"
|
||||
|
||||
# Keymap mora biti naveden u rdp_keymaps, inace ga generate.pl preskoci.
|
||||
MAKEFILE="${BUILD_CTX}/src/protocols/rdp/Makefile.am"
|
||||
grep -q "$KEYMAP" "$MAKEFILE" || \
|
||||
sed -i "s|\(\$(srcdir)/keymaps/en_us_qwerty.keymap[[:space:]]*\\\\\)|\1\n \$(srcdir)/keymaps/${KEYMAP} \\\\|" "$MAKEFILE"
|
||||
grep -q "$KEYMAP" "$MAKEFILE" || { echo "Ubacivanje u Makefile.am nije uspjelo" >&2; exit 1; }
|
||||
|
||||
echo "==> Gradnja ${IMAGE} (dugotrajno, gradi se i FreeRDP)"
|
||||
# Upstream Dockerfile ovisnosti gradi iz gita i bira NAJNOVIJI tag koji
|
||||
# odgovara regexu. Kako te biblioteke izlaze, gradnja pukne sama od sebe
|
||||
# iako se nista nije promijenilo kod nas:
|
||||
# - libwebsockets v5 trazi GnuTLS kojeg build okruzenje 1.6.0 nema
|
||||
# - FreeRDP 2.x je odmakao na razvojne tagove koje configure odbija
|
||||
# Zato su zakljucani na ono sto nosi sluzbeni guacd:1.6.0 image.
|
||||
# Za drugu verziju Guacamolea po potrebi pregazi preko env varijabli.
|
||||
docker build \
|
||||
--build-arg BUILD_JOBS="$(nproc)" \
|
||||
--build-arg WITH_LIBWEBSOCKETS="${WITH_LIBWEBSOCKETS:-v4(\\.\\d+)+}" \
|
||||
--build-arg WITH_FREERDP="${WITH_FREERDP:-2\\.11\\.7}" \
|
||||
-t "$IMAGE" "$BUILD_CTX"
|
||||
|
||||
echo "==> Provjera da je raspored u imageu"
|
||||
if docker run --rm --entrypoint sh "$IMAGE" -c \
|
||||
'strings /opt/guacamole/lib/libguac-client-rdp.so.0.0.0 | grep -qx hr-hr-qwertz'; then
|
||||
echo "OK — ${IMAGE} sadrzi hr-hr-qwertz"
|
||||
else
|
||||
echo "GRESKA: raspored nije zavrsio u imageu" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat <<MSG
|
||||
|
||||
Gotovo. U /opt/guacamole/docker-compose.yml zamijenite guacd image s:
|
||||
|
||||
image: ${IMAGE}
|
||||
|
||||
pa "docker compose up -d guacd". Zatim na konekciji postavite
|
||||
server-layout = hr-hr-qwertz
|
||||
MSG
|
||||
@@ -0,0 +1,92 @@
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
#
|
||||
# Croatian (hrvatska) QWERTZ layout.
|
||||
#
|
||||
# Derived from the X11 "hr" layout, which inherits from rs(latin):
|
||||
# rs(common) for the digit row, rs(latalpha) for s/d/c/c/z with
|
||||
# diacritics, and rs(latlevel3) for the AltGr level.
|
||||
#
|
||||
|
||||
parent "base_altgr"
|
||||
name "hr-hr-qwertz"
|
||||
freerdp "KBD_CROATIAN"
|
||||
|
||||
#
|
||||
# Basic keys
|
||||
#
|
||||
|
||||
map -caps -altgr -shift 0x29 0x02..0x0D ~ "`1234567890'+"
|
||||
map -caps -altgr -shift 0x10..0x1B ~ "qwertzuiopšđ"
|
||||
map -caps -altgr -shift 0x1E..0x28 0x2B ~ "asdfghjklčćž"
|
||||
map -caps -altgr -shift 0x56 0x2C..0x35 ~ "<yxcvbnm,.-"
|
||||
|
||||
map -caps -altgr +shift 0x29 0x02..0x0D ~ "~!"#$%&/()=?*"
|
||||
map -caps -altgr +shift 0x10..0x1B ~ "QWERTZUIOPŠĐ"
|
||||
map -caps -altgr +shift 0x1E..0x28 0x2B ~ "ASDFGHJKLČĆŽ"
|
||||
map -caps -altgr +shift 0x56 0x2C..0x35 ~ ">YXCVBNM;:_"
|
||||
|
||||
map +caps -altgr -shift 0x29 0x02..0x0D ~ "`1234567890'+"
|
||||
map +caps -altgr -shift 0x10..0x1B ~ "QWERTZUIOPŠĐ"
|
||||
map +caps -altgr -shift 0x1E..0x28 0x2B ~ "ASDFGHJKLČĆŽ"
|
||||
map +caps -altgr -shift 0x56 0x2C..0x35 ~ "<YXCVBNM,.-"
|
||||
|
||||
map +caps -altgr +shift 0x29 0x02..0x0D ~ "~!"#$%&/()=?*"
|
||||
map +caps -altgr +shift 0x10..0x1B ~ "qwertzuiopšđ"
|
||||
map +caps -altgr +shift 0x1E..0x28 0x2B ~ "asdfghjklčćž"
|
||||
map +caps -altgr +shift 0x56 0x2C..0x35 ~ ">yxcvbnm;:_"
|
||||
|
||||
#
|
||||
# Keys requiring AltGr
|
||||
#
|
||||
|
||||
map +altgr -shift 0x04 ~ "^"
|
||||
map +altgr -shift 0x06 ~ "°"
|
||||
|
||||
map +altgr -shift 0x10 ~ "\"
|
||||
map +altgr -shift 0x11 ~ "|"
|
||||
map +altgr -shift 0x12 ~ "€"
|
||||
map +altgr -shift 0x1A ~ "÷"
|
||||
map +altgr -shift 0x1B ~ "×"
|
||||
|
||||
map +altgr -shift 0x21 ~ "["
|
||||
map +altgr -shift 0x22 ~ "]"
|
||||
map +altgr -shift 0x25 ~ "ł"
|
||||
map +altgr -shift 0x28 ~ "ß"
|
||||
map +altgr -shift 0x2B ~ "¤"
|
||||
|
||||
map +altgr -shift 0x2E ~ "¢"
|
||||
map +altgr -shift 0x2F ~ "@"
|
||||
map +altgr -shift 0x30 ~ "{"
|
||||
map +altgr -shift 0x31 ~ "}"
|
||||
map +altgr -shift 0x32 ~ "§"
|
||||
|
||||
#
|
||||
# Dead keys
|
||||
#
|
||||
|
||||
map +altgr -shift 0x03 ~ 0xFE5A # Dead caron
|
||||
map +altgr -shift 0x05 ~ 0xFE55 # Dead breve
|
||||
map +altgr -shift 0x07 ~ 0xFE5C # Dead ogonek
|
||||
map +altgr -shift 0x09 ~ 0xFE56 # Dead abovedot
|
||||
map +altgr -shift 0x0A ~ 0xFE51 # Dead acute
|
||||
map +altgr -shift 0x0B ~ 0xFE59 # Dead doubleacute
|
||||
map +altgr -shift 0x0C ~ 0xFE57 # Dead diaeresis
|
||||
map +altgr -shift 0x0D ~ 0xFE5B # Dead cedilla
|
||||
Reference in New Issue
Block a user