#!/bin/sh
APP=$1
# NOTES:
# - lion stores the bundle id or the path as a URL (uri encoded)
# - snow leopard stores the file path without special encoding (the file path contains the bundle name)
# find the bundle id as the application path is not unique in the dock plist config
BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$1"/Contents/Info.plist)
# find the bundle name as the application path is not unique in the dock plist config
BUNDLE_NAME=$(/usr/libexec/PlistBuddy -c "Print :CFBundleName" "$1"/Contents/Info.plist)
# check if the entry for the app to be added already exists
defaults read com.apple.dock persistent-apps | grep -i "$BUNDLE_ID"
grepresult=$?
if [ $grepresult -eq 0 ] ; then
echo "entry already exists. quitting."
exit 0
fi
# check if the path is already in the dock
defaults read com.apple.dock persistent-apps | grep -i "$BUNDLE_NAME"
grepresult=$?
if [ $grepresult -eq 0 ] ; then
echo "entry already exists. quitting. (2)"
exit 0
fi
# in case we are still here yet add the dock entry
defaults write com.apple.dock persistent-apps -array-add \
"<dict>
<key>tile-data</key>
<dict>
<key>file-data</key>
<dict>
<key>_CFURLString</key>
<string>$APP</string>
<key>_CFURLStringType</key>
<integer>0</integer>
</dict>
</dict>
</dict>"
dockplistfile="${HOME}/Library/Preferences/com.apple.dock.plist"
/usr/libexec/PlistBuddy -c save "${dockplistfile}"
/usr/bin/killall -HUP Dock
≠
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Microsoft Remote Desktop.app.zip (43个子文件)
Microsoft Remote Desktop.app
Contents
_CodeSignature
CodeResources 12KB
Info.plist 2KB
Frameworks
libQtXml.4.8.4.dylib 424KB
libcrypto.1.0.0.dylib 3.65MB
libQtNetwork.dylib 24B
libQtNetwork.4.8.4.dylib 1.66MB
libQtNetwork.4.dylib 24B
libQtNetwork.4.8.dylib 24B
libQtCore.dylib 21B
libQtCore.4.8.4.dylib 4.06MB
libssl.1.0.0.dylib 880KB
libQtGui.4.8.dylib 20B
libQtGui.4.8.4.dylib 13.23MB
libQtXml.dylib 20B
libQtCore.4.8.dylib 21B
libQtGui.4.dylib 20B
ADALiOS.framework
Resources 26B
Versions
Current 1B
A
_CodeSignature
CodeResources 3KB
Resources
Info.plist 1KB
en.lproj
InfoPlist.strings 92B
ADALiOS 277KB
ADALiOS 24B
libQtGui.dylib 20B
libQtXml.4.dylib 20B
libQtXml.4.8.dylib 20B
libQtCore.4.dylib 21B
Resources
dock-remove.sh 1023B
qt_menu.nib
info.nib 472B
classes.nib 1KB
keyedobjects.nib 5KB
empty.lproj 0B
postinstall.sh 1KB
change-dock.sh 1KB
qt.conf 26B
qmote-512x512.icns 474KB
PlugIns
accessible
libqtaccessiblewidgets.dylib 447KB
imageformats
libqtga.dylib 44KB
libqgif.dylib 57KB
libqico.dylib 55KB
MacOS
Microsoft Remote Desktop 12.03MB
_MASReceipt
receipt 5KB
PkgInfo 9B
共 43 条
- 1
fromgrey
- 粉丝: 2
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页