跳转到主内容

桌面启动器快捷操作

概览​

On many Linux environments, you can add custom entries to the system launcher by modifying the .desktop file. For details, see the freedesktop.org Desktop Entry Specification.

若要创建快捷方式,你需要为添加到快捷菜单的条目提供 Name 和 Exec 属性。 The desktop will execute the command defined in the Exec field after the user clicks the shortcut menu item. .desktop 文件的示例如下:

Actions=PlayPause;Next;Previous

[Desktop Action PlayPause]
Name=Play-Pause
Exec=audacious -t

[Desktop Action Next]
Name=Next
Exec=audacious -f

[Desktop Action Previous]
Name=Previous
Exec=audacious -r

The preferred way for the desktop to instruct your application on what to do is using parameters. You can find them in your application in the global variable process.argv.