Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Mute the startup sound using a logout hook' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Mute the startup sound using a logout hook
Authored by: david-bo on Oct 08, '03 11:48:19AM

Are there any other hooks available? Sleep?

Btw, where do you find these hooks?

---
http://www.google.com/search?as_q=%22Authored+by%3A+david-bo%22&num=10&hl=en&ie=ISO-8859-1&btnG=



[ Reply to This | # ]
Mute the startup sound using a logout hook
Authored by: extra88 on Oct 08, '03 12:39:34PM
"Logout hooks" are just Login Items that run at logout instead of login. There's no GUI for setting programs to run at logout so you have to resort to console commands like this one

sudo defaults write com.apple.loginwindow LogoutHook /usr/local/bin/mute.sh

The muting magic it being done by using AppleScript to set the volume. According to a recent O'Reilly article, there's no direct AppleScript control for Sleep but they provide a script using AppleScript GUI Scripting (basically a script which uses an application's menus , buttons, etc.) You could probably create this sleep script and set a logout hook to run it so every time you log off, the computer goes to sleep.

[ Reply to This | # ]

Mute the startup sound using a logout hook
Authored by: Eravau on Oct 08, '03 01:40:51PM
I may be wrong, but I think david-bo was asking if there are any other hooks you can use besides ones that are caught at Logout. For example, could you set a hook to run certain things when you tell the computer to go to sleep (or startup or shutdown, etc.). For Example:

sudo defaults write com.apple.loginwindow SleepHook /usr/local/bin/do_sleep_stuff.sh

If there are other hooks available, what are they?

[ Reply to This | # ]

logout hooks
Authored by: matx666 on Oct 08, '03 01:50:19PM

check out bombich.com and his loginwindow manager

http://www.bombich.com/software/lwm.html

and his hooks

http://www.bombich.com/mactips/loginhooks.html

-x



[ Reply to This | # ]
running scripts on sleep / wake
Authored by: miggins on Oct 09, '03 12:39:21AM

try using sleepwatcher from http://home.t-online.de/home/bernhard.baehr/



[ Reply to This | # ]
Mute the startup sound using a logout hook
Authored by: MVasilakis on Oct 27, '03 09:50:14AM

Could we make a logout directory and hook to that directory?

sudo defaults write com.apple.loginwindow LogoutHook /usr/local/bin/logout/*



[ Reply to This | # ]
Mute the startup sound using a logout hook
Authored by: kirbysdl on Feb 05, '04 03:46:40PM
I don't think that would work, but you can have your logouthook script run everything in a given directory...
for i in /some/directory/* ; do
  if [ -x "$i" ]; then
    . $i
  fi
done
Keep in mind that all of the executable scripts in the targetted directory will be run as root, so be careful who can write into this directory and know what's inside.

[ Reply to This | # ]