打开android studio的命令

打开android studio的命令

我最近在我的 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"

相关内容