You are not logged in.

#1 2013-12-28 22:28:27

compty
Member
Registered: 2013-03-26
Posts: 3

[SOLVED] Laptop Lid Close

I've been using arch on my laptop for a while now and have been having problems when I close the lid on my laptop. What I want my a laptop to do is nothing except simply turn the screen off when the lid is shut. However, at the moment when I close the lid, it doesn't suspend or sleep or anything, the screen turns off, but when I open the lid, I am presented with a black screen(lit up). I have to turn my laptop on and off to use it again, or change tty and then restart the x-screen. Any help would be much appreciated. Thanks in advance.

Last edited by compty (2013-12-30 08:15:22)

Offline

#2 2013-12-29 17:41:54

kardia
Member
From: NH, USA
Registered: 2010-01-15
Posts: 14

Re: [SOLVED] Laptop Lid Close

What is handling the lid switch? systemd? acpid?

I previously had my laptop set up to do what you described. To do that, I disabled systemd handling the lid switch in /etc/systemd/logind.conf and used acpid, making the lid switch lock the screen with slimlock and turn off the screen with 'xset dpms force off'. Without additional info it is hard to say why you are getting stuck with a blank screen though.

Offline

#3 2013-12-29 17:50:53

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,802

Re: [SOLVED] Laptop Lid Close

Compty,
Welcome to Arch Linux.
Perhaps you might want to tell us what desktop environment / window manager you are using.
Also, as kardia pointed out, there are multiple mechanisms.  Which have you configured?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2013-12-29 18:40:05

compty
Member
Registered: 2013-03-26
Posts: 3

Re: [SOLVED] Laptop Lid Close

Thanks,

I'm using acpid to handle the event and in the /etc/systemd/logind.conf I have only the following line uncommented:

HandleLidSwitch=ignore

Which to my understanding should prevent systemd from controlling the event yes?

And at the moment I currently have the default acpi setup,

so the anything event:

# Pass all events to our one handler script
event=.*
action=/etc/acpi/handler.sh %e

And the following hander.sh:

#!/bin/bash
# Default acpi script that takes an entry for all actions

case "$1" in
    button/power)
        case "$2" in
            PBTN|PWRF)
                logger 'PowerButton pressed'
                ;;
            *)
                logger "ACPI action undefined: $2"
                ;;
        esac
        ;;
    button/sleep)
        case "$2" in
            SLPB|SBTN)
                logger 'SleepButton pressed'
                ;;
            *)
                logger "ACPI action undefined: $2"
                ;;
        esac
        ;;
    ac_adapter)
        case "$2" in
            AC|ACAD|ADP0)
                case "$4" in
                    00000000)
                        logger 'AC unpluged'
                        ;;
                    00000001)
                        logger 'AC pluged'
                        ;;
                esac
                ;;
            *)
                logger "ACPI action undefined: $2"
                ;;
        esac
        ;;
    battery)
        case "$2" in
            BAT0)
                case "$4" in
                    00000000)
                        logger 'Battery online'
                        ;;
                    00000001)
                        logger 'Battery offline'
                        ;;
                esac
                ;;
            CPU0)
                ;;
            *)  logger "ACPI action undefined: $2" ;;
        esac
        ;;
    button/lid)
        case "$3" in
            close)
                logger 'LID closed'
                ;;
            open)
                logger 'LID opened'
                ;;
            *)
                logger "ACPI action undefined: $3"
                ;;
    esac
    ;;
    *)
        logger "ACPI group/action undefined: $1 / $2"
        ;;
esac

# vim:set ts=4 sw=4 ft=sh et:

I know I need to add the commands etc to perform the various functions, but I thought that this handler.sh would do nothing?

I'm also using xfce. My laptop is a Dell Inspiron 7720.

Any advice on what I might be doing wrong?

Offline

#5 2013-12-29 18:49:18

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,802

Re: [SOLVED] Laptop Lid Close

Two things.  There is a second entry in loginctl.conf.  ensure that LidSwitchIgnoreInhibited is set to no, or that the line is commented.

It has been a while since if have used Xfce4, but it has a power manager and a lock screen, so you might want to go in and ensure that those functions are not "helping" you.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#6 2013-12-29 19:29:43

compty
Member
Registered: 2013-03-26
Posts: 3

Re: [SOLVED] Laptop Lid Close

Ahhh thanks. Well it turns out, what was happening was that the power manager settings were set to lock the screen when the laptop lid was closed. If i then typed in my username and password, it would unlock successfully. So the black screen was just the login screen. Still thanks for your help! smile

Offline

#7 2013-12-29 20:31:18

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,802

Re: [SOLVED] Laptop Lid Close

Cool.  Do me a favor, edit your first post and prepend [SOLVED] to the thread title.  We ask that you do that because only the original poster knows for sure when it is solved smile


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB