|
#!/bin/bash |
|
|
|
# Per https://github.com/beagleboard/image-builder/blob/master/configs/bb.org-debian-jessie-lxqt-4gb-v4.4.conf |
|
# and https://github.com/beagleboard/image-builder/blob/master/target/chroot/beagleboard.org-jessie.sh |
|
|
|
rfs_username="debian" |
|
rfs_default_desktop="lxqt" |
|
rfs_desktop_background="/opt/scripts/images/beaglebg.jpg" |
|
|
|
setup_desktop () { |
|
if [ -d /etc/X11/ ] ; then |
|
wfile="/etc/X11/xorg.conf" |
|
echo "Patching: ${wfile}" |
|
echo "Section \"Monitor\"" > ${wfile} |
|
echo " Identifier \"Builtin Default Monitor\"" >> ${wfile} |
|
echo "EndSection" >> ${wfile} |
|
echo "" >> ${wfile} |
|
echo "Section \"Device\"" >> ${wfile} |
|
echo " Identifier \"Builtin Default fbdev Device 0\"" >> ${wfile} |
|
|
|
# echo " Driver \"modesetting\"" >> ${wfile} |
|
# echo " Option \"AccelMethod\" \"none\"" >> ${wfile} |
|
echo " Driver \"fbdev\"" >> ${wfile} |
|
|
|
echo "#HWcursor_false Option \"HWcursor\" \"false\"" >> ${wfile} |
|
|
|
echo "EndSection" >> ${wfile} |
|
echo "" >> ${wfile} |
|
echo "Section \"Screen\"" >> ${wfile} |
|
echo " Identifier \"Builtin Default fbdev Screen 0\"" >> ${wfile} |
|
echo " Device \"Builtin Default fbdev Device 0\"" >> ${wfile} |
|
echo " Monitor \"Builtin Default Monitor\"" >> ${wfile} |
|
echo " DefaultDepth 16" >> ${wfile} |
|
echo "EndSection" >> ${wfile} |
|
echo "" >> ${wfile} |
|
echo "Section \"ServerLayout\"" >> ${wfile} |
|
echo " Identifier \"Builtin Default Layout\"" >> ${wfile} |
|
echo " Screen \"Builtin Default fbdev Screen 0\"" >> ${wfile} |
|
echo "EndSection" >> ${wfile} |
|
fi |
|
|
|
wfile="/etc/lightdm/lightdm.conf" |
|
if [ -f ${wfile} ] ; then |
|
echo "Patching: ${wfile}" |
|
sed -i -e 's:#autologin-user=:autologin-user='$rfs_username':g' ${wfile} |
|
sed -i -e 's:#autologin-session=UNIMPLEMENTED:autologin-session='$rfs_default_desktop':g' ${wfile} |
|
if [ -f /opt/scripts/3rdparty/xinput_calibrator_pointercal.sh ] ; then |
|
sed -i -e 's:#display-setup-script=:display-setup-script=/opt/scripts/3rdparty/xinput_calibrator_pointercal.sh:g' ${wfile} |
|
fi |
|
fi |
|
|
|
if [ ! "x${rfs_desktop_background}" = "x" ] ; then |
|
mkdir -p /home/${rfs_username}/.config/ || true |
|
if [ -d /opt/scripts/desktop-defaults/jessie/lxqt/ ] ; then |
|
cp -rv /opt/scripts/desktop-defaults/jessie/lxqt/* /home/${rfs_username}/.config |
|
fi |
|
chown -R ${rfs_username}:${rfs_username} /home/${rfs_username}/.config/ |
|
fi |
|
|
|
#Disable dpms mode and screen blanking |
|
#Better fix for missing cursor |
|
wfile="/home/${rfs_username}/.xsessionrc" |
|
echo "#!/bin/sh" > ${wfile} |
|
echo "" >> ${wfile} |
|
echo "xset -dpms" >> ${wfile} |
|
echo "xset s off" >> ${wfile} |
|
echo "xsetroot -cursor_name left_ptr" >> ${wfile} |
|
chown -R ${rfs_username}:${rfs_username} ${wfile} |
|
|
|
# #Disable LXDE's screensaver on autostart |
|
# if [ -f /etc/xdg/lxsession/LXDE/autostart ] ; then |
|
# sed -i '/xscreensaver/s/^/#/' /etc/xdg/lxsession/LXDE/autostart |
|
# fi |
|
|
|
#echo "CAPE=cape-bone-proto" >> /etc/default/capemgr |
|
|
|
# #root password is blank, so remove useless application as it requires a password. |
|
# if [ -f /usr/share/applications/gksu.desktop ] ; then |
|
# rm -f /usr/share/applications/gksu.desktop || true |
|
# fi |
|
|
|
# #lxterminal doesnt reference .profile by default, so call via loginshell and start bash |
|
# if [ -f /usr/bin/lxterminal ] ; then |
|
# if [ -f /usr/share/applications/lxterminal.desktop ] ; then |
|
# sed -i -e 's:Exec=lxterminal:Exec=lxterminal -l -e bash:g' /usr/share/applications/lxterminal.desktop |
|
# sed -i -e 's:TryExec=lxterminal -l -e bash:TryExec=lxterminal:g' /usr/share/applications/lxterminal.desktop |
|
# fi |
|
# fi |
|
|
|
} |
|
|
|
setup_desktop |
Thanks a lot! You rock!