Compare commits

..

18 Commits
master ... main

Author SHA1 Message Date
cd503caf9b hypridle and hyprlock 2025-06-20 18:56:23 +02:00
9d3885c6a4 Neovim extraconfig 2025-06-17 10:32:59 +02:00
d15d6360b9 Link all dir 2025-06-17 10:30:33 +02:00
4cc6baefc9 Should be good now :) 2025-05-08 16:47:38 +02:00
26143c5f81 Fix node bug 2025-05-08 15:09:53 +02:00
53c5859678 Working 2025-05-06 17:38:23 +02:00
78625c52d7 Fixes 2025-05-06 16:22:54 +02:00
d783dfcf77 Better support for noroot 2025-05-03 17:08:01 +02:00
806c1d1510 Fix bug in chsh 2025-05-03 17:02:39 +02:00
70838875e6 Working 2025-05-03 16:20:02 +02:00
235e2b7402 Python venv 2025-05-03 00:11:56 +02:00
8666527ddc Debian / Arch 2025-05-03 00:08:14 +02:00
a94894652b Better but still not sorking 2025-05-02 22:11:04 +02:00
178ba8ae8f Preparing for archlinux 2025-05-02 22:07:00 +02:00
8d1a0e9557 Add modules 2025-05-02 16:43:14 +02:00
b7a5c42b9b Fix bugs 2024-11-09 22:13:24 +01:00
9dbff77dd1 Webpage 2024-10-19 04:04:22 +02:00
2b8d7b3b92 A lot of work 2024-10-19 03:38:04 +02:00
5 changed files with 543 additions and 331 deletions

51
Dockerfile Normal file
View File

@ -0,0 +1,51 @@
# Test on debian
FROM debian:11 AS debian-user
RUN \
apt update -y && \
apt install sudo curl -y && \
useradd -m tester && \
echo tester:tester | chpasswd && \
usermod -aG sudo tester
USER tester
WORKDIR /home/tester
COPY ./tforgione.sh /home/tester/tforgione.sh
RUN echo "cat tforgione.sh | bash" > /home/tester/.bash_history
CMD ["bash"]
# Test on ubuntu
FROM ubuntu:24.04 AS ubuntu-user
RUN \
apt update -y && \
apt install sudo curl -y && \
useradd -m tester && \
echo tester:tester | chpasswd && \
usermod -aG sudo tester
USER tester
WORKDIR /home/tester
COPY ./tforgione.sh /home/tester/tforgione.sh
RUN echo "cat tforgione.sh | bash" > /home/tester/.bash_history
CMD ["bash"]
# Test on archlinux
FROM archlinux AS archlinux-user
RUN \
pacman -Sy curl sudo --noconfirm && \
groupadd sudo && \
echo "%sudo ALL=(ALL:ALL) ALL" > /etc/sudoers.d/sudoers && \
useradd -m tester && \
echo tester:tester | chpasswd && \
usermod -aG sudo tester
USER tester
WORKDIR /home/tester
COPY ./tforgione.sh /home/tester/tforgione.sh
RUN echo "cat tforgione.sh | bash" > /home/tester/.bash_history
CMD ["bash"]

2
Makefile Normal file
View File

@ -0,0 +1,2 @@
deploy:
scp tforgione.sh index.html pi:docker/sh

67
index.html Normal file
View File

@ -0,0 +1,67 @@
<!doctype HTML>
<html>
<head>
<meta charset="utf-8">
<title>sh.tforgione.fr</title>
<style>
.container {
width: 800px;
margin: auto;
border: solid;
border-width: 1px;
padding: 5rem;
margin-top: 5rem;
}
h1 {
text-align: center;
margin-top: 0rem;
margin-bottom: 3rem;
}
.code {
width: 45rem;
margin: auto;
display: flex;
text-align: center;
}
pre::before {
content: "$ ";
color: grey;
}
pre {
display: inline;
width: 45rem;
margin: 0px;
background-color: black;
color: white;
padding: 1rem;
font-size: 1rem;
}
.button {
cursor: pointer;
background-color: white;
padding: 0 1rem 0 1rem;
margin: 0px;
}
</style>
</head>
<body>
<div class="container">
<h1>Run the following command to get started with tforgione's dotfiles!</h1>
<div class="code">
<pre><code id="code">curl --proto '=https' --tlsv1.2 -sSf https://sh.tforgione.fr | bash</code></pre><button id="copy" class="button"><svg width="24" height="25" viewBox="0 0 24 25" xmlns="http://www.w3.org/2000/svg" alt="Copy curl command to clipboard to download Rustup">
<path d="M18 20h2v3c0 1-1 2-2 2H2c-.998 0-2-1-2-2V5c0-.911.755-1.667 1.667-1.667h5A3.323 3.323 0 0110 0a3.323 3.323 0 013.333 3.333h5C19.245 3.333 20 4.09 20 5v8.333h-2V9H2v14h16v-3zM3 7h14c0-.911-.793-1.667-1.75-1.667H13.5c-.957 0-1.75-.755-1.75-1.666C11.75 2.755 10.957 2 10 2s-1.75.755-1.75 1.667c0 .911-.793 1.666-1.75 1.666H4.75C3.793 5.333 3 6.09 3 7z"></path><path d="M4 19h6v2H4zM12 11H4v2h8zM4 17h4v-2H4zM15 15v-3l-4.5 4.5L15 21v-3l8.027-.032L23 15z"></path>
</svg></button>
</div>
</div>
<script>
document.getElementById('copy').addEventListener('click', function() {
navigator.clipboard.writeText("curl --proto '=https' --tlsv1.2 -sSf https://sh.tforgione.fr | bash");
});
</script>
</body>
</html>

18
test-env.sh Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
debian() {
docker build . --tag debian-user --target debian-user --debug
docker container run -it debian-user bash
}
ubuntu() {
docker build . --tag ubuntu-user --target ubuntu-user --debug
docker container run -it ubuntu-user bash
}
archlinux() {
docker build . --tag archlinux-user --target archlinux-user --debug
docker container run -it archlinux-user bash
}
"$@"

View File

@ -1,6 +1,5 @@
#!/usr/bin/env sh #!/usr/bin/env bash
# This script installs the default things for having a stylish zsh
user=$USER user=$USER
user_shell=`getent passwd $USER | cut -f7 -d:` user_shell=`getent passwd $USER | cut -f7 -d:`
@ -42,14 +41,6 @@ test_command() {
done done
} }
yes_no_ask_required() {
yes_no_ask $@ "(required)"
if [ $? -ne 0 ]; then
error "refused to perform required task, can't continue"
exit 1
fi
}
yes_no_ask() { yes_no_ask() {
info_n $@ "[Y/n]" info_n $@ "[Y/n]"
read answer read answer
@ -60,285 +51,391 @@ yes_no_ask() {
fi fi
} }
install() { has_sudo=0
test_command apt has_apt=0
has_pacman=0
should_install_git=0
should_install_zsh=0
should_clone_dotfiles=0
should_install_dotfiles=0
should_install_update_remainder=0
should_install_neovim=0
should_configure_neovim=0
should_install_rust=0
should_install_nodejs=0
should_configure_nodejs=0
should_install_python=0
should_configure_python=0
should_install_hyprland=0
find_os() {
apt --version > /dev/null 2>&1
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
sudo apt install -yqq $@ has_apt=1
return return
fi fi
test_command pacman pacman --version > /dev/null 2>&1
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
sudo pacman -S $@ has_pacman=1
return return
fi fi
error "distribution not recognized, can't install $@." error_n "os not supported"
exit 1
} }
remove() { ask_for_dotfiles() {
test_command apt test_command zsh
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
sudo apt purge -yqq $1 has_zsh=1
sudo apt autoremove -yqq
return
fi
test_command pacman
if [ $? -eq 0 ]; then
sudo pacman -Rsn $1
return
fi
error "distribution not recognized, can't remove $1."
}
install_python3() {
test_command apt
if [ $? -eq 0 ]; then
sudo apt install -yqq python3 python3-pip
return
fi
test_command pacman
if [ $? -eq 0 ]; then
sudo pacman -S python python-pip
return
fi
error "distribution not recognized, can't install python3."
}
install_python_neovim() {
test_command pip3
if [ $? -eq 0 ]; then
sudo pip3 install neovim
return
fi
test_command pip
if [ $? -eq 0 ]; then
sudo pip install neovim
return
fi
error "couldn't find pip, can't install python-neovim."
}
install_neovim() {
test_command apt
if [ $? -eq 0 ]; then
sudo apt install -yqq neovim
return
fi
test_command pacman
if [ $? -eq 0 ]; then
sudo pacman -S neovim
return
fi
error "distribution not recognized, can't install neovim."
}
git_clone() {
info_n "cloning $1..."
git clone $@ > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo " OK!"
else else
echo has_zsh=0
error "clone failed!"
fi fi
}
clone_dotfiles() {
if [ ! -d $HOME/.config/dotfiles ]; then
test_command git test_command git
if [ $? -ne 0 ]; then if [ $? -eq 0 ]; then
if [ $sudo_available -ne 0 ]; then has_git=1
error "git is needed, but you don't have git or sudo"
return 1
else else
yes_no_ask_required "you'll need git for this, do you wish to install git?" has_git=0
install git fi
if [ $has_sudo -eq 0 ]; then
if [ $has_zsh -eq 0 ] || [ $has_git -eq 0 ]; then
warn "can't install dotfiles without sudo, or zsh and git"
return
fi fi
fi fi
git_clone https://gitea.tforgione.fr/tforgione/dotfiles/ $HOME/.config/dotfiles yes_no_ask "do you wish to install and configure dotfiles?"
if [ $? -eq 0 ]; then
echo "# Checks that the update is done weekly, if its not done, prints a nice message" > $HOME/.config/dotfiles/zsh/extraconfig.zsh if [ $has_zsh -eq 0 ]; then
should_install_zsh=1
fi
if [ $has_git -eq 0 ]; then
should_install_git=1
fi
should_clone_dotfiles=1
should_install_dotfiles=1
yes_no_ask "do you want a weekly remainder to do your system's update?"
if [ $? -eq 0 ]; then
should_install_update_remainder=1
fi
fi
}
ask_for_neovim() {
test_command nvim
if [ $? -eq 0 ]; then
has_neovim=1
else
has_neovim=0
fi
if [ $has_neovim -eq 0 ] && [ $has_sudo -eq 0 ]; then
warn "can't install neovim without sudo"
return
fi
if [ $has_neovim -eq 1 ]; then
yes_no_ask "do you wish to configure neovim?"
if [ $? -eq 0 ]; then
should_clone_dotfiles=1
should_configure_neovim=1
fi
else
yes_no_ask "do you wish to install and configure neovim?"
if [ $? -eq 0 ]; then
should_clone_dotfiles=1
should_install_neovim=1
should_configure_neovim=1
fi
fi
}
ask_for_rust() {
yes_no_ask "do you wish to install and configure rust?"
if [ $? -ne 0 ]; then
return
fi
test_command rustc
if [ $? -ne 0 ]; then
should_install_rust=1
fi
}
ask_for_python() {
test_command python
if [ $? -eq 0 ]; then
has_python=1
else
has_python=0
fi
if [ $has_python -eq 0 ] && [ $has_sudo -eq 0 ]; then
warn "can't install python without sudo"
return
fi
if [ $has_python -eq 1 ]; then
yes_no_ask "do you wish to configure python?"
if [ $? -eq 0 ]; then
should_configure_python=1
fi
else
yes_no_ask "do you wish to install and configure python?"
if [ $? -eq 0 ]; then
should_install_python=1
should_configure_python=1
fi
fi
}
ask_for_nodejs() {
test_command node
if [ $? -eq 0 ]; then
has_node=1
else
has_node=0
fi
if [ $has_node -eq 0 ] && [ $has_sudo -eq 0 ]; then
warn "can't install node without sudo"
return
fi
if [ $has_node -eq 1 ]; then
yes_no_ask "do you wish to configure nodejs?"
if [ $? -eq 0 ]; then
should_configure_node=1
fi
else
yes_no_ask "do you wish to install and configure nodejs?"
if [ $? -eq 0 ]; then
should_install_nodejs=1
should_configure_nodejs=1
fi
fi
}
ask_for_hyprland() {
if [ $has_sudo -eq 0 ]; then
return
fi
if [ $has_pacman -ne 1 ]; then
warn "can't install hyprland on this OS"
return
fi
yes_no_ask "do you wish to install and configure hyprland?"
if [ $? -ne 0 ]; then
return
fi
should_clone_dotfiles=1
should_install_hyprland=1
}
debug() {
if [ $should_install_git -eq 1 ]; then
info "should install git"
fi
if [ $should_install_zsh -eq 1 ]; then
info "should install zsh"
fi
if [ $should_install_dotfiles -eq 1 ]; then
info "should install dotfiles"
fi
if [ $should_install_neovim -eq 1 ]; then
info "should install neovim"
fi
if [ $should_configure_neovim -eq 1 ]; then
info "should configure neovim"
fi
if [ $should_install_rust -eq 1 ]; then
info "should install rust"
fi
if [ $should_install_python -eq 1 ]; then
info "should install python"
fi
if [ $should_configure_python -eq 1 ]; then
info "should configure python"
fi
if [ $should_install_nodejs -eq 1 ]; then
info "should install nodejs"
fi
if [ $should_configure_nodejs -eq 1 ]; then
info "should configure nodejs"
fi
if [ $should_install_hyprland -eq 1 ]; then
info "should install hyprland"
fi
}
run() {
packages=()
python_packages=()
if [ $should_install_git -eq 1 ]; then
packages+=(git)
fi
if [ $should_install_zsh -eq 1 ]; then
packages+=(zsh)
fi
if [ $should_install_neovim -eq 1 ]; then
if [ $has_pacman -eq 1 ]; then
packages+=(neovim)
fi
fi
if [ $should_install_nodejs -eq 1 ]; then
packages+=(nodejs)
if [ $has_pacman -eq 1 ]; then
packages+=(npm)
fi
fi
if [ $should_install_python ]; then
# Install python
if [ $has_apt -eq 1 ]; then
packages+=(python3)
packages+=(python-is-python3)
packages+=(python3-pip)
packages+=(python3-venv)
elif [ $has_pacman -eq 1 ]; then
packages+=(python)
fi
# Install some python plugins that work well with neovim if necessary
if [ $should_configure_neovim -eq 1 ]; then
python_packages+=(neovim)
python_packages+=(pycodestyle)
python_packages+=("python-lsp-server[all]")
fi
fi
if [ $should_install_hyprland -eq 1 ]; then
packages+=(hyprland)
packages+=(hyprpaper)
packages+=(hyprpicker)
packages+=(hyprlock)
packages+=(hypridle)
packages+=(egl-wayland)
packages+=(pavucontrol)
packages+=(waybar)
packages+=(slurp)
packages+=(wl-clipboard)
packages+=(brightnessctl)
python_packages+=(psutil)
fi
# Add apt repository for recent nodejs for debian
if [ $should_install_nodejs -eq 1 ] && [ $has_apt -eq 1 ]; then
curl -fsSL https://deb.nodesource.com/setup_current.x | sudo bash
fi
if [ $has_sudo -eq 1 ]; then
if [ $has_apt -eq 1 ]; then
sudo apt install -y ${packages[@]}
if [ $should_install_neovim ]; then
# Install neovim from github to get latest version
curl -L https://github.com/neovim/neovim/releases/download/stable/nvim-linux-x86_64.tar.gz -o tmp.tar.gz
sudo mkdir -p /opt/nvim
sudo tar xf tmp.tar.gz -C /opt/nvim --strip-components=1
sudo ln -s /opt/nvim/bin/nvim /usr/bin/nvim
rm tmp.tar.gz
fi
elif [ $has_pacman -eq 1 ]; then
sudo pacman -Sy ${packages[@]} --noconfirm --needed
fi
if [ $should_configure_dotfiles ]; then
sudo chsh $USER -s /usr/bin/zsh
fi
fi
# Prepare venv for python
if [ $should_configure_python -eq 1 ]; then
python -m venv $HOME/.venv
VIRTUAL_ENV=$HOME/.venv $HOME/.venv/bin/pip install ${python_packages[@]}
fi
# Configure dotfiles
if [ $should_clone_dotfiles -eq 1 ]; then
if [ ! -d $HOME/.config/dotfiles ]; then
git clone https://gitea.tforgione.fr/tforgione/dotfiles $HOME/.config/dotfiles
fi
fi
if [ $should_install_dotfiles -eq 1 ]; then
if [ ! -d $HOME/.config/ohmyzsh ]; then
git clone https://github.com/ohmyzsh/ohmyzsh $HOME/.config/ohmyzsh
fi
ln -s $HOME/.config/dotfiles/zshrc $HOME/.zshrc
if [ $should_install_update_remainder -eq 1 ]; then
echo "# Checks that the update is done weekly, if its not done, prints a nice message" >> $HOME/.config/dotfiles/zsh/extraconfig.zsh
echo "export UPDATE_CHECK=weekly" >> $HOME/.config/dotfiles/zsh/extraconfig.zsh echo "export UPDATE_CHECK=weekly" >> $HOME/.config/dotfiles/zsh/extraconfig.zsh
echo "export UPDATE_CHECK_TYPE=sliding" >> $HOME/.config/dotfiles/zsh/extraconfig.zsh echo "export UPDATE_CHECK_TYPE=sliding" >> $HOME/.config/dotfiles/zsh/extraconfig.zsh
export UPDATE_CHECK=weekly
export UPDATE_CHECK_TYPE=sliding
$HOME/.config/dotfiles/bin/update postpone
if [ $has_sudo -eq 0 ]; then
mkdir -p $HOME/.config/dotfiles/.data mkdir -p $HOME/.config/dotfiles/.data
if [ $sudo_available -ne 0 ]; then
touch $HOME/.config/dotfiles/.data/noroot touch $HOME/.config/dotfiles/.data/noroot
fi fi
fi fi
}
configure_dotfiles() {
if [ ! -d $HOME/.config/dotfiles ]; then
yes_no_ask "do you wish to configure the dotfiles?"
if [ $? -ne 0 ]; then
return
fi fi
clone_dotfiles # Configure hyprland
fi if [ $should_install_hyprland -eq 1 ]; then
} ln -s $HOME/.config/dotfiles/hypr $HOME/.config/hypr
ln -s $HOME/.config/dotfiles/hypr/waybar $HOME/.config/waybar
configure_shell() { touch $HOME/.config/dotfiles/hypr/exec-once.conf
installed_locally=false touch $HOME/.config/dotfiles/hypr/monitors.conf
yes_no_ask "do you wish to install and configure zsh?"
if [ $? -ne 0 ]; then
yes_no_ask "you don't want zsh? Ok... but can I at least give you a nice bashrc?"
if [ $? -ne 0 ]; then
info "ok :'( I guess I'm not doing anything then"
return
fi fi
clone_dotfiles # Configure neovim
rm -f $HOME/.bashrc if [ $should_configure_neovim -eq 1 ]; then
ln -s `realpath $HOME/.config/dotfiles/bashrc` `realpath $HOME/.bashrc`
mkdir -p $HOME/.config/dotfiles/bash
echo "# Checks that the update is done weekly, if its not done, prints a nice message" > $HOME/.config/dotfiles/bash/extraconfig.bash
echo "export UPDATE_CHECK=weekly" >> $HOME/.config/dotfiles/bash/extraconfig.bash
info "bashrc configured successfully"
return
fi
clone_dotfiles
test_command zsh
if [ $? -ne 0 ]; then
if [ $sudo_available -ne 0 ]; then
warn "zsh is needed, but you don't have zsh or sudo"
yes_no_ask "do you want me to compile and install zsh locally?"
if [ $? -ne 0 ]; then
error "zsh is needed, but you refused to install zsh"
return 1
fi
installed_locally=true
info "downloading zsh..."
mkdir tmp
cd tmp
curl https://codeload.github.com/zsh-users/zsh/tar.gz/zsh-5.7.1 --output zsh.tar.gz > /dev/null 2>&1
tar xvf zsh.tar.gz > /dev/null 2>&1
cd zsh-zsh-5.7.1
info "building zsh (this may take a while)..."
./Util/preconfig > /dev/null 2>&1
./configure --prefix ~/.local/share > /dev/null 2>&1
make > /dev/null 2>&1
info "installing zsh (this may take a while)..."
make install > /dev/null 2>&1
cd ../../
rm -rf tmp
info "zsh installed!"
else
yes_no_ask_required "this magnificent prompt is based on zsh, do you wish to install zsh?"
install zsh
fi
fi
mkdir -p $HOME/.config
if [ ! -d $HOME/.config/ohmyzsh ]; then
git_clone https://github.com/ohmyzsh/ohmyzsh $HOME/.config/ohmyzsh
fi
if [ -f $HOME/.zshrc ]; then
path1=`realpath $HOME/.zshrc`
path2=`realpath $HOME/.config/dotfiles/zshrc`
if [ "$path1" == "$path2" ]; then
info "it seems that your zshrc is already a good link."
else
if `realpath $HOME/.zshrc`; then
warn "you already have a zshrc, it will be moved to ~/.zshrc.bak"
mv $HOME/.zshrc $HOME/.zshrc.bak
fi
info "linking zshrc"
ln -s $HOME/.config/dotfiles/zshrc $HOME/.zshrc
fi
else
info "linking zshrc"
ln -s $HOME/.config/dotfiles/zshrc $HOME/.zshrc
fi
if [ "$user_shell" == "/bin/zsh" ]; then
info "it seems that you already use zsh."
else
info "it seems your shell is not zsh..."
if [ $sudo_available -eq 0 ]; then
# Sudo is available, run chsh
yes_no_ask "do you want to change your shell?"
if [ $? -eq 0 ]; then
info "changing your shell"
sudo chsh $user -s /bin/zsh
else
info "not doing anything"
fi
else
info "you don't have root, but you can run 'exec zsh' at the end of your bashrc"
yes_no_ask "do you wish to do that?"
if [ $? -eq 0 ]; then
echo >> $HOME/.bashrc
if [ "$installed_locally" == "true" ]; then
echo "exec ~/.local/share/bin/zsh" >> $HOME/.bashrc
else
echo "exec zsh" >> $HOME/.bashrc
fi
echo >> $HOME/.bashrc
else
info "not doing anything"
fi
fi
fi
}
configure_neovim() {
test_command nvim
if [ $? -ne 0 ] && [ $sudo_available -ne 0 ]; then
warn "you don't have sudo or neovim, skipping neovim configuration"
return
fi
yes_no_ask "do you wish to install and configure neovim?"
if [ $? -ne 0 ]; then
info "not installing neovim"
return
fi
clone_dotfiles
test_command nvim
if [ $? -ne 0 ]; then
info "installing neovim"
install_neovim
fi
# Try and install python3 and python-neovim
test_command python3 pip3
if [ $? -ne 0 ]; then
install_python3
fi
install_python_neovim
# Create config files an directories # Create config files an directories
mkdir -p $HOME/.config/nvim $HOME/.nvim/backups $HOME/.nvim/swp $HOME/.nvim/undo mkdir -p $HOME/.nvim/backups $HOME/.nvim/swp $HOME/.nvim/undo
rm -f $HOME/.config/nvim/init.vim ln -s $HOME/.config/dotfiles/nvim $HOME/.config/nvim
ln -s $HOME/.config/dotfiles/init.vim $HOME/.config/nvim/init.vim
# Empty extra config for nvim
mkdir -p $HOME/.config/dotfies/nvim/lua
echo "-- Customize your neovim config here" > $HOME/.config/dotfiles/nvim/lua/extraconfig.lua
# Install vim plug # Install vim plug
curl -fLo $HOME/.local/share/nvim/site/autoload/plug.vim --create-dirs \ curl -fLo $HOME/.local/share/nvim/site/autoload/plug.vim --create-dirs \
@ -346,97 +443,74 @@ configure_neovim() {
# Install plugins # Install plugins
nvim +PlugInstall +qa nvim +PlugInstall +qa
}
configure_powerline() {
yes_no_ask "do you wish to install powerline fonts?"
if [ $? -ne 0 ]; then
return
fi fi
info installing powerline fonts # Configure nodejs
git_clone https://github.com/powerline/fonts if [ $should_configure_nodejs -eq 1 ]; then
cd fonts mkdir -p $HOME/.npmbin
./install.sh npm config set prefix $HOME/.npmbin
cd .. npm install -g npm
rm -rf fonts
}
configure_rust() {
yes_no_ask "do you wish to install and configure rust?"
if [ $? -ne 0 ]; then
return
fi fi
# Configure rust
if [ $should_install_rust -eq 1 ]; then
curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path -y curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path -y
export PATH=$HOME/.cargo/bin:$PATH export PATH=$HOME/.cargo/bin:$PATH
rustup component add rust-analyzer
cargo_update_installed=1
yes_no_ask "do you wish to install cargo-update? it allows to update package automatically"
if [ $? -eq 0 ]; then
cargo_update_installed=0
cargo install cargo-update
fi
yes_no_ask "do you wish to install racer? it enabled rust completion from vim"
if [ $? -eq 0 ]; then
rustup toolchain add nightly
cargo +nightly install racer
if [ $cargo_update_installed -eq 0 ]; then
cargo install-update-config -t nightly racer
fi
fi fi
} }
configure_node() { banner() {
yes_no_ask "do you wish to install and configure node and npm?" echo -e "\x1b[32;1m┌───────────────────────────────────────────────────────────────────────────────────────────┐"
echo "│ _ __ _ _ _ _ _ _ │"
if [ $? -ne 0 ]; then echo "│ | | / _| (_) ( ) (_) | | | | | │"
return echo "│ | |_| |_ ___ _ __ __ _ _ ___ _ __ ___|/ ___ _ _ __ ___| |_ __ _| | | ___ _ __ │"
fi echo "│ | __| _/ _ \| '__/ _\` | |/ _ \| '_ \ / _ \ / __| | | '_ \/ __| __/ _\` | | |/ _ \ '__| │"
echo "│ | |_| || (_) | | | (_| | | (_) | | | | __/ \__ \ | | | | \__ \ || (_| | | | __/ | │"
install nodejs npm echo "│ \__|_| \___/|_| \__, |_|\___/|_| |_|\___| |___/ |_|_| |_|___/\__\__,_|_|_|\___|_| │"
echo "│ __/ | │"
mkdir ~/.npmbin echo "│ |___/ │"
npm config set prefix ~/.npmbin echo "├───────────────────────────────────────────────────────────────────────────────────────────┤"
npm install -g npm echo "│ WELCOME TO TFORGIONE'S INSTALLER │"
echo -e "└───────────────────────────────────────────────────────────────────────────────────────────┘\x1b[0m"
remove npm
} }
configure_awesome() { ending_banner() {
yes_no_ask "do you wish to install and configure awesome?" echo -e "\x1b[32;1m┌───────────────────────────────────────────────────────────────────────────────────────────┐"
echo "│ _ __ _ _ _ _ _ _ │"
if [ $? -ne 0 ]; then echo "│ | | / _| (_) ( ) (_) | | | | | │"
return echo "│ | |_| |_ ___ _ __ __ _ _ ___ _ __ ___|/ ___ _ _ __ ___| |_ __ _| | | ___ _ __ │"
fi echo "│ | __| _/ _ \| '__/ _\` | |/ _ \| '_ \ / _ \ / __| | | '_ \/ __| __/ _\` | | |/ _ \ '__| │"
echo "│ | |_| || (_) | | | (_| | | (_) | | | | __/ \__ \ | | | | \__ \ || (_| | | | __/ | │"
install awesome acpi echo "│ \__|_| \___/|_| \__, |_|\___/|_| |_|\___| |___/ |_|_| |_|___/\__\__,_|_|_|\___|_| │"
git_clone https://gitea.tforgione.fr/tforgione/awesome ~/.config/awesome echo "│ __/ | │"
echo "│ |___/ │"
git_clone https://github.com/horst3180/arc-icon-theme --depth 1 && cd arc-icon-theme echo "├───────────────────────────────────────────────────────────────────────────────────────────┤"
./autogen.sh --prefix=/usr echo "│ TFORGIONE'S DOTFILES INSTALLED! HAVE A GREAT DAY! │"
sudo make install echo -e "└───────────────────────────────────────────────────────────────────────────────────────────┘\x1b[0m"
cd ..
rm -rf arc-icon-theme
} }
main() { main() {
echo_green "=== WELCOME TO TFORGIONE'S CONFIG INSTALLER ===" banner
find_os
info "before anything, i need to know if your user can use sudo" info "before anything, i need to know if your user can use sudo"
yes_no_ask "can your user use sudo?" yes_no_ask "can your user use sudo?"
sudo_available=$? if [ $? -eq 0 ]; then
has_sudo=1
fi
configure_dotfiles ask_for_dotfiles
configure_shell ask_for_neovim
configure_neovim ask_for_rust
configure_powerline ask_for_python
configure_rust ask_for_nodejs
configure_node ask_for_hyprland
configure_awesome
debug
run
ending_banner
} }
main < /dev/tty main < /dev/tty