first working version, I think

This commit is contained in:
Solomon Laing 2021-08-28 21:17:59 +09:30
parent 5ceab93dd5
commit ad609ce24b
7 changed files with 85 additions and 30 deletions

View File

@ -14,13 +14,11 @@ This project is an effort to create a easy to use system to install a fresh vers
I want this to be able to be used on a fresh arch install with 0 dependencies, so, I will need to make sure that the user has set up internet, or that an existing connection exists.
I also need to make sure that all required programs are then sucessfully installed, and that some configs are written.
I also need to make sure that all required programs are then successfully installed, and that some configs are written.
> Ill need to do this for lightdm and lightdm webkit3 greeter currently.
> will also need to set shell, if they install my default programs, to fish.
remove rofi from xmonad.hs
review xmonad.sh for default programs / dependencies
@ -50,4 +48,4 @@ setup.sh will then...
6. install my scripts
1. copy inks-scrips to /usr/local/bin as it should be in path by default
7. install my config
1. warn user that if they didn't intstall default programs, they'll need to edit xmonad.hs
1. warn user that if they didn't install default programs, they'll need to edit xmonad.hs

View File

@ -22,7 +22,7 @@ pulseaudio
nfs-utils
network-manager-applet
wget
volumeicon
volctl
unzip
ttf-fira-code
trayer
@ -45,6 +45,7 @@ xdotool
xterm
flameshot
simple-mtpfs
micro
DEPENDENCIES_END
DEPENDENCIES_LAPTOP_START
@ -67,6 +68,8 @@ visual-studio-code-bin
DEFAULTS_END
MISC_START
lyx
kile
plexamp-appimage
mpv
kdeconnect

View File

@ -25,11 +25,5 @@ case $input in
;;
esac
default_loc=/tmp/sudo-password
if [ ! -f "$default_loc" ] ; then
get-sudo-password
fi
cd dmenu-inkletblot
cat $default_loc | sudo -S make clean install
sudo -S make clean install

View File

@ -2,10 +2,30 @@
default_programs="./default-programs"
dependencies=$(sed -n '/DEPENDENCIES_START/,/DEPENDENCIES_END/p' $default_programs | sed -e 's/DEPENDENCIES_START//' -e 's/DEPENDENCIES_END//')
laptop_dependencies=$(sed -n '/DEPENDENCIES_LAPTOP_START/,/DEPENDENCIES_LAPTOP_END/p' $default_programs | sed -e 's/DEPENDENCIES_LAPTOP_START//' -e 's/DEPENDENCIES_LAPTOP_END//')
laptop=0
# check user is happy to run this script
echo "This script is going to install all of the programs required for my scripts and dotfiles to function in a bisic manner. As such it will ask for root privilages."
echo "Dependencies:$dependencies"
echo ""
echo "If you are installing this on a laptop there are a couple of laptop specific dependencies that need to be installed as well..."
read -r -p "Would you like to install these? [y/N] " laptop_input
case $laptop_input in
[yY][eE][sS] | [yY])
echo "The extra dependencies will be installed..."
laptop=1
;;
[nN][oO] | [nN])
echo "Not installing extra dependencies..."
;;
*)
echo "Invalid input... Not installing extra dependencies..."
;;
esac
read -r -p "Are you sure you want to continue? [y/N] " input
case $input in
[yY][eE][sS] | [yY])
@ -40,6 +60,21 @@ do
fi
done
if [ $laptop -eq 1 ]; then
# run though each laptop dependency and install it if it's not already installed
for dependency in $laptop_dependencies
do
if ! yay -Qi $dependency &> /dev/null; then
echo "Installing $dependency and it's dependencies..."
yay -S --noconfirm $dependency &> /dev/null
fi
if ! yay -Qi $dependency &> /dev/null; then
failures+=("$dependency\n")
fi
done
fi
total_failures=$((${#failures[@]}))
if [ $total_failures -gt 0 ]; then

View File

@ -4,7 +4,7 @@ default_programs="./default-programs"
dependencies=$(sed -n '/MISC_START/,/MISC_END/p' $default_programs | sed -e 's/MISC_START//' -e 's/MISC_END//')
# check user is happy to run this script
echo "This script is going to install all of my default programs, e.g.: browser, rss reader, etc. As such it will ask for root privilages."
echo "This script is going to install all of my misc programs that I frequently use."
echo "Misc programs:$dependencies"
read -r -p "Are you sure you want to continue? [y/N] " input
case $input in

View File

@ -32,11 +32,11 @@ case $input in
esac
if ! command -v fakeroot &> /dev/null; then
cat $default_loc | sudo -S pacman -Sy --noconfirm base-devel
sudo -S pacman -Sy --noconfirm base-devel
fi
cd /opt
cat $default_loc | sudo -S git clone https://aur.archlinux.org/yay.git
cat $default_loc | sudo -S chown -R $USER:users ./yay
sudo -S git clone https://aur.archlinux.org/yay.git
sudo -S chown -R $USER:users ./yay
cd yay
makepkg -si

29
setup
View File

@ -85,11 +85,17 @@ function install_scripts {
exit 1
fi
cd $working_dir
git submodule init
git submodule update
./install-scripts
}
function install_dmenu {
if [ $? -eq 1 ]; then
exit 1
fi
cd $working_dir
./install-dmenu-inkletblot
}
# install my config
function install_config {
if [ $? -eq 1 ]; then
@ -110,6 +116,7 @@ echo " deps : Install the dependencies for my scripts and window manager"
echo " defaults : Install my chosen default programs"
echo " misc : Install my collection of misc - nice to have - programs"
echo " scripts : Install my scirpts"
echo " dmenu : Install my customisation of dmenu"
echo " config : Install my dotfiles to the system"
echo ""
echo "Note: it is expected that the initial run of this script lets each stage complete sucessfully."
@ -128,6 +135,7 @@ case $1 in
install_defaults
install_misc
install_scripts
install_dmenu
install_config
fi
;;
@ -141,6 +149,7 @@ case $1 in
install_defaults
install_misc
install_scripts
install_dmenu
install_config
fi
;;
@ -153,6 +162,7 @@ case $1 in
install_defaults
install_misc
install_scripts
install_dmenu
install_config
fi
;;
@ -164,6 +174,7 @@ case $1 in
install_defaults
install_misc
install_scripts
install_dmenu
install_config
fi
;;
@ -174,6 +185,7 @@ case $1 in
else
install_misc
install_scripts
install_dmenu
install_config
fi
;;
@ -182,6 +194,15 @@ case $1 in
install_scripts
else
install_scripts
install_dmenu
install_config
fi
;;
dmenu)
if [ "$2" = "only" ]; then
install_dmenu
else
install_dmenu
install_config
fi
;;
@ -199,4 +220,8 @@ case $1 in
;;
esac
if [ $? -eq 1 ]; then
exit 1
fi
exit 0