Changeset 1013


Ignore:
Timestamp:
Mar 5, 2008, 12:42:17 AM (10 years ago)
Author:
jrollins
Message:

cmrg/machines/servo: update/simplify acpi scripts

Location:
trunk/cmrg/machines/servo/etc/acpi
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/cmrg/machines/servo/etc/acpi/default.sh

    r1011 r1013  
    44set $*
    55
    6 # Take care about the way events are reported
     6log() {
     7    logger "acpid: $1"
     8    echo "$1"
     9}
     10
     11# find event and event type
    712ev_type=$(echo "$1" | cut -d/ -f1)
    813if [ "$ev_type" = "$1" ] ; then
     
    1217fi
    1318
    14 SID="acpid:$(basename $0)"
    15 
    1619case "$ev_type" in
    1720    button)
    1821        case "$event" in
    1922            power)
    20                 logger "$SID: received shutdown request"
    21                 exec /etc/acpi/powerbtn.sh
     23                log "power button event"
     24                log "executing /etc/acpi/poweroff.sh..."
     25                exec /etc/acpi/poweroff.sh
    2226                ;;
    23            
    2427            lid)
    25                 logger "$SID: received lid event"
    26                 /etc/acpi/sleep.sh
     28                log "lid event"
     29                log "executing /etc/acpi/sleep.sh..."
     30                exec /etc/acpi/sleep.sh
    2731                ;;
    28 
    29             sleep)
    30                 logger "$SID: received sleep event"
    31                 /etc/acpi/sleep.sh
    32                 ;;
    33 
    3432            *)
    35                 logger "$SID: $ev_type '$event' is not defined"
     33                log "button event '$event' not defined"
    3634                ;;
    3735        esac
     
    4038        event="$4"
    4139        case "$event" in
    42             00001003)
    43                 logger "$SID: switch to vt 1 event"
    44                 chvt 1
     40            00001003) #Fn-F3
     41                log "ibm: Fn-F3 event"
     42                log "switching to vt1..."
     43                exec chvt 1
     44                ;;
     45            00001004) #Fn-F4
     46                log "ibm: Fn-F4 event"
     47                log "executing /etc/acpi/sleep.sh..."
     48                exec /etc/acpi/sleep.sh
     49                ;;
     50            00001005) #Fn-F5
     51                log "ibm: Fn-F5 event"
     52                ;;
     53            00001007) #Fn-F7
     54                log "ibm: Fn-F7 event"
     55                ;;
     56            00001009) #Fn-F9
     57                log "ibm: Fn-F9 event"
     58                ;;
     59            0000100c) #Fn-F12
     60                log "ibm: Fn-F12 event"
    4561                ;;
    4662            *)
    47                 logger "$SID: $ev_type '$event' is not defined"
     63                log "ibm: event '$event' not defined"
    4864                ;;
    4965        esac
     
    5167
    5268    *)
    53         logger "$SID: $ev_type $event is not defined"
     69        log "$event '$@' not defined"
    5470        ;;
    5571esac
  • trunk/cmrg/machines/servo/etc/acpi/poweroff.sh

    r1011 r1013  
    11#!/bin/sh
    2 # /etc/acpi/powerbtn.sh
    3 # Initiates a shutdown when the power putton has been
    4 # pressed.
     2# custom acpi poweroff script by jrollins
    53
    64# # If powersaved is running, let it process the acpi event
     
    97# fi
    108
    11 # if ps -Af | grep -q '[k]desktop' && test -f /usr/bin/dcop
    12 # then
    13 #     dcop --all-sessions --all-users ksmserver ksmserver logout 0 2 0 && exit 0
    14 # else
    15 #     /sbin/shutdown -h now "Power button pressed"
    16 # fi
    17 
    189echo -en "\a" && sleep .15 && echo -en "\a" && sleep .15 && echo -en "\a"
    1910/sbin/poweroff
  • trunk/cmrg/machines/servo/etc/acpi/sleep.sh

    r1011 r1013  
    11#!/bin/sh
    2 ### custom acpi sleep script by jrollins
     2# custom acpi sleep script by jrollins
    33
    4 # function to execute xscreensaver command for all users
     4# function to execute xscreensaver lock command for all users
     5# not working yet
    56function xssc() {
    67    CMD="$1"
Note: See TracChangeset for help on using the changeset viewer.