Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 177388 Details for
Bug 253764
Stabilize sys-power/acpid-2.0.17-r1
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
power_button
power_button (text/plain), 1.80 KB, created by
Pacho Ramos
on 2009-01-04 19:10:42 UTC
(
hide
)
Description:
power_button
Filename:
MIME Type:
Creator:
Pacho Ramos
Created:
2009-01-04 19:10:42 UTC
Size:
1.80 KB
patch
obsolete
>#!/bin/bash ># ># check if a X session is running and active. ># If not, shut down the system ># ># Copyright (C) 2008 Holger Macht <hmacht@suse.de> ># ># This file is released under the GPLv2. ># > >EXEC="/sbin/shutdown -h now" > ># check if we have pm-profiler and an active profile. If so, $EXEC can be ># overwritten by the active profile's configuration >. /etc/pm-profiler.conf > /dev/null 2>&1 >if [ "$?" = "0" ]; then > . /etc/pm-profiler/$PM_PROFILER_PROFILE/config >/dev/null 2>&1 >fi >[ -z "$POWER_BUTTON_HOOK" ] || EXEC="$POWER_BUTTON_HOOK" > > ># iterate over all sessions. If a active X session is found, do nothing >while read A; do > SESSION=`echo $A | sed 's/\(Session[0-9]*\)://g'` > [ -z "$SESSION" ] || continue > > SESSION=`echo $A | sed 's/\(Session[0-9]*\):/\1/g'` > IS_X=`dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit \ > /org/freedesktop/ConsoleKit/$SESSION \ > org.freedesktop.ConsoleKit.Session.GetX11Display` > > # check if this is a X session, if not, go on > DISP=`echo $IS_X | sed -e 's/^.* string "\(.*\)"/\1/'` > [ -n "$DISP" ] || continue > > IS_ACTIVE=`dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit \ > /org/freedesktop/ConsoleKit/$SESSION \ > org.freedesktop.ConsoleKit.Session.IsActive` > IS_ACTIVE=`echo $IS_ACTIVE | sed -e 's/^.* boolean \(.*\)$/\1/'` > > # debug > #if [ "$IS_ACTIVE" = "true" ]; then > # echo "and is active" > #else > # echo "and is not active" > #fi > > if [ "$IS_ACTIVE" = "true" -a -n "$DISP" ]; then > # additional check, if none of these two apps are running, go on > if [ -n "`pidof kpowersave`" -o -n "`pidof gnome-power-manager`" -o -n "`pidof kded4`" ]; then > echo doing nothing... > exit 0 > fi > fi >done < <(ck-list-sessions) > >logger -s -t pm-profiler "Power Button pressed, executing $EXEC" >$EXEC
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 253764
:
177386
| 177388 |
232137
|
335892