I'm in fluxbox on Arch on a Macbook 5,1. New to linux. I'm trying to get Arch to suspend when I close my laptop. Lately I've just been using sudo pm-suspend.

I installed slimlock, and inserted

    case $3 in
            #echo "LID switched!">/dev/tty5
         /usr/sbin/pm-suspend &
         DISPLAY=:0.0 su -c - username /usr/bin/slimlock

in my /etc/acpi/handler.sh, which I read to do here, but it doesn't work. I tried installing xscreensaver, but I get a weird error:

error: perl-lwp-mediatypes: signature from "Justin Davis (juster) <[email protected]>" is unknown trust
error: failed to commit transaction (invalid or corrupted package (PGP signature))

3 Answers 3


You will need to install archlinux-keyring package to have all needed public key.

pacman -S archlinux-keyring

More information here.

Also you should lock first, suspend later:

    case $3 in
            #echo "LID switched!">/dev/tty5
            DISPLAY=:0.0 su -c - username /usr/bin/slimlock &
  • How does this approach differ from configuring lid off/on in /etc/systemd/logind.conf? Do we need to configure both, or are they mutually exclusive?
    – modulitos
    Commented Jan 1, 2016 at 8:43

I understand this question is a little old, now the easiest way to do this is with systemd.

Use systemd-logind for this. see man logind.conf.

With HandleLidSwitch option you can tell it what you want it to do when lid closes.


The options can be one of ,

  • ignore
  • poweroff
  • reboot
  • halt
  • kexec
  • suspend
  • hibernate
  • hybrid-sleep
  • lock

Follow this: https://wiki.archlinux.org/index.php/Pacman

Being new to Linux and going directly to Arch is not a good idea. Take a look at Fedora/Ubuntu or Debian.

Ps: You need to generate the PGP keys for arch linux so you can add them.

  • But I was under the impression that installing (or updating pacman) did that automatically...
    – mmtauqir
    Commented Sep 4, 2012 at 18:53
  • thanks, this helped getting xscreensaver. but that script still isn't running anything on lid close Commented Sep 4, 2012 at 19:04
  • 3
    @mtahmed Actually it depends on the installation you are using. Last time I installed using the new Arch version, I didn't need to do anything. If you do, you usually need; pacman-key --init ; pacman-key --populate archlinux. JackStewart: I remember having the same problem with XFCE4. I The only way for me to close the lid was telling XFCE4 to suspend and not hibernate. Maybe a hint, perhaps you tried laptop-tools from the repo? wiki.archlinux.org/index.php/Laptop_Mode_Tools
    – user22921
    Commented Sep 11, 2012 at 10:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .