You are not logged in.

#1 2010-03-03 13:14:26

Natanji
Member
Registered: 2009-09-22
Posts: 133

[SOLVED] ACPI handler.sh no longer working (Thinkpad X60 Tablet)

Hello there,
I recently did a few updates on my system to reduce power usage and get hdaps working. For some reason one of these changes must have broken ACPID in some way so that what I wrote in handler.sh no longer has any effect when I e.g. press the configured buttons to lock my screen or shut down, but I have no clue which.

I'm not really familiar with where ACPI and ACPID keeps all their logs either, and which parts in there might mean something for me. I don't even know how I can check if ACPI is running properly and just ACPID isn't, for instance (both are running thought, confirmed with ps -A).

Here's what I can remember of what I did:
-full system update
-install cpufreq to redcude power usage with acpi_cpufreq
-install HDAPS with Thinkpad driver, as described on the Wiki
-tweak my laptop-mode settings, e.g. disable VGA output when in laptop mode
-enable AHCI for my hard drive in kernel image and BIOS

Would be great if you could help me troubleshoot this somehow, as I really don't have a clue on how to fix this. Here's some output that might be helpful for starters:

cat /etc/acpi/handler.sh

#!/bin/sh
set $*

case "$1" in
    button/power)
        #echo "PowerButton pressed!">/dev/tty5
        case "$2" in
            PWRF) 
            #Power off
            shutdown -h now
        ;;
            *)
            logger "ACPI action undefined: $2"
        ;;
        esac
        ;;
    ibm/hotkey)
        #echo "Display swiveled">/dev/tty5
    case "$2" in
        HKEY)
            case "$4" in
                00005009)
                    #Swiveling down
                    /bin/sh /etc/acpi/actions/swivel-down
                ;;
                0000500a)
                    #Swiveling up
                    /bin/sh /etc/acpi/actions/swivel-up
                ;;
                00001002)
                    #Lock screen
                    xscreensaver-command -lock
                    #run_once xtrlock &
                ;;
                00001004)
                    #Standby button
                    xscreensaver-command -lock ; s2ram
                ;;
                00001005)
                    #Network button
                    /etc/rc.d/net-auto-wireless restart
                ;;
                00001009)
                    #Reboot
                    shutdown -r now
                ;;
                00007000)
                    #WLan button switched
                    /etc/rc.d/net-auto-wireless restart
                    fi
                ;;
            esac
            ;;
    esac
    ;;
    button/sleep)
        case "$2" in
            SLPB)   echo -n mem >/sys/power/state ;;
            *)      logger "ACPI action undefined: $2" ;;
        esac
        ;;
    ac_adapter)
        case "$2" in
            AC)
                case "$4" in
                    00000000)
                        #laptop mode should take care of this alone!
                        #/etc/rc.d/laptop-mode start
                    ;;
                    00000001)
                        #/etc/rc.d/laptop-mode stop
                    ;;
                esac
                ;;
            *)  logger "ACPI action undefined: $2" ;;
        esac
        ;;
    battery)
        case "$2" in
            BAT0)
                case "$4" in
                    00000000)   #echo "offline" >/dev/tty5
                    ;;
                    00000001)   #echo "online"  >/dev/tty5
                    ;;
                esac
                ;;
            CPU0)    
                ;;
            *)  logger "ACPI action undefined: $2" ;;
        esac
        ;;
    button/lid)
        #echo "LID switched!">/dev/tty5
        case "$2" in
            LID)
                if [[ `cat /proc/acpi/button/lid/LID/state | awk '{print $2}'` = "closed" ]]
                then
                    #run_once xtrlock &
                    xscreensaver-command -lock
                fi
            ;;
        esac
        ;;
    *)
        logger "ACPI group/action undefined: $1 / $2"
        ;;
esac

dmesg | grep acpi

 BIOS-e820: 000000007f6d0000 - 000000007f6df000 (ACPI data)
 BIOS-e820: 000000007f6df000 - 000000007f700000 (ACPI NVS)
 modified: 000000007f6d0000 - 000000007f6df000 (ACPI data)
 modified: 000000007f6df000 - 000000007f700000 (ACPI NVS)
ACPI: RSDP 000f67c0 00024 (v02 LENOVO)
ACPI: XSDT 7f6d11e8 0008C (v01 LENOVO TP-7J    00001140  LTP 00000000)
ACPI: FACP 7f6d1300 000F4 (v03 LENOVO TP-7J    00001140 LNVO 00000001)
ACPI Warning: 32/64X length mismatch in Gpe1Block: 0/32 (20090903/tbfadt-526)
ACPI Warning: Optional field Gpe1Block has zero address or length: 000000000000102C/0 (20090903/tbfadt-557)
ACPI: DSDT 7f6d1690 0D56F (v01 LENOVO TP-7J    00001140 MSFT 0100000E)
ACPI: FACS 7f6f4000 00040
ACPI: SSDT 7f6d14b4 001DC (v01 LENOVO TP-7J    00001140 MSFT 0100000E)
ACPI: ECDT 7f6debff 00052 (v01 LENOVO TP-7J    00001140 LNVO 00000001)
ACPI: TCPA 7f6dec51 00032 (v02 LENOVO TP-7J    00001140 LNVO 00000001)
ACPI: APIC 7f6dec83 00068 (v01 LENOVO TP-7J    00001140 LNVO 00000001)
ACPI: MCFG 7f6deceb 0003C (v01 LENOVO TP-7J    00001140 LNVO 00000001)
ACPI: HPET 7f6ded27 00038 (v01 LENOVO TP-7J    00001140 LNVO 00000001)
ACPI: SLIC 7f6dee62 00176 (v01 LENOVO TP-7J    00001140  LTP 00000000)
ACPI: BOOT 7f6defd8 00028 (v01 LENOVO TP-7J    00001140  LTP 00000001)
ACPI: SSDT 7f6f2603 0025F (v01 LENOVO TP-7J    00001140 INTL 20050513)
ACPI: SSDT 7f6f2862 000A6 (v01 LENOVO TP-7J    00001140 INTL 20050513)
ACPI: SSDT 7f6f2908 004F7 (v01 LENOVO TP-7J    00001140 INTL 20050513)
ACPI: SSDT 7f6f2dff 001D8 (v01 LENOVO TP-7J    00001140 INTL 20050513)
ACPI: Local APIC address 0xfee00000
ACPI: PM-Timer IO Port: 0x1008
ACPI: Local APIC address 0xfee00000
ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1])
ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0])
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
ACPI: IRQ0 used by override.
ACPI: IRQ2 used by override.
ACPI: IRQ9 used by override.
Using ACPI (MADT) for SMP configuration information
ACPI: HPET id: 0x8086a201 base: 0xfed00000
ACPI: Core revision 20090903
ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
ACPI: bus type pci registered
ACPI: EC: EC description table is found, configuring boot EC
ACPI: Interpreter enabled
ACPI: (supports S0 S3 S4 S5)
ACPI: Using IOAPIC for interrupt routing
ACPI: EC: GPE = 0x1c, I/O: command/status = 0x66, data = 0x62
ACPI: Power Resource [PUBS] (on)
ACPI: ACPI Dock Station Driver: 3 docks/bays found
ACPI: PCI Root Bridge [PCI0] (0000:00)
pci 0000:00:1f.0: quirk: region 1000-107f claimed by ICH6 ACPI/GPIO/TCO
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.EXP0._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.EXP1._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.EXP2._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.EXP3._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PCI1._PRT]
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 *11)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 9 10 *11)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 9 10 *11)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 9 10 *11)
ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 7 9 10 *11)
ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 9 10 *11)
ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 7 9 10 *11)
ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 6 7 9 10 *11)
PCI: Using ACPI for IRQ routing
pnp: PnP ACPI init
ACPI: bus type pnp registered
pnp: PnP ACPI: found 11 devices
ACPI: ACPI bus type pnp unregistered
acpi device:01: registered as cooling_device0
ACPI: Video Device [VID] (multi-head: yes  rom: no  post: no)
ACPI: Lid Switch [LID]
ACPI: Sleep Button [SLPB]
ACPI: Power Button [PWRF]
i915 0000:00:02.0: power state changed by ACPI to D0
ata1.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
ata1.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
ata1.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out
ata1.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
ata1.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
ata1.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out
ACPI: SSDT 7f6f1ccc 001FE (v01  PmRef  Cpu0Ist 00000100 INTL 20050513)
ACPI: SSDT 7f6f1f4f 006B4 (v01  PmRef  Cpu0Cst 00000100 INTL 20050513)
ACPI: SSDT 7f6f1c04 000C8 (v01  PmRef  Cpu1Ist 00000100 INTL 20050513)
ACPI: SSDT 7f6f1eca 00085 (v01  PmRef  Cpu1Cst 00000100 INTL 20050513)
ehci_hcd 0000:00:1d.7: power state changed by ACPI to D0
uhci_hcd 0000:00:1d.0: power state changed by ACPI to D0
uhci_hcd 0000:00:1d.2: power state changed by ACPI to D0
ACPI: Thermal Zone [THM0] (56 C)
ACPI: Thermal Zone [THM1] (59 C)
ACPI: AC Adapter [AC] (on-line)
ACPI: Battery Slot [BAT0] (battery present)
thinkpad_acpi: ThinkPad ACPI Extras v0.23
thinkpad_acpi: http://ibm-acpi.sf.net/
thinkpad_acpi: ThinkPad BIOS 7JET29WW (1.14 ), EC 7JHT13WW-1.04
thinkpad_acpi: Lenovo ThinkPad X60 Tablet, model 6363WDK
thinkpad_acpi: WARNING: Outdated ThinkPad BIOS/EC firmware
thinkpad_acpi: WARNING: This firmware may be missing critical bug fixes and/or important features
thinkpad_acpi: ACPI backlight control delay disabled
thinkpad_acpi: radio switch found; radios are enabled
thinkpad_acpi: possible tablet mode switch found; ThinkPad in laptop mode
thinkpad_acpi: This ThinkPad has standard ACPI backlight brightness control, supported by the ACPI video driver
thinkpad_acpi: Disabling thinkpad-acpi brightness events by default...
Registered led device: tpacpi::thinklight
Registered led device: tpacpi::power
Registered led device: tpacpi::standby
Registered led device: tpacpi::thinkvantage
thinkpad_acpi: Standard ACPI backlight interface available, not loading native one.
ata1.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
ata1.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
ata1.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out
ata1.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
ata1.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
ata1.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out

