switch to sddm

This commit is contained in:
Rick van Lieshout 2022-05-03 14:41:51 +02:00
parent ea861dbbfa
commit 3768caaa76
3 changed files with 134 additions and 134 deletions

View File

@ -7,8 +7,9 @@ root = true
[*] [*]
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
indent_size = 2
# Matches multiple files with brace expansion notation # Matches multiple files with brace expansion notation
[*.{sh,py,yml}] [*.{sh,py,yml}]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2

View File

@ -24,7 +24,6 @@ networkmanager
eog eog
python python
python-pip python-pip
gdm
neofetch neofetch
git git
scrot scrot
@ -87,3 +86,4 @@ blueman
pulseaudio-bluetooth pulseaudio-bluetooth
bluez bluez
bluez-libs bluez-libs
sddm

View File

@ -6,52 +6,52 @@
# Ask a question and return true or false based on the users input # Ask a question and return true or false based on the users input
ask() { ask() {
# from https://djm.me/ask # from https://djm.me/ask
local prompt default reply local prompt default reply
while true; do while true; do
if [ "${2:-}" = "Y" ]; then if [ "${2:-}" = "Y" ]; then
prompt="Y/n" prompt="Y/n"
default=Y default=Y
elif [ "${2:-}" = "N" ]; then elif [ "${2:-}" = "N" ]; then
prompt="y/N" prompt="y/N"
default=N default=N
else else
prompt="y/n" prompt="y/n"
default= default=
fi fi
echo -n "$1 [$prompt] " echo -n "$1 [$prompt] "
read -r reply </dev/tty read -r reply </dev/tty
if [ -z "$reply" ]; then if [ -z "$reply" ]; then
reply=$default reply=$default
fi fi
case "$reply" in case "$reply" in
[Yy]*) return 0 ;; [Yy]*) return 0 ;;
[Nn]*) return 1 ;; [Nn]*) return 1 ;;
esac esac
done done
} }
# delete target, create dirs if they don't exist yet and finally symlink the dir # delete target, create dirs if they don't exist yet and finally symlink the dir
function linkDir { function linkDir {
rm -rf "$2"; rm -rf "$2"
mkdir -p "${2%/*}" mkdir -p "${2%/*}"
ln -sf "$1" "$2" ln -sf "$1" "$2"
} }
# replace line endings with a space (for use in package managers) # replace line endings with a space (for use in package managers)
function fileToList { function fileToList {
echo $(cat "$1" | sed ':a;N;$!ba;s/\n/ /g') echo $(cat "$1" | sed ':a;N;$!ba;s/\n/ /g')
} }
# create and copy files to directory # create and copy files to directory
function copyToDir { function copyToDir {
echo "$2" | sed 's%/[^/]*$%/%' | xargs mkdir -p echo "$2" | sed 's%/[^/]*$%/%' | xargs mkdir -p
cp "$1" "$2" cp "$1" "$2"
} }
# ======================================= # =======================================
@ -60,124 +60,122 @@ function copyToDir {
# moves all fonts into the fonts directories (overwriting existing files) # moves all fonts into the fonts directories (overwriting existing files)
function install_fonts { function install_fonts {
mkdir -p ~/.fonts mkdir -p ~/.fonts
mkdir -p ~/.local/share/fonts mkdir -p ~/.local/share/fonts
cp -rf ./fonts/* ~/.fonts cp -rf ./fonts/* ~/.fonts
cp -rf ./fonts/* ~/.local/share/fonts cp -rf ./fonts/* ~/.local/share/fonts
} }
# install trizen, a aur helper # install trizen, a aur helper
function install_trizen { function install_trizen {
git clone https://aur.archlinux.org/trizen.git git clone https://aur.archlinux.org/trizen.git
pushd trizen || return pushd trizen || return
makepkg -si makepkg -si
popd || return popd || return
sudo rm -dRf trizen/ sudo rm -dRf trizen/
} }
# install other configs # install other configs
function install_config { function install_config {
# link directories # link directories
linkDir "$PWD"/wallpapers/images ~/Pictures/wallpapers linkDir "$PWD"/wallpapers/images ~/Pictures/wallpapers
linkDir "$PWD"/i3 ~/.config/i3 linkDir "$PWD"/i3 ~/.config/i3
linkDir "$PWD"/config/notify-osd/notify-osd ~/.notify-osd linkDir "$PWD"/config/notify-osd/notify-osd ~/.notify-osd
linkDir "$PWD"/config/terminal/xfce4-term ~/.config/xfce4/terminal linkDir "$PWD"/config/terminal/xfce4-term ~/.config/xfce4/terminal
linkDir "$PWD"/config/gtk-3.0/settings.ini ~/.config/gtk-3.0/.config linkDir "$PWD"/config/gtk-3.0/settings.ini ~/.config/gtk-3.0/.config
linkDir "$PWD"/config/ranger ~/.config/ linkDir "$PWD"/config/ranger ~/.config/
# link user files # link user files
ln -sf "$PWD"/bash/.bashrc ~/.bashrc ln -sf "$PWD"/bash/.bashrc ~/.bashrc
ln -sf "$PWD"/bash/.dotnet-install.sh ~/.dotnet-install.sh ln -sf "$PWD"/bash/.dotnet-install.sh ~/.dotnet-install.sh
ln -sf "$PWD"/bash/.alias.sh ~/.alias ln -sf "$PWD"/bash/.alias.sh ~/.alias
ln -sf "$PWD"/config/nano/.nanorc ~/.nanorc ln -sf "$PWD"/config/nano/.nanorc ~/.nanorc
ln -sf "$PWD"/bash/.powerline-shell.json ~/.powerline-shell.json ln -sf "$PWD"/bash/.powerline-shell.json ~/.powerline-shell.json
ln -sf "$PWD"/config/gtk-3.0/settings.ini ~/.gtkrc-2.0.mine ln -sf "$PWD"/config/gtk-3.0/settings.ini ~/.gtkrc-2.0.mine
ln -sf "$PWD"/config/mimeapps.list ~/.config/mimeapps.list ln -sf "$PWD"/config/mimeapps.list ~/.config/mimeapps.list
mkdir -p ~/.config/rofi
ln -sf "$PWD"/config/rofi/rofi.rasi ~/.config/rofi/config.rasi
ln -sf "$PWD"/config/rofi/mytheme.rasi ~/.config/rofi/mytheme.rasi
ln -sf "$PWD"/config/.gitconfig ~/.gitconfig mkdir -p ~/.config/rofi
ln -sf "$PWD"/config/.npmrc ~/.npmrc ln -sf "$PWD"/config/rofi/rofi.rasi ~/.config/rofi/config.rasi
ln -sf "$PWD"/config/user-dirs.dirs ~/.config/user-dirs.dirs ln -sf "$PWD"/config/rofi/mytheme.rasi ~/.config/rofi/mytheme.rasi
mkdir -p ~/.pulse
ln -sf "$PWD"/config/pulse/daemon.conf ~/.pulse/daemon.conf ln -sf "$PWD"/config/.gitconfig ~/.gitconfig
ln -sf "$PWD"/config/.npmrc ~/.npmrc
ln -sf "$PWD"/config/user-dirs.dirs ~/.config/user-dirs.dirs
mkdir -p ~/.pulse
ln -sf "$PWD"/config/pulse/daemon.conf ~/.pulse/daemon.conf
ln -sf "$PWD"/config/picom.conf ~/.config/picom.conf ln -sf "$PWD"/config/picom.conf ~/.config/picom.conf
# link system files / directories # link system files / directories
sudo ln -sf "$PWD"/config/package-managers/pacman.conf /etc/pacman.conf sudo ln -sf "$PWD"/config/package-managers/pacman.conf /etc/pacman.conf
sudo ln -sf "$PWD"/config/package-managers/makepkg.conf /etc/makepkg.conf sudo ln -sf "$PWD"/config/package-managers/makepkg.conf /etc/makepkg.conf
sudo ln -sf "$PWD"/config/ntp.conf /etc/ntp.conf sudo ln -sf "$PWD"/config/ntp.conf /etc/ntp.conf
sudo ln -sf "$PWD"/bash/Completion /etc/bash_completion.d sudo ln -sf "$PWD"/bash/Completion /etc/bash_completion.d
# create empty .custom alias file # create empty .custom alias file
echo "" > ~/.custom echo "" >~/.custom
echo "" > ~/.variables echo "" >~/.variables
# system fixes # system fixes
echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
mkdir -p ~/Pictures/Screenshots mkdir -p ~/Pictures/Screenshots
} }
# Installs the dependencies on Arch Linux # Installs the dependencies on Arch Linux
function install_dependencies { function install_dependencies {
fileToList dependencies/pacman.txt | xargs sudo pacman --noconfirm -S fileToList dependencies/pacman.txt | xargs sudo pacman --noconfirm -S
install_trizen install_trizen
fileToList dependencies/aur.txt | xargs trizen --force -S --noconfirm fileToList dependencies/aur.txt | xargs trizen --force -S --noconfirm
fileToList dependencies/pip.txt | xargs sudo pip install fileToList dependencies/pip.txt | xargs sudo pip install
fileToList dependencies/npm.txt | xargs sudo npm install -g fileToList dependencies/npm.txt | xargs sudo npm install -g
} }
# ======================================= # =======================================
# User output functions # User output functions
# ======================================= # =======================================
# Run the intro bit # Run the intro bit
function intro { function intro {
echo "___ ___ _ _ _ _ _ " echo "___ ___ _ _ _ _ _ "
echo "| \/ | | | (_) | | | | ( )" echo "| \/ | | | (_) | | | | ( )"
echo "| . . | __ _ ___| |_ ___ _ __ _ __ ___ _ _ __ __| |___| |__ |/ " echo "| . . | __ _ ___| |_ ___ _ __ _ __ ___ _ _ __ __| |___| |__ |/ "
echo "| |\/| |/ _\` / __| __/ _ \ '__| '_ \` _ \| | '_ \ / _' |_ / '_ \ " echo "| |\/| |/ _\` / __| __/ _ \ '__| '_ \` _ \| | '_ \ / _' |_ / '_ \ "
echo "| | | | (_| \__ \ || __/ | | | | | | | | | | | (_| |/ /| | | | " echo "| | | | (_| \__ \ || __/ | | | | | | | | | | | (_| |/ /| | | | "
echo "\_| |_/\__,_|___/\__\___|_| |_| |_| |_|_|_| |_|\__,_/___|_| |_| " echo "\_| |_/\__,_|___/\__\___|_| |_| |_| |_|_|_| |_|\__,_/___|_| |_| "
echo " " echo " "
echo " " echo " "
echo " __ _ _ " echo " __ _ _ "
echo " / _(_) ___ (_) " echo " / _(_) ___ (_) "
echo " ___ ___ _ __ | |_ _ __ _ ( _ ) _ __ _ ___ ___ " echo " ___ ___ _ __ | |_ _ __ _ ( _ ) _ __ _ ___ ___ "
echo " / __/ _ \| '_ \| _| |/ _\` | / _ \/\ | '__| |/ __/ _ \ " echo " / __/ _ \| '_ \| _| |/ _\` | / _ \/\ | '__| |/ __/ _ \ "
echo "| (_| (_) | | | | | | | (_| | | (_> < | | | | (_| __/ " echo "| (_| (_) | | | | | | | (_| | | (_> < | | | | (_| __/ "
echo " \___\___/|_| |_|_| |_|\__, | \___/\/ |_| |_|\___\___| " echo " \___\___/|_| |_|_| |_|\__, | \___/\/ |_| |_|\___\___| "
echo " __/ | " echo " __/ | "
echo " |___/ " echo " |___/ "
echo "" echo ""
} }
function computer { function computer {
echo " /\ " echo " /\ "
echo " / \ " echo " / \ "
echo " /_ %%==O=% _____________ " echo " /_ %%==O=% _____________ "
echo " % - -% | '\\\\\\\\\\" echo " % - -% | '\\\\\\\\\\"
echo " _____c% > __ | ' ____|_ " echo " _____c% > __ | ' ____|_ "
echo " (_|. . % \` % .' | + '||:::::: " echo " (_|. . % \` % .' | + '||:::::: "
echo " ||. ___)%%%%_.' | '||_____| " echo " ||. ___)%%%%_.' | '||_____| "
echo " ||.( \ ~ / ,)' \'_______|_____| " echo " ||.( \ ~ / ,)' \'_______|_____| "
echo " || /| \'/ |\ ___/____|___\___ " echo " || /| \'/ |\ ___/____|___\___ "
echo " _,,,;!___*_____\_| _ ' <<<:| " echo " _,,,;!___*_____\_| _ ' <<<:| "
echo " / /| |_________'___o_o| " echo " / /| |_________'___o_o| "
echo " /_____/ / " echo " /_____/ / "
echo " |:____|/ \"Boy, I LOVE this stuff\". " echo " |:____|/ \"Boy, I LOVE this stuff\". "
echo "" echo ""
echo "" echo ""
} }
# ======================================= # =======================================
# Main loop # Main loop
# ======================================= # =======================================
@ -188,24 +186,25 @@ intro
ask "Do you want to continue installing my config and rice?" Y && ask "Do you want to continue installing my config and rice?" Y &&
# Ask for dependency installation # Ask for dependency installation
if ask "Do you want to install the applications listen in ./dependencies? (might prompt for password)" Y; then if ask "Do you want to install the applications listen in ./dependencies? (might prompt for password)" Y; then
install_dependencies install_dependencies
fi fi
# Ask for config installation # Ask for config installation
if ask "Do you want to install the config files?" Y; then if ask "Do you want to install the config files?" Y; then
install_config install_config
fi fi
# Ask for font installation # Ask for font installation
if ask "Do you want to install the fonts?" Y; then if ask "Do you want to install the fonts?" Y; then
install_fonts install_fonts
fi fi
# ask to enable gdm # ask to enable the display manager
if ask "Do you want to enable GDM?" Y; then if ask "Do you want to enable sddm?" Y; then
sudo systemctl enable gdm.service sudo systemctl set-default graphical.target
sudo systemctl enable sddm.service
fi fi
clear clear
@ -214,17 +213,17 @@ computer
prompt=$(echo $'\n> ' "Please select a specific computer to install or q to finish the install") prompt=$(echo $'\n> ' "Please select a specific computer to install or q to finish the install")
PS3="$prompt: " PS3="$prompt: "
select opt in "$PWD/computers"/*; do select opt in "$PWD/computers"/*; do
if (( REPLY == "q" )) ; then if ((REPLY == "q")); then
break break
elif (( REPLY > 0 )) ; then
bash "$opt/install.sh"
break
else
echo "Invalid option. Try another one."
fi
done
clear
echo "Enjoy using my rice! Do not forget to select i3 in GDM :)" elif ((REPLY > 0)); then
bash "$opt/install.sh"
break
else
echo "Invalid option. Try another one."
fi
done
clear
echo "Enjoy using my rice! Do not forget to select i3 in sddm :)"