site  contact  subhomenews

'mousecheck'

October 20, 2011 — BarryK
I introduced this concept in Woof awhile back, then took it out. Now I have worked on it some more and it is back. For the situation of X starting automatically at first boot, a new script 'mousecheck' runs in the background.

If you don't move the mouse within a certain time, it puts up a request to please move it, if still no movement then puts up a dialog for configuring the mouse -- that may be keyboard driven.

The script is internationalised. If anyone is interested in creating a translation for it, please do. It is here:
http://distro.ibiblio.org/quirky/test/mousecheck.gz

...down and gunzip to /usr/sbin, make sure execute attributes are set.

Instructions for internationalising:
http://distro.ibiblio.org/quirky/test/mousecheck.pupdev.gz

Contents of instructions file:

i created the mousecheck.pot file like this. first I renamed script temporarily

to mousecheck.sh, then:

xgettext -o mousecheck.pot --no-wrap mousecheck.sh

Now convert to a .po file in your language, example 'de':

# msginit --no-wrap --locale=de_DE --output-file=de.po --input=mousecheck.pot

...the generated de.po has a line with "charset=", please change that to
"charset=UTF-8"

Also, edit this line to look like this:

"Project-Id-Version: mousecheck 1.0\n"

Then insert your country translations into de.po.

Then create a compiled mousecheck.mo file:

# mkdir -p /usr/share/locale/de/LC_MESSAGES
# msgfmt --check --output-file=/usr/share/locale/de/LC_MESSAGES/mousecheck.mo de.po

If you want to contribute this file so it will be distributed with Puppy, email de.po
to me: bkaulerATgmailDOTcom

note that an existing .mo file can be uncompiled like this:
# msgunfmt mousecheck.mo


It is easy to test. Open a terminal window. Put the mouse pointer in centre of screen. Type "mousecheck" in the terminal, then wait.

Comments

mousecheck de translation
Username: BarryK
Thanks to L18L, who has created a de.po (German) translation. Also found an oversight -- into line 31, insert the the translation H_mt for pupdialog (also modify the pupdialog line): [code] H_mc=$(gettext 'MouseCheck: choose interface') H_mt=$(gettext 'Please choose mouse type...') pupdialog --background '#FFFF00' --ok-label "${B_ok}" --cancel-label "${B_cancel}" --colors --backtitle "${H_mc}" --menu "${ALERTMSG1}\n\n${ALERTMSG2}\n\n${MOUSEINTRO}\n\n${H_mt}" 0 100 3 "$MOUSEMENU1a" "${TABCHAR}${MOUSEMENU1b}" "$MOUSEMENU2a" "${TABCHAR}${MOUSEMENU2b}" 2> /tmp/testmsx [ $? -ne 0 ] && return 1[/code]

no mouse
Username: shinobar
"Barry> If you don't move the mouse within a certain time, it puts up a request to please move it, if still no movement then puts up a dialog for configuring the mouse -- that may be keyboard driven. Great idea. Does it run only under PUPMODE=5 (I hope so)? I am using Puppy for some system without mouse nor keyboard. It automatically tuns s custom application without mouse nor keyboard.

Re no mouse
Username: BarryK
"shinobar, Yes, only when PUPMODE=5. Launched in /usr/sbin/delayedrun. There are some people who always boot with PUPMODE=5 and never create a save-file. They might find this feature to be annoying.

mousecheck ru translation
Username: BarryK
"Thanks to rodin.s for the ru (Russian) translation.

mousecheck fr translation
Username: BarryK
"Thanks to esmourguit. A note to L18L and others, you might find translation is more flexible if you use the '--no-wrap' option for 'msginit', as shown in my code in first post. It keeps paragraphs as one line, and gtkdialog takes care of the wrapping.


Tags: woof