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] [mergetool]
keepBackup = false 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"] [credential "https://git.mildef.com"]
helper = store --file ~/.my-credentials helper = store --file ~/.my-credentials
username = christoffer 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-h split-window -v -c "#{pane_current_path}"
bind -n C-M-v split-window -h -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-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 status-position top
set-option -g default-terminal "tmux-256color" set-option -g default-terminal "tmux-256color"

View File

@ -14,7 +14,7 @@ else
DESKTOP="no" DESKTOP="no"
fi fi
if [ "$(systemd-detect-virt)" == "wsl" ]; then if [[ "$(systemd-detect-virt)" == *"wsl"* ]]; then
WSL="yes" WSL="yes"
else else
WSL="no" WSL="no"
@ -44,7 +44,7 @@ echo -e ' \e[H\e[2J
printf -- '\033[32m *** System applications ***\n\033[37m' printf -- '\033[32m *** System applications ***\n\033[37m'
# Ubuntu 20.04 workaround # Ubuntu 20.04 workaround
if [ "$VER" == "20.04" ]; then if [ "$WSL" == "yes" ]; then
sudo apt -y purge --auto-remove neovim sudo apt -y purge --auto-remove neovim
fi fi
@ -52,16 +52,18 @@ fi
printf -- '\033[33m Updating system\n\033[37m' printf -- '\033[33m Updating system\n\033[37m'
sudo apt update sudo apt update
sudo apt upgrade -y sudo apt upgrade -y
if dpkg -s flatpak &>/dev/null; then if [ "$WSL" == "no" ]; then
flatpak update -y if dpkg -s flatpak &>/dev/null; then
else flatpak update -y
sudo add-apt-repository -y ppa:flatpak/stable else
sudo apt update sudo add-apt-repository -y ppa:flatpak/stable
sudo apt install -y flatpak sudo apt update
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo sudo apt install -y flatpak
flatpak install -y flathub com.github.tchx84.Flatseal flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y flathub com.github.tchx84.Flatseal
fi
fi fi
if dpkg -s flatpak &>/dev/null; then if dpkg -s snap &>/dev/null; then
sudo snap refresh sudo snap refresh
else else
sudo apt install -y snap 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 if [ -d ~/.fzf ]; then rm -rf ~/.fzf; fi
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all ~/.fzf/install --all
source ~/.fzf.bash
# # Install VirtualHere server # # Install VirtualHere server
# curl https://raw.githubusercontent.com/virtualhere/script/main/install_server | sudo sh # 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 if [ -d ~/neovim ]; then rm -rf ~/neovim; fi
# Install caffeine # Install caffeine
printf -- '\033[33m Installing caffeine\n\033[37m' if [ "$WSL" == "no" ]; then
sudo apt install -y caffeine printf -- '\033[33m Installing caffeine\n\033[37m'
sudo apt install -y caffeine
fi
# Install fd # Install fd
printf -- '\033[33m Installing fd\n\033[37m' printf -- '\033[33m Installing fd\n\033[37m'
sudo apt install -y fd-find sudo apt install -y fd-find
@ -192,7 +194,13 @@ sudo apt install -y composer
# Install java # Install java
printf -- '\033[33m Installing java\n\033[37m' 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 # Install julia
printf -- '\033[33m Installing julia\n\033[37m' 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' printf -- '\033[33m Installing Rust\n\033[37m'
cd ~ cd ~
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path -y 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 self update
rustup update stable rustup update stable
rustup default stable rustup default stable
@ -269,107 +279,109 @@ printf -- '\033[33m Installing starship\n\033[37m'
cargo install starship --locked cargo install starship --locked
# *** Desktop applications *** # *** 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 if [ "$DESKTOP" == "yes" ]; then
printf -- '\033[33m Installing Krita\n\033[37m' printf -- '\033[33m Installing Krita\n\033[37m'
flatpak install -y flathub org.kde.krita flatpak install -y flathub org.kde.krita
printf -- '\033[33m Installing KiCad\n\033[37m' printf -- '\033[33m Installing KiCad\n\033[37m'
flatpak install -y flathub org.kicad.KiCad flatpak install -y flathub org.kicad.KiCad
printf -- '\033[33m Installing FreeCad\n\033[37m' printf -- '\033[33m Installing FreeCad\n\033[37m'
flatpak install -y flathub org.freecadweb.FreeCAD flatpak install -y flathub org.freecadweb.FreeCAD
printf -- '\033[33m Installing Moonlight\n\033[37m' printf -- '\033[33m Installing Moonlight\n\033[37m'
flatpak install -y flathub com.moonlight_stream.Moonlight flatpak install -y flathub com.moonlight_stream.Moonlight
printf -- '\033[33m Installing DrawIo\n\033[37m' printf -- '\033[33m Installing DrawIo\n\033[37m'
flatpak install -y flathub com.jgraph.drawio.desktop flatpak install -y flathub com.jgraph.drawio.desktop
# Install VSCode # Install VSCode
printf -- '\033[33m Installing VSCode\n\033[37m' printf -- '\033[33m Installing VSCode\n\033[37m'
sudo snap install --classic code sudo snap install --classic code
# Install gnome-shell-extension-manager # Install gnome-shell-extension-manager
printf -- '\033[33m Installing gnome-shell-extension-manager\n\033[37m' printf -- '\033[33m Installing gnome-shell-extension-manager\n\033[37m'
sudo apt install -y gnome-shell-extension-manager sudo apt install -y gnome-shell-extension-manager
# Install gnome tweaks # Install gnome tweaks
printf -- '\033[33m Installing gnome tweaks\n\033[37m' printf -- '\033[33m Installing gnome tweaks\n\033[37m'
sudo apt install -y gnome-tweaks sudo apt install -y gnome-tweaks
# Install remmina # Install remmina
printf -- '\033[33m Installing remmina\n\033[37m' printf -- '\033[33m Installing remmina\n\033[37m'
sudo apt install -y remmina sudo apt install -y remmina
# Install feh # Install feh
printf -- '\033[33m Installing feh\n\033[37m' printf -- '\033[33m Installing feh\n\033[37m'
sudo apt install -y feh sudo apt install -y feh
# Install NerdFonts # Install NerdFonts
printf -- '\033[33m Installing NerdFonts\n\033[37m' printf -- '\033[33m Installing NerdFonts\n\033[37m'
mkdir -p /home/$USER/.local/share/fonts mkdir -p /home/$USER/.local/share/fonts
cd /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 wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/CodeNewRoman.zip
unzip -o CodeNewRoman.zip unzip -o CodeNewRoman.zip
rm CodeNewRoman.zip rm CodeNewRoman.zip
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/NerdFontsSymbolsOnly.zip wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/NerdFontsSymbolsOnly.zip
unzip -o NerdFontsSymbolsOnly.zip unzip -o NerdFontsSymbolsOnly.zip
rm NerdFontsSymbolsOnly.zip rm NerdFontsSymbolsOnly.zip
fc-cache -fv fc-cache -fv
# Install Wezterm # Install Wezterm
printf -- '\033[33m Installing wezterm\n\033[37m' 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 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 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 update
sudo apt install -y wezterm sudo apt install -y wezterm
# Install Brave Browser # Install Brave Browser
printf -- '\033[33m Installing Brave Browser\n\033[37m' 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 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 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 update
sudo apt install -y brave-browser sudo apt install -y brave-browser
# Install Virtualbox # Install Virtualbox
printf -- '\033[33m Installing Virtualbox\n\033[37m' 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_2016.asc | gpg --dearmor >oracle_vbox_2016.gpg
curl https://www.virtualbox.org/download/oracle_vbox.asc | gpg --dearmor >oracle_vbox.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_2016.gpg /etc/apt/trusted.gpg.d/
sudo install -o root -g root -m 644 oracle_vbox.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 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 update
sudo apt install -y linux-headers-"$(uname -r)" dkms sudo apt install -y linux-headers-"$(uname -r)" dkms
sudo apt install virtualbox-7.1 -y 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 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 VBoxManage extpack install --replace Oracle_VirtualBox_Extension_Pack-7.1.4.vbox-extpack --accept-license=eb31505e56e9b4d0fbca139104da41ac6f6b98f8e78968bdf01b1f3da3c4f9ae
sudo usermod -a -G vboxusers "$USER" 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 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 fi
# *** Dotfile symlinking *** # *** Dotfile symlinking ***
printf -- '\033[32m *** Dotfile symlinking ***\n\033[37m' printf -- '\033[32m *** Dotfile symlinking ***\n\033[37m'
# Symlink wezterm config if [ "$WSL" == "no" ]; then
printf -- '\033[33m Symlinking wezterm config\n\033[37m' # Symlink wezterm config
ln -sf ~/code_server/wezterm.lua ~/.wezterm.lua printf -- '\033[33m Symlinking wezterm config\n\033[37m'
ln -sf ~/code_server/wezterm.lua ~/.wezterm.lua
fi
# Symlink nvim config # Symlink nvim config
printf -- '\033[33m Symlinking nvim config\n\033[37m' printf -- '\033[33m Symlinking nvim config\n\033[37m'
mkdir -p ~/.config/nvim mkdir -p ~/.config/nvim
@ -377,7 +389,11 @@ ln -sf ~/code_server/config/nvim/init.lua ~/.config/nvim/init.lua
# Symlink git config # Symlink git config
printf -- '\033[33m Symlinking git config\n\033[37m' 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 # Symlink tmux config
printf -- '\033[33m Symlinking tmux config\n\033[37m' printf -- '\033[33m Symlinking tmux config\n\033[37m'