diff --git a/.config/ghostty/config b/.config/ghostty/config index bc8355a..d448f84 100644 --- a/.config/ghostty/config +++ b/.config/ghostty/config @@ -1,6 +1,5 @@ # Theme -theme = GruvboxDarkHard -background = 1d2021 +theme = gruvbox-material-medium-dark # Font font-family = JetBrainsMono Nerd Font Mono diff --git a/.config/ghostty/themes/gruvbox-material-hard-dark b/.config/ghostty/themes/gruvbox-material-hard-dark new file mode 100644 index 0000000..118afb0 --- /dev/null +++ b/.config/ghostty/themes/gruvbox-material-hard-dark @@ -0,0 +1,21 @@ +palette = 0=#141617 +palette = 1=#ea6962 +palette = 2=#a9b665 +palette = 3=#d8a657 +palette = 4=#7daea3 +palette = 5=#d3869b +palette = 6=#89b482 +palette = 7=#ddc7a1 +palette = 8=#141617 +palette = 9=#ea6962 +palette = 10=#a9b665 +palette = 11=#d8a657 +palette = 12=#7daea3 +palette = 13=#d3869b +palette = 14=#89b482 +palette = 15=#ddc7a1 +background = #1d2021 +foreground = #ddc7a1 +cursor-color = #ffffff +selection-background = #2b2c3f +selection-foreground = #333e34 diff --git a/.config/ghostty/themes/gruvbox-material-hard-light b/.config/ghostty/themes/gruvbox-material-hard-light new file mode 100644 index 0000000..1d3114a --- /dev/null +++ b/.config/ghostty/themes/gruvbox-material-hard-light @@ -0,0 +1,21 @@ +palette = 0=#f3eac7 +palette = 1=#c14a4a +palette = 2=#6c782e +palette = 3=#b47109 +palette = 4=#45707a +palette = 5=#945e80 +palette = 6=#4c7a5d +palette = 7=#4f3829 +palette = 8=#f3eac7 +palette = 9=#c14a4a +palette = 10=#6c782e +palette = 11=#b47109 +palette = 12=#45707a +palette = 13=#945e80 +palette = 14=#4c7a5d +palette = 15=#4f3829 +background = #f9f5d7 +foreground = #4f3829 +cursor-color = #654735 +selection-background = #2b2c3f +selection-foreground = #333e34 diff --git a/.config/ghostty/themes/gruvbox-material-medium-dark b/.config/ghostty/themes/gruvbox-material-medium-dark new file mode 100644 index 0000000..87624a0 --- /dev/null +++ b/.config/ghostty/themes/gruvbox-material-medium-dark @@ -0,0 +1,21 @@ +palette = 0=#1b1b1b +palette = 1=#ea6962 +palette = 2=#a9b665 +palette = 3=#d8a657 +palette = 4=#7daea3 +palette = 5=#d3869b +palette = 6=#89b482 +palette = 7=#ddc7a1 +palette = 8=#1b1b1b +palette = 9=#ea6962 +palette = 10=#a9b665 +palette = 11=#d8a657 +palette = 12=#7daea3 +palette = 13=#d3869b +palette = 14=#89b482 +palette = 15=#ddc7a1 +background = #282828 +foreground = #ddc7a1 +cursor-color = #ffffff +selection-background = #2b2c3f +selection-foreground = #333e34 diff --git a/.config/ghostty/themes/gruvbox-material-medium-light b/.config/ghostty/themes/gruvbox-material-medium-light new file mode 100644 index 0000000..a991a86 --- /dev/null +++ b/.config/ghostty/themes/gruvbox-material-medium-light @@ -0,0 +1,21 @@ +palette = 0=#f2e5bc +palette = 1=#c14a4a +palette = 2=#6c782e +palette = 3=#b47109 +palette = 4=#45707a +palette = 5=#945e80 +palette = 6=#4c7a5d +palette = 7=#4f3829 +palette = 8=#f2e5bc +palette = 9=#c14a4a +palette = 10=#6c782e +palette = 11=#b47109 +palette = 12=#45707a +palette = 13=#945e80 +palette = 14=#4c7a5d +palette = 15=#4f3829 +background = #fbf1c7 +foreground = #4f3829 +cursor-color = #654735 +selection-background = #2b2c3f +selection-foreground = #333e34 diff --git a/.config/ghostty/themes/gruvbox-material-soft-dark b/.config/ghostty/themes/gruvbox-material-soft-dark new file mode 100644 index 0000000..e4cc09d --- /dev/null +++ b/.config/ghostty/themes/gruvbox-material-soft-dark @@ -0,0 +1,22 @@ +palette = 0=#252423 +palette = 1=#ea6962 +palette = 2=#a9b665 +palette = 3=#d8a657 +palette = 4=#7daea3 +palette = 5=#d3869b +palette = 6=#89b482 +palette = 7=#ddc7a1 +palette = 8=#252423 +palette = 9=#ea6962 +palette = 10=#a9b665 +palette = 11=#d8a657 +palette = 12=#7daea3 +palette = 13=#d3869b +palette = 14=#89b482 +palette = 15=#ddc7a1 +background = #32302f +foreground = #ddc7a1 +cursor-color = #ffffff +selection-background = #2b2c3f +selection-foreground = #333e34 + diff --git a/.config/ghostty/themes/gruvbox-material-soft-light b/.config/ghostty/themes/gruvbox-material-soft-light new file mode 100644 index 0000000..19047e0 --- /dev/null +++ b/.config/ghostty/themes/gruvbox-material-soft-light @@ -0,0 +1,21 @@ +palette = 0=#ebdbb2 +palette = 1=#c14a4a +palette = 2=#6c782e +palette = 3=#b47109 +palette = 4=#45707a +palette = 5=#945e80 +palette = 6=#4c7a5d +palette = 7=#4f3829 +palette = 8=#ebdbb2 +palette = 9=#c14a4a +palette = 10=#6c782e +palette = 11=#b47109 +palette = 12=#45707a +palette = 13=#945e80 +palette = 14=#4c7a5d +palette = 15=#4f3829 +background = #f2e5bc +foreground = #4f3829 +cursor-color = #654735 +selection-background = #2b2c3f +selection-foreground = #333e34 diff --git a/.config/kitty/current-theme.conf b/.config/kitty/current-theme.conf index 863e46f..88e7be9 100644 --- a/.config/kitty/current-theme.conf +++ b/.config/kitty/current-theme.conf @@ -1,49 +1,47 @@ -# gruvbox dark by morhetz, https://github.com/morhetz/gruvbox -# This work is licensed under the terms of the MIT license. -# For a copy, see https://opensource.org/licenses/MIT. +# vim:ft=kitty +## name: Gruvbox Material Dark Medium +## author: Sainnhe Park +## license: MIT +## upstream: https://raw.githubusercontent.com/rsaihe/gruvbox-material-kitty/main/colors/gruvbox-material-dark-medium.conf +## blurb: A modified version of Gruvbox with softer contrasts -background #1d2021 -foreground #d4be98 +background #282828 +foreground #d4be98 -cursor #928374 +selection_background #d4be98 +selection_foreground #282828 -selection_foreground #928374 -selection_background #3c3836 +cursor #a89984 +cursor_text_color background -color0 #282828 -color8 #928374 +# Black +color0 #665c54 +color8 #928374 -# red -color1 #cc241d -# light red -color9 #fb4934 +# Red +color1 #ea6962 +color9 #ea6962 -# green -color2 #98971a -# light green -color10 #b8bb26 +# Green +color2 #a9b665 +color10 #a9b665 -# yellow -color3 #d79921 -# light yellow -color11 #fabd2d +# Yellow +color3 #e78a4e +color11 #d8a657 -# blue -color4 #458588 -# light blue -color12 #83a598 +# Blue +color4 #7daea3 +color12 #7daea3 -# magenta -color5 #b16286 -# light magenta -color13 #d3869b +# Magenta +color5 #d3869b +color13 #d3869b -# cyan -color6 #689d6a -# lighy cyan -color14 #8ec07c +# Cyan +color6 #89b482 +color14 #89b482 -# light gray -color7 #a89984 -# dark gray -color15 #928374 +# White +color7 #d4be98 +color15 #d4be98 diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index acb4a8d..5968def 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -16,6 +16,6 @@ macos_option_as_alt yes hide_window_decorations yes # BEGIN_KITTY_THEME -# Gruvbox Dark +# Gruvbox Material Dark Medium include current-theme.conf # END_KITTY_THEME diff --git a/.config/kitty/kitty.conf.bak b/.config/kitty/kitty.conf.bak index 6dd8855..48cc279 100644 --- a/.config/kitty/kitty.conf.bak +++ b/.config/kitty/kitty.conf.bak @@ -1,5 +1,5 @@ # Font handling -font_family JetBrainsMono Nerd Font Mono Light +font_family JetBrainsMono Nerd Font Mono Regular font_size 16.0 #Remove annoying things @@ -16,6 +16,6 @@ macos_option_as_alt yes hide_window_decorations yes # BEGIN_KITTY_THEME -# Gruvbox Light +# Gruvbox Material Dark Soft include current-theme.conf # END_KITTY_THEME diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index c083547..0cf9014 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,45 +1,46 @@ { "blame.nvim": { "branch": "main", "commit": "39bb4cda9e658d053a43919b10ca52c0a4d738e1" }, - "blink.cmp": { "branch": "main", "commit": "046a2af7580ba90cda9ffebbab3f1fe68ca1fa59" }, - "conform.nvim": { "branch": "master", "commit": "f4e8837878fc5712d053ba3091a73d27d96a09e2" }, + "blink.cmp": { "branch": "main", "commit": "5f442681df24fe705d1ee7ce5b4d435aa4b4dee4" }, + "conform.nvim": { "branch": "master", "commit": "9180320205d250429f0f80e073326c674e2a7149" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, - "fzf-lua": { "branch": "main", "commit": "0527d79322da97375e6d6aa7da9f841adb704918" }, - "gruvbox-material": { "branch": "master", "commit": "b95c102f683d6402f84c8e492d3b0641c2d273e4" }, + "fzf-lua": { "branch": "main", "commit": "dbc5bd14e72ba680df44906e957b0a821121726b" }, + "gruvbox-material": { "branch": "master", "commit": "3eb4a739a80f68b8386d13359a005ef45bf9a9eb" }, "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, "inc-rename.nvim": { "branch": "main", "commit": "f4e13df6e2d0b3177a7305dbc1cc7f7ea44b94f1" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, - "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, + "lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" }, "ltex-extra.nvim": { "branch": "master", "commit": "24acd044ce7a26b3cdb537cbd094de37c3e1ac45" }, "lua-async-await": { "branch": "main", "commit": "652d94df34e97abe2d4a689edbc4270e7ead1a98" }, - "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "markview.nvim": { "branch": "main", "commit": "72cd34279e94ee96ee33bdf30a87b00e6d45319d" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.ai": { "branch": "main", "commit": "ebb04799794a7f94628153991e6334c3304961b8" }, + "nightfox.nvim": { "branch": "main", "commit": "595ffb8f291fc4a9bef3201a28b7c0379a41cdee" }, "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, - "nvim-bqf": { "branch": "main", "commit": "1b24dc6050c34e8cd377b6b4cd6abe40509e0187" }, - "nvim-dap": { "branch": "master", "commit": "567da83810dd9da32f9414d941bc6848715fc102" }, - "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, - "nvim-java": { "branch": "main", "commit": "a36f50c82f922f352d4ce7ac6a3c6b238b3e0a36" }, - "nvim-java-core": { "branch": "main", "commit": "5b03dca22fee76524a89e1c2dc1d73a9f0b1a3bb" }, + "nvim-bqf": { "branch": "main", "commit": "68d3c20f6bee49105dcfde3df1f7ec972529f2a3" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, + "nvim-dap": { "branch": "master", "commit": "665d3569a86395fe0dab85efbdb26d7d2ee57e49" }, + "nvim-dap-ui": { "branch": "master", "commit": "e94d98649dccb6a3884b66aabc2e07beb279e535" }, + "nvim-java": { "branch": "main", "commit": "e8e84413ca03e7d0541921e795b2e6bf8801f186" }, + "nvim-java-core": { "branch": "main", "commit": "22eca6b90b7e209299d99cbf60421f0ffdae5629" }, "nvim-java-dap": { "branch": "main", "commit": "55f239532f7a3789d21ea68d1e795abc77484974" }, "nvim-java-refactor": { "branch": "main", "commit": "ea1420fed5463c9cc976c2b4175f434b3646f0f7" }, "nvim-java-test": { "branch": "main", "commit": "7f0f40e9c5b7eab5096d8bec6ac04251c6e81468" }, - "nvim-lspconfig": { "branch": "master", "commit": "9f2c279cf9abe584f03bfeb37c6658d68e3ff49d" }, + "nvim-lspconfig": { "branch": "master", "commit": "57154fd9a24e76907e3b0bdba4677ef42c88d91c" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-treesitter": { "branch": "master", "commit": "102bc74e093ef54aab57a368db15befeb9ba9d58" }, + "nvim-treesitter": { "branch": "master", "commit": "5d18ef22dc63624e90aa7b6dbc17f2c3856ae716" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, - "nvim-ufo": { "branch": "main", "commit": "270ca542dae992ffe40274718c63645217ebc8bf" }, - "nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" }, + "nvim-ufo": { "branch": "main", "commit": "32cb247b893a384f1888b9cd737264159ecf183c" }, + "nvim-web-devicons": { "branch": "master", "commit": "63f552a7f59badc6e6b6d22e603150f0d5abebb7" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, - "oil.nvim": { "branch": "master", "commit": "dba037598843973b8c54bc5ce0318db4a0da439d" }, + "oil.nvim": { "branch": "master", "commit": "ba858b662599eab8ef1cba9ab745afded99cb180" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, - "refactoring.nvim": { "branch": "master", "commit": "2db6d378e873de31d18ade549c2edba64ff1c2e3" }, - "rustaceanvim": { "branch": "master", "commit": "0a618c1d1c05a8059880076feccb15301da6993d" }, - "smart-splits.nvim": { "branch": "master", "commit": "1e8fa136f1be004c75b4f794f86a7103e077b6ca" }, - "snacks.nvim": { "branch": "main", "commit": "282be8bfa8e6f46d6994ff46638d1c155b90753f" }, + "rustaceanvim": { "branch": "master", "commit": "6db1fe9e3f005b2e0921c7302d2c195eeb90a451" }, + "smart-splits.nvim": { "branch": "master", "commit": "49c397120944ebb89fbb11126b7edce36be8bdad" }, + "snacks.nvim": { "branch": "main", "commit": "98df370703b3c47a297988f3e55ce99628639590" }, "spring-boot.nvim": { "branch": "main", "commit": "218c0c26c14d99feca778e4d13f5ec3e8b1b60f0" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua index df882e7..a532f87 100644 --- a/.config/nvim/lua/core/keymaps.lua +++ b/.config/nvim/lua/core/keymaps.lua @@ -24,7 +24,7 @@ vim.keymap.set("n", "x", "source %") vim.keymap.set("n", "x", ":.lua") vim.keymap.set("v", "x", ":lua") --Merge lines in visual mode -vim.keymap.set("v", "J", function() +vim.keymap.set("v", "", function() for _ = 1, vim.fn.getpos("'>")[2] - vim.fn.getpos("'<")[2] - 1 do vim.api.nvim_command("normal! J") end diff --git a/.config/nvim/lua/core/theme.lua b/.config/nvim/lua/core/theme.lua index 49ac420..dd7ff5c 100644 --- a/.config/nvim/lua/core/theme.lua +++ b/.config/nvim/lua/core/theme.lua @@ -1,5 +1,5 @@ -vim.g.gruvbox_material_better_performance = 1 -vim.g.gruvbox_material_background = 'hard' -vim.g.gruvbox_material_foreground = 'original' -vim.opt.background = 'dark' +vim.g.gruvbox_material_better_performance=1 +vim.g.gruvbox_material_background="medium" +vim.g.gruvbox_material_foreground="material" +vim.opt.background="dark" vim.cmd('colorscheme gruvbox-material') diff --git a/.config/nvim/lua/core/variables.lua b/.config/nvim/lua/core/variables.lua index b904088..f815f1d 100644 --- a/.config/nvim/lua/core/variables.lua +++ b/.config/nvim/lua/core/variables.lua @@ -9,8 +9,9 @@ vim.wo.relativenumber = true vim.opt.hlsearch = false vim.opt.incsearch = true vim.opt.smartindent = true +-- Make searches case insensitive (except when using uppercase) +vim.opt.smartcase = true --Change word definition -vim.opt.iskeyword:append("-") vim.opt.iskeyword:append("_") --Remove Wrap vim.opt.wrap = false diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index 9e44e39..f77806e 100644 --- a/.config/nvim/lua/plugins/colorscheme.lua +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -4,4 +4,9 @@ return { event = "VeryLazy", priority = 1000, }, + { + "EdenEast/nightfox.nvim", + event = "VeryLazy", + priority = 1000 + } } diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua index d60abea..01c7cf3 100644 --- a/.config/nvim/lua/plugins/ui.lua +++ b/.config/nvim/lua/plugins/ui.lua @@ -96,5 +96,11 @@ return { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" } + }, + { + 'norcalli/nvim-colorizer.lua', + config = function() + require 'colorizer'.setup() + end } } diff --git a/.config/tmux/tmux_copy_mode.conf b/.config/tmux/tmux_copy_mode.conf index c2c4d06..33656a5 100644 --- a/.config/tmux/tmux_copy_mode.conf +++ b/.config/tmux/tmux_copy_mode.conf @@ -4,5 +4,7 @@ bind -T copy-mode-vi v send -X begin-selection bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy" bind P paste-buffer -bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy" +# Copy mode mouse +unbind-key -T copy-mode-vi MouseDragEnd1Pane +bind-key -T copy-mode-vi MouseDown1Pane select-pane\; send-keys -X clear-selection diff --git a/.config/tmux/tmux_status_bar.conf b/.config/tmux/tmux_status_bar.conf index 0d21a5c..e2f427d 100644 --- a/.config/tmux/tmux_status_bar.conf +++ b/.config/tmux/tmux_status_bar.conf @@ -1,10 +1,10 @@ #!/usr/bin/env bash # Hardcoded values -set -g status-bg "#1d2021" +set -g status-bg "#282828" set -g @unfocused-fg "#d4be98" set -g @focused-bg "#d4be98" -set -g @focused-fg "#1d2021" +set -g @focused-fg "#282828" # Set status bar position set -g status-position top @@ -28,7 +28,7 @@ set -g window-status-current-format '#[bg=#{@focused-bg},fg=#{@focused-fg}] #I:# # AUTO RENAME WINDOW -set-option -g status-interval 1 +set-option -g status-interval 5 set-option -g automatic-rename on diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 31a7b3e..34e0533 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -22,10 +22,7 @@ export READER=mupdf source $ZDOTDIR/themes/gruvbox_dark.zsh #Prompt -fpath+=$ZDOTDIR/prompts/pure -autoload -U promptinit; promptinit -export PURE_GIT_PULL=0 -prompt pure +source $ZDOTDIR/prompts/simple-two-line.zsh source $ZDOTDIR/functions.zsh source $ZDOTDIR/plugins.zsh diff --git a/.config/zsh/prompts/simple-two-line.zsh b/.config/zsh/prompts/simple-two-line.zsh new file mode 100644 index 0000000..c3e6846 --- /dev/null +++ b/.config/zsh/prompts/simple-two-line.zsh @@ -0,0 +1,17 @@ +autoload -Uz vcs_info +precmd() { + vcs_info + setopt PROMPT_SUBST + if [[ -n "$vcs_info_msg_0_" ]]; then + PROMPT='%F{blue}%~%F{yellow} (${vcs_info_msg_0_})%f'$'\n''%F{magenta}❯ ' + else + PROMPT='%F{blue}%~%f'$'\n''%F{magenta}❯ ' + fi + print -P "" +} + +zstyle ':vcs_info:*' enable git +zstyle ':vcs_info:git*' formats '%b' + +# Simple prompt initialization +autoload -U promptinit; promptinit diff --git a/.config/zsh/themes/gruvbox_dark.zsh b/.config/zsh/themes/gruvbox_dark.zsh index 549e41c..6d6c86b 100644 --- a/.config/zsh/themes/gruvbox_dark.zsh +++ b/.config/zsh/themes/gruvbox_dark.zsh @@ -75,8 +75,6 @@ ZSH_HIGHLIGHT_STYLES[cursor]='fg=#83a598' #ZSH Syntax Highlighting ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#928374,italic,underline" - - #Pure prompt # Define gruvbox dark colors pure_prompt_colors() { @@ -102,11 +100,6 @@ pure_prompt_colors() { (( $#colors )) || echo $colors } -# Apply gruvbox dark colors to Zsh Pure prompt -for color in $(pure_prompt_colors); do - zstyle ":prompt:pure:$color" color "$color" -done - # FZF # # Scheme name: Gruvbox dark, hard # Scheme system: base16 diff --git a/.local/bin/change-theme.sh b/.local/bin/change-theme.sh index 39a1a71..0f1647d 100755 --- a/.local/bin/change-theme.sh +++ b/.local/bin/change-theme.sh @@ -1,128 +1,204 @@ #!/bin/zsh -# Required parameters: -# @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 Dark", "value": "gruvbox-dark"},{"title": "Gruvbox Light", "value": "gruvbox-light"}]} -# - -#Ignore errors +# Ignore errors set +e -terminal_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/${terminal_theme_name}.toml\"]|g" ~/.config/alacritty/alacritty.toml - #Change zsh theme - sed -i '' -e "s|source \$ZDOTDIR/themes/.*zsh|source \$ZDOTDIR/themes/${zsh_theme_name}.zsh|g" "$ZDOTDIR"/.zshrc - #Reload zsh sessions +# Declare theme configurations +typeset -A themes +themes[catppuccin-latte]=\ +'alacritty_theme_name=catppuccin_latte + ghostty_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 + kitty_theme="Catppuccin-Latte"' + +themes[catppuccin-frappe]=\ +'alacritty_theme_name=catppuccin_frappe + ghostty_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 + kitty_theme="Catppuccin-Frappe"' + +themes[gruvbox-original-hard-dark]=\ +'alacritty_theme_name=gruvbox_dark + ghostty_theme_name=GruvboxDarkHard + zsh_theme_name=gruvbox_dark + nvim_color_scheme=gruvbox-material + background_color=#1d2021 + tmux_bar_unfocused_fg=#ebdbb2 + tmux_bar_focused_bg=#ebdbb2 + tmux_bar_focused_fg=#1d2021 + additional_nvim_commands="\ +vim.g.gruvbox_material_better_performance=1 +vim.g.gruvbox_material_background=\"hard\" +vim.g.gruvbox_material_foreground=\"original\" +vim.opt.background=\"dark\"" + kitty_theme="Gruvbox Dark Hard"' + +themes[gruvbox-material-hard-dark]=\ +'alacritty_theme_name=gruvbox_dark + ghostty_theme_name=gruvbox-material-hard-dark + zsh_theme_name=gruvbox_dark + nvim_color_scheme=gruvbox-material + background_color=#1d2021 + tmux_bar_unfocused_fg=#d4be98 + tmux_bar_focused_bg=#d4be98 + tmux_bar_focused_fg=#1d2021 + additional_nvim_commands="\ +vim.g.gruvbox_material_better_performance=1 +vim.g.gruvbox_material_background=\"hard\" +vim.g.gruvbox_material_foreground=\"material\" +vim.opt.background=\"dark\"" + kitty_theme="Gruvbox Material Dark Hard"' + +themes[gruvbox-material-medium-dark]=\ +'alacritty_theme_name=gruvbox_dark + ghostty_theme_name=gruvbox-material-medium-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 + additional_nvim_commands="\ +vim.g.gruvbox_material_better_performance=1 +vim.g.gruvbox_material_background=\"medium\" +vim.g.gruvbox_material_foreground=\"material\" +vim.opt.background=\"dark\"" + kitty_theme="Gruvbox Material Dark Medium"' + +themes[gruvbox-material-soft-dark]=\ +'alacritty_theme_name=gruvbox_dark + ghostty_theme_name=gruvbox-material-soft-dark + zsh_theme_name=gruvbox_dark + nvim_color_scheme=gruvbox-material + background_color=#32302f + tmux_bar_unfocused_fg=#d4be98 + tmux_bar_focused_bg=#d4be98 + tmux_bar_focused_fg=#32302f + additional_nvim_commands="\ +vim.g.gruvbox_material_better_performance=1 +vim.g.gruvbox_material_background=\"soft\" +vim.g.gruvbox_material_foreground=\"material\" +vim.opt.background=\"dark\"" + kitty_theme="Gruvbox Material Dark Soft"' + +themes[gruvbox-material-hard-light]=\ +'alacritty_theme_name=gruvbox_light + ghostty_theme_name=gruvbox-material-hard-light + zsh_theme_name=gruvbox_light + nvim_color_scheme=gruvbox-material + background_color=#f9f5d7 + tmux_bar_unfocused_fg=#654735 + tmux_bar_focused_bg=#654735 + tmux_bar_focused_fg=#f9f5d7 + additional_nvim_commands="\ +vim.g.gruvbox_material_better_performance=1 +vim.g.gruvbox_material_background=\"hard\" +vim.g.gruvbox_material_foreground=\"material\" +vim.opt.background=\"light\"" + kitty_theme="Gruvbox Material Light Hard"' + +themes[gruvbox-material-medium-light]=\ +'alacritty_theme_name=gruvbox_light + ghostty_theme_name=gruvbox-material-medium-light + zsh_theme_name=gruvbox_light + background_color=#fbf1c7 + tmux_bar_unfocused_fg=#654735 + tmux_bar_focused_bg=#654735 + tmux_bar_focused_fg=#fbf1c7 + nvim_color_scheme=gruvbox-material + additional_nvim_commands="\ +vim.g.gruvbox_material_better_performance=1 +vim.g.gruvbox_material_background=\"medium\" +vim.g.gruvbox_material_foreground=\"material\" +vim.opt.background=\"light\"" + kitty_theme="Gruvbox Material Light Medium"' + +themes[gruvbox-material-soft-light]=\ +'alacritty_theme_name=gruvbox_light + ghostty_theme_name=gruvbox-material-soft-light + zsh_theme_name=gruvbox_light + background_color=#f2e5bc + tmux_bar_unfocused_fg=#654735 + tmux_bar_focused_bg=#654735 + tmux_bar_focused_fg=#f2e5bc + nvim_color_scheme=gruvbox-material + additional_nvim_commands="\ +vim.g.gruvbox_material_better_performance=1 +vim.g.gruvbox_material_background=\"soft\" +vim.g.gruvbox_material_foreground=\"material\" +vim.opt.background=\"light\"" + kitty_theme="Gruvbox Material Light Soft"' + +themes[gruvbox-original-medium-light]=\ +'alacritty_theme_name=gruvbox_light + ghostty_theme_name=GruvboxLight + zsh_theme_name=gruvbox_light + nvim_color_scheme=gruvbox-material + background_color=#fbf1c7 + tmux_bar_unfocused_fg=#3c3836 + tmux_bar_focused_bg=#3c3836 + tmux_bar_focused_fg=#fbf1c7 + additional_nvim_commands="\ +vim.g.gruvbox_material_better_performance=1 +vim.g.gruvbox_material_background=\"medium\" +vim.g.gruvbox_material_foreground=\"original\" +vim.opt.background=\"light\"" + kitty_theme="Gruvbox Light Medium"' + +# Function to reload Zsh sessions +reload_zsh_sessions() { + local pids pids=$(pgrep zsh) - while IFS= read -r pid; do - kill -USR1 "$pid" - done <<< "$pids" + for pid in $pids; do + kill -USR1 "$pid" 2>/dev/null || true + done +} - #Change tmux theme +# Function to reload Neovim +reload_neovim() { + local scheme=$1 + local extra_cmds=$2 + echo "$extra_cmds" > ~/.config/nvim/lua/core/theme.lua + echo "vim.cmd('colorscheme ${scheme}')" >> ~/.config/nvim/lua/core/theme.lua + for addr in $XDG_RUNTIME_DIR/nvim.*; do + nvim --server "$addr" --remote-send ":source ~/.config/nvim/lua/core/theme.lua" || true + done +} + +# Change common settings +change_theme() { + 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 \$ZDOTDIR/themes/.*zsh|source \$ZDOTDIR/themes/${zsh_theme_name}.zsh|g" "$ZDOTDIR"/.zshrc + reload_zsh_sessions 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 - for addr in $XDG_RUNTIME_DIR/nvim.*; do - nvim --server $addr --remote-send ':colorscheme ${nvim_color_scheme}' || true - done + [[ -n "$kitty_theme" ]] && kitten themes --reload-in=all "$kitty_theme" + reload_neovim "$nvim_color_scheme" "$additional_nvim_commands" + sed -i '' -E "s/theme =.*$/theme = $ghostty_theme_name/" ~/.config/ghostty/config } -case $1 in - "catppuccin-latte") - terminal_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" - - echo '' > ~/.config/nvim/lua/core/theme.lua - change_common - ;; - - "catppuccin-frappe") - terminal_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" - - echo '' > ~/.config/nvim/lua/core/theme.lua - change_common - ;; - - "gruvbox-dark") - terminal_theme_name="gruvbox_dark" - zsh_theme_name="gruvbox_dark" - nvim_color_scheme="gruvbox-material" - background_color="#1d2021" - tmux_bar_unfocused_fg="#d4be98" - tmux_bar_focused_bg="#d4be98" - tmux_bar_focused_fg="#1d2021" +# Menu selection +theme_selection=$(printf '%s\n' "${(@k)themes}" | fzf --prompt="Select a theme: " --height=40%) +if [[ -n "$theme_selection" ]]; then + eval "${themes[$theme_selection]}" + change_theme + echo "Theme '${theme_selection}' applied successfully." +else + echo "No theme selected. Exiting." + exit 1 +fi - for addr in $XDG_RUNTIME_DIR/nvim.*; do - nvim --server $addr --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 $addr --remote-send ':lua vim.g.gruvbox_material_background = "hard"' || true - echo "vim.g.gruvbox_material_background = 'hard'" >> ~/.config/nvim/lua/core/theme.lua - nvim --server $addr --remote-send ':lua vim.g.gruvbox_material_foreground = "original"' || true - echo "vim.g.gruvbox_material_foreground = 'original'" >> ~/.config/nvim/lua/core/theme.lua - nvim --server $addr --remote-send ':lua vim.opt.background = "dark"' || true - echo "vim.opt.background = 'dark'" >> ~/.config/nvim/lua/core/theme.lua - done - - #Change kitty theme - kitten themes --reload-in=all Gruvbox Dark - - change_common - ;; - - "gruvbox-light") - terminal_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" - - - for addr in $XDG_RUNTIME_DIR/nvim.*; do - nvim --server $addr --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 $addr --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 $addr --remote-send ':lua vim.g.gruvbox_material_foreground = "original"' || true - echo "vim.g.gruvbox_material_foreground = 'original'" >> ~/.config/nvim/lua/core/theme.lua - nvim --server $addr --remote-send ':lua vim.opt.background = "light"' || true - echo "vim.opt.background = 'light'" >> ~/.config/nvim/lua/core/theme.lua - done - - #Change kitty theme - kitten themes --reload-in=all Gruvbox Light - - change_common - - ;; -esac