From 374ed17b4046e903592a72835d7fde9fdd5667ad Mon Sep 17 00:00:00 2001 From: kerem yollu Date: Tue, 10 Jan 2023 15:38:07 +0100 Subject: [PATCH] nerly finl version for arch is tested --- setup/config.sh | 16 +++--- setup/dotfiles/xmobar/ip.sh | 14 ----- setup/dotfiles/xmobar/ip_arch.sh | 6 ++ setup/dotfiles/xmobar/ip_debian.sh | 5 ++ setup/programs/alacritty/alacritty | 1 + setup/programs/alacritty/alacritty.sh | 3 +- setup/programs/fish/fish.sh | 21 +++++++ setup/programs/os/os_install.sh | 2 + setup/programs/sddm/sddm.sh | 10 +++- setup/programs/xmonad/xmonad.sh | 79 +++++++++++++++++++++++++-- setup/test.sh | 3 +- 11 files changed, 130 insertions(+), 30 deletions(-) delete mode 100755 setup/dotfiles/xmobar/ip.sh create mode 100755 setup/dotfiles/xmobar/ip_arch.sh create mode 100755 setup/dotfiles/xmobar/ip_debian.sh create mode 160000 setup/programs/alacritty/alacritty create mode 100755 setup/programs/fish/fish.sh diff --git a/setup/config.sh b/setup/config.sh index 179e0d1..80f7b66 100755 --- a/setup/config.sh +++ b/setup/config.sh @@ -8,6 +8,9 @@ source $MAIN_DIR/programs/alacritty/alacritty.sh source $MAIN_DIR/programs/wallpaper/wallpaper.sh source $MAIN_DIR/programs/picom/picom.sh source $MAIN_DIR/programs/obsidian/obsidian.sh +source $MAIN_DIR/programs/xmonad/xmonad.sh +source $MAIN_DIR/programs/sddm/sddm.sh +source $MAIN_DIR/programs/fish/fish.sh DOTFILE_DIR=$MAIN_DIR/dotfiles @@ -23,11 +26,11 @@ sleepTime=0.2 # Declaration of OS and their package managers os_list=(debian arch raspberry) -pckgmngr_list=('sudo apt -y install' 'sudo pacman -S' 'sudo apt -y install') +pckgmngr_list=('sudo apt -y install' 'sudo pacman -S' 'raspi install') # Declaration of common packages and their config files forr al linux distros # These pacakges must be found in the standart repositories -common_programs_list=(htop tmux git fish mc wget sudo unzip cmake make gcc exa scrot) +common_programs_list=(htop tmux git fish mc wget sudo unzip cmake make gcc exa scrot acpi) common_dotfile_list=(fish) @@ -40,8 +43,7 @@ default_installs_raspberry=(chromium) # Declaration of customized installations for different OS # Their instalation methodes can differ depending of the distribution # These pacakges must not be found in the standart repositories and can be gits or direct installs -custom_installs_debian=(dmenu fonts alacritty wallpaper picom obsidian) -custom_installs_arch=(dmenu fonts alacritty wallpaper picom obsidian) -custom_installs_raspberry=(dmenu fonts alacritty wallpaper picom) - - +custom_installs_debian=(fish dmenu fonts alacritty wallpaper picom obsidian xmonad sddm) +#custom_installs_arch=(fish dmenu fonts wallpaper picom obsidian xmonad sddm) +custom_installs_arch=(sddm) +custom_installs_raspberry=(fish dmenu fonts alacritty wallpaper picom xmonad sddm) diff --git a/setup/dotfiles/xmobar/ip.sh b/setup/dotfiles/xmobar/ip.sh deleted file mode 100755 index ddf0d85..0000000 --- a/setup/dotfiles/xmobar/ip.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -system=$(cat /etc/os-release | sed -n 3p) - -if [[ $system == *"arch"* ]] - then - ip=$(ip -json route get 8.8.8.8 | jq -r '.[].prefsrc') -elif [[ $system == *"debian"* ]] - then - ip=$(hostname -I | awk '{print $1}') -fi - -echo $ip - diff --git a/setup/dotfiles/xmobar/ip_arch.sh b/setup/dotfiles/xmobar/ip_arch.sh new file mode 100755 index 0000000..5518548 --- /dev/null +++ b/setup/dotfiles/xmobar/ip_arch.sh @@ -0,0 +1,6 @@ +#!/bin/bash + + +ip=$(ip -json route get 8.8.8.8 | jq -r '.[].prefsrc') +echo $ip + diff --git a/setup/dotfiles/xmobar/ip_debian.sh b/setup/dotfiles/xmobar/ip_debian.sh new file mode 100755 index 0000000..73b8757 --- /dev/null +++ b/setup/dotfiles/xmobar/ip_debian.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +ip=$(hostname -I | awk '{print $1}') +echo $ip + diff --git a/setup/programs/alacritty/alacritty b/setup/programs/alacritty/alacritty new file mode 160000 index 0000000..bcd6d0d --- /dev/null +++ b/setup/programs/alacritty/alacritty @@ -0,0 +1 @@ +Subproject commit bcd6d0d981fd192f21a2f5142f421f4aa1de1648 diff --git a/setup/programs/alacritty/alacritty.sh b/setup/programs/alacritty/alacritty.sh index ed3b7e7..0a3fef6 100755 --- a/setup/programs/alacritty/alacritty.sh +++ b/setup/programs/alacritty/alacritty.sh @@ -2,7 +2,7 @@ ALACRITTY_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) alacritty_req_list_debian=(cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev libxkbcommon-dev) -alacritty_req_list_arch=(cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev libxkbcommon-dev) +alacritty_req_list_arch=(cmake pkg-config) alacritty_req_list_raspberry=(cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev libxkbcommon-dev) alacritty_source="https://github.com/alacritty/alacritty.git" @@ -38,6 +38,7 @@ alacritty_install_core() git clone $alacritty_source cd alacritty/ + echo "Build Flags : --release -j$CPU_CORE_COUNT" cargo build --release -j$CPU_CORE_COUNT sudo cp target/release/alacritty /usr/local/bin sudo cp extra/logo/alacritty-term.svg /usr/share/pixmaps/Alacritty.svg diff --git a/setup/programs/fish/fish.sh b/setup/programs/fish/fish.sh new file mode 100755 index 0000000..69007e0 --- /dev/null +++ b/setup/programs/fish/fish.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +install_fish() +{ + graphics_install_prompt "Fish Will be installed" + install_prog "fish" + + + graphics_comment "Copying Fish Config files" + if [[ -f "$USER_DOTFILE_DIR/fish/config.fish" ]] + then + graphics_comment "config.fish is found a a backup will be made as fish.config.bak" + mv $USER_DOTFILE_DIR/fish/config.fish $USER_DOTFILE_DIR/fish/fish.config.bak + fi + + echo "$DOTFILE_DIR/fish/config.fish $USER_DOTFILE_DIR/fish/fish.config" + cp $DOTFILE_DIR/fish/config.fish $USER_DOTFILE_DIR/fish/fish.config + + graphics_install_prompt "Fish Is installed" +} + diff --git a/setup/programs/os/os_install.sh b/setup/programs/os/os_install.sh index e41ac8c..624d7c1 100755 --- a/setup/programs/os/os_install.sh +++ b/setup/programs/os/os_install.sh @@ -12,6 +12,8 @@ install_prog() echo " |--> Will Be Installed" echo "" color_stop + + echo "${pckgmngr_list[$OS_NO]} $1" ${pckgmngr_list[$OS_NO]} $1 } diff --git a/setup/programs/sddm/sddm.sh b/setup/programs/sddm/sddm.sh index 782ce19..8c4ad2c 100755 --- a/setup/programs/sddm/sddm.sh +++ b/setup/programs/sddm/sddm.sh @@ -1,5 +1,9 @@ #!/bin/bash -source common.sh -sudo $installCMD sddm -systemctl enable sddm +install_sddm() +{ + graphics_install_prompt "SDDM Will be installed" + install_prog "sddm" + graphics_install_prompt "SDDM Is installed" +} + diff --git a/setup/programs/xmonad/xmonad.sh b/setup/programs/xmonad/xmonad.sh index 0abbd4b..52860a5 100755 --- a/setup/programs/xmonad/xmonad.sh +++ b/setup/programs/xmonad/xmonad.sh @@ -1,7 +1,78 @@ #!/bin/bash -source common.sh +XNOMAD_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -sudo $installCMD xmonad xmonad-contrib dmenu xmobar picom -cp -r $main_dir/dotfiles/xmonad /home/$USER/.config -cp -r $main_dir/dotfiles/xmobar /home/$USER/.config +xmonad_install_list_debian=(xmonad xmonad-contrib xmobar) +xmonad_install_list_arch=(xmonad xmonad-contrib xmobar) + +install_xmonad() +{ + graphics_install_prompt "Xnomad Will be installed" + + cd $XNOMAD_SCRIPT_DIR + + case $OS in + debian) + install_from_list "${xmonad_install_list_debian[@]}" + ;; + + arch) + install_from_list "${xmonad_install_list_arch[@]}" + ;; + + rasberry) + ;; + + *) + echo "Invalid os is selectred" + exit_abord + ;; + esac + + if [[ -d "$USER_DOTFILE_DIR/xmobar" ]] + then + graphics_comment "Xmobar config directory exists a backup will be made" + mv $USER_DOTFILE_DIR/xmobar $USER_DOTFILE_DIR/xmobar_back + mkdir -p $USER_DOTFILE_DIR/xmobar + else + mkdir -p $USER_DOTFILE_DIR/xmobar + fi + + if [[ -d "$USER_DOTFILE_DIR/xmobar" ]] + then + graphics_comment "Xmonad config directory exists a backup will be made" + mv $USER_DOTFILE_DIR/xmonad $USER_DOTFILE_DIR/xmonad_back + mkdir -p $USER_DOTFILE_DIR/xmonad + else + mkdir -p $USER_DOTFILE_DIR/xmonad + fi + + if [[ -d "/home/$USER/.xmonad" ]] + then + graphics_comment "Xmonad defualt config at /home/$USER/.xmonad is found and will be deleted" + sudo rm -r /home/$USER/.xmonad/ + fi + + graphics_comment "You are installing for a : $PLATFORM" + + graphics_comment "Copying Xmonad Config files" + cp $DOTFILE_DIR/xmonad/* $USER_DOTFILE_DIR/xmonad/ + + graphics_comment "Copying Xmobar Config files" + echo "$DOTFILE_DIR/xmobar/xmobarrc_$PLATFORM.hs $USER_DOTFILE_DIR/xmobar/xmobarrc.hs" + cp $DOTFILE_DIR/xmobar/xmobarrc_$PLATFORM.hs $USER_DOTFILE_DIR/xmobar/xmobarrc.hs + + echo "$DOTFILE_DIR/xmobar/ip_$OS.sh $USER_DOTFILE_DIR/xmobar/ip.sh" + cp $DOTFILE_DIR/xmobar/ip_$OS.sh $USER_DOTFILE_DIR/xmobar/ip.sh + + echo "$DOTFILE_DIR/xmobar/get_kernel.sh $USER_DOTFILE_DIR/xmobar/" + cp $DOTFILE_DIR/xmobar/get_kernel.sh $USER_DOTFILE_DIR/xmobar/ + + echo "$DOTFILE_DIR/xmobar/battery.sh $USER_DOTFILE_DIR/xmobar/" + cp $DOTFILE_DIR/xmobar/battery.sh $USER_DOTFILE_DIR/xmobar/ + + xmonad --recompile + + graphics_install_prompt "Xnomad installation complete" + cd $MAIN_DIR +} diff --git a/setup/test.sh b/setup/test.sh index 2ee4758..829463d 100755 --- a/setup/test.sh +++ b/setup/test.sh @@ -8,5 +8,6 @@ source $INSTALL_SCRIPT_DIR/../scripts/check_installed.sh source $MAIN_DIR/programs/obsidian/obsidian.sh OS="arch" +OS_NO=1 CPU_CORE_COUNT=17 -install_obsidian +install_sddm