在我的计算机中,我有我的帐户 (cyrex) 和来宾会话。如果我的用户 cyrex 将其文件存储/home/cyrex在来宾会话存储其文件的位置?例如,如果我想以某种方式设置来宾,以便它在加载时具有特定的墙纸、启动器图标大小和我想要使用的任何其他自定义设置。
在 中/tmp/guest-[xxxxxx],其中 x 是一串字母和数字。该文件夹包含用户的所有普通主文件夹。
来宾帐户由lightdmthrough管理/usr/sbin/guest-account,它是一个 shell 脚本。设置访客帐户后,脚本将运行首选项脚本(如果存在):/etc/guest-session/prefs.sh
可以在CustomizeGuestSession 中找到一组方便的脚本,使这个过程更容易,以及如何使用它们的一些说明。
您可以更改的基本设置是:
Firefox preference settings
Disabling the login-sound
gettexted strings
Set a Folder for storing files permanently
Show an Info dialog at startup
Set an Icon on the desktop
Set the guest account language and keyboard
Run Code Online (Sandbox Code Playgroud)
我还没有测试过所有东西,但在使用它几次之后,事情似乎运行良好,而且似乎很容易修改。我认为更改语言最有可能出现错误,但我将访客语言设置为中文,效果很好。
需要添加一些东西,例如更改背景。
有两个主要文件prefs.sh,以 root 身份运行,然后在完成时调用auto.sh以访客用户身份运行的 。
可以根据需要将功能添加到任一文件中。要更改墙纸,我将以下行添加到auto.sh.
gsettings set org.gnome.desktop.background picture-uri "file:///usr/share/backgrounds/Leftover_by_Sagar_jain.jpg"
Run Code Online (Sandbox Code Playgroud)
启动器图标大小有点棘手,因为它是一个可重定位的架构,DConf 编辑器说它没有架构,但命令是:
gesettings set org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ icon-size 32
Run Code Online (Sandbox Code Playgroud)
感谢 @dobey 对使用可重定位模式的解释。
原始脚本由 Gunnar Hjalmarsson 发布在 Ubuntu 论坛上。