GNOME/文件
文件是GNOME的默认文件管理器。文件的目的是提供一种管理文件和应用的简化方法。
安装[编辑 | 编辑源代码]
安装nautilus包软件包,此软件包是gnome包组组的一部分。见File manager functionality#附加功能[损坏的链接:无效的章节]。
扩展[编辑 | 编辑源代码]
一些程序可以为文件增加额外的功能,例如下面这些来自官方软件仓库和AUR的软件包。
- File Manager Actions — Configures programs to be launched when files are selected in Nautilus (written in C)
- Folder Color — A file browser extension for choosing the color of a folder (written in Python)
- https://foldercolor.tuxfamily.org/ || folder-color-nautilusAUR
- 提示:This extension works only with these icon-themes which contain additional colored icons, eg:
numix-icon-theme-gitAUR, vibrancy-colorsAUR, humanity-icon-themeAUR, mint-x-iconsAUR
- Nautilus Admin — Add to menu: "Open as administrator" or "Edit as administrator" (written in Python)
- Nautilus Annotations — Annotate files and directories (written in C)
- Nautilus Bluetooth — Add to menu: "Send via Bluetooth" (written in C)
- Nautilus Git — Nautilus/Nemo extension to add important information about the current git directory (written in Python)
- Nautilus Hide — Add to menu: "Hide"/"Unhide" (written in C)
- Nautilus Launch — Nautilus extension to run executables and launchers via right-click menu (written in C)
- Nautilus Metadata Editor — Nautilus extension with simple Metadata Editor for the following mime types:
audio/x-mp3
,audio/x-flac
,audio/x-vorbis+ogg
,audio/x-speex+ogg
,audio/x-musepack
,audio/x-wavpack
,audio/x-tta
,audio/x-aiff
,audio/m4a
,video/mp4
,video/x-ms-asf
(written in C and Vala)
- Nautilus SendTo — Files context menu for sending files (written in C)
- Nautilus Share — Nautilus extension to share folder using Samba (written in C)
- Nautilus Wipe — Nautilus extension to provide wiping integration (written in C)
- Seahorse Nautilus — PGP encryption and signing for Files (written in C)
安装自己Nautilus扩展的应用程序[编辑 | 编辑源代码]
以下应用默认安装自己的扩展,从而将其功能集成于Nautilus。
- EasyTAG — EasyTAG is a simple application for viewing and editing tags in audio files; it supports MP3, MP2, MP4/AAC, FLAC, Ogg Opus, Ogg Speex, Ogg Vorbis, MusePack, Monkey's Audio, and WavPack files and works under Linux or Windows — The application includes a "Nautilus EasyTAG" extension (written in C)
- Brasero — CD/DVD mastering tool — The application includes a "Nautilus Brasero" extension (written in C)
- Eiciel — GNOME file ACL editor — The application includes an "Eiciel Nautilus" extension that add graphical ACL editor into the file properties window (written in C++)
- Evince — Document viewer (PDF, PostScript, XPS, djvu, dvi, tiff, cbr, cbz, cb7, cbt) — The application includes an "Evince Properties Page" extension for Nautilus (written in C)
- File Roller — An application for browsing archives — The application includes a "Nautilus FileRoller" extension (written in C)
- GNOME Terminal — The GNOME Terminal Emulator — The application includes a "Terminal Nautilus" extension (written in C)
- Tilix — A tiling terminal emulator for GNU/Linux using GTK+ 3 — The application includes an extension for Nautilus which adds an "Open in Tilix" option to the context menu (written in Python)
- https://github.com/gnunn1/tilix || tilix包
- 注意: "Open in Tilix"扩展将python-nautilus包软件包标记为可选依赖,但必须安装才能使用。
依赖非自由软件的扩展[编辑 | 编辑源代码]
一些GNOME 文件的扩展虽然免费/自由,但可能依赖于非自由软件,例如:
- Code Nautilus — 用来在Visual Studio Code中打开文件和目录的Nautilus扩展(用Python编写)
- JetBrains Nautilus — Nautilus extension to open files and directories in JetBrains Toolbox installed products (written in Python)
配置[编辑 | 编辑源代码]
文件很容易进行图形化配置,但并非所有选项都能在首选项中找到。更多选项可以使用dconf-editor在org.gnome.nautilus
中找到。
/usr/lib/gsd-xsettings
正在运行,否则dconf设置不会在文件中应用。桌面图标[编辑 | 编辑源代码]
见GNOME#Icons on the desktop[损坏的链接:无效的章节]。
改变默认项目视图[编辑 | 编辑源代码]
设置default-folder-viewer
变量可以改变项目的默认视图,如设为列表视图:
$ gsettings set org.gnome.nautilus.preferences default-folder-viewer 'list-view'
按类型排序[编辑 | 编辑源代码]
若要默认用类型排序所有文件夹中的文件:
$ gsettings set org.gnome.nautilus.preferences default-sort-order 'type'
从侧边栏移除文件夹[编辑 | 编辑源代码]
~/.config/user-dirs.dirs
中指定了侧边栏显示的文件夹,可以用文本编辑器修改。执行xdg-user-dirs-update
会改变文件,因此最好将文件权限设为只读。
始终显示文本文件路径[编辑 | 编辑源代码]
文件工具栏默认显示用于路径导航的按钮栏界面。若要用键盘输入路径,则需按Ctrl+l
显示文本路径栏。
若要始终以文本路径栏显示,可以使用以下gsettings命令:
$ gsettings set org.gnome.nautilus.preferences always-use-location-entry true
提示与技巧[编辑 | 编辑源代码]
缩略图[编辑 | 编辑源代码]
见File manager functionality#缩略图预览[损坏的链接:无效的章节]。
~/.cache/thumbnails/fail/
目录中),这是由于非特权用户的命名空间因为安全原因在该内核上默认禁用。Nautilus使用bwrap
(由bubblewrap包提供)对缩略图进行沙盒处理。可以用bubblewrap-suid包替换bubblewrap包。详见Security#Sandboxing applications。有时会无法显示视频缩略图。若要解决此问题(正如No video thumbnails on nautilus),必须安装ffmpegthumbnailer包、gst-libav包、gst-plugins-ugly包并移除~/.cache/thumbnails/fail/
里的内容。
用右键菜单创建新文档[编辑 | 编辑源代码]
若要使用此选项,请在您的主文件夹中创建一个~/Templates/
(模板)文件夹,并通过终端touch ~/Templates/new
或任何文件管理器在该文件夹中放置一个空文件,然后重新启动文件。
在非英语系统中,模板目录的名称可能不同。可以用xdg-user-dir TEMPLATES
找到实际目录。
可以在~/.config/user-dirs.dirs
文件中配置模板目录。
XDG_TEMPLATES_DIR="$HOME/some/path"
隐藏文件[编辑 | 编辑源代码]
GNOME文件和大部分文件管理器一样,默认隐藏名称以“.”开头的文件。
GNOME Files additionally hides files when their names are listed in a .hidden
file in the same directory (one filename per line). See nautilus-hideAUR for an extension that facilitates adding/removing entries from such .hidden
files.
在Tilix中打开当前路径[编辑 | 编辑源代码]
If you are using tilix包 terminal you can easily add "Open in Tilix" option to the context menu of GNOME Files by installing its optional dependency python-nautilus包.
将文件夹加入书签[编辑 | 编辑源代码]
若要将文件夹添加到你的书签中,只需在Nautilus中打开该文件夹,并按Ctrl+d
。请注意,书签列表与其它基于GNOME的图形化文件管理器(如Nemo)共享,因此在其中增减的文件夹也会影响到其它文件管理器中的书签。
自定义脚本[编辑 | 编辑源代码]
位于~/.local/share/nautilus/scripts
的脚本可以运行于文件的右键关联菜单。
The context menu can also be organized into subfolders, e.g. ~/.local/share/nautilus/scripts/images
and ~/.local/share/nautilus/scripts/music
.
Scripts have access to the following environment variables:
NAUTILUS_SCRIPT_SELECTED_FILE_PATHS NAUTILUS_SCRIPT_SELECTED_URIS NAUTILUS_SCRIPT_CURRENT_URI NAUTILUS_SCRIPT_WINDOW_GEOMETRY
一些脚本示例:
~/.local/share/nautilus/scripts/open-terminal-here
#!/bin/sh gnome-terminal
~/.local/share/nautilus/scripts/remove-extension
#!/bin/sh echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | while read -r filename; do mv -n "$filename" "${filename%.*}" done
nautilus -q
for them to show up.Keybinds[编辑 | 编辑源代码]
Keybinds to execute scripts can be assigned in the ~/.config/nautilus/scripts-accels
file:
; Example Keybinds ; Modifiers: <Control> <Alt> <Shift> F4 open-terminal-here <Alt>x remove-extension
疑难解答[编辑 | 编辑源代码]
文件已不再是默认文件管理器[编辑 | 编辑源代码]
这可能是因为重置了路径的文件关联,安装anjutaAUR往往会造成这种情况。
若要解决此问题,打开文件,右键点击一个文件夹,然后选择使用其它程序打开 > 文件 > 选择,就会把路径的关联设回文件。
若没有解决此问题,见File manager functionality#目录未在文件管理器中打开[损坏的链接:无效的章节]。
每次复制操作后都会卡几秒[编辑 | 编辑源代码]
如果系统中安装了kdeconnect包,问题可能来自其文件共享模块,停用文件共享即可。
打不开Google Drive[编辑 | 编辑源代码]
可能是因为没有全部安装以下软件包:
全部安装即可。