本文介紹如何在Linux系統(tǒng)中自定義回收站路徑。我們將涵蓋GNOME、KDE Plasma桌面環(huán)境以及命令行方法。
GNOME桌面環(huán)境
-
安裝dconf-editor (如果未安裝): 使用終端執(zhí)行以下命令:
sudo apt install dconf-editor
-
打開dconf-editor: 在終端輸入:
dconf-editor
-
導(dǎo)航至回收站設(shè)置: 在dconf-editor中,找到org -> gnome -> desktop -> trash路徑。
-
修改回收站路徑: 找到location鍵,雙擊并輸入自定義路徑,例如:file:///path/to/your/custom/trash。
-
應(yīng)用更改: 關(guān)閉dconf-editor,更改即生效。
KDE Plasma桌面環(huán)境
-
打開系統(tǒng)設(shè)置: 通過開始菜單或右鍵點(diǎn)擊桌面選擇“系統(tǒng)設(shè)置”。
-
導(dǎo)航至垃圾箱設(shè)置: 找到“存儲(chǔ)” -> “垃圾箱”設(shè)置。
-
修改回收站路徑: 在“位置”選項(xiàng)中,輸入自定義路徑,例如:file:///path/to/your/custom/trash。
-
應(yīng)用更改: 點(diǎn)擊“應(yīng)用”或“確定”保存更改。
命令行方法
對于命令行用戶,可以通過編輯配置文件修改回收站路徑。
GNOME:
-
編輯配置文件: 使用nano編輯器打開配置文件:
nano ~/.config/dconf/user
-
添加或修改配置: 添加或修改以下內(nèi)容,將/path/to/your/custom/trash替換為你的自定義路徑:
[org/gnome/desktop/trash] location='file:///path/to/your/custom/trash'
-
保存并退出: 按Ctrl+X,然后Y確認(rèn)保存,最后Enter退出。
KDE Plasma:
-
編輯配置文件: 使用nano編輯器打開配置文件:
nano ~/.config/plasma-org.kde.trashrc
-
添加或修改配置: 添加或修改以下內(nèi)容,將/path/to/your/custom/trash替換為你的自定義路徑:
[Trash] Location=file:///path/to/your/custom/trash
-
保存并退出: 按Ctrl+X,然后Y確認(rèn)保存,最后Enter退出。
重要提示: 確保自定義路徑存在且具有正確的權(quán)限,以便系統(tǒng)能夠正確訪問和使用該路徑作為回收站。