18.04 = circular login problem on system freeze
Ralf Mardorf
silver.bullet at zoho.com
Fri Jul 20 02:30:28 UTC 2018
Sometimes I boot an Ubuntu flavour live media and run scripts to change
a few defaults. Since those scripts also run apt command that require
root privileges and because the user of Ubuntu flavour live media has
got the UID 1001 and the script is in a mounted home of a user with the
UID 1000 I run
sudo -i
first, then I launch the script.
A script could contain something like this:
[rocketmouse at archlinux ~]$ grep flavour= lumatic.sh
flavour="ubuntu-mate" # user name
[rocketmouse at archlinux ~]$ grep userset\( -A5 lumatic.sh
userset() # Usage: userset <schema> <key> <value>
{
HOME="/home/$flavour"
sudo -u $flavour gsettings set $@
HOME="/root"
}
[rocketmouse at archlinux ~]$ grep rootset\( -A3 lumatic.sh
rootset() # Usage: rootset <schema> <key> <value>
{
gsettings set $@
}
[rocketmouse at archlinux ~]$ grep pluma lumatic.sh
rootset org.mate.pluma color-scheme 'tango'
userset org.mate.pluma color-scheme 'tango'
[rocketmouse at archlinux ~]$ grep Marco lumatic.sh
userset org.mate.Marco.general reduced-resources $redures
userset org.mate.Marco.general side-by-side-tiling $sidetil
userset org.mate.Marco.general theme 'TraditionalOk'
userset org.mate.Marco.general focus-mode 'mouse'
userset org.mate.Marco.general button-layout ':minimize,maximize,close'
userset org.mate.Marco.general center-new-windows true
userset org.mate.Marco.general compositing-manager false
or it does contain something similar to this:
[rocketmouse at archlinux ~]$ grep u1000= tailsmatic-legacy2.sh
u1000=$(getent passwd 1000 | cut -d: -f1)
[rocketmouse at archlinux ~]$ grep prof_default= tailsmatic-legacy2.sh
prof_default=$(echo [:$(gsettings get org.gnome.Terminal.ProfilesList default | sed "s/'//g")])
[rocketmouse at archlinux ~]$ grep bell_tmp= tailsmatic-legacy2.sh
bell_tmp=/tmp/gnome-terminal-bell-$u1000-$(id -u)
[rocketmouse at archlinux ~]$ grep "dbus-launch dconf dump" -B1 -A9 tailsmatic-legacy2.sh
sudo -u $u1000 echo $prof_default > $bell_tmp
sudo -u $u1000 dbus-launch dconf dump /org/gnome/terminal/legacy/profiles:/ | grep -v audible-bell | grep -vF $prof_default >> $bell_tmp
case $1 in
--bell-off)
echo audible-bell=false >> $bell_tmp
;;
*)
echo audible-bell=true >> $bell_tmp
;;
esac
sudo -u $u1000 dbus-launch dconf load /org/gnome/terminal/legacy/profiles:/ < $bell_tmp
Regards,
Ralf
More information about the ubuntu-users
mailing list