Skip to content

Instantly share code, notes, and snippets.

@EricZhang456
Last active July 3, 2022 02:47
Show Gist options
  • Save EricZhang456/020c33c3f579e603ea13e5ba8be50b14 to your computer and use it in GitHub Desktop.
Save EricZhang456/020c33c3f579e603ea13e5ba8be50b14 to your computer and use it in GitHub Desktop.
A quick and dirty script for installing CDE on Debian.
#!/bin/bash
if [ "$(id -u)" == "0" ]; then
echo "Do not run this script as root. You will be asked for your password when needed." 1>&2
exit 1
fi
if ! command -v sudo &> /dev/null
then
echo "Please install and configure sudo."
exit 1
fi
if ! command -v dialog &> /dev/null
then
sudo apt install dialog
fi
dialog --title "Welcome" --backtitle "CDE Installation Script" --msgbox "Welcome to CDE Installation Script for Debian! Please note that this is not an offical script. This installation script will now install required libraries." 6 100
sudo apt install xorg autoconf automake libtool git build-essential libpam-dev libutempter-dev libxt-dev libxmu-dev libxft-dev libxinerama-dev libxpm-dev libxm4 libmotif-dev libxaw7-dev libx11-dev libxss-dev libtirpc-dev x11-xserver-utils libjpeg62-turbo-dev libfreetype6-dev libssl-dev tcl-dev ksh m4 ncompress patch xfonts-100dpi xfonts-100dpi-transcoded rpcbind bison xbitmaps x11proto-fonts-dev psmisc flex
dialog --title "Locale Configuration" --backtitle "CDE Installation Script" --yesno "Do you want to generate addational locale support?" 5 60
response=$?
case $response in
0) echo -e "de_DE ISO-8859-1\nes_ES ISO-8859-1\nfr_FR ISO-8859-1\nit_IT ISO-8859-1\nde_DE.UTF-8 UTF-8\nes_ES.UTF-8 UTF-8\nfr_FR.UTF-8 UTF-8\nit_IT.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen && sudo locale-gen;;
1) echo "locale not modified.";;
255) exit;;
esac
dialog --title "Installation" --backtitle "CDE Installation Script" --msgbox "Now building and installing CDE, this will take a long time." 5 65
cd /tmp
git clone https://git.code.sf.net/p/cdesktopenv/code cdesktopenv-code
cd cdesktopenv-code/cde
./autogen.sh
./configure
make
sudo make install
dialog --title "Display Manager Configuration" --backtitle "CDE Installation Script" --yesno "Do you want to be able to start CDE with the display manager you are currently using? (e.g. LightDM, GDM, etc)" 6 70
response1=$?
case $response1 in
0) sudo cp /tmp/cdesktopenv-code/cde/contrib/desktopentry/cde.desktop /usr/share/xsessions/;;
1) echo "Desktop file not copied.";;
255) exit;;
esac
dialog --title "dtlogin" --backtitle "CDE Installation Script" --yesno "Do you want to create a dtlogin service?" 6 70
response2=$?
case $response2 in
0) echo -e "[Unit]\nDescription=dtlogin\nRequires=rpcbind.service\nAfter=rpcbind.service\n\n[Service]\nExecStart=/usr/dt/bin/dtlogin\n\n[Install]\nAlias=display-manager.service" | sudo tee /etc/systemd/system/dtlogin.service;;
1) echo "dtlogin.service has not been created";;
255) exit;;
esac
dialog --title "Finish" --backtitle "CDE Installation Script" --msgbox "Installation has been finished!" 5 35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment