Last active
June 29, 2018 12:40
-
-
Save alex2844/231a57937b042f0bdf362899e3a5ed70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
mount -o remount,rw / | |
cat <<EOT > /usr/local/bin/run | |
#!/usr/bin/env bash | |
rm -f /tmp/run | |
if [ "\$1" == "x" ]; then | |
sudo startunity -n bionic -X xorg | |
exit; | |
fi | |
if [ "\$1" == "t" ]; then | |
if [ ! -z "\$2" ]; then | |
sudo enter-chroot xiwi -T \$2 | |
else | |
sudo startunity -n bionic -X xiwi-tab | |
fi | |
exit; | |
fi | |
if [ ! -z "\$@" ]; then | |
sed -i "//tmp/run/d" /usr/local/chroots/bionic/home/*/.bashrc | |
echo 'if [ -e "/tmp/run" ]; then exec /tmp/run; else cd ~/Downloads; fi' >> /usr/local/chroots/bionic/home/*/.bashrc | |
echo "#!/bin/bash" >> /tmp/run | |
echo "pwd="\$(pwd) >> /tmp/run | |
echo 'cd \${pwd///home/chronos/user//home/*}' >> /tmp/run | |
echo \$@ >> /tmp/run | |
echo "logout" >> /tmp/run | |
chmod +x /tmp/run | |
fi | |
sudo enter-chroot | |
EOT | |
chmod +x /usr/local/bin/run | |
wget https://raw.githubusercontent.com/dnschneid/crouton/master/installer/crouton | |
if [ -e "/usr/local/chroots/bionic" ]; then | |
sudo sh crouton -u -n bionic | |
else | |
sudo sh crouton -r bionic -t xiwi,unity,xorg | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment