Gur*_*rok 7 gnome icons 10.10 menu folder
我对 Ubuntu 很陌生,但我知道基础知识。
我阅读了“如何更改“位置”菜单中的文件夹图标?” 但这没有帮助,因为我想为单个目录指定它(目前),所以选择了选项 #2。
所以我该怎么做?
我将文件夹图像作为 SVG 在:
/usr/share/icons/hicolor/scalable/apps//usr/share/icons/hicolor/scalable/places/我要使用的图像:
我想要的地方:

小智 12
出现在位置菜单中的书签图标无法更改,请参阅:https : //bugs.launchpad.net/ubuntu/+source/nautilus/+bug/423890
但是,正如您所看到的,像 Videos 和 Pictures 这样的用户文件夹确实有不同的图标,这是因为 Places 菜单只查看 standard::icon: 属性,而自定义图标只会更改 metadata::custom-icon: 属性. 我发现无法更改 standard::icon: 属性。在“普通”文件夹中,此属性将始终相同。
我使用的解决方法是将用户文件夹(我不使用)的目录更改为必须更改图标的文件夹的目录,然后替换该用户文件夹的图标文件。
可以通过编辑文件 ~/.config/user-dirs.dirs 来更改用户文件夹的目录。您可以通过在终端窗口中键入以下行来打开它:
gedit .config/user-dirs.dirs
Run Code Online (Sandbox Code Playgroud)
或者通过导航到您的主文件夹按 Ctrl+H,搜索文件夹 .config 并从那里打开 user-dirs.dirs 文件。
该文件的输出将是这样的:
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_MUSIC_DIR="$HOME/Music"
XDG_VIDEOS_DIR="$HOME/Videos"
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PICTURES_DIR="$HOME/Pictures"
Run Code Online (Sandbox Code Playgroud)
注意:在开始编辑此文件之前,请使用 user-dirs.dirs.bak 之类的名称保存它进行备份
在此文件中,您可以更改用户文件夹的目录。例如,如果要将 Public 文件夹的目录更改为 Dropbox 文件夹的目录,请更改以下行:
XDG_PUBLICSHARE_DIR="$HOME/Public"
Run Code Online (Sandbox Code Playgroud)
到:
XDG_PUBLICSHARE_DIR="$HOME/Dropbox"
Run Code Online (Sandbox Code Playgroud)
(假设您的 Dropbox 文件夹位于您的主目录中)
完成此操作后,您会注意到您的 Dropbox 文件夹(如果您使用的是 Ambiance 主题)将如下所示:

通过将它拖到 nautilus 中的侧边栏将其添加为书签后,它将出现在您的位置菜单中,如下所示:

If this is not the case try refreshing your window by pressing Ctrl+R or F5, if its still not working at that point check the users-dirs.dirs file for any mistakes you could have made.
Although this is a very nice icon it's not the one you wanted to use. You have to replace the icons of the user folder with your own. The icons for the user folder public are named "folder-publicshare.svg" and can be found in:
/usr/share/icons/Humanity/places/16/
/usr/share/icons/Humanity/places/22/
/usr/share/icons/Humanity/places/24/
/usr/share/icons/Humanity/places/32/
/usr/share/icons/Humanity/places/48/
/usr/share/icons/Humanity/places/64/
Run Code Online (Sandbox Code Playgroud)
Because i was bored i made a bash script to make this easy for you
#!/bin/bash
i=0
for d in `ls -d $2*/`
do cp $1 $d$3
echo copying $1 to $d$3
let i++
done
echo "The file $3 was copied to a total of $i locations"
Run Code Online (Sandbox Code Playgroud)
You can copy this in a text editor like gedit and save it in your home folder with the name copy.sh or some other name which you like better. Once you have saved it you have to open a terminal window and type:
sudo chmod +x ./copy.sh
Run Code Online (Sandbox Code Playgroud)
This will make the file you just created executable, to replace the icons type:
sudo ./copy.sh /dir/to/icon.png /usr/share/icons/Humanity/places/ folder-publicshare.svg
Replace the first parameter /dir/to/icon.png with the location of your icon, the second parameter is the parent directory of the folders where the icons are stored, the third parameter is the name of the icons that need to be replaced (this parameter is optional if the script is used for a different purpose).
Using this script will also make a copy to the 128 folder where it isn't needed, it will do no harm there but if you want to delete it you can do this by typing the following line in a terminal window:
sudo rm /usr/share/icons/Humanity/places/128/folder-publicshare.svg
Run Code Online (Sandbox Code Playgroud)
After you logged out and and logged in again this will be the result (in Dutch):

As you can see there is another custom icon in my menu named School (it has my School logo on it), this one replaced the user folder Templates (guess no one really uses that folder). The icons for the user folder Templates are named folder-templates.svg and can be found at the same locations as the icons for the user folder public. While replacing these icons i didn't use the bash script that i posted above but i copied them manually because i made six different icons with different resolutions.
The downside on this approach is that you can only customize a total of seven icons and you have to hand in a standard user folder.
Note: Do not change the directory of your Desktop unless you know what you are doing.
I hope this has answered your question, it may look like a lot of work but its done in a minute.
| 归档时间: |
|
| 查看次数: |
3836 次 |
| 最近记录: |