快速列表的命令
我正在使用Unity。 快速列表function非常有用。 我在Ubuntu Tweak的nautilus快速列表中添加了一些条目。 这些命令很容易理解。
但现在我不知道如何找到应该用于添加快速列表的命令。 每个应用程序都有不同的命令方式。
例如:
虽然nautilus命令类似于nautilus /home/username/Music
。 Chrome命令完全不同。 像这样 – /opt/google/chrome/google-chrome
现在我如何找出默认情况下没有任何应用程序的应用程序?
这很容易
[NewIncognito Shortcut Group] Name=New Incognito Window Exec=/opt/google/chrome/google-chrome --incognito TargetEnvironment=Unity
你必须添加这样的一行
X-Ayatana-Desktop-Shortcuts=XXXXX;XXXXX;XXXXX
此处XXXXX
是[ ]
名称,但Shortcut Group
除外
现在举个例子,
你可以在[ ]
之间给出任何名称,就像这里是NewIncognito Shortcut Group
。 但你必须在名字后写下Shortcut Group
。 这意味着您只能在[NewIncognito Shortcut Group]
中提供任何名称来代替NewIncognito
。
Name=
可以是任何有意义的东西,无论它知道它做什么。
Exec=
是该可执行文件的路径(仅当目录不在PATH
变量中时),如Exec=/opt/google/chrome/google-chrome
现在所有这个模糊的主要事情的实际的东西是打开可执行文件时传递的参数。 这是--incognito
。
您始终知道要启动哪个可执行文件但主要问题是
使用哪个参数? 或者我怎么知道使用这个或那个?
只需打开终端cd
(无需cd
到dir,如果它在你的PATH
变量中)到你的可执行文件所在的目录。
现在写下你的可执行文件的名字(这里是google-chrome
)然后写--help
。 所以你要打字
google-chrome --help
这将显示可以传递的不同选项或参数以及有关它们的其他信息。 这是输出
OPTIONS Google Chrome has hundreds of undocumented command-line flags that are added and removed at the whim of the developers. Here, we document relatively stable flags. --user-data-dir=DIR Specifies the directory that user data (your "profile") is kept in. Defaults to ~/.config/google-chrome . Separate instances of Google Chrome must use separate user data directories; repeated invocations of google-chrome will reuse an existing process for a given user data directory. --app=URL Runs URL in "app mode": with no browser toolbars. --incognito Open in incognito mode. --version Show version information.
这个输出很长,我不应该在这里粘贴。
google-chrome --help
实际上打开了manpage
。 但大部分时间只在终端中给出文本输出。
让我们举个女妖的例子
如果你运行banshee --help
它会给出类似的东西
Usage: banshee [options...] [files|URIs...] Help Options --help Show this help --help-playback Show options for controlling playback --help-query-track Show options for querying the playing track --help-query-player Show options for querying the playing engine --help-ui Show options for the user interface --help-debug Show options for developers and debugging --help-all Show all option groups --version Show version information
他们明智地划分了帮助类别。 现在我想知道播放的选项,所以我会输入
banshee --help-playback
这表现了,
Playback Control Options --next Play the next track, optionally restarting if the 'restart' value is set --previous Play the previous track, optionally restarting if the 'restart value is set --restart-or-previous If the current song has been played longer than 4 seconds then restart it, otherwise the same as --previous --play-enqueued Automatically start playing any tracks enqueued on the command line --play Start playback --pause Pause playback --toggle-playing Toggle playback --stop Completely stop playback --stop-when-finished Enable or disable playback stopping after the currently playing track (value should be either 'true' or 'false') --set-volume=LEVEL Set the playback volume (0-100), prefix with +/- for relative values --set-position=POS Seek to a specific point (seconds, float) --set-rating=RATING Set the currently played track's rating (0 to 5)
现在您知道如何让它播放下一个或上一个或暂停。 所以你可以创建像这样的条目
Exec=banshee --next
下一首歌的下一个
Exec=banshee --pause
– 暂停歌曲暂停
Exec=banshee --previous
以前播放上一曲目
大多数应用程序存储在目录/usr/bin/
或者在该目录中具有存储它们的位置的链接。 以图形方式,您可以使用Nautilus(默认文件浏览器)导航到该目录,然后按Ctrl + F搜索应用程序名称。 希望这可以帮助。