cat /var/log/acpid.log

Feb 28 13:19:28 damnation acpid: exiting
Mar  1 12:48:43 damnation acpid: starting up
Mar  1 12:48:43 damnation acpid: 4 rules loaded
Mar  1 12:48:43 damnation acpid: waiting for events: event logging is off
Mar  1 12:48:44 damnation acpid: client connected from 1737[82:82]
Mar  1 12:48:44 damnation acpid: 1 client rule loaded
Mar  1 12:49:39 damnation acpid: client connected from 2523[0:0]
Mar  1 12:49:39 damnation acpid: 1 client rule loaded
Mar  1 12:49:56 damnation acpid: exiting
Mar  1 12:49:56 damnation acpid: starting up
Mar  1 12:49:56 damnation acpid: 4 rules loaded
Mar  1 12:49:56 damnation acpid: waiting for events: event logging is off
Mar  1 12:49:57 damnation acpid: client connected from 2523[0:0]
Mar  1 12:49:57 damnation acpid: 1 client rule loaded
Mar  1 12:50:01 damnation acpid: client connected from 1737[82:82]
Mar  1 12:50:01 damnation acpid: 1 client rule loaded
Mar  2 10:23:50 damnation acpid: client 2523[0:0] has disconnected
Mar  2 10:23:50 damnation acpid: client connected from 2523[0:0]
Mar  2 10:23:50 damnation acpid: 1 client rule loaded
Mar  2 10:52:18 damnation acpid: client 2523[0:0] has disconnected
Mar  2 10:52:18 damnation acpid: client connected from 2523[0:0]
Mar  2 10:52:18 damnation acpid: 1 client rule loaded
Mar  2 17:00:21 damnation acpid: client 2523[0:0] has disconnected
Mar  2 17:00:21 damnation acpid: client connected from 2523[0:0]
Mar  2 17:00:21 damnation acpid: 1 client rule loaded
Mar  3 09:54:32 damnation acpid: client 2523[0:0] has disconnected
Mar  3 09:54:32 damnation acpid: client connected from 2523[0:0]
Mar  3 09:54:32 damnation acpid: 1 client rule loaded
Mar  3 10:28:14 damnation acpid: exiting
Mar  3 10:28:14 damnation acpid: starting up
Mar  3 10:28:14 damnation acpid: 4 rules loaded
Mar  3 10:28:14 damnation acpid: waiting for events: event logging is off
Mar  3 10:28:15 damnation acpid: client connected from 2523[0:0]
Mar  3 10:28:15 damnation acpid: 1 client rule loaded
Mar  3 10:28:19 damnation acpid: client connected from 1737[82:82]
Mar  3 10:28:19 damnation acpid: 1 client rule loaded
Mar  3 10:37:44 damnation acpid: exiting
Mar  3 10:37:44 damnation acpid: starting up
Mar  3 10:37:44 damnation acpid: 4 rules loaded
Mar  3 10:37:44 damnation acpid: waiting for events: event logging is off
Mar  3 10:37:45 damnation acpid: client connected from 2523[0:0]
Mar  3 10:37:45 damnation acpid: 1 client rule loaded
Mar  3 10:37:49 damnation acpid: client connected from 1737[82:82]
Mar  3 10:37:49 damnation acpid: 1 client rule loaded
Mar  3 12:22:44 damnation acpid: exiting
Mar  3 12:23:44 damnation acpid: starting up
Mar  3 12:23:45 damnation acpid: 4 rules loaded
Mar  3 12:23:45 damnation acpid: waiting for events: event logging is off
Mar  3 12:23:46 damnation acpid: client connected from 3417[82:82]
Mar  3 12:23:46 damnation acpid: 1 client rule loaded
Mar  3 12:24:40 damnation acpid: client connected from 4287[0:0]
Mar  3 12:24:40 damnation acpid: 1 client rule loaded
Mar  3 12:24:55 damnation acpid: exiting
Mar  3 12:24:55 damnation acpid: starting up
Mar  3 12:24:55 damnation acpid: 4 rules loaded
Mar  3 12:24:55 damnation acpid: waiting for events: event logging is off
Mar  3 12:24:56 damnation acpid: client connected from 4287[0:0]
Mar  3 12:24:56 damnation acpid: 1 client rule loaded
Mar  3 12:25:00 damnation acpid: client connected from 3417[82:82]
Mar  3 12:25:00 damnation acpid: 1 client rule loaded
Mar  3 12:40:54 damnation acpid: exiting
Mar  3 12:49:47 damnation acpid: starting up
Mar  3 12:49:47 damnation acpid: 4 rules loaded
Mar  3 12:49:47 damnation acpid: waiting for events: event logging is off
Mar  3 12:49:49 damnation acpid: client connected from 3396[82:82]
Mar  3 12:49:49 damnation acpid: 1 client rule loaded
Mar  3 12:50:12 damnation acpid: client connected from 5224[0:0]
Mar  3 12:50:12 damnation acpid: 1 client rule loaded
Mar  3 12:50:59 damnation acpid: exiting
Mar  3 12:50:59 damnation acpid: starting up
Mar  3 12:50:59 damnation acpid: 4 rules loaded
Mar  3 12:50:59 damnation acpid: waiting for events: event logging is off
Mar  3 12:51:00 damnation acpid: client connected from 5224[0:0]
Mar  3 12:51:00 damnation acpid: 1 client rule loaded
Mar  3 12:51:04 damnation acpid: client connected from 3396[82:82]
Mar  3 12:51:04 damnation acpid: 1 client rule loaded
Mar  3 13:21:42 damnation acpid: exiting
Mar  3 13:21:42 damnation acpid: starting up
Mar  3 13:21:42 damnation acpid: 4 rules loaded
Mar  3 13:21:42 damnation acpid: waiting for events: event logging is off
Mar  3 13:21:43 damnation acpid: client connected from 5224[0:0]
Mar  3 13:21:43 damnation acpid: 1 client rule loaded
Mar  3 13:21:47 damnation acpid: client connected from 3396[82:82]
Mar  3 13:21:47 damnation acpid: 1 client rule loaded
Mar  3 13:22:21 damnation acpid: exiting
Mar  3 13:22:21 damnation acpid: starting up
Mar  3 13:22:21 damnation acpid: 4 rules loaded
Mar  3 13:22:21 damnation acpid: waiting for events: event logging is off
Mar  3 13:22:22 damnation acpid: client connected from 5224[0:0]
Mar  3 13:22:22 damnation acpid: 1 client rule loaded
Mar  3 13:22:26 damnation acpid: client connected from 3396[82:82]
Mar  3 13:22:26 damnation acpid: 1 client rule loaded
Mar  3 13:23:03 damnation acpid: client 5224[0:0] has disconnected
Mar  3 13:23:03 damnation acpid: client connected from 5224[0:0]
Mar  3 13:23:03 damnation acpid: 1 client rule loaded
Mar  3 13:25:00 damnation acpid: exiting
Mar  3 13:25:00 damnation acpid: starting up
Mar  3 13:25:00 damnation acpid: 4 rules loaded
Mar  3 13:25:00 damnation acpid: waiting for events: event logging is off
Mar  3 13:25:01 damnation acpid: client connected from 5224[0:0]
Mar  3 13:25:01 damnation acpid: 1 client rule loaded
Mar  3 13:25:05 damnation acpid: client connected from 3396[82:82]
Mar  3 13:25:05 damnation acpid: 1 client rule loaded
Mar  3 13:29:52 damnation acpid: client connected from 21588[1000:100]
Mar  3 13:29:52 damnation acpid: 1 client rule loaded
Mar  3 13:30:27 damnation acpid: client 21588[1000:100] has disconnected
Mar  3 13:36:15 damnation acpid: exiting
Mar  3 13:37:54 damnation acpid: starting up
Mar  3 13:37:54 damnation acpid: 4 rules loaded
Mar  3 13:37:54 damnation acpid: waiting for events: event logging is off
Mar  3 13:37:56 damnation acpid: client connected from 3419[82:82]
Mar  3 13:37:56 damnation acpid: 1 client rule loaded
Mar  3 13:38:28 damnation acpid: client connected from 4292[0:0]
Mar  3 13:38:28 damnation acpid: 1 client rule loaded
Mar  3 13:39:24 damnation acpid: exiting
Mar  3 13:39:24 damnation acpid: starting up
Mar  3 13:39:24 damnation acpid: 4 rules loaded
Mar  3 13:39:24 damnation acpid: waiting for events: event logging is off
Mar  3 13:39:25 damnation acpid: client connected from 4292[0:0]
Mar  3 13:39:25 damnation acpid: 1 client rule loaded
Mar  3 13:39:29 damnation acpid: client connected from 3419[82:82]
Mar  3 13:39:29 damnation acpid: 1 client rule loaded
Mar  3 13:44:09 damnation acpid: client connected from 4488[1000:100]
Mar  3 13:44:09 damnation acpid: 1 client rule loaded
Mar  3 13:45:42 damnation acpid: client 4488[1000:100] has disconnected
Mar  3 13:58:17 damnation acpid: exiting
Mar  3 13:58:17 damnation acpid: starting up
Mar  3 13:58:17 damnation acpid: 4 rules loaded
Mar  3 13:58:17 damnation acpid: waiting for events: event logging is off
Mar  3 13:58:18 damnation acpid: client connected from 4292[0:0]
Mar  3 13:58:18 damnation acpid: 1 client rule loaded
Mar  3 13:58:22 damnation acpid: client connected from 3419[82:82]
Mar  3 13:58:22 damnation acpid: 1 client rule loaded

(are all these "client has disconnected" messages normal?)

Last edited by Natanji (2010-03-07 11:03:54)

Offline

#2 2010-03-03 21:56:50

Square
Member
Registered: 2008-06-11
Posts: 435

Re: [SOLVED] ACPI handler.sh no longer working (Thinkpad X60 Tablet)

I too get those messages in acpid.log, so I wouldn't worry about that.

For me, everything works in handler.sh just fine except for locking the screen when the lid is closed. To fix that I have to '/etc/rc.d/acpid restart' after X has started, then everything works fine.


 

Offline

#3 2010-03-03 22:51:25

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: [SOLVED] ACPI handler.sh no longer working (Thinkpad X60 Tablet)

Yeah, I have to do that too in any case. But that's not really the issue here - I can manually restart acpid as often as I want, still none of the commands gets executed.

Is there any possibility to see if acpid actually *reads* the handler.sh at some point?

Offline

#4 2010-03-06 10:41:54

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: [SOLVED] ACPI handler.sh no longer working (Thinkpad X60 Tablet)

*bump* Please help me, this is really annoying...

EDIT: Gah, my fault, there was an error in my handler.sh file.

Last edited by Natanji (2010-03-07 11:03:24)

Offline

#5 2010-04-28 20:35:56

lynucs
Member
Registered: 2008-05-05
Posts: 67
Website

Re: [SOLVED] ACPI handler.sh no longer working (Thinkpad X60 Tablet)

is there actually a solution for making acpi rules work without restarting acpid on each Xsession start? is there some interference with HAL? what does cause such a broken behaviour (which I have since about a year and still found no solution).


Pinky, are you pondering what I'm pondering?

Offline

#6 2010-06-25 11:13:08

schuschu
Member
Registered: 2009-06-06
Posts: 17

Re: [SOLVED] ACPI handler.sh no longer working (Thinkpad X60 Tablet)

I don't know if it works for everyone but i have just fixed the acpi rotate for my x60t

/usr/bin/xrotate

#!/bin/sh
 
 output=LVDS1
 if [ "$XROT_OUTPUT" ]
 then    
         output=$XROT_OUTPUT;
 fi
 devices="stylus eraser"
 
 geomnbr=0
 xrandr=normal
 wacom=normal
 if [ "$1" == "-" ] || [ "$1" == "+" ] || ! [ "$1" ];
 then    
         operator="$1";
         [ "$1" ] || operator='+';
         case `xrandr --verbose | grep "^$output " | sed "s/^[^ ]* [^ ]* [^ ]* ([^(]*) \([a-z]*\).*/\1/"` in
                 normal)         geom=0;;
                 left)           geom=1;;
                 inverted)       geom=2;;
                 right)          geom=3;;
         esac
         let geom=${geom}${operator}1+4
         let geom=${geom}%4
 else    
         geom="$1"
 fi
 
 
 case $geom in
         1)      wacom=CCW; xrandr=left ;;
         2)      wacom=HALF; xrandr=inverted ;;
         3)      wacom=CW; xrandr=right ;;
         *)      wacom=NONE; xrandr=normal ;;
 esac
 
 echo "xrandr to $xrandr, xsetwacom to $wacom" >&2
 
 if xrandr --output "$output" --rotate "$xrandr"; then
         for device in $devices
         do      
                 xsetwacom set "$device" Rotate "$wacom"
         done
 fi
 
 #workaround for linuxwacom bug
 if [ "`xsetwacom get stylus Mode`" == '1' ]; then
         for decive in $devices
         do      
                 xsetwacom set stylus CoreEvent "off"
                 xsetwacom set stylus Mode "off"
         done
         { sleep 1;
         for device in $devices
         do      
                 xsetwacom set stylus Mode "on"
                 xsetwacom set stylus CoreEvent "on"
         done; } &
 fi

/etc/acpi/thinkpad-swivel-up.sh       

#!/bin/bash
XAUTHORITY=/var/lib/gdm/\:0.Xauth DISPLAY=:0.0 /usr/bin/xrotate 0

/etc/acpi/thinkpad-swivel-down.sh       

#!/bin/bash
XAUTHORITY=/var/lib/gdm/\:0.Xauth DISPLAY=:0.0 /usr/bin/xrotate 1

The problem was that my acpid starts long before xorg.

System:
Thinkpad x60 tablet
xorg 1.8
acpid 1.0.10

Offline

Board footer

Powered by FluxBB