linux绝对路径进桌面,Linux桌面快捷方式 Desktop Entry 详解

The Exec key

The Exec key must contain a command line.

A command line consists of an executable program optionally followed

by one or more arguments.

The executable program can either be specified with its full path or

with the name of the executable only. If no full path is provided the

executable is looked up in the $PATH environment variable used by the

desktop environment.

The name or path of the executable program may not contain the equal

sign ("="). Arguments are separated by a space.

Arguments may be quoted in whole. If an argument contains a reserved

character the argument must be quoted. The rules for quoting of

arguments is also applicable to the executable name or path of the

executable program as provided.

Quoting must be done by enclosing the argument between double quotes

and escaping the double quote character, backtick character ("`"),

dollar sign ("$") and backslash character ("\") by preceding it with an

additional backslash character. Implementations must undo quoting before

expanding field codes and before passing the argument to the executable

program. Reserved characters are space (" "), tab, newline, double

quote, single quote ("'"), backslash character ("\"),

greater-than sign (">"), less-than sign ("

Note that the general escape rule for values of type string states that

the backslash character can be escaped as ("\\") as well and that this

escape rule is applied before the quoting rule. As such, to

unambiguously represent a literal backslash character in a quoted

argument in a desktop entry file requires the use of four successive

backslash characters ("\\\\"). Likewise, a literal dollar sign in a

quoted argument in a desktop entry file is unambiguously represented

with ("\\$").

A number of special field codes have been defined which will be

expanded by the file manager or program launcher when encountered

in the command line.

Field codes consist of the percentage character ("%") followed by

an alpha character. Literal percentage characters must be escaped

as %%.

Deprecated field codes should be removed from the command line and

ignored.

Field codes are expanded only once, the string that is used to

replace the field code should not be checked for field codes itself.

Command lines that contain a field code that is not listed in this

specification are invalid and must not be processed, in particular

implementations may not introduce support for field codes not listed

in this specification. Extensions, if any, should be introduced by

means of a new key.

Implementations must take care not to expand field codes into multiple

arguments unless explicitly instructed by this specification.

This means that name fields, filenames and other replacements that

can contain spaces must be passed as a single argument

to the executable program after expansion.

Although the Exec key is defined to have a value

of the type string, which is limited to ASCII characters, field code

expansion may introduce non-ASCII characters in arguments.

Implementations must take care that all characters in arguments

passed to the executable program are properly encoded according to

the applicable locale setting.

Recognized field codes are as follows:

CodeDescription%fA single file name, even if multiple files are selected. The system

reading the desktop entry should recognize that the program in

question cannot handle multiple file arguments, and it should

should probably spawn and execute multiple copies of a program

for each selected file if the program is not able to handle

additional file arguments. If files are not on the local file system

(i.e. are on HTTP or FTP locations), the files will be copied to the local

file system and %f will be expanded to point at the temporary

file. Used for programs that do not understand the URL syntax.

%FA list of files. Use for apps that can open several local

files at once.

Each file is passed as a separate argument to

the executable program.

%uA single URL. Local files may either be passed as

file: URLs or as file path.

%UA list of URLs.

Each URL is passed as a separate argument to

the executable program. Local files may either be passed as

file: URLs or as file path.

%dDeprecated.

%DDeprecated.

%nDeprecated.

%NDeprecated.

%iThe Icon key of the desktop entry

expanded as two arguments, first

--icon and then the value of the

Icon key. Should not expand to any

arguments if the Icon key is empty

or missing.

%cThe translated name of the application as listed in

the appropriate Name key in the

desktop entry.

%kThe location of the desktop file as either a URI (if for

example gotten from the vfolder system) or a local

filename or empty if no location is known.

%vDeprecated.

%mDeprecated.

A command line may contain at most one %f, %u, %F or %U field code.

If the application should not open any

file the %f, %u, %F and %U field codes must be removed from the

command line and ignored.

Field codes must not be used inside a quoted argument, the result of

field code expansion inside a quoted argument is undefined. The %F and

%U field codes may only be used as an argument on their own.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值