From b5daa2039ae46cf0ef02f5c4dde3de4a58ee4af6 Mon Sep 17 00:00:00 2001 From: afonsofrancof Date: Tue, 13 Feb 2024 17:50:02 +0000 Subject: [PATCH 1/5] [alacritty] Fixed themes --- .config/alacritty/alacritty.toml | 5 +++-- .../themes/{gruvbox_material_dark.toml => gruvbox_dark.toml} | 0 .../{gruvbox_material_light.toml => gruvbox_light.toml} | 2 +- .zshrc | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) rename .config/alacritty/themes/{gruvbox_material_dark.toml => gruvbox_dark.toml} (100%) rename .config/alacritty/themes/{gruvbox_material_light.toml => gruvbox_light.toml} (95%) diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 0422d9f..be62564 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,4 +1,4 @@ -import = ["~/.config/alacritty/themes/gruvbox_material_dark.toml"] +import = ["~/.config/alacritty/themes/gruvbox_light.toml"] [env] TERM = "xterm-256color" @@ -11,7 +11,8 @@ family = "FiraCode Nerd Font Mono" style = "Retina" [window] -opacity = 0.95 +opacity = 1 +blur = false option_as_alt = "Both" dynamic_padding = true decorations= "Buttonless" diff --git a/.config/alacritty/themes/gruvbox_material_dark.toml b/.config/alacritty/themes/gruvbox_dark.toml similarity index 100% rename from .config/alacritty/themes/gruvbox_material_dark.toml rename to .config/alacritty/themes/gruvbox_dark.toml diff --git a/.config/alacritty/themes/gruvbox_material_light.toml b/.config/alacritty/themes/gruvbox_light.toml similarity index 95% rename from .config/alacritty/themes/gruvbox_material_light.toml rename to .config/alacritty/themes/gruvbox_light.toml index d43ac16..de3705f 100644 --- a/.config/alacritty/themes/gruvbox_material_light.toml +++ b/.config/alacritty/themes/gruvbox_light.toml @@ -2,7 +2,7 @@ # Default colors [colors.primary] -background = '#fbf1c7' +background = '#f2e5bc' foreground = '#654735' # Normal colors diff --git a/.zshrc b/.zshrc index f1bafe5..cf30db0 100644 --- a/.zshrc +++ b/.zshrc @@ -73,7 +73,7 @@ ZSH_CUSTOM=/Users/afonso/.config/zsh #THEME -source $HOME/.config/zsh/themes/gruvbox_dark.zsh +source $HOME/.config/zsh/themes/gruvbox_light.zsh source $HOME/.config/zsh/overrides.zsh plugins=(git sudo macos tmux command-not-found web-search zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting fzf-tab) From ac112e2072980bc0a56ee57d4045d78ab6ac55f2 Mon Sep 17 00:00:00 2001 From: afonsofrancof Date: Tue, 13 Feb 2024 17:51:02 +0000 Subject: [PATCH 2/5] [tmux] removed plugin and added it manually --- .config/tmux/tmux.conf | 1 + .config/tmux/tmux_plugins.conf | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index fcada17..ab7ea46 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -5,4 +5,5 @@ source-file ~/.config/tmux/tmux_binds.conf source-file ~/.config/tmux/tmux_copy_mode.conf source-file ~/.config/tmux/tmux_plugins.conf source-file ~/.config/tmux/tmux_init.conf +source-file ~/.config/tmux/tmux_status_bar.conf diff --git a/.config/tmux/tmux_plugins.conf b/.config/tmux/tmux_plugins.conf index c280ef2..044ac7c 100644 --- a/.config/tmux/tmux_plugins.conf +++ b/.config/tmux/tmux_plugins.conf @@ -3,18 +3,12 @@ # List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' -set -g @plugin 'niksingh710/minimal-tmux-status' #set -g @plugin 'catppuccin/tmux' #set -g @plugin 'tmux-plugins/tmux-resurrect' #set -g @plugin 'tmux-plugins/tmux-continuum' #set -g @plugin 'tomhey/tmux-remote-sessions' # Plugin settings -set -g @minimal-tmux-justify "left" -set -g @minimal-tmux-indicator-str "" -set -g @minimal-tmux-indicator false -set -g @minimal-tmux-status "top" -set -g @minimal-tmux-bg "#698DDA" #set -g @catppuccin_flavour 'latte' #set -g @catppuccin_window_tabs_enabled on #set -g @resurrect-strategy-nvim 'session' From 0415827f4ba5f935623f48c1de63283d62ff4e01 Mon Sep 17 00:00:00 2001 From: afonsofrancof Date: Tue, 13 Feb 2024 17:51:21 +0000 Subject: [PATCH 3/5] [zsh] changed gruvbox theme --- .config/zsh/themes/gruvbox_dark.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.config/zsh/themes/gruvbox_dark.zsh b/.config/zsh/themes/gruvbox_dark.zsh index 8610971..c776a66 100644 --- a/.config/zsh/themes/gruvbox_dark.zsh +++ b/.config/zsh/themes/gruvbox_dark.zsh @@ -31,7 +31,7 @@ ZSH_HIGHLIGHT_STYLES[builtin]='fg=#b8bb26' ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=#b8bb26' ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=#b8bb26' ## Punctuation -ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#fabd2f' +ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#d4be98' ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter]='fg=#83a598' ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-unquoted]='fg=#83a598' ZSH_HIGHLIGHT_STYLES[process-substitution-delimiter]='fg=#83a598' @@ -58,9 +58,9 @@ ZSH_HIGHLIGHT_STYLES[numeric-fd]='fg=#83a598' ## No category relevant in spec ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=#fb4934' ZSH_HIGHLIGHT_STYLES[path]='fg=#83a598,underline' -ZSH_HIGHLIGHT_STYLES[path_pathseparator]='fg=#fabd2f,underline' +ZSH_HIGHLIGHT_STYLES[path_pathseparator]='fg=#d4be98,underline' ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=#83a598,underline' -ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]='fg=#fabd2f,underline' +ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]='fg=#d4be98,underline' ZSH_HIGHLIGHT_STYLES[globbing]='fg=#83a598' ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=#d3869b' #ZSH_HIGHLIGHT_STYLES[command-substitution]='fg=?' @@ -72,3 +72,5 @@ ZSH_HIGHLIGHT_STYLES[redirection]='fg=#83a598' ZSH_HIGHLIGHT_STYLES[arg0]='fg=#83a598' ZSH_HIGHLIGHT_STYLES[default]='fg=#83a598' ZSH_HIGHLIGHT_STYLES[cursor]='fg=#83a598' +#ZSH Syntax Highlighting +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#928374,italic,underline" From 9d74c517609528095e4c617906fde86a1ad02486 Mon Sep 17 00:00:00 2001 From: afonsofrancof Date: Tue, 13 Feb 2024 17:51:41 +0000 Subject: [PATCH 4/5] [script] Finished change-theme.sh for now --- .local/bin/change-theme.sh | 114 ++++++++++++++++++++++++------------- 1 file changed, 74 insertions(+), 40 deletions(-) diff --git a/.local/bin/change-theme.sh b/.local/bin/change-theme.sh index eca22e6..0927d6a 100755 --- a/.local/bin/change-theme.sh +++ b/.local/bin/change-theme.sh @@ -4,73 +4,107 @@ # @raycast.schemaVersion 1 # @raycast.title Theme Switcher # @raycast.mode silent -# @raycast.argument1 { "type": "dropdown","placeholder":"Theme", "data": [{"title": "Catppuccin Frappe", "value": "catppuccin-frappe"},{"title": "Catppuccin Latte", "value": "catppuccin-latte"},{"title": "Gruvbox Material Dark", "value": "gruvbox-material-dark"},{"title": "Gruvbox Material Light", "value": "gruvbox-material-light"}]} +# @raycast.argument1 { "type": "dropdown","placeholder":"Theme", "data": [{"title": "Catppuccin Frappe", "value": "catppuccin-frappe"},{"title": "Catppuccin Latte", "value": "catppuccin-latte"},{"title": "Gruvbox Dark", "value": "gruvbox-dark"},{"title": "Gruvbox Light", "value": "gruvbox-light"}]} # alacritty_theme_name="" zsh_theme_name="" +background_color="" +nvim_color_scheme="" +tmux_bar_unfocused_fg="" +tmux_bar_focused_bg="" +tmux_bar_focused_fg="" + +change_common(){ + #Change alacritty theme + sed -i '' -e "s|import = \[\"~/.config/alacritty/themes/.*\"\]|import = [\"~/.config/alacritty/themes/${alacritty_theme_name}.toml\"]|g" ~/.config/alacritty/alacritty.toml + #Change zsh theme + sed -i '' -e "s|source \$HOME/.config/zsh/themes/.*zsh|source \$HOME/.config/zsh/themes/${zsh_theme_name}.zsh|g" ~/.zshrc + #Reload zsh sessions + pids=$(pgrep zsh) + while IFS= read -r pid; do + kill -USR1 "$pid" + done <<< "$pids" + + #Change tmux theme + sed -i '' -E "s/set -g status-bg .*$/set -g status-bg \"$background_color\"/" ~/.config/tmux/tmux_status_bar.conf + sed -i '' -E "s/set -g @unfocused-fg .*$/set -g @unfocused-fg \"$tmux_bar_unfocused_fg\"/" ~/.config/tmux/tmux_status_bar.conf + sed -i '' -E "s/set -g @focused-bg .*$/set -g @focused-bg \"$tmux_bar_focused_bg\"/" ~/.config/tmux/tmux_status_bar.conf + sed -i '' -E "s/set -g @focused-fg .*$/set -g @focused-fg \"$tmux_bar_focused_fg\"/" ~/.config/tmux/tmux_status_bar.conf + + + #Reload tmux sessions + tmux source-file ~/.config/tmux/tmux.conf + + echo "vim.cmd('colorscheme ${nvim_color_scheme}')" >> ~/.config/nvim/lua/core/theme.lua + nvim --server /tmp/nvim.pipe --remote-send ":colorscheme ${nvim_color_scheme}" || true +} case $1 in "catppuccin-latte") alacritty_theme_name="catppuccin_latte" zsh_theme_name="catppuccin_latte" + nvim_color_scheme="catppuccin-latte" + background_color="#eff1f5" + tmux_bar_unfocused_fg="#4c4f69" + tmux_bar_focused_bg="#4c4f69" + tmux_bar_focused_fg="#eff1f5" - set +e - #Clear nvim theme file - > ~/.config/nvim/lua/core/theme.lua - echo "vim.cmd('colorscheme catppuccin-latte')" >> ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':colorscheme catppuccin-latte' - set -e + echo '' > ~/.config/nvim/lua/core/theme.lua + change_common ;; "catppuccin-frappe") alacritty_theme_name="catppuccin_frappe" zsh_theme_name="catppuccin_frappe" + nvim_color_scheme="catppuccin-frappe" + background_color="#303446" + tmux_bar_unfocused_fg="#c6d0f5" + tmux_bar_focused_bg="#c6d0f5" + tmux_bar_focused_fg="#303446" - set +e - #Clear nvim theme file - > ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':colorscheme catppuccin-frappe' - echo "vim.cmd('colorscheme catppuccin-frappe')" >> ~/.config/nvim/lua/core/theme.lua - set -e + echo '' > ~/.config/nvim/lua/core/theme.lua + change_common ;; - "gruvbox-material-dark") - alacritty_theme_name="gruvbox_material_dark" + "gruvbox-dark") + alacritty_theme_name="gruvbox_dark" zsh_theme_name="gruvbox_dark" + nvim_color_scheme="gruvbox-material" + background_color="#282828" + tmux_bar_unfocused_fg="#d4be98" + tmux_bar_focused_bg="#d4be98" + tmux_bar_focused_fg="#282828" - set +e - #Clear nvim theme file - > ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_better_performance = 1' - echo "vim.g.gruvbox_material_better_performance = 1" >> ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_background = "medium"' + + nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_better_performance = 1' || true + echo "vim.g.gruvbox_material_better_performance = 1" > ~/.config/nvim/lua/core/theme.lua + nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_background = "medium"' || true echo "vim.g.gruvbox_material_background = 'medium'" >> ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.opt.background = "dark"' + nvim --server /tmp/nvim.pipe --remote-send ':lua vim.opt.background = "dark"' || true echo "vim.opt.background = 'dark'" >> ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':colorscheme gruvbox-material' - echo "vim.cmd('colorscheme gruvbox-material')" >> ~/.config/nvim/lua/core/theme.lua - set -e + + change_common ;; - "gruvbox-material-light") - alacritty_theme_name="gruvbox_material_light" + "gruvbox-light") + alacritty_theme_name="gruvbox_light" zsh_theme_name="gruvbox_light" + nvim_color_scheme="gruvbox-material" + background_color="#f2e5bc" + tmux_bar_unfocused_fg="#654735" + tmux_bar_focused_bg="#654735" + tmux_bar_focused_fg="#f2e5bc" - set +e - #Clear nvim theme file - > ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_better_performance = 1' - echo "vim.g.gruvbox_material_better_performance = 1" >> ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_background = "soft"' + + nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_better_performance = 1' || true + echo "vim.g.gruvbox_material_better_performance = 1" > ~/.config/nvim/lua/core/theme.lua + nvim --server /tmp/nvim.pipe --remote-send ':lua vim.g.gruvbox_material_background = "soft"' || true echo "vim.g.gruvbox_material_background = 'soft'" >> ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':lua vim.opt.background = "light"' + nvim --server /tmp/nvim.pipe --remote-send ':lua vim.opt.background = "light"' || true echo "vim.opt.background = 'light'" >> ~/.config/nvim/lua/core/theme.lua - nvim --server /tmp/nvim.pipe --remote-send ':colorscheme gruvbox-material' - echo "vim.cmd('colorscheme gruvbox-material')" >> ~/.config/nvim/lua/core/theme.lua - set -e + + change_common + ;; esac - -sed -i '' -e "s|import = \[\"~/.config/alacritty/themes/.*\"\]|import = [\"~/.config/alacritty/themes/${alacritty_theme_name}.toml\"]|g" ~/.config/alacritty/alacritty.toml -sed -i '' -e "s|source \$HOME/.config/zsh/themes/.*zsh|source \$HOME/.config/zsh/themes/${zsh_theme_name}.zsh|g" ~/.zshrc From e41c17d3eb172d12e739256ceb9fd425f05773a1 Mon Sep 17 00:00:00 2001 From: afonsofrancof Date: Tue, 13 Feb 2024 17:52:31 +0000 Subject: [PATCH 5/5] [zsh] Added TRAPUSR1 to respawn shell on theme change --- .zshenv | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .zshenv diff --git a/.zshenv b/.zshenv new file mode 100644 index 0000000..a169cd3 --- /dev/null +++ b/.zshenv @@ -0,0 +1,6 @@ +#This is used to reload the instance +TRAPUSR1() { + if [[ -o INTERACTIVE ]]; then + exec "${SHELL}" + fi +}