From 80ef9a31a67d47857199502734a95700aae707ea Mon Sep 17 00:00:00 2001 From: Victor Wagner <vitus@wagner.pp.ru> Date: Tue, 29 Aug 2006 13:17:09 +0000 Subject: [PATCH] Added bringup script to xtitle page, added XVKbd russian layout --- software/unix/XVkbd-russian | 108 +++++++++++++++++++++++++++++++++++ software/unix/bringup.sh | 38 ++++++++++++ software/unix/xtitle.html | 38 +++++++++++- software/unix/xtitle.sh | 12 +++- software/unix/xvkbd-rus.html | 36 ++++++++++++ 5 files changed, 228 insertions(+), 4 deletions(-) create mode 100644 software/unix/XVkbd-russian create mode 100644 software/unix/bringup.sh create mode 100644 software/unix/xvkbd-rus.html diff --git a/software/unix/XVkbd-russian b/software/unix/XVkbd-russian new file mode 100644 index 0000000..ed5e3ba --- /dev/null +++ b/software/unix/XVkbd-russian @@ -0,0 +1,108 @@ +!! XVkbd-russian.ad - Russian (win-keyboard like) layout for xvkbd +!! by Victor Wagner <vitus@45.free.net) +!! based on sample app-defaults file for xvkbd +!! by Tom Sato <VEF00200@nifty.ne.jp>, http://homepage3.nifty.com/tsato/ +!! +!! Requires xvkbd to be started in ru_RU.KOI8-R (or ru_UA.KOI8-R) locale +!! to show key labels correctly. You may recode this file to any other +!! 8-bit cyrillic encoding and change font resources appropriately. But +!! as of xvkbd ver 2.6 it doesn't show labels correctly if resourses +!! are in utf-8 +!! +!! Last update: 2006-07-27 + +#include "XVkbd-common" + +xvkbd.title: xvkbd - Virtual Keyboard (Russian) + +xvkbd*generalFont: -*-fixed-medium-r-normal-*-13-*-*-*-*-*-koi8-r +xvkbd*letterFont: -*-fixed-medium-r-normal-*-13-*-*-*-*-*-koi8-r + +xvkbd*space.width: 80 + +xvkbd.modalKeytop: true + +xvkbd.NormalKeys: \ + F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 BackSpace \n\ + Escape 1 2 3 4 5 6 7 8 9 0 - = ` # \n\ + Tab q w e r t y u i o p [ ] Delete \n\ + Control_L a s d f g h j k l ; ' Return \n\ + Shift_L \\ z x c v b n m , . / Multi_key Shift_R \n\ + MainMenu Caps_Lock Alt_L Meta_L space Meta_R Mode_switch Left Right Up Down Focus + +xvkbd.ShiftKeys: \ + F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 BackSpace \n\ + Escape ! @ # $ % ^ & = ( ) _ + ~ # \n\ + Tab Q W E R T Y U I O P { } Delete \n\ + Control_L A S D F G H J K L : " Return \n\ + Shift_L | Z X C V B N M < > ? Multi_key Shift_R \n\ + MainMenu Caps_Lock Alt_L Meta_L space Meta_R Mode_switch Left Right Up Down Focus + + +xvkbd.KeyLabels: \ + F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Backspace \n\ + Esc 1 2 3 4 5 6 7 8 9 0 - = ` # \n\ + Tab q w e r t y u i o p [ ] Del \n\ + Ctrl a s d f g h j k l ; ' Return \n\ + Shift \\ z x c v b n m , . / Comp Shift \n\ + MainMenu Caps Alt Meta space Meta Rus left right up down Focus + +xvkbd.NormalKeyLabels: \ + F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Backspace \n\ + Esc 1 2 3 4 5 6 7 8 9 0 - = ` # \n\ + Tab q w e r t y u i o p [ ] Del \n\ + Ctrl a s d f g h j k l ; ' Return \n\ + Shift \\ z x c v b n m , . / Comp Shift \n\ + MainMenu Caps Alt Meta space Meta Rus left right up down Focus + + +xvkbd.ShiftKeyLabels: \ + F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Backspace \n\ + Esc ! @ # $ % ^ & = ( ) _ + ~ # \n\ + Tab Q W E R T Y U I O P { } Del \n\ + Ctrl A S D F G H J K L : " Return \n\ + Shift | Z X C V B N M < > ? Comp Shift \n\ + MainMenu Caps Alt Meta space Meta Rus left right up down Focus + + +xvkbd.AltgrKeys: \ + F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 BackSpace \n\ + Escape 1 2 3 4 5 6 7 8 9 0 - = Cyrillic_io # \n\ + Tab Cyrillic_shorti Cyrillic_tse Cyrillic_u Cyrillic_ka Cyrillic_ie\ + Cyrillic_en Cyrillic_ghe Cyrillic_sha Cyrillic_shcha Cyrillic_ze\ + Cyrillic_ha Cyrillic_hardsign Delete \n\ + Control_L Cyrillic_ef Cyrillic_yeru Cyrillic_ve Cyrillic_a Cyrillic_pe\ + Cyrillic_er Cyrillic_o Cyrillic_el Cyrillic_de Cyrillic_zhe Cyrillic_e\ + Return \n\ + Shift_L \\ Cyrillic_ya Cyrillic_che Cyrillic_es Cyrillic_em Cyrillic_i\ + Cyrillic_te Cyrillic_softsign Cyrillic_be Cyrillic_yu . Multi_key Shift_R \n\ + MainMenu Caps_Lock Alt_L Meta_L space Meta_R Mode_switch Left Right Up Down Focus + +xvkbd.ShiftAltgrKeys: \ + F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 BackSpace \n\ + Escape ! " # ; % : ? * ( ) _ + Cyrillic_IO # \n\ + Tab Cyrillic_SHORTI Cyrillic_TSE Cyrillic_U Cyrillic_KA Cyrillic_IE\ + Cyrillic_EN Cyrillic_GHE Cyrillic_SHA Cyrillic_SHCHA Cyrillic_ZE\ + Cyrillic_HA Cyrillic_HARDSIGN Delete \n\ + Control_L Cyrillic_EF Cyrillic_YERU Cyrillic_VE Cyrillic_A Cyrillic_PE\ + Cyrillic_ER Cyrillic_O Cyrillic_EL Cyrillic_DE Cyrillic_ZHE Cyrillic_E\ + Return \n\ + Shift_L \\ Cyrillic_YA Cyrillic_CHE Cyrillic_ES Cyrillic_EM Cyrillic_I\ + Cyrillic_TE Cyrillic_SOFTSIGN Cyrillic_BE Cyrillic_YU , Multi_key Shift_R \n\ + MainMenu Caps_Lock Alt_L Meta_L space Meta_R Mode_switch Left Right Up Down Focus + +xvkbd.AltgrKeyLabels: \ + F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 BackSpace \n\ + Escape 1 2 3 4 5 6 7 8 9 0 - = £ # \n\ + Tab Ê Ã Õ Ë Å Î Ç Û Ý Ú È ß Delete \n\ + Control Æ Ù × Á Ð Ò Ï Ì Ä Ö Ü Return \n\ + Shift \\ Ñ Þ Ó Í É Ô Ø Â À . Comp Shift \n\ + Menu Caps Alt Meta space Meta Eng left right up down Focus + +xvkbd.ShiftAltgrKeyLabels: \ + F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Backspace \n\ + Esc ! " # ; % : ? * ( ) _ + ³ ~ \n\ + Tab ê ã õ ë å î ç û ý ú è ÿ Del \n\ + Ctrl æ ù ÷ á ð ò ï ì ä ö ü Return \n\ + Shift / ñ þ ó í é ô ø â à , Comp Shift \n\ + Menu Caps Alt Meta space Meta Eng left right up down Focus diff --git a/software/unix/bringup.sh b/software/unix/bringup.sh new file mode 100644 index 0000000..efc8739 --- /dev/null +++ b/software/unix/bringup.sh @@ -0,0 +1,38 @@ +#!/bin/sh +TITLE="$1" +shift +COMMAND=$1 + +ttyprefix=/dev/; #for linux systems with /dev/pts +cmdcolumn=5 ;# where to find command in ps output +ttycolumn=2 ;# where to find tty name in ps output +psargs=aww; +get_tty_from_command () { + local t + t=`ps $psargs|awk "\\$$cmdcolumn~/$1/ {print \"$ttyprefix\" \\$$ttycolumn;exit}"` + if [ -z "$t" ] + then + return 1 + fi + check_tty $t +} + +check_tty () { + if [ ! -c $1 ] + then + echo "$i is not valid tty name" >&2 + exit 1 + fi + if [ ! -w $1 ] + then + echo "$i is not writable for you" >&2 + exit 1 + fi + tty=$1 +} + +if get_tty_from_command $COMMAND; then + echo -n '[1t[5t' >$tty +else + xterm -T "$TITLE" -name $COMMAND -e "$@" & +fi diff --git a/software/unix/xtitle.html b/software/unix/xtitle.html index c8bcdc7..fe227e3 100644 --- a/software/unix/xtitle.html +++ b/software/unix/xtitle.html @@ -13,8 +13,44 @@ title of window: <li> given as pseudo-tty name in command line <li> where given command is running </ul> -<a href="xtitle.sh">script itself</h1> +<a href="xtitle.sh">script itself</a> <!--<a href="xtitle.1">Man page</a> (<a href="xtitle.1.html">HTML formatted</a>) --> +<h3>Parameters</h3> +<pre> +xtitle [ -t tty|-c command] [-i|-w|-f] title +</pre> +<dl> +<dt> -t <i>/dev/pts/N</i></dt><dd> specifies tty associated with xterm to +change</dd> +<dt> -c <i>someprogram</i><dd> specifies command running in this +xterm</dd> +<dt> -i</dt><dd> notifies, that only icon name should be changed</dd> +<dt> -w</dt><dd> that window name only, not the icon name should be +changed (default - both)</dd> +<dt> -f</dt><dd> changes font instead of title. If you are specifying +XLFD font name, which start with hyphen, use -- to separate it from +options</dd> +<dt>-r</dt><dd> raises/deiconifies window instead of changing name</dd> +</dl> +<h2>BringUp script</h2> +<p> +This script brings up an xterm window with given command running, i.e +launches new one, if no is executed, or finds exisiting and +raises/deiconifies it. +</p> +<p> +<a href="bringup.sh">script</a>. +</p> +<p> +Usage: +</p> +<pre> + bringup Title command [parameters] +</pre> + +Note that only command name is taking into account when searching for +existing running program, not parameters. + </BODY> </HTML> diff --git a/software/unix/xtitle.sh b/software/unix/xtitle.sh index f9b0c75..84d8ae0 100755 --- a/software/unix/xtitle.sh +++ b/software/unix/xtitle.sh @@ -2,9 +2,9 @@ # customization parameters #ttyprefix=/dev/tty ;# what to add to ttycolumn's word to obtain valid device ttyprefix=/dev/; #for linux systems with /dev/pts -cmdcolumn=4 ;# where to find command in ps output +cmdcolumn=5 ;# where to find command in ps output ttycolumn=2 ;# where to find tty name in ps output -psargs=-aww; +psargs=aww; # displays usage information usage () { echo "xtitle [ -t tty|-c command] [-i|-w|-f] title" >&2 @@ -13,6 +13,7 @@ usage () { echo " -i notifies, that only icon name should be changed" >&2 echo " -w that window name only (default - both)">&2 echo " -f changes font instead of title" >&2 + echo " -r raises/deiconifies window instead of changing title" >&2 } # tries to get tty name from command name get_tty_from_command () { @@ -44,7 +45,7 @@ check_tty () { tty=`tty` # by default change both window name and icon name mode=0 -set -- `getopt "iwfc:t:h" $*` +set -- `getopt "iwrfc:t:h" $*` if [ $? != 0 ] then usage @@ -64,9 +65,14 @@ do usage exit 0 ;; + -r) raise_mode=1; shift;; --) shift; break;; esac done +echo "tty=$tty" +if [ -n "$raise_mode" ]; then + echo -ne "\\033[1t\\033[5t" >$tty +fi echo -e "\\033]$mode;$*\a\c" >$tty diff --git a/software/unix/xvkbd-rus.html b/software/unix/xvkbd-rus.html new file mode 100644 index 0000000..5acfa63 --- /dev/null +++ b/software/unix/xvkbd-rus.html @@ -0,0 +1,36 @@ +<HTML><HEAD> +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=koi8-r"> +<TITLE>Russian layout for xvkbd</TITLE> +<meta name="description" content="Russian layout for xvkbd on-screen +keyboard"> +</HEAD><BODY> +<H1>Russian layout for xvkbd</H1> +<p> +<a href="http://homepage3.nifty.com/tsato/xvkbd/">xvkbd</a> is a piece +of software useful for keyboard-less computers such as PDA or +web-tablets. It includes layouts for some languages, but no Russian +among them. But xvkbd is highly customizable via X resources +</p> +<p> +So, I've written my own keyboard layout for xvkbd. Download <a +href="XVkbd-russian">XVkbd-russian</a> file and use it as described +in xvkbd manual. +</p> +<p> +It is recommended to turn on "Lock AltGr" menu option in xvkbd +(I've found no way to turn it on from resource file, but xvkbd would +remember your settings). +</p> +<p> +This file assumes that xvkbd is running with <b>ru_RU.KOI8-R</b> locale. +If you want to run it in different locale, just recode filename and fix +font charset in the first lines of file. <b>Note</b> version of xvkbd +provided in Debian stable (2.6) is not able to display Cyrillic key +lables correctly if they are UTF-8. So, don't run xvkbd in +<b>ru_RU.UTF-8</b> locale, even if rest of your X application use that +locale. This layout produce correct X keysyms, so cyrillic letters would +be entered properly even if xvkbd and application run in different +locales. +</p> +</BODY> +</HTML> -- 2.39.5