WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: actkbd  (Read 3643 times)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
actkbd
« on: October 02, 2009, 03:01:06 PM »
Quote
Title:          actkbd.tcz
Description:    Actkbd keyboard hotkey daemon
Version:        0.2.8
Author:         Theodoros V. Kalamatianos
Original-site:  http://users.softlab.ntua.gr/~thkala/projects/actkbd/actkbd.html
Copying-policy: GPL
Size:      12K
Extension_by:   Curaga
Comments:       Works in both console and X.
      Sample config file included as
      /usr/local/etc/actkbd.sample.
-
      PPI compatible.
Change-log:     
Current:        2009/09/29 Original

Adding my own files below for reference.

/bin/mbp-keys.sh:
Quote
#!/bin/sh

case "$1" in
   mute)
      if amixer sget Master | grep -q off; then
         amixer sset Master on > /dev/null 2>&1
      else
         amixer sset Master off > /dev/null 2>&1
      fi
   ;;
   voldown)
      vol=$(amixer sget Master | grep dB | awk '{print $3}')
      vol=$((vol-1))
      amixer sset Master $vol > /dev/null 2>&1
   ;;
   volup)
      vol=$(amixer sget Master | grep dB | awk '{print $3}')
      vol=$((vol+1))
      amixer sset Master $vol > /dev/null 2>&1
   ;;
   keylight)
      light=$(cat /sys/class/leds/smc::kbd_backlight/brightness)
      if [ "$light" -gt 0 ]; then
         echo -n "0" > /sys/class/leds/smc::kbd_backlight/brightness
      else
         echo -n "255" > /sys/class/leds/smc::kbd_backlight/brightness
      fi
   ;;
   keylightup)
      light=$(cat /sys/class/leds/smc::kbd_backlight/brightness)
      echo -n "$((light+10))" > /sys/class/leds/smc::kbd_backlight/brightness
   ;;
   keylightdown)
      light=$(cat /sys/class/leds/smc::kbd_backlight/brightness)
      echo -n "$((light-10))" > /sys/class/leds/smc::kbd_backlight/brightness
   ;;
esac

/usr/local/etc/actkbd.conf:
Quote
# The keycodes on a PC are usually:
#
# Left Shift = 42
# Left Ctrl = 29
# Left Alt = 56
# Right Alt = 100
# Right Ctrl = 97
# Right Shift = 54
#
# Mute = 113
# Volume Down = 114
# Volume Up = 115
# Eject = 161
#
# The LED codes on a PC are usually:
#
# Num Lock = 0
# Caps Lock = 1
# Scroll Lock = 2

#56+114:::echo left.alt+volume.down press

# brightness down 224
# brightness up 225
# mute 113
113:::/bin/mbp-keys.sh mute

# voldown 114
114:::/bin/mbp-keys.sh voldown

# volup 115
115:::/bin/mbp-keys.sh volup

# keylight toggle 228
228:::/bin/mbp-keys.sh keylight

# keylight down 229
229:::/bin/mbp-keys.sh keylightdown

# keylight up 230
230:::/bin/mbp-keys.sh keylightup

And in /opt/bootlocal.sh, I have this line:
Quote
actkbd -D -q -d /dev/input/event8
The only barriers that can stop you are the ones you create yourself.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: actkbd
« Reply #1 on: October 03, 2009, 07:21:55 PM »
easyier:
amixer set Master 10%+
amixer set Master 10%-
amixer set Mic mute
amixer set Mic unmute
dCore user