mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
web: just use "open" on OS X
R=rsc http://codereview.appspot.com/1764045
This commit is contained in:
parent
36d9b90c56
commit
f92863adf4
1 changed files with 1 additions and 67 deletions
68
bin/web
68
bin/web
|
@ -1,74 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
plumbfirefox()
|
|
||||||
{
|
|
||||||
echo '
|
|
||||||
tell application "Firefox"
|
|
||||||
activate
|
|
||||||
tell application "System Events"
|
|
||||||
tell process "firefox"
|
|
||||||
keystroke "t" using {command down}
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
Get URL "'$1'"
|
|
||||||
end tell
|
|
||||||
' | osascript
|
|
||||||
}
|
|
||||||
|
|
||||||
plumbsafari()
|
|
||||||
{
|
|
||||||
echo '
|
|
||||||
tell application "Safari"
|
|
||||||
activate
|
|
||||||
tell application "System Events"
|
|
||||||
tell process "safari"
|
|
||||||
keystroke "t" using {command down}
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
open location "'$1'"
|
|
||||||
end tell
|
|
||||||
' | osascript
|
|
||||||
}
|
|
||||||
|
|
||||||
plumbcamino()
|
|
||||||
{
|
|
||||||
echo '
|
|
||||||
tell application "Camino"
|
|
||||||
activate
|
|
||||||
tell application "System Events"
|
|
||||||
tell process "camino"
|
|
||||||
keystroke "t" using {command down}
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
Get URL "'$1'"
|
|
||||||
end tell
|
|
||||||
' | osascript
|
|
||||||
}
|
|
||||||
|
|
||||||
plumbapple()
|
plumbapple()
|
||||||
{
|
{
|
||||||
case ${BROWSER:-none} in
|
open "$@"
|
||||||
firefox)
|
|
||||||
plumbfirefox "$@"
|
|
||||||
;;
|
|
||||||
safari)
|
|
||||||
plumbsafari "$@"
|
|
||||||
;;
|
|
||||||
camino)
|
|
||||||
plumbcamino "$@"
|
|
||||||
;;
|
|
||||||
none)
|
|
||||||
if [ -d /Applications/Camino.app ]
|
|
||||||
then
|
|
||||||
plumbcamino "$@"
|
|
||||||
elif [ -d /Applications/Firefox.app ]
|
|
||||||
then
|
|
||||||
plumbfirefox "$@"
|
|
||||||
else
|
|
||||||
plumbsafari "$@"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
plumbunix()
|
plumbunix()
|
||||||
|
|
Loading…
Reference in a new issue