From d5ea34a80562b64a391cb007e391cd567a3caabd Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Mon, 19 May 2025 10:11:46 +0200 Subject: [PATCH 1/5] Updated scripts --- bashrc_ubuntu | 30 ++++++++++++------------- start_toolbox.sh | 11 ++++++++++ tmux.conf | 57 ++++++++++++++++++++---------------------------- 3 files changed, 50 insertions(+), 48 deletions(-) create mode 100755 start_toolbox.sh diff --git a/bashrc_ubuntu b/bashrc_ubuntu index 7c640c8..1124079 100644 --- a/bashrc_ubuntu +++ b/bashrc_ubuntu @@ -4,12 +4,6 @@ case $- in *) return ;; esac -# if [[ ! $TERM =~ linux ]]; then -# if [[ $TERM =~ tmux ]]; then -# source ~/.local/share/blesh/ble.sh --noattach -# fi -# fi - # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth @@ -25,6 +19,13 @@ HISTFILESIZE=2000 # update the values of LINES and COLUMNS. shopt -s checkwinsize +# Set autocomplete +bind 'set show-all-if-ambiguous on' +bind 'TAB:menu-complete' + +# Set auto cd +shopt -s autocd + # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" @@ -51,17 +52,16 @@ alias lsa="eza -1 -l --icons=auto --git-repos --git -h -g -o --no-permissions -a alias lss="eza -1 -l --icons=auto --git-repos --git -h -g --total-size -o --no-permissions -a" eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" +source ~/.fzf.bash +eval "$(starship init bash)" if [[ $TERM =~ tmux ]]; then - source ~/.fzf.bash eval "$(zoxide init bash)" - eval "$(starship init bash)" - # [[ ! ${BLE_VERSION-} ]] || ble-attach fi -# TMUX -if [[ ! $TERM =~ tmux ]]; then - if which tmux >/dev/null 2>&1; then - tmux new-session - fi -fi +# # TMUX +# if [[ ! $TERM =~ tmux ]]; then +# if which tmux >/dev/null 2>&1; then +# tmux new-session +# fi +# fi diff --git a/start_toolbox.sh b/start_toolbox.sh new file mode 100755 index 0000000..d987707 --- /dev/null +++ b/start_toolbox.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Name of the tmux session +SESSION_NAME="toolbox" + +# Check if the tmux session already exists +if tmux has-session -t "$SESSION_NAME" 2>/dev/null; then + tmux attach-session -t "$SESSION_NAME" +else + tmux new-session -s "$SESSION_NAME" "devspectoolbox" +fi diff --git a/tmux.conf b/tmux.conf index 32ed406..b2cff85 100644 --- a/tmux.conf +++ b/tmux.conf @@ -10,44 +10,12 @@ if "test ! -d ~/.tmux/plugins/tpm" \ # Activate the plugins. run "~/.tmux/plugins/tpm/tpm" +# Options set -g mouse on - -# Start windows and panes at 1, not 0 set -g base-index 1 set -g pane-base-index 1 set-window-option -g pane-base-index 1 set-option -g renumber-windows on - -set -g @smart-splits_no_wrap '' # to disable wrapping. (any value disables wrapping) - -set -g @smart-splits_move_left_key 'C-h' # key-mapping for navigation. -set -g @smart-splits_move_down_key 'C-j' # --"-- -set -g @smart-splits_move_up_key 'C-k' # --"-- -set -g @smart-splits_move_right_key 'C-l' # --"-- - -set -g @smart-splits_resize_left_key 'M-h' # key-mapping for resizing. -set -g @smart-splits_resize_down_key 'M-j' # --"-- -set -g @smart-splits_resize_up_key 'M-k' # --"-- -set -g @smart-splits_resize_right_key 'M-l' # --"-- - -set -g @smart-splits_resize_step_size '3' # change the step-size for resizing. - -bind -n C-M-h if -F "#{@pane-is-vim}" 'split-window -h -b -c "#{pane_current_path}" "nvim"' 'split-window -h -b' -bind -n C-M-l if -F "#{@pane-is-vim}" 'split-window -h -c "#{pane_current_path}" "nvim"' 'split-window -h' -bind -n C-M-j split-window -v -p 10 -c "#{pane_current_path}" -bind -n C-M-k split-window -v -b -c "#{pane_current_path}" - -bind -n M-1 select-window -t 1 -bind -n M-2 select-window -t 2 -bind -n M-3 select-window -t 3 -bind -n M-4 select-window -t 4 -bind -n M-5 select-window -t 5 -bind -n M-n select-window -n -bind -n M-Enter new-window -bind -n M-c kill-pane - -bind -n C-g display-popup -d "#{pane_current_path}" -E -w 90% -h 90% "lazygit" - set-option -g status-position top set-option -g default-terminal "tmux-256color" set-option -sa terminal-features ',xterm-256color:RGB' @@ -55,16 +23,39 @@ set-option -sg escape-time 1 set-option -g focus-events on set-option -g status-right-length 100 set-option -g set-clipboard on +set -g @smart-splits_no_wrap '' # to disable wrapping. (any value disables wrapping) +set -g @smart-splits_resize_step_size '3' # change the step-size for resizing. +# Key bindings +set -g @smart-splits_move_left_key 'C-h' # key-mapping for navigation. +set -g @smart-splits_move_down_key 'C-j' # --"-- +set -g @smart-splits_move_up_key 'C-k' # --"-- +set -g @smart-splits_move_right_key 'C-l' # --"-- +set -g @smart-splits_resize_left_key 'M-h' # key-mapping for resizing. +set -g @smart-splits_resize_down_key 'M-j' # --"-- +set -g @smart-splits_resize_up_key 'M-k' # --"-- +set -g @smart-splits_resize_right_key 'M-l' # --"-- + +bind h if -F "#{@pane-is-vim}" 'split-window -h -b -c "#{pane_current_path}" "source ~/.bashrc && nvim"' 'split-window -h -b' +bind l if -F "#{@pane-is-vim}" 'split-window -h -c "#{pane_current_path}" "source ~/.bashrc && nvim"' 'split-window -h' +bind j split-window -v -p 10 -c "#{pane_current_path}" +bind k split-window -v -b -c "#{pane_current_path}" + +bind -n C-g display-popup -d "#{pane_current_path}" -E -w 90% -h 90% "lazygit" + +# Status bar config set -g status-interval 2 set -g status-bg "#303030" set -g status-fg "#c6c6c6" set -g status-left '#[bg=#87afd7,fg=#000000] #{session_name} ' set -g status-right '#[fg=#87afd7,bg=#303030]#[fg=#c6c6c6,bg=#303030] #{pane_current_path} #[bg=#87afd7,fg=#000000] %d-%b-%Y %H:%M ' set -g status-justify left + set-window-option -g window-status-separator '' set-window-option -g window-status-format '#[bg=#303030,fg=#555555] #I ' set-window-option -g window-status-current-format '#[bg=#303030,fg=#c6c6c6] #I ' + +# Window styling set -g window-style 'bg=default,fg=#c6c6c6' set -g window-active-style 'bg=default,fg=#c6c6c6' set -g pane-border-style 'bg=#262626,fg=#000000' From 4a10e0d20f5153b8fd3bf132e42b27f78e5b3e75 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Mon, 19 May 2025 10:20:15 +0200 Subject: [PATCH 2/5] Updated script --- config/alacritty/alacritty.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/alacritty/alacritty.toml b/config/alacritty/alacritty.toml index 7310b0e..6840ffb 100644 --- a/config/alacritty/alacritty.toml +++ b/config/alacritty/alacritty.toml @@ -21,14 +21,14 @@ cyan="#a0a0a0" white="#eeeeee" [colors.bright] -black="#a0a0a0" +black="#303030" red="#d75400" green="#afd787" yellow="#d7af5f" blue="#87afd7" magenta="#d7d7af" cyan="#a0a0a0" -white="#eeeeee" +white="#ffffff" [colors.dim] black="#000000" @@ -38,7 +38,7 @@ yellow="#d7af5f" blue="#87afd7" magenta="#d7d7af" cyan="#a0a0a0" -white="#eeeeee" +white="#dddddd" [selection] save_to_clipboard = true @@ -50,5 +50,5 @@ padding={x=2} [env] TERM="xterm-256color" -# [mouse] -# hide_when_typing = true +[mouse] +hide_when_typing = true From 4ba92c89626fdce07eb89f41a39daee42fff23c0 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Mon, 19 May 2025 16:10:52 +0200 Subject: [PATCH 3/5] Upadted scripts --- bashrc_arch | 14 +++----------- bashrc_ubuntu | 10 ---------- update_arch.sh | 1 + update_ubuntu.sh | 2 ++ 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/bashrc_arch b/bashrc_arch index b403786..fa08077 100644 --- a/bashrc_arch +++ b/bashrc_arch @@ -46,17 +46,9 @@ alias ls="eza -1 -l --icons=auto --git-repos --git -h -g -o --no-permissions" alias lsa="eza -1 -l --icons=auto --git-repos --git -h -g -o --no-permissions -a" alias lss="eza -1 -l --icons=auto --git-repos --git -h -g --total-size -o --no-permissions -a" +source ~/.fzf.bash +eval "$(starship init bash)" -if [[ ! $TERM =~ linux ]]; then - # if [[ $TERM =~ tmux ]]; then - source ~/.fzf.bash - eval "$(zoxide init bash)" - eval "$(starship init bash)" - # else - # if which tmux >/dev/null 2>&1; then - # tmux new-session - # fi - # fi -else +if [[ $TERM =~ linux ]]; then wrappedhl fi diff --git a/bashrc_ubuntu b/bashrc_ubuntu index 1124079..7673d0a 100644 --- a/bashrc_ubuntu +++ b/bashrc_ubuntu @@ -55,13 +55,3 @@ eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" source ~/.fzf.bash eval "$(starship init bash)" -if [[ $TERM =~ tmux ]]; then - eval "$(zoxide init bash)" -fi - -# # TMUX -# if [[ ! $TERM =~ tmux ]]; then -# if which tmux >/dev/null 2>&1; then -# tmux new-session -# fi -# fi diff --git a/update_arch.sh b/update_arch.sh index ca45b70..0b83519 100755 --- a/update_arch.sh +++ b/update_arch.sh @@ -172,6 +172,7 @@ rustup default stable ln -sf ~/linuxbox/bashrc_arch ~/.bashrc mkdir -p ~/.local/bin ln -sf ~/linuxbox/update_wrapper.sh ~/.local/bin/update +ln -sf ~/linuxbox/start_nvim.sh ~/.local/bin/start_nvim sudo localectl set-locale LANG=en_US.UTF-8 # Install hyprland diff --git a/update_ubuntu.sh b/update_ubuntu.sh index 164ce76..cb327d7 100755 --- a/update_ubuntu.sh +++ b/update_ubuntu.sh @@ -83,6 +83,8 @@ else ln -sf ~/linuxbox/config/alacritty/alacritty.toml ~/.config/alacritty/alacritty.toml fi ln -sf ~/linuxbox/update_wrapper.sh ~/.local/bin/update +ln -sf ~/linuxbox/start_nvim.sh ~/.local/bin/start_nvim +ln -sf ~/linuxbox/start_toolbox.sh ~/.local/bin/start_toolbox # Install brew printf -- '\033[33m Installing Homebrew\n\033[37m' From fd66009be4692bc78c506e2d80e4ced68654e72f Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Mon, 19 May 2025 16:12:03 +0200 Subject: [PATCH 4/5] Updated script --- update_arch.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/update_arch.sh b/update_arch.sh index 0b83519..a7b47a4 100755 --- a/update_arch.sh +++ b/update_arch.sh @@ -269,14 +269,6 @@ if [ "${ROLES[TERMINAL]}" == "yes" ]; then ~/.fzf/install --all source ~/.fzf.bash - # printf -- '\033[33m Installing ble.sh\n\033[37m' - # if [ -d ~/ble.sh ]; then rm -rf ~/ble.sh; fi - # cd ~ - # git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.git - # make -C ble.sh install - # if [ -d ~/ble.sh ]; then rm -rf ~/ble.sh; fi - # ln -sf ~/linuxbox/blerc ~/.blerc - printf -- '\033[33m Installing LSP servers\n\033[37m' sudo pacman --noconfirm --needed -S prettier stylua python-black shfmt lua-language-server bash-language-server ccls vscode-html-languageserver vscode-json-languageserver marksman pyright yaml-language-server vscode-css-languageserver clang yay --noconfirm -S --needed --aur dockerfile-language-server From a4801430600f7d76c33478df63134539fcbc5e46 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Mon, 19 May 2025 18:13:38 +0200 Subject: [PATCH 5/5] Updated scripts --- config/nvim/init.lua | 1 + update_arch.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 12fd41d..f351469 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -235,6 +235,7 @@ require("lazy").setup({ json = { "prettier" }, yaml = { "prettier" }, markdown = { "prettier" }, + sh = { "shfmt" }, }, formatters = { clang_format = { diff --git a/update_arch.sh b/update_arch.sh index a7b47a4..7711140 100755 --- a/update_arch.sh +++ b/update_arch.sh @@ -172,7 +172,6 @@ rustup default stable ln -sf ~/linuxbox/bashrc_arch ~/.bashrc mkdir -p ~/.local/bin ln -sf ~/linuxbox/update_wrapper.sh ~/.local/bin/update -ln -sf ~/linuxbox/start_nvim.sh ~/.local/bin/start_nvim sudo localectl set-locale LANG=en_US.UTF-8 # Install hyprland @@ -258,6 +257,7 @@ if [ "${ROLES[TERMINAL]}" == "yes" ]; then ln -sf ~/linuxbox/config/nvim/init.lua ~/.config/nvim/init.lua ln -sf ~/linuxbox/config/alacritty/alacritty.toml ~/.config/alacritty/alacritty.toml ln -sf ~/linuxbox/config/lazygit/config.yml ~/.config/lazygit/config.yml + ln -sf ~/linuxbox/start_nvim.sh ~/.local/bin/start_nvim if [ -d ~/.local/share/nvim/lazy ]; then nvim --headless "+Lazy! sync" +qa