有没有办法将 nautilus 缩略图保存在 NAS 上而不是 ~/.cache/thumbnails 上?
我有多个设备访问 NAS,生成缩略图总是需要很长时间。我正在考虑使用类似 Windows 中的 Thumbs.db 的解决方案。
答案1
警告我有不是在实际生活中尝试过此方法,这可能会使使用缩略图的应用程序感到困惑。请man
在执行命令前了解命令,并使其适应您的环境。
这是一个命令行解决方案,可在终端中运行。
# Ensure no process has any thumbnails open
sudo lsof +D $HOME/.cache/thumbnails
# If there are any processes listed, either exit them, or
# Terminate them with SIGKILL
sudo lsof -t +D $HOME/.cache/thumbnails | xargs --no-run-if-empty sudo kill -9
# Create a directory on the NAS, owned by me, readable by Group and Other
sudo mkdir --parents --mode=0755 /NAS/thumbnails
sudo chown $(id -u):$(id -g) /NAS/thumbnails/
sudo chmod 755 /NAS/thumbnails
# Populate the NAS
cp -r -v $HOME/.cache/thumbnails/* /NAS/thumbnails
# Hide $HOME/.cache/thumbnails, but keep a copy in case this doesn't work
mv $HOME/.cache/thumbnails $HOME/.cache/Local_thumbnails
# Now, create a symbolic link (man ln) as $HOME/.cache/thumbnails that points to /NAS/thumbnails
ln --symbolic /NAS/thumbnails $HOME/.cache/thumbnails
ls -ld $HOME/.cache/thumbnails
ls -lR $HOME/.cache/thumbnails
#
#
# **If it fails**
# If your GUI app doesn't work with symbolic links, undo this by
# Ensure no process has any thumbnails open
sudo lsof +D $HOME/.cache/thumbnails
# If there are any processes listed, either exit them, or
# Terminate them with SIGKILL
sudo lsof -t +D $HOME/.cache/thumbnails | xargs --no-run-if-empty sudo kill -9
# delete the link
rm $HOME/.cache/thumbnails
# put the old way back
mv $HOME/.cache/Local_thumbnails $HOME/.cache/thumbnails
# clean up the NAS
sudo rm -rf /NAS/thumbnails
使用风险自负。