![打開android studio的命令](https://rvso.com/image/1127623/%E6%89%93%E9%96%8Bandroid%20studio%E7%9A%84%E5%91%BD%E4%BB%A4.png)
我最近在我的 Ubuntu 14.04 LTS 系統上安裝了 EasyStroke。我想為其添加一個快捷方式。大佬能告訴我用什麼指令嗎? android studio 的位置是
/home/antony/Documents/Android Studio Installation Files/android-studio/bin/studio.sh
對於我使用的其他應用程序,例如 Firefox
wmctrl -a Firefox || firefox
但這不適用於 android studio
也
xdg-open of /home/....
在文字編輯器而不是終端機中開啟 bash 檔案。
請幫幫我吧夥計們
答案1
使用此命令:
wmctrl -a "Android Studio" || "/home/antony/Documents/Android Studio Installation Files/android-studio/bin/studio.sh"
使用雙引號的完整路徑。
從man wmctrl
-a <WIN>
Switch to the desktop containing the window <WIN>, raise the window, and give it
focus.
<WIN> This argument specifies a window that is the target of an action. By default the
argument is treated as if were a string, and windows are examined until one is
found with a title the contains the specified string as a substring. The substring
matching is done in a case insensitive manner. The -F option may be used to force
exact, case sensitive title matching. The option -i may be used to interpret the
window target as a numeric window identity instead of a string.
答案2
嘗試這個:
xdotool type "sh '/home/antony/Documents/Android Studio Installation Files/android-studio/bin/studio.sh'" ; xdotool key KP_Enter
如果不起作用,請嘗試以下操作:
wmctrl -a "Android Studio" || "/home/antony/Documents/Android Studio Installation Files/android-studio/bin/studio.sh"