是否可以使用“gio set”命令在文件夹上插入图标?

Raf*_*rsk 5 icons command-line gvfs 18.04

Ubuntu 16.04我使用以下命令在我的文件夹中插入图标​​并且它工作正常:

gvfs-set-attribute -t string folderIWishToInsertIcon metadata::custom-icon "file:///home/myUser/myIcon.png"
Run Code Online (Sandbox Code Playgroud)

升级Ubuntu 18.04到此命令后仍然可以正常工作,但现在我收到一条消息,说它是一个已弃用的工具,它建议我gio set改用:

ramuyko@myPC:~$ gvfs-set-attribute -t string folderIWishToInsertIcon metadata::custom-icon "file:///home/myUser/myIcon.png"
This tool has been deprecated, use 'gio set' instead.
See 'gio help set' for more info.
Run Code Online (Sandbox Code Playgroud)

我看过gio的手册页并尝试使用gio set命令在我的文件夹中插入图标​​,但我没有成功使用正确的参数。有谁知道这是否可能以及如何做到?

Ser*_*nyy 5

正如评论中所解决的,gio setcommand 使用与所使用的相同形式的参数gvfs-set-attribute,除了setingio是一个单独的命令行参数,而不是gvfs-set-attribute一个完整的命令。因此,正确的命令应该是:

gio set -t 'string' folderIWishToInsertIcon 'metadata::custom-icon' 'file:///home/myUser/myIcon.png'
Run Code Online (Sandbox Code Playgroud)