Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 40 lines (30 sloc) 1.262 kb
27367b3 @wincent Initial import
authored
1 #!/bin/sh
fa23874 @wincent more error tolerance
authored
2 #
3 # Activate WinSwitch.command
4 # Script to activate WinSwitch in current user account
5 # $Id$
27367b3 @wincent Initial import
authored
6
7 tool="/Library/Menu Extras/WinSwitch.menu/Contents/Resources/menu-extra-tool"
8
9 # deactivate Apple's menu extra, MenuCracker and WinSwitch
10 "${tool}" \
11 -r com.apple.menuextra.appleuser \
12 -r net.sourceforge.menucracker \
13 -r com.wincent.WinSwitch
14
15 /bin/sleep 3
16
fa23874 @wincent more error tolerance
authored
17 # must kill SystemUIServer to force it to reload the new WinSwitch bundle
27367b3 @wincent Initial import
authored
18 /usr/bin/killall -SIGHUP SystemUIServer
19
20 # open MenuCracker; will relaunch SystemUIServer if it did not respawn already
21 /usr/bin/open \
22 "/Library/Menu Extras/WinSwitch.menu/Contents/Resources/MenuCracker.menu"
23
24 # allow time for SystemUIServer to relaunch
25 /bin/sleep 5
26
27 # activate WinSwitch, adding to right-hand end of menu bar
28 "${tool}" \
29 -a "/Library/Menu Extras/WinSwitch.menu" \
30 -p -1
31
fa23874 @wincent more error tolerance
authored
32 # retry if error reported on first try (system under heavy load may take longer to respawn SystemUIServer)
33 if [ $? -ne 0 ]; then
34 /bin/sleep 5
35 "${tool}" -a "/Library/Menu Extras/WinSwitch.menu" -p -1
36 fi
37
38 # don't check the exit status (spurious errors reported due to conflict with Unsanity MEE?)
39 exit 0
Something went wrong with that request. Please try again.