Thanks for the help, but these solutions did not work.
When I close the lid, nothing happens. Also I tried adding xfce4-power-manager to .xinitrc, but when I try to close the lid it tells me "power manager not authorized." However if I run xfce4-power-manger from dmenu, it works. But I want a permanent fix and not just something that I have to start manually at every login.
If it helps here are my acpi files.
/etc/acpi/events/lid
Code:
event=button/lid
action=/etc/acpi/actions/lid.sh %e
/etc/acpi/actions/lid.sh
Code:
#!/bin/sh
grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]
then
pm-suspend
exit
fi