![禁用更改背景功能](https://linux22.com/image/1168421/%E7%A6%81%E7%94%A8%E6%9B%B4%E6%94%B9%E8%83%8C%E6%99%AF%E5%8A%9F%E8%83%BD.png)
如何在 Ubuntu 18.04 的终端上禁用“更改背景”功能?并始终设置一个标准背景?谢谢 :)
答案1
2020 年 4 月 11 日编辑
您可能对该脚本感兴趣https://github.com/PRATAP-KUMAR/backgrounds_lock
如果你想锁定背景图片
警告:以下脚本文件不提供任何保证..请先理解它..然后自行继续..
创建一个名为lbg.sh
“Lock Back Ground”的脚本,内容如下
#!/bin/bash
keys=/etc/dconf/db/local.d/00-bg
locks=/etc/dconf/db/local.d/locks/background
touch /etc/dconf/profile/user
echo "user-db:user" >> /etc/dconf/profile/user
echo "system-db:local" >> /etc/dconf/profile/user
mkdir -p /etc/dconf/db/local.d
touch $keys
echo "[org/gnome/desktop/background]" >> $keys
echo "picture-uri='file:///usr/share/backgrounds/Halifax_Sunset_by_Vlad_Drobinin.jpg'" >> $keys
echo "picture-options='zoom'" >> $keys
echo "primary-color='#456789'" >> $keys
echo "secondary-color='#FFFFFF'" >> $keys
mkdir -p /etc/dconf/db/local.d/locks
touch $locks
echo "/org/gnome/desktop/background/picture-uri" >> $locks
echo "/org/gnome/desktop/background/picture-options" >> $locks
echo "/org/gnome/desktop/background/primary-color" >> $locks
echo "/org/gnome/desktop/background/secondary-color" >> $locks
dconf update
其他脚本简称rbg.sh
为“Release Back Ground”,内容如下
#!/bin/bash
rm -r /etc/dconf/profile/user /etc/dconf/db/local.d
dconf update
要锁定桌面背景,请运行脚本sudo
。
如果您已将lbg.sh
脚本保存在主文件夹中,请运行
sudo /bin/bash /home/<user>/lbg.sh
这将锁定上面脚本中给出的 picture-uri 值
然后注销并重新登录
为了使一切正常,rbg.sh
例如运行第二个脚本
sudo /bin/bash /home/<user>/rbg.sh
然后注销并重新登录
来源:https://help.gnome.org/admin/system-admin-guide/stable/desktop-background.html.en