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[編輯 | 編輯原始碼]
可能是因為沒有全部安裝以下軟件包:
全部安裝即可。