#!/bin/sh
# build_xvkbd.rpi.sh
# 2019-01-21
# by Gernot Walzl
# Downloads, builds and installs xvkbd on Raspbian.
# xvkbd is a virtual (on-screen) keyboard for the X Window System.
VERSION="3.9"
SOURCE="xvkbd-$VERSION.tar.gz"
DOWNLOAD="http://t-sato.in.coocan.jp/xvkbd/$SOURCE"
MD5SUM="a719ec0f27fd788b471c24ffec8d9fad"
DEPENDS='build-essential xutils-dev libxaw7-dev libxtst-dev xaw3dg-dev'
# exit on error
set -e
# remove default xvkbd package
apt-get remove xvkbd
# install dependencies
apt-get install $DEPENDS
# download
if [ ! -f "$SOURCE" ]; then
wget -O "$SOURCE" "$DOWNLOAD"
fi
# check for correct source file
if [ "$(md5sum $SOURCE | cut -f 1 -d ' ')" != "$MD5SUM" ]; then
exit 1
fi
# extract
tar xvf "$SOURCE"
cd "xvkbd-$VERSION"
# build
xmkmf
make
# default configuration
cat >> XVkbd.ad <<EOF
xvkbd.secure: true
xvkbd.windowGeometry: 800x200-240-50
xvkbd.keypad: false
xvkbd.modalKeytop: true
xvkbd.alwaysOnTop: true
xvkbd*Font: lucidasans-14
!xvkbd.customization: -german
EOF
# install
make install
# launcher
cat > '/usr/share/applications/xvkdb.desktop' <<EOF
[Desktop Entry]
Name=xvkbd
GenericName=X Virtual Keyboard
Exec=xvkbd
Categories=System;Utility;
Type=Application
Keywords=keyboard;input
EOF