From a2290513a470dc3e844df3bd3d4c18a4ae4a92c2 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@arch-desktop" Date: Fri, 10 Apr 2020 18:39:01 +0200 Subject: [PATCH] Add sddm --- installation_scripts/{i3_update.sh => i3.sh} | 29 ++++++++------ installation_scripts/sddm.sh | 40 +++++++++++++++++++ .../{vim_update.sh => vim.sh} | 0 main_install.sh | 17 +++++++- 4 files changed, 71 insertions(+), 15 deletions(-) rename installation_scripts/{i3_update.sh => i3.sh} (70%) create mode 100644 installation_scripts/sddm.sh rename installation_scripts/{vim_update.sh => vim.sh} (100%) diff --git a/installation_scripts/i3_update.sh b/installation_scripts/i3.sh similarity index 70% rename from installation_scripts/i3_update.sh rename to installation_scripts/i3.sh index 4a018b9..a8e1397 100644 --- a/installation_scripts/i3_update.sh +++ b/installation_scripts/i3.sh @@ -6,6 +6,10 @@ if [ -z "$BASE_DIR" ]; then echo "BASE_DIR wasn't set." exit 1 fi +if [ -z "$GITHUB_DOTFILES" ]; then + echo "GITHUB_DOTFILES wasn't set." + exit 1 +fi # Install required packages {{{ @@ -28,22 +32,21 @@ fi # Add clones from GitHub {{{ -github_dotfiles=~/github_dotfiles +mkdir -p "$GITHUB_DOTFILES" -mkdir -p ~/github_dotfiles -if [ -e "$github_dotfiles"/i3-starterpack ]; then +if [ -e "$GITHUB_DOTFILES"/i3-starterpack ]; then if [ "$UPDATE" = 'true' ]; then - cd "$github_dotfiles"/i3-starterpack && git pull + cd "$GITHUB_DOTFILES"/i3-starterpack && git pull fi else - cd "$github_dotfiles" && git clone https://github.com/addy-dclxvi/i3-starterpack.git + cd "$GITHUB_DOTFILES" && git clone https://github.com/addy-dclxvi/i3-starterpack.git fi -if [ -e "$github_dotfiles"/i3blocks-contrib ]; then +if [ -e "$GITHUB_DOTFILES"/i3blocks-contrib ]; then if [ "$UPDATE" = 'true' ]; then - cd "$github_dotfiles"/i3blocks-contrib && git pull + cd "$GITHUB_DOTFILES"/i3blocks-contrib && git pull fi else - cd "$github_dotfiles" && git clone https://github.com/vivien/i3blocks-contrib.git + cd "$GITHUB_DOTFILES" && git clone https://github.com/vivien/i3blocks-contrib.git fi # }}} @@ -52,10 +55,10 @@ fi echo "Adding .Xresources and .xsettingsd" if [ ! -L ~/.Xresources ]; then - ln -rs "$github_dotfiles"/i3-starterpack/.Xresources ~/.Xresources 2> /dev/null + ln -rs "$GITHUB_DOTFILES"/i3-starterpack/.Xresources ~/.Xresources 2> /dev/null fi if [ ! -L ~/.xsettingsd ]; then - ln -rs "$github_dotfiles"/i3-starterpack/.xsettingsd ~/.xsettingsd 2> /dev/null + ln -rs "$GITHUB_DOTFILES"/i3-starterpack/.xsettingsd ~/.xsettingsd 2> /dev/null fi echo "Adding picom.config" @@ -67,7 +70,7 @@ fi echo "Adding feather.ttf" mkdir -p ~/.fonts/icomoon if [ ! -L ~/.fonts/icomoon/feather.ttf ]; then - ln -rs "$github_dotfiles"/i3-starterpack/.fonts/icomoon/feather.ttf ~/.fonts/icomoon/feather.ttf 2> /dev/null + ln -rs "$GITHUB_DOTFILES"/i3-starterpack/.fonts/icomoon/feather.ttf ~/.fonts/icomoon/feather.ttf 2> /dev/null fi # }}} @@ -100,10 +103,10 @@ if [ ! -L ~/.config/i3blocks/config ]; then ln -rs "$BASE_DIR"/dotfiles/i3/i3blocks_config ~/.config/i3blocks/config 2> /dev/null fi if [ ! -L ~/.config/i3blocks/scripts/arch-update ]; then - ln -rs ~/github_dotfiles/i3blocks-contrib/arch-update/arch-update ~/.config/i3blocks/scripts/arch-update 2> /dev/null + ln -rs "$GITHUB_DOTFILES"/i3blocks-contrib/arch-update/arch-update ~/.config/i3blocks/scripts/arch-update 2> /dev/null fi if [ ! -L ~/.config/i3blocks/scripts/rofi-calendar ]; then - ln -rs ~/github_dotfiles/i3blocks-contrib/rofi-calendar/rofi-calendar ~/.config/i3blocks/scripts/rofi-calendar 2> /dev/null + ln -rs "$GITHUB_DOTFILES"/i3blocks-contrib/rofi-calendar/rofi-calendar ~/.config/i3blocks/scripts/rofi-calendar 2> /dev/null fi # }}} diff --git a/installation_scripts/sddm.sh b/installation_scripts/sddm.sh new file mode 100644 index 0000000..5914061 --- /dev/null +++ b/installation_scripts/sddm.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +## This script takes care of the sddm configuration + +if [ -z "$BASE_DIR" ]; then + echo "BASE_DIR wasn't set." + exit 1 +fi +if [ -z "$GITHUB_DOTFILES" ]; then + echo "GITHUB_DOTFILES wasn't set." + exit 1 +fi + +# Install required packages {{{ + +if [ "$OS" = 'arch' ]; then + sudo pacman -S --needed sddm +elif [ "$OS" = 'debian' ]; then + sudo apt install sddm +else + echo "${RED}The OS wasn't defined. Quitting...${NC}" + exit 1 +fi + +# }}} + +# Add clones from GitHub {{{ + +mkdir -p "$GITHUB_DOTFILES" + +if [ -e "$GITHUB_DOTFILES"/delicious-sddm-theme ]; then + if [ "$UPDATE" = 'true' ]; then + cd "$GITHUB_DOTFILES"/delicious-sddm-theme && git pull + fi +else + cd "$GITHUB_DOTFILES" && git clone https://github.com/stuomas/delicious-sddm-theme.git && /bin/bash/ "$GITHUB_DOTFILES"/delicious-sddm-theme/install.sh +fi + +# }}} + diff --git a/installation_scripts/vim_update.sh b/installation_scripts/vim.sh similarity index 100% rename from installation_scripts/vim_update.sh rename to installation_scripts/vim.sh diff --git a/main_install.sh b/main_install.sh index d3c2c24..da6d3ed 100755 --- a/main_install.sh +++ b/main_install.sh @@ -20,6 +20,9 @@ export NC BASE_DIR="$PWD" export BASE_DIR +GITHUB_DOTFILES=~/github_dotfiles +export GITHUB_DOTFILES + separator() { exit_status=$? if [ $exit_status -eq 0 ]; then @@ -137,17 +140,27 @@ update_vim() { # {{{ # Update vim configuration echo "Setting up configuration for Vim..." - /bin/bash "$BASE_DIR"/installation_scripts/vim_update.sh + /bin/bash "$BASE_DIR"/installation_scripts/vim.sh separator } # }}} update_vim +setup_sddm() { # {{{ + # Update sddm + + echo "Setting up SDDM..." + /bin/bash "$BASE_DIR"/install_scripts/sddm.sh + separator + +} # }}} +setup_sddm + update_i3() { # {{{ # Update i3 configuration echo "Setting up i3..." - /bin/bash "$BASE_DIR"/installation_scripts/i3_update.sh + /bin/bash "$BASE_DIR"/installation_scripts/i3.sh separator } # }}}