Updated scripts

This commit is contained in:
Christoffer Martinsson 2025-01-04 14:29:10 +01:00
parent 8cc9facdb2
commit 52f247ca8a
4 changed files with 126 additions and 102 deletions

View File

@ -15,7 +15,4 @@
[mergetool]
keepBackup = false
# when working on work projects
[includeIf "gitdir:**/work/**/.git"]
path = ~/code_server/gitconfig.work

View File

@ -5,3 +5,13 @@
[credential "https://git.mildef.com"]
helper = store --file ~/.my-credentials
username = christoffer
[pull]
rebase = false
[merge]
tool = nvimdiff
[mergetool]
keepBackup = false
# when working on work projects
[includeIf "gitdir:**/code_server/.git"]
path = ~/code_server/gitconfig

View File

@ -42,6 +42,7 @@ bind -n C-M-x confirm kill-pane
bind -n C-M-h split-window -v -c "#{pane_current_path}"
bind -n C-M-v split-window -h -c "#{pane_current_path}"
bind -n C-g display-popup -d "#{pane_current_path}" -E -w 90% -h 90% "lazygit"
bind -n C-t display-popup -d "#{pane_current_path}" -E -w 90% -h 90% "btop"
set-option -g status-position top
set-option -g default-terminal "tmux-256color"

View File

@ -14,7 +14,7 @@ else
DESKTOP="no"
fi
if [ "$(systemd-detect-virt)" == "wsl" ]; then
if [[ "$(systemd-detect-virt)" == *"wsl"* ]]; then
WSL="yes"
else
WSL="no"
@ -44,7 +44,7 @@ echo -e ' \e[H\e[2J
printf -- '\033[32m *** System applications ***\n\033[37m'
# Ubuntu 20.04 workaround
if [ "$VER" == "20.04" ]; then
if [ "$WSL" == "yes" ]; then
sudo apt -y purge --auto-remove neovim
fi
@ -52,16 +52,18 @@ fi
printf -- '\033[33m Updating system\n\033[37m'
sudo apt update
sudo apt upgrade -y
if dpkg -s flatpak &>/dev/null; then
flatpak update -y
else
sudo add-apt-repository -y ppa:flatpak/stable
sudo apt update
sudo apt install -y flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y flathub com.github.tchx84.Flatseal
if [ "$WSL" == "no" ]; then
if dpkg -s flatpak &>/dev/null; then
flatpak update -y
else
sudo add-apt-repository -y ppa:flatpak/stable
sudo apt update
sudo apt install -y flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y flathub com.github.tchx84.Flatseal
fi
fi
if dpkg -s flatpak &>/dev/null; then
if dpkg -s snap &>/dev/null; then
sudo snap refresh
else
sudo apt install -y snap
@ -98,7 +100,6 @@ printf -- '\033[33m Installing fzf\n\033[37m'
if [ -d ~/.fzf ]; then rm -rf ~/.fzf; fi
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all
source ~/.fzf.bash
# # Install VirtualHere server
# curl https://raw.githubusercontent.com/virtualhere/script/main/install_server | sudo sh
@ -138,9 +139,10 @@ cd build && cpack -G DEB && sudo dpkg -i nvim-linux64.deb
if [ -d ~/neovim ]; then rm -rf ~/neovim; fi
# Install caffeine
printf -- '\033[33m Installing caffeine\n\033[37m'
sudo apt install -y caffeine
if [ "$WSL" == "no" ]; then
printf -- '\033[33m Installing caffeine\n\033[37m'
sudo apt install -y caffeine
fi
# Install fd
printf -- '\033[33m Installing fd\n\033[37m'
sudo apt install -y fd-find
@ -192,7 +194,13 @@ sudo apt install -y composer
# Install java
printf -- '\033[33m Installing java\n\033[37m'
sudo apt install -y default-jdk
if [ "$WSL" == "yes" ]; then
sudo add-apt-repository -y ppa:linuxuprising/java
sudo apt update
sudo apt install -y oracle-java17-installer
else
sudo apt install -y default-jdk
fi
# Install julia
printf -- '\033[33m Installing julia\n\033[37m'
@ -235,7 +243,9 @@ sudo npm install -g neovim
printf -- '\033[33m Installing Rust\n\033[37m'
cd ~
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path -y
#source "$HOME/.cargo/env"
if [ "$WSL" == "yes" ]; then
source "$HOME/.cargo/env"
fi
rustup self update
rustup update stable
rustup default stable
@ -269,107 +279,109 @@ printf -- '\033[33m Installing starship\n\033[37m'
cargo install starship --locked
# *** Desktop applications ***
printf -- '\033[32m *** Desktop applications ***\n\033[37m'
if [ "$WSL" == "no" ]; then
printf -- '\033[32m *** Desktop applications ***\n\033[37m'
if [ "$DESKTOP" == "yes" ]; then
printf -- '\033[33m Installing Krita\n\033[37m'
flatpak install -y flathub org.kde.krita
if [ "$DESKTOP" == "yes" ]; then
printf -- '\033[33m Installing Krita\n\033[37m'
flatpak install -y flathub org.kde.krita
printf -- '\033[33m Installing KiCad\n\033[37m'
flatpak install -y flathub org.kicad.KiCad
printf -- '\033[33m Installing KiCad\n\033[37m'
flatpak install -y flathub org.kicad.KiCad
printf -- '\033[33m Installing FreeCad\n\033[37m'
flatpak install -y flathub org.freecadweb.FreeCAD
printf -- '\033[33m Installing FreeCad\n\033[37m'
flatpak install -y flathub org.freecadweb.FreeCAD
printf -- '\033[33m Installing Moonlight\n\033[37m'
flatpak install -y flathub com.moonlight_stream.Moonlight
printf -- '\033[33m Installing Moonlight\n\033[37m'
flatpak install -y flathub com.moonlight_stream.Moonlight
printf -- '\033[33m Installing DrawIo\n\033[37m'
flatpak install -y flathub com.jgraph.drawio.desktop
printf -- '\033[33m Installing DrawIo\n\033[37m'
flatpak install -y flathub com.jgraph.drawio.desktop
# Install VSCode
printf -- '\033[33m Installing VSCode\n\033[37m'
sudo snap install --classic code
# Install VSCode
printf -- '\033[33m Installing VSCode\n\033[37m'
sudo snap install --classic code
# Install gnome-shell-extension-manager
printf -- '\033[33m Installing gnome-shell-extension-manager\n\033[37m'
sudo apt install -y gnome-shell-extension-manager
# Install gnome-shell-extension-manager
printf -- '\033[33m Installing gnome-shell-extension-manager\n\033[37m'
sudo apt install -y gnome-shell-extension-manager
# Install gnome tweaks
printf -- '\033[33m Installing gnome tweaks\n\033[37m'
sudo apt install -y gnome-tweaks
# Install gnome tweaks
printf -- '\033[33m Installing gnome tweaks\n\033[37m'
sudo apt install -y gnome-tweaks
# Install remmina
printf -- '\033[33m Installing remmina\n\033[37m'
sudo apt install -y remmina
# Install remmina
printf -- '\033[33m Installing remmina\n\033[37m'
sudo apt install -y remmina
# Install feh
printf -- '\033[33m Installing feh\n\033[37m'
sudo apt install -y feh
# Install feh
printf -- '\033[33m Installing feh\n\033[37m'
sudo apt install -y feh
# Install NerdFonts
printf -- '\033[33m Installing NerdFonts\n\033[37m'
mkdir -p /home/$USER/.local/share/fonts
cd /home/$USER/.local/share/fonts
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/CodeNewRoman.zip
unzip -o CodeNewRoman.zip
rm CodeNewRoman.zip
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/NerdFontsSymbolsOnly.zip
unzip -o NerdFontsSymbolsOnly.zip
rm NerdFontsSymbolsOnly.zip
fc-cache -fv
# Install NerdFonts
printf -- '\033[33m Installing NerdFonts\n\033[37m'
mkdir -p /home/$USER/.local/share/fonts
cd /home/$USER/.local/share/fonts
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/CodeNewRoman.zip
unzip -o CodeNewRoman.zip
rm CodeNewRoman.zip
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/NerdFontsSymbolsOnly.zip
unzip -o NerdFontsSymbolsOnly.zip
rm NerdFontsSymbolsOnly.zip
fc-cache -fv
# Install Wezterm
printf -- '\033[33m Installing wezterm\n\033[37m'
curl -fsSL https://apt.fury.io/wez/gpg.key | sudo gpg --yes --dearmor -o /usr/share/keyrings/wezterm-fury.gpg
echo 'deb [signed-by=/usr/share/keyrings/wezterm-fury.gpg] https://apt.fury.io/wez/ * *' | sudo tee /etc/apt/sources.list.d/wezterm.list
sudo apt update
sudo apt install -y wezterm
# Install Wezterm
printf -- '\033[33m Installing wezterm\n\033[37m'
curl -fsSL https://apt.fury.io/wez/gpg.key | sudo gpg --yes --dearmor -o /usr/share/keyrings/wezterm-fury.gpg
echo 'deb [signed-by=/usr/share/keyrings/wezterm-fury.gpg] https://apt.fury.io/wez/ * *' | sudo tee /etc/apt/sources.list.d/wezterm.list
sudo apt update
sudo apt install -y wezterm
# Install Brave Browser
printf -- '\033[33m Installing Brave Browser\n\033[37m'
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list
sudo apt update
sudo apt install -y brave-browser
# Install Brave Browser
printf -- '\033[33m Installing Brave Browser\n\033[37m'
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list
sudo apt update
sudo apt install -y brave-browser
# Install Virtualbox
printf -- '\033[33m Installing Virtualbox\n\033[37m'
curl https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor >oracle_vbox_2016.gpg
curl https://www.virtualbox.org/download/oracle_vbox.asc | gpg --dearmor >oracle_vbox.gpg
sudo install -o root -g root -m 644 oracle_vbox_2016.gpg /etc/apt/trusted.gpg.d/
sudo install -o root -g root -m 644 oracle_vbox.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
sudo apt update
sudo apt install -y linux-headers-"$(uname -r)" dkms
sudo apt install virtualbox-7.1 -y
wget https://download.virtualbox.org/virtualbox/7.1.4/Oracle_VirtualBox_Extension_Pack-7.1.4.vbox-extpack
sudo VBoxManage extpack install --replace Oracle_VirtualBox_Extension_Pack-7.1.4.vbox-extpack --accept-license=eb31505e56e9b4d0fbca139104da41ac6f6b98f8e78968bdf01b1f3da3c4f9ae
sudo usermod -a -G vboxusers "$USER"
# Install Virtualbox
printf -- '\033[33m Installing Virtualbox\n\033[37m'
curl https://www.virtualbox.org/download/oracle_vbox_2016.asc | gpg --dearmor >oracle_vbox_2016.gpg
curl https://www.virtualbox.org/download/oracle_vbox.asc | gpg --dearmor >oracle_vbox.gpg
sudo install -o root -g root -m 644 oracle_vbox_2016.gpg /etc/apt/trusted.gpg.d/
sudo install -o root -g root -m 644 oracle_vbox.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
sudo apt update
sudo apt install -y linux-headers-"$(uname -r)" dkms
sudo apt install virtualbox-7.1 -y
wget https://download.virtualbox.org/virtualbox/7.1.4/Oracle_VirtualBox_Extension_Pack-7.1.4.vbox-extpack
sudo VBoxManage extpack install --replace Oracle_VirtualBox_Extension_Pack-7.1.4.vbox-extpack --accept-license=eb31505e56e9b4d0fbca139104da41ac6f6b98f8e78968bdf01b1f3da3c4f9ae
sudo usermod -a -G vboxusers "$USER"
printf -- '\033[33m Installing Audio control\n\033[37m'
if [ $VER == "22.04" ]; then
# Install helvum
sudo apt install -y pavucontrol
fi
if [ $VER == "24.04" ]; then
# Install helvum
sudo apt install -y pavucontrol helvum
fi
# Install timeshift
printf -- '\033[33m Installing Timeshift\n\033[37m'
sudo apt install -y timeshift
printf -- '\033[33m Installing Audio control\n\033[37m'
if [ $VER == "22.04" ]; then
# Install helvum
sudo apt install -y pavucontrol
fi
if [ $VER == "24.04" ]; then
# Install helvum
sudo apt install -y pavucontrol helvum
fi
# Install timeshift
printf -- '\033[33m Installing Timeshift\n\033[37m'
sudo apt install -y timeshift
fi
# *** Dotfile symlinking ***
printf -- '\033[32m *** Dotfile symlinking ***\n\033[37m'
# Symlink wezterm config
printf -- '\033[33m Symlinking wezterm config\n\033[37m'
ln -sf ~/code_server/wezterm.lua ~/.wezterm.lua
if [ "$WSL" == "no" ]; then
# Symlink wezterm config
printf -- '\033[33m Symlinking wezterm config\n\033[37m'
ln -sf ~/code_server/wezterm.lua ~/.wezterm.lua
fi
# Symlink nvim config
printf -- '\033[33m Symlinking nvim config\n\033[37m'
mkdir -p ~/.config/nvim
@ -377,7 +389,11 @@ ln -sf ~/code_server/config/nvim/init.lua ~/.config/nvim/init.lua
# Symlink git config
printf -- '\033[33m Symlinking git config\n\033[37m'
ln -sf ~/code_server/gitconfig ~/.gitconfig
if [ "$WSL" == "yes" ]; then
ln -sf ~/code_server/gitconfig.work ~/.gitconfig
else
ln -sf ~/code_server/gitconfig ~/.gitconfig
fi
# Symlink tmux config
printf -- '\033[33m Symlinking tmux config\n\033[37m'