A new Slackware 12.2 install - a few niggly issues
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
The default acpi handler will list the events captured (such as when the lid is closed or a special button is pressed). You just need to write handler cases for the events you want to handle.
There is also some useful information/controls available via /proc/acpi
OK. I have the touchpad working the way I want. I just had to find the right man page to read. It turns out that man synaptics tells me everything I needed to put in xorg.conf. Who knew?
Here is my working version. This config gives button 2 and 3 from tapping in top right and bottom right, respectively and horizontal scrolling (in apps that support this).
7. In my home directory I prepare ~/GNUstep/Defaults/WMRootMenu file with shortcuts to XF86AudioPlay, XF86AudioStop, XF86AudioNext, and XF86AudioPrev keys.
(The paths in your system can be different than in mine so customize them to your needs. If you'd like to use OpenOffice.org, Inkscape, and MPlayer you should install them. If you don't use Window Maker assign these shortcuts to the commands using the appropriate method for your window manager.)
8. In ~/GNUstep/Defaults/WindowMaker I set two options:
10. In /etc/lilo.conf file I add to append option the switch resume=/dev/sda8. (Instead of /dev/sda8 point there your swap partition).
11. I rerun LILO with lilo command.
12. I reboot the system.
***
How it works...
1. Closing the lid blanks the screen.
2. Fn+F2 locks the screen using sophisticated xlock command on display :0 and xhost `hostname`. To unlock it use root's password.
3. Fn+F4 suspends (sleeps) the system to RAM.
4. Fn+F12 suspends the system to swap partition. To restore it use the same kernel that you use to store it.
5. Fn+arrows cooperates with remoot and works with a lot of programs such as Audacious or moc (see: http://moc.daper.net/).
6. ``Windows'' key runs WPrefs program and ``Menu'' key runs wmakerconf (see: http://wmakerconf.sourceforge.net/) -- both these programs are for Window Maker configuration.
7. So called ``browser keys'' switch to the previous and the next virtual terminal in Window Maker.
***
Comments...
I don't like the system suspending after closing the lid. I prefer to use a shortcut for such purposes. Feel free to customize that function to your needs.
I didn't manage to force Fn+F7 to switch the screen between LCD and monitor. Maybe you'll find the proper solution.
If you'll discover how to use other keys, or you'll find the better way to use these keys, or you'll have good idea for what purposes use ``Windows'' and ``Menu'' keys share your knowledge with the community.
I have been cobbling together stuff from various sources. Some is similar to what you have posted. I am making progress and will definitely post what I end up with.
One thing this experience is demonstrating is how much the more "polished" distros such as SuSE hide from you.
I knew I would have some tweaking to do, which is why I started this on the first day of my winter vacation.
this is my fix for the missing VTs
just add some 4s to this part of
/etc/initab
like this
Code:
# These are the standard console login getties in multiuser mode:
c1:12345:respawn:/sbin/agetty 38400 tty1 linux
c2:12345:respawn:/sbin/agetty 38400 tty2 linux
c3:12345:respawn:/sbin/agetty 38400 tty3 linux
c4:12345:respawn:/sbin/agetty 38400 tty4 linux
c5:12345:respawn:/sbin/agetty 38400 tty5 linux
c6:12345:respawn:/sbin/agetty 38400 tty6 linux
Then, in /etc/acpi/actions I have the corresponding files.
ati-toggle.sh
Code:
#!/bin/bash
#
# Source:
# http://www.thinkwiki.org/wiki/Script_for_Dynamic_Display_Management_with_fglrx
#
# Script to switch displays, e.g. by pressing Fn-F7 on Thinkpad Laptops.
# Uses aticonfig from the ATI fglrx driver for dynamic switching, and
# xrandr for resolution changing. OSD done with xosd.sh, which uses
# osd_cat from Xosd.
#
# Author: Armin Hornung -- www.arminhornung.de
# Date: 2008-05-01
#
# Partly based on a display switching script from SuSE 10.1
#
# path to xosd.sh, change to "echo" if not installed
xosd="/usr/local/bin/xosd.sh"
# path to xrandr
xrandr="/usr/bin/xrandr"
INTERNAL="lvds" # internal LCD of Laptop
EXTERNAL="crt1" # external monitor, CRT or TFT
# Determine X user, script usually runs as root:
getXuser() {
user=`finger| grep -m1 ":$displaynum " | awk '{print $1}'`
if [ x"$user" = x"" ]; then
user=`finger| grep -m1 ":$displaynum" | awk '{print $1}'`
fi
if [ x"$user" != x"" ]; then
userhome=`getent passwd $user | cut -d: -f6`
export XAUTHORITY=$userhome/.Xauthority
else
export XAUTHORITY=""
fi
}
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXuser
if [ x"$XAUTHORITY" != x"" ]; then
# extract current state
export DISPLAY=":$displaynum"
_enabled_monitors=`su $user -c "aticonfig --query-monitor | grep Enabled"`
_connected_monitors=`su $user -c "aticonfig --query-monitor | grep Connected"`
fi
done
# determine if internal is active
echo "${_enabled_monitors}" | grep $INTERNAL > /dev/null 2>&1
if [ $? -eq 0 ]; then
_internal_enabled=yes
else
_internal_enabled=no
fi
# determine if external is connected
# (LVDS always assumed to be connected)
echo "${_connected_monitors}" | grep $EXTERNAL > /dev/null 2>&1
if [ $? -eq 0 ]; then
_external_connected=yes
else
_external_connected=no
fi
# determine if external is active
_external_enabled=no
echo "${_enabled_monitors}" | grep $EXTERNAL > /dev/null 2>&1
if [ $? -eq 0 ]; then
_external_enabled=yes
fi
#### display switching part ####
if [ "${_internal_enabled}" = "yes" ]; then
if [ "${_external_connected}" = "yes" ]; then
if [ "${_external_enabled}" = "yes" ]; then
# switch to external only, after both enabled:
$xosd "Enabling $EXTERNAL" &
su $user -c "aticonfig --enable-monitor $EXTERNAL"
# adjust resolution back to standard:
$xrandr -s 1280x1024 -r 60
else
# switch to both enabled, after external only
$xosd "Enabling $INTERNAL & $EXTERNAL" &
su $user -c "aticonfig --enable-monitor $INTERNAL,$EXTERNAL"
# adjust resolution:
$xrandr -s 1280x1024 -r 60
fi
else
$xosd "No external display connected" &
if [ "${_external_enabled}" = "yes" ]; then
# switch back just if external display got disconnected
su $user -c "aticonfig --enable-monitor $INTERNAL"
$xrandr -s 1680x1050 -r 60
fi
fi
else
# switch back to internal only, after external enabled:
$xosd "Enabling $INTERNAL" &
su $user -c "aticonfig --enable-monitor $INTERNAL"
# adjust resolution back to standard:
$xrandr -s 1680x1050 -r 60
fi
exit 0
This was pulled from the URL in the comments at the beginning. The xosd.sh script referenced is also available there.
lock.sh
Code:
#!/bin/bash
getXuser() {
user=`finger| grep -m1 ":$displaynum " | awk '{print $1}'`
if [ x"$user" = x"" ]; then
user=`finger| grep -m1 ":$displaynum" | awk '{print $1}'`
fi
if [ x"$user" != x"" ]; then
userhome=`getent passwd $user | cut -d: -f6`
export XAUTHORITY=$userhome/.Xauthority
else
export XAUTHORITY=""
fi
}
#Find the right XServer to be configured.
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXuser;
if [ x"$XAUTHORITY" != x"" ]; then
export DISPLAY=":$displaynum"
fi
done
LOCKAPP="/usr/bin/kdesktop_lock --forcelock"
su ${user} -c "${LOCKAPP}" &
ati-powermode.sh
Code:
!/bin/bash
#
# Control script for ACPI lid state and AC adapter state
#
getXuser() {
user=`finger| grep -m1 ":$displaynum " | awk '{print $1}'`
if [ x"$user" = x"" ]; then
user=`finger| grep -m1 ":$displaynum" | awk '{print $1}'`
fi
if [ x"$user" != x"" ]; then
userhome=`getent passwd $user | cut -d: -f6`
export XAUTHORITY=$userhome/.Xauthority
else
export XAUTHORITY=""
fi
}
grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]; then
lid_closed=1
echo "Lid Closed"
else
lid_closed=0
echo "Lid Open"
fi
grep -q off-line /proc/acpi/ac_adapter/*/state
if [ $? = 0 ]; then
echo "On DC"
on_dc=1
else
echo "On AC"
on_dc=0
fi
#Find the right XServer to be configured.
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXuser;
if [ x"$XAUTHORITY" != x"" ]; then
export DISPLAY=":$displaynum"
fi
done
#If PPLIB is enabled
su $user -c '/usr/bin/aticonfig --pplib-cmd="get version"' | grep PPLIB
if [ $? = 0 ]; then
echo "Has PPLIB"
has_pplib=1
else
echo "No PPLIB"
has_pplib=0
fi
if [ ${lid_closed} -eq 1 -o ${on_dc} -eq 1 ]; then
echo "Low power"
if [ ${has_pplib} -eq 1 ]; then
su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc dc"'
else
su $user -c "/usr/bin/aticonfig --set-powerstate=1 --effective=now"
fi
else
echo "high power"
if [ ${has_pplib} -eq 1 ]; then
su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc ac"'
else
su $user -c "/usr/bin/aticonfig --set-powerstate=3 --effective=now"
fi
fi
I found ati-powermode.sh in the /usr/doc/fglrx/examples/etc/acpi directory.
suspend.sh
Code:
#!/bin/sh
sync ; sync ; echo -n mem > /sys/power/state
This is the same as what w1k0 posted and worked great. The hibernate script from w1k0 did not work for me.
I shall continue to plug away on this. At least now I have the most important ones for me working. Thanks to all your responses, I am starting to get a handle on setting up the ACPI handlers.
I use Slackware 12.1 with generic kernel 2.6.24.5-smp as well as with custom 2.6.24.5-smp kernel. In both cases hibernation works perfectly:
1. I press Fn-F12,
2. I wait until machine stops,
3. I turn machine on,
4. I select the same kernel as before,
5. and machine restores system from swap partition.
On what step you notice the problem? Did you try to run hibernate.sh manually? Did you add resume=/dev/... switch to append option in /etc/lilo.conf? Did you restart LILO with lilo command? What versions of Slackware and kernel you use?
I am using Slackware 12.2 with the generic (huge?) 2.6.27.7 kernel. I added the appropriate resume switch to my LILO config as well.
The step at which it failed was actually shutting down. It started to hibernate but instead of shutting down, I was returned immediately to my desktop.
this sounds may be different but in bios do you have a setting for the mouse and is it set to both or just touch pad. this was a prblem once with a older laptop and I used a ps2 touch pad on it. pluss the onboard mouse. so I guess yours is a on board mouse pad so while your in there set you bios to none operating system. or none windows if you have that option. Linux is not good at controlling bios. but can read them and kinda and work with the acpi
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.