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
if [ "$WSL" == "no" ]; then
if dpkg -s flatpak &>/dev/null; then
flatpak update -y
else
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,9 +279,10 @@ 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
if [ "$DESKTOP" == "yes" ]; then
printf -- '\033[33m Installing Krita\n\033[37m'
flatpak install -y flathub org.kde.krita
@ -361,15 +372,16 @@ if [ "$DESKTOP" == "yes" ]; then
printf -- '\033[33m Installing Timeshift\n\033[37m'
sudo apt install -y timeshift
fi
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'