在 Ubuntu 16.04 LTS 中,我正在编写一个 Bash 脚本来将桌面图标与自定义网格对齐。为此,我需要检索桌面上每个文件的图标位置。
遵循建议这里,我尝试在终端中针对特定文件和文件夹运行此命令......
sudo gvfs-info -a 'metadata::nautilus-icon-position' '/home/user/Desktop/Untitled Document/'
...但是除了文件 uri 和空行之外,没有任何信息输出到终端attributes:
。
当我运行这个更通用的命令时......
sudo gvfs-info -a "*" /home/user/Desktop/*
...我发现桌面上的任何文件都没有任何以 为前缀的属性metadata::
,更不用说任何类似于 的属性了nautilus-icon-position
。
例如,上述命令提供了桌面上一个文件夹的信息...
display name: wishlist
edit name: wishlist
name: wishlist
type: directory
size: 4096
uri: file:///home/user/Desktop/wishlist
attributes:
standard::type: 2
standard::name: wishlist
standard::display-name: wishlist
standard::edit-name: wishlist
standard::copy-name: wishlist
standard::icon: folder
standard::content-type: inode/directory
standard::fast-content-type: inode/directory
standard::size: 4096
standard::allocated-size: 4096
standard::symbolic-icon: folder-symbolic, folder
etag::value: 1477080349:564939
id::file: l44:401458
id::filesystem: l44
access::can-read: TRUE
access::can-write: TRUE
access::can-execute: TRUE
access::can-delete: TRUE
access::can-trash: TRUE
access::can-rename: TRUE
time::modified: 1477080349
time::modified-usec: 564939
time::access: 1487319742
time::access-usec: 474841
time::changed: 1487319742
time::changed-usec: 470842
unix::device: 44
unix::inode: 401458
unix::mode: 16895
unix::nlink: 15
unix::uid: 1000
unix::gid: 1000
unix::rdev: 0
unix::block-size: 4096
unix::blocks: 8
owner::user: user
owner::user-real: user
owner::group: user
那么,如何获取(和设置)桌面上每个文件的图标位置?