public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Vromans <jvromans-2pNSKKP3PSKEVqv0pETR8A@public.gmane.org>
To: sanskryt-FWhLrETftxM@public.gmane.org
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: bluetooth button is dead
Date: Tue, 21 Dec 2004 20:37:54 +0100	[thread overview]
Message-ID: <m2d5x3l9wt.fsf@phoenix.squirrel.nl> (raw)
In-Reply-To: <200412212014.36223.sanskryt-FWhLrETftxM@public.gmane.org> (Zdzisław A. Kaleta's message of "Tue, 21 Dec 2004 20:14:35 +0100")

[-- Attachment #1: Type: text/plain, Size: 665 bytes --]

"Zdzisław A. Kaleta" <sanskryt-FWhLrETftxM@public.gmane.org> writes:

> I think the answer is yes. Just try.
> Please for security cc it to my priv ;-)

Okay. Attached is "acer_keys", a script to run at boot time to map all
unmapped Acer specific keys to keycodes.
Note that the key code set is different from the one received by X,
but that seems to be a known problem.
Also attached is ".xbindkeysrc", a bindkeys configuration to intercept
some of these keys and do something.
xbindkeys is probably on your computer already, if not, use Google.
xosd is a small script (attached) that uses osd-cat (Google) to show
on-screen message.

Have phun!


[-- Attachment #2: acer key settings --]
[-- Type: application/octet-stream, Size: 1649 bytes --]

#!/bin/bash
#
# chkconfig: 2345 55 25
# description: Acer TravelMate 4001 Key codes
#
# source function library
. /etc/rc.d/init.d/functions

RETVAL=0

start()
{
	
	echo -n $"Setting Acer TravelMate key codes: "
# Set valid keycodes for all additional keys of the Acer TravelMate 4001.
# WARNING: The key code set is not always the one returned by X event!

# Euro-key near the cursor block
setkeycodes e033 89 # X: 211
# $-key near the cursor block
setkeycodes e034 90 # X: 128
# WiFi/RF [front of the latptop]
setkeycodes e055 88 # on, X: 96
setkeycodes e056 91 # off, X: 127
# Bluetooth [front of the laptop]
setkeycodes e058 92 # X: 129

# "p" key [near power button]
setkeycodes e073 93 # X: 208
# "e" key [near power button]
setkeycodes e074 94 # X: 131
# "Planet" key [near power button]
# keycode 178
# "Mail" key [near power button]
# keycode 236

# Fn F1 [?]
setkeycodes e025 140 # X: 161
# Fn F2 [ ]
setkeycodes e026 141 # X: 108
# Fn F3 [ ]
setkeycodes e027 142 # X: 109
# Fn F4 [Zz]
# ACPI button/sleep SLPB event
# Fn F5 [Video Aux]
setkeycodes e029 143 # X: 227
# Fn F6 [Display Backlight]
# -- no key/event --
# Fn F7 [Touchpad on]
setkeycodes e071 144 # X: 198
# Fn F7 [Touchpad off]
setkeycodes e072 145 # X: 199
# Fn F8 [Mute]
# keycode 160

# Fn Up [Vol incr]
# keycode 176
# Fn Left [Display darker]
# keycode 239
# Fn Down [Vol decr]
# keycode 174
# Fn Right [Display brighter]
setkeycodes e06e 238 # X: 243

# Panel close
# ACPI button/lib LID event
	success
	echo
}

case "$1" in
	start)
		start
		;;
	stop)
		;;
	restart)
		start
		;;
	reload)
		reload
		;;
	*)
		echo $"Usage: $0 {start|stop}"
		RETVAL=1
esac
exit $RETVAL

[-- Attachment #3: .xbindkeysrc --]
[-- Type: application/octet-stream, Size: 442 bytes --]

# For the benefit of emacs users: -*- shell-script -*-

"xbk_aumix incr"
  c:176

"xbk_aumix decr"
  c:174

"xbk_aumix mute"
  c:160

"echo Touchpad Off | xosd -- -"
  c:199

"echo Touchpad On | xosd -- -"
  c:198

"echo Display: Darker | xosd -- -"
  c:239

"echo Display: Brighter | xosd -- -"
  c:243

"echo WiFi Off | xosd -- -"
  c:127

"echo WiFi On | xosd -- -"
  c:96

"echo BlueTooth | xosd -- -"
  c:129

"xbk_sysinfo info"
  c:161

[-- Attachment #4: xosd --]
[-- Type: application/octet-stream, Size: 285 bytes --]

#!/bin/sh

exec /usr/bin/osd_cat \
    --font='-b&h-lucidasans-bold-r-normal-sans-0-480-0-0-p-0-iso8859-1' \
    --font='-b&h-luxi sans-bold-r-normal--0-480-0-0-p-0-iso8859-1' \
    --shadow=1 \
    --color=green \
    --pos=middle \
    --align=center \
    --delay=2 \
    ${1+"$@"}

[-- Attachment #5: xbk_aumix --]
[-- Type: application/octet-stream, Size: 750 bytes --]

#!/bin/sh

cd $HOME

action=$1; shift
killall -q osd_cat > /dev/null 2>&1

get_volume() {
    volume=`aumix -q | sed -ne 's/^vol \([^,]*\).*/\1/p'`
}

show_volume() {
    xosd --text Volume:\ $1 --barmode=percentage --percentage=$1
}

case "$action" in

incr)
    delta=${1:-5}
    rm -f .mutevol
    aumix -v +$delta
    get_volume
    show_volume $volume
    ;;

decr)
    delta=${1:-5}
    rm -f .mutevol
    aumix -v -$delta
    get_volume
    show_volume $volume
    ;;

mute)
    if [ -s .mutevol ]
    then
	vol=`cat .mutevol`
	rm -f .mutevol
	aumix -v $vol
	# echo "Volume: $vol" | xosd -- -
	show_volume $vol
    else
	get_volume
	[ $volume != 0 ] && echo $volume > .mutevol
	aumix -v 0
	echo "Volume: muted" | xosd -- -
    fi
    ;;
esac


[-- Attachment #6: xbk_sysinfo --]
[-- Type: application/octet-stream, Size: 471 bytes --]

#!/bin/sh

cd $HOME

action=$1; shift
killall -q osd_cat > /dev/null 2>&1

case "$action" in

info)
    thrm=/proc/acpi/thermal_zone/THRM
    fan=/proc/acpi/fan
    power=/proc/acpi/processor
    (
	sed -ne 's/^active state: *\(.*\)/CPU state: \1/p' $power/CPU*/power
	sed -e 's/  */ /g' $thrm/temperature
	sed -e 's/  */ /g' $thrm/state
	sed -e 's/	/ /g' $thrm/cooling_mode
	sed -e 's/status: */fan: /' $fan/FAN*/state
    )| xosd --lines=6 --delay=3 -- -
    ;;

esac


  parent reply	other threads:[~2004-12-21 19:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-21 15:03 bluetooth button is dead Johan Vromans
     [not found] ` <20041221150316.14A5D9DA3B-KjnUIgV0B0bak1Ioo/c9IoRWq/SkRNHw@public.gmane.org>
2004-12-21 15:25   ` Pedro Venda
2004-12-21 17:21     ` Johan Vromans
     [not found]       ` <16840.23466.968238.615803-KjnUIgV0B0bak1Ioo/c9IoRWq/SkRNHw@public.gmane.org>
2004-12-22 12:34         ` Ultrakorne
2004-12-21 15:28   ` Zdzisław A. Kaleta
     [not found]     ` <200412211628.47370.sanskryt-FWhLrETftxM@public.gmane.org>
2004-12-21 19:03       ` Johan Vromans
     [not found]         ` <m2hdmflbhe.fsf-KjnUIgV0B0bak1Ioo/c9IoRWq/SkRNHw@public.gmane.org>
2004-12-21 19:14           ` Zdzisław A. Kaleta
     [not found]             ` <200412212014.36223.sanskryt-FWhLrETftxM@public.gmane.org>
2004-12-21 19:37               ` Johan Vromans [this message]
     [not found]                 ` <200412212042.56854.juris@juris.com.pl>
2004-12-21 20:08                   ` Johan Vromans
     [not found]                     ` <16840.33460.373241.800472-KjnUIgV0B0bak1Ioo/c9IoRWq/SkRNHw@public.gmane.org>
2004-12-21 23:16                       ` Pedro Venda
     [not found]                         ` <41C8AEDE.3050105-aHmAgkVUFT6Joy8PIJZ9VA@public.gmane.org>
2004-12-22  0:01                           ` David Gómez
2004-12-22  0:27                             ` Pedro Venda
2004-12-22 10:35                           ` Johan Vromans
  -- strict thread matches above, loose matches on Subject: below --
2004-12-13  2:15 Ultrakorne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2d5x3l9wt.fsf@phoenix.squirrel.nl \
    --to=jvromans-2pnskkp3pskevqv0petr8a@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=sanskryt-FWhLrETftxM@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox