source: casper-and-ubiquity-hooks/trunk/fuentes/casper-customize-autologin/usr/share/initramfs-tools/scripts/casper-bottom/16_lliurex_autologin @ 791

Last change on this file since 791 was 791, checked in by kbut, 5 years ago

add hooks

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/sh
2
3PREREQ=""
4DESCRIPTION="Fixed autologin on livecds "
5
6prereqs()
7{
8    echo "$PREREQ"
9}
10
11case $1 in
12# get pre-requisites
13prereqs)
14       prereqs
15       exit 0
16       ;;
17esac
18
19. /scripts/casper-functions
20
21log_begin_msg "$DESCRIPTION"
22
23# Only in casper mode
24rc=0
25cat /proc/cmdline | grep -q "casper" ||rc=1
26if [ ${rc} -eq 0 ]; then
27
28        echo "[SeatDefaults]" > /root/usr/share/lightdm/lightdm.conf.d/90-autologin.conf
29        echo "autologin-user=ubuntu"  >> /root/usr/share/lightdm/lightdm.conf.d/90-autologin.conf
30        echo "autologin-user-timeout=0" >> /root/usr/share/lightdm/lightdm.conf.d/90-autologin.conf
31
32
33                rm -rf /root/usr/share/gconf/schemas/*
34                rm -f /root/usr/share/gconf/defaults/10_libgnome2-common
35                rm -f /root/usr/share/gconf/defaults/10_libgnome2vfs2-common
36                touch /root/root/casper.remove.schemas
37
38        if [ -x /root/usr/bin/xdg_translator ]; then
39                echo '#!/bin/sh' > /root/etc/lightdm/PreSession.d/ubiquity_fixer
40                echo 'CURRENT_DESKTOP_FOLDER=$(/usr/bin/xdg_translator "$LANG" "Desktop")' >> /root/etc/lightdm/PreSession.d/ubiquity_fixer
41                echo 'cp -f /usr/share/applications/ubiqu*.desktop /home/lliurex/$CURRENT_DESKTOP_FOLDER' >> /root/etc/lightdm/PreSession.d/ubiquity_fixer
42                echo 'chown lliurex:lliurex /home/lliurex/$CURRENT_DESKTOP_FOLDER/ubiqu*desktop' >> /root/etc/lightdm/PreSession.d/ubiquity_fixer
43                echo 'chmod +x /home/lliurex/$CURRENT_DESKTOP_FOLDER/ubiqu*desktop' >> /root/etc/lightdm/PreSession.d/ubiquity_fixer
44                echo 'exit 0' >> /root/etc/lightdm/PreSession.d/ubiquity_fixer
45                chmod +x /root/etc/lightdm/PreSession.d/ubiquity_fixer
46        fi
47
48else
49        echo " Disabled (not in casper)"
50fi
51
52
53log_end_msg
Note: See TracBrowser for help on using the repository browser.