From 0d8809b59658f607492418f3819c5707332836e3 Mon Sep 17 00:00:00 2001 From: afranco Date: Wed, 1 Nov 2023 22:56:14 +0000 Subject: [PATCH] chore: Added a theme change in rofi script. Need to add rofi itself and other stuff still --- .config/fish/config.fish | 1 - .config/fish/myfunctions/code.fish | 8 ----- .config/fish/myfunctions/replacements.fish | 7 +++- .config/fish/themes/Catppuccin Latte.theme | 30 ++++++++++++++++ .config/kitty/kitty.conf | 6 ++++ .config/kitty/kitty.conf.bak | 42 ++++++++++++++++++++++ .config/nvim/init.lua | 1 + .config/nvim/lua/plugins/lazy.lua | 1 + .config/nvim/lua/plugins/lspconfig.lua | 17 ++++----- .config/nvim/lua/plugins/none-ls.lua | 1 + .config/nvim/lua/plugins/remote-theme.lua | 8 +++++ .config/tmux/tmux.conf | 2 +- .local/bin/rofi-change-theme | 34 ++++++++++++++++++ 13 files changed, 139 insertions(+), 19 deletions(-) delete mode 100644 .config/fish/myfunctions/code.fish create mode 100644 .config/fish/themes/Catppuccin Latte.theme create mode 100644 .config/kitty/kitty.conf.bak create mode 100644 .config/nvim/lua/plugins/remote-theme.lua create mode 100755 .local/bin/rofi-change-theme diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 11f7b2e..a90e968 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -15,7 +15,6 @@ fish_add_path $HOME/.cargo/bin fish_add_path $HOME/.ghcup/bin fish_add_path /usr/bin/vendor_perl -source ~/.config/fish/myfunctions/code.fish source ~/.config/fish/myfunctions/dotfiles.fish source ~/.config/fish/myfunctions/pacman.fish source ~/.config/fish/myfunctions/qol.fish diff --git a/.config/fish/myfunctions/code.fish b/.config/fish/myfunctions/code.fish deleted file mode 100644 index 959bac0..0000000 --- a/.config/fish/myfunctions/code.fish +++ /dev/null @@ -1,8 +0,0 @@ -function vim - nvim $argv -end - -function ta - tmux attach -end - diff --git a/.config/fish/myfunctions/replacements.fish b/.config/fish/myfunctions/replacements.fish index e8ab78a..e1699c4 100644 --- a/.config/fish/myfunctions/replacements.fish +++ b/.config/fish/myfunctions/replacements.fish @@ -1,9 +1,14 @@ function ls eza --icons -l --sort type $argv end +function nvim + /usr/bin/nvim --listen /tmp/nvim.pipe $argv +end +function vim + /usr/bin/nvim --listen /tmp/nvim.pipe $argv +end abbr -a find fd abbr -a df duf -abbr -a v nvim abbr -a lg lazygit function rm echo "rm is disabled, use trash instead" diff --git a/.config/fish/themes/Catppuccin Latte.theme b/.config/fish/themes/Catppuccin Latte.theme new file mode 100644 index 0000000..23a514e --- /dev/null +++ b/.config/fish/themes/Catppuccin Latte.theme @@ -0,0 +1,30 @@ +# name: 'Catppuccin latte' +# url: 'https://github.com/catppuccin/fish' +# preferred_background: eff1f5 + +fish_color_normal 4c4f69 +fish_color_command 1e66f5 +fish_color_param dd7878 +fish_color_keyword d20f39 +fish_color_quote 40a02b +fish_color_redirection ea76cb +fish_color_end fe640b +fish_color_comment 8c8fa1 +fish_color_error d20f39 +fish_color_gray 9ca0b0 +fish_color_selection --background=ccd0da +fish_color_search_match --background=ccd0da +fish_color_option 40a02b +fish_color_operator ea76cb +fish_color_escape e64553 +fish_color_autosuggestion 9ca0b0 +fish_color_cancel d20f39 +fish_color_cwd df8e1d +fish_color_user 179299 +fish_color_host_remote 40a02b +fish_color_host 1e66f5 +fish_color_status d20f39 +fish_pager_color_progress 9ca0b0 +fish_pager_color_prefix ea76cb +fish_pager_color_completion 4c4f69 +fish_pager_color_description 9ca0b0 diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 32cd99f..b662cfe 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -34,3 +34,9 @@ env TERM=xterm-256color include current-theme.conf + + +# BEGIN_KITTY_THEME +# Catppuccin-Frappe +include current-theme.conf +# END_KITTY_THEME \ No newline at end of file diff --git a/.config/kitty/kitty.conf.bak b/.config/kitty/kitty.conf.bak new file mode 100644 index 0000000..7031695 --- /dev/null +++ b/.config/kitty/kitty.conf.bak @@ -0,0 +1,42 @@ +font_family FiraCode Nerd Font Mono Normal + font_size 14.0 + +enable_audio_bell no +window_padding_width 6 +confirm_os_window_close 0 +env TERM=xterm-256color + + + +# Multiplexer mappings +#map ctrl+u kitten pass_keys.py neighboring_window bottom ctrl+u +#map ctrl+i kitten pass_keys.py neighboring_window top ctrl+i +#map ctrl+y kitten pass_keys.py neighboring_window left ctrl+y +#map ctrl+o kitten pass_keys.py neighboring_window right ctrl+o +# +#map ctrl+shift+w no_op +#map ctrl+x close_window +#map ctrl+shift+x close_tab +# +#map ctrl+shift+enter no_op +#map ctrl+n new_window +#map ctrl+shift+n new_tab +# +#map ctrl+f toggle_layout stack +# +# Remote control +#allow_remote_control yes +#listen-on unix:@"$(date +%s%N)" + +#Project management + +#map ctrl+space launch --type=overlay fish -ic "kitty @ ls | jq -r '.[0].tabs | map(.title) | .[]' | fzf | xargs -I _ kitty @ focus-tab --match title:_" + + +include current-theme.conf + + +# BEGIN_KITTY_THEME +# Catppuccin-Latte +include current-theme.conf +# END_KITTY_THEME \ No newline at end of file diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index ea61c13..efe7eb3 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,3 +1,4 @@ require("core.variables") require('core.package_manager') +require('plugins.remote-theme') require('impatient') diff --git a/.config/nvim/lua/plugins/lazy.lua b/.config/nvim/lua/plugins/lazy.lua index 99d33e6..421e495 100644 --- a/.config/nvim/lua/plugins/lazy.lua +++ b/.config/nvim/lua/plugins/lazy.lua @@ -7,6 +7,7 @@ lazy.setup({ -------------------------------------------THEMES------------------------------------------ { 'catppuccin/nvim', + name = "catppuccin", lazy = false, priority = 1000, config = function() diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index 688eeb4..f35b085 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -48,19 +48,20 @@ local capabilities = vim.tbl_deep_extend( require('cmp_nvim_lsp').default_capabilities() ) -local setup = { - on_attach = on_attach, - flags = lsp_flags, - capabilities = capabilities, -} mason_lspconfig.setup_handlers { -- This is a default handler that will be called for each installed server (also for new servers that are installed during a session) function(server_name) - lspconfig[server_name].setup { setup } + lspconfig[server_name].setup { + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, + } end, } -lspconfig["ocamllsp"].setup { - setup +lspconfig["ocamllsp"].setup{ + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, } diff --git a/.config/nvim/lua/plugins/none-ls.lua b/.config/nvim/lua/plugins/none-ls.lua index e10986f..6980746 100644 --- a/.config/nvim/lua/plugins/none-ls.lua +++ b/.config/nvim/lua/plugins/none-ls.lua @@ -7,6 +7,7 @@ null_ls.setup({ null_ls.builtins.formatting.blue, null_ls.builtins.formatting.gofmt, null_ls.builtins.code_actions.shellcheck, + null_ls.builtins.formatting.beautysh, null_ls.builtins.formatting.prettierd.with({ filetypes = { "html", "json", "css", "js", "yaml", "markdown" }, }), diff --git a/.config/nvim/lua/plugins/remote-theme.lua b/.config/nvim/lua/plugins/remote-theme.lua new file mode 100644 index 0000000..cc5d7b1 --- /dev/null +++ b/.config/nvim/lua/plugins/remote-theme.lua @@ -0,0 +1,8 @@ +local M = {} + +M.change_theme = function(scheme) + vim.cmd('colorscheme ' .. scheme) +end + +return M + diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 916c200..9b538c0 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -46,7 +46,7 @@ set -g @catppuccin_flavour 'frappe' set -g @catppuccin_window_tabs_enabled on set -g @resurrect-strategy-nvim 'session' set -g @resurrect-capture-pane-contents 'on' -set -g @continuum-restore 'on' +#set -g @continuum-restore 'on' set -g @continuum-save-interval '10' set -g @continuum-boot 'on' diff --git a/.local/bin/rofi-change-theme b/.local/bin/rofi-change-theme new file mode 100755 index 0000000..de60dd1 --- /dev/null +++ b/.local/bin/rofi-change-theme @@ -0,0 +1,34 @@ +#!/bin/bash + +# Define a list of themes +themes="latte\nfrappe" + +# Display theme options in Rofi +selected_theme=$(echo -e "${themes[@]}" | rofi -dmenu -p "Select a theme:") + +case $selected_theme in + "latte") + # Change to Latte theme + #kitty + kitty +kitten themes --reload-in=all catppuccin-latte + sed -i 's/flavour = ".*"/flavour = "latte"/' "$HOME"/.config/nvim/lua/plugins/catppuccin.lua + nvim --server /tmp/nvim.pipe --remote-send ':colorscheme catppuccin-latte' + sed -i 's/set -g @catppuccin_flavour .*/set -g @catppuccin_flavour '\''latte'\''/' "$HOME"/.config/tmux/tmux.conf + fish -c "echo \"Y\" | fish_config theme save \"Catppuccin Latte\"" + ;; + "frappe") + # Change to Frappe theme + #kitty + kitty +kitten themes --reload-in=all catppuccin-frappe + sed -i 's/flavour = ".*"/flavour = "frappe"/' "$HOME"/.config/nvim/lua/plugins/catppuccin.lua + nvim --server /tmp/nvim.pipe --remote-send ':colorscheme catppuccin-frappe' + sed -i 's/set -g @catppuccin_flavour .*/set -g @catppuccin_flavour '\''frappe'\''/' "$HOME"/.config/tmux/tmux.conf + fish -c "echo \"Y\" | fish_config theme save \"Catppuccin Frappe\"" + ;; + *) + # Handle an invalid selection or cancel + echo "Invalid selection or canceled." + ;; +esac + +tmux source-file "$HOME/.config/tmux/tmux.conf"