├── .gitignore ├── LICENSE-APACHE ├── LICENSE-MIT ├── Makefile ├── README.md ├── confs ├── alacritty │ ├── alacritty.toml │ └── catppuccin │ │ └── catppuccin-mocha.toml ├── btop │ ├── btop.conf │ └── themes │ │ └── catppuccin.theme ├── dynamic-island-sketchybar │ ├── LICENSE │ ├── README.md │ ├── helper.sh │ ├── helper │ │ ├── dynamicisland.h │ │ ├── islandhelper │ │ ├── islandhelper.c │ │ ├── makefile │ │ ├── notificationhelper.h │ │ └── sketchybar.h │ ├── images │ │ ├── demo.gif │ │ └── fullupdated.png │ ├── item.sh │ ├── listener.sh │ ├── process.sh │ ├── scripts │ │ └── islands │ │ │ ├── appswitch │ │ │ ├── appswitch_island.sh │ │ │ ├── creator.sh │ │ │ ├── handler.sh │ │ │ └── reset.sh │ │ │ ├── brightness │ │ │ ├── brightness_island.sh │ │ │ ├── creator.sh │ │ │ ├── handler.sh │ │ │ └── reset.sh │ │ │ ├── clear.sh │ │ │ ├── music │ │ │ ├── cava.conf │ │ │ ├── cava.sh │ │ │ ├── creator.sh │ │ │ ├── get_artwork.scpt │ │ │ ├── handler.sh │ │ │ ├── music_island.sh │ │ │ ├── pause_island.sh │ │ │ ├── reset-resume.sh │ │ │ └── reset.sh │ │ │ ├── notification │ │ │ ├── creator.sh │ │ │ ├── notification_island.sh │ │ │ └── reset.sh │ │ │ ├── power │ │ │ ├── creator.sh │ │ │ ├── handler.sh │ │ │ ├── power_island.sh │ │ │ └── reset.sh │ │ │ ├── previous_island │ │ │ ├── restore.sh │ │ │ ├── volume │ │ │ ├── creator.sh │ │ │ ├── handler.sh │ │ │ ├── reset.sh │ │ │ └── volume_island.sh │ │ │ └── wifi │ │ │ ├── creator.sh │ │ │ ├── handler.sh │ │ │ ├── reset.sh │ │ │ └── wifi_island.sh │ ├── sketchybarrc │ ├── userconfig.sh │ └── userconfigs │ │ └── mbp2021_14.sh ├── gm │ ├── codebase │ │ ├── .gitignore │ │ ├── Cargo.lock │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ └── gm.rs │ └── config.json ├── nvim │ ├── LICENSE │ ├── README.md │ ├── config.ld │ ├── init.lua │ └── lua │ │ ├── astronvim │ │ ├── autocmds.lua │ │ ├── bootstrap.lua │ │ ├── health.lua │ │ ├── icons │ │ │ ├── nerd_font.lua │ │ │ └── text.lua │ │ ├── lazy.lua │ │ ├── mappings.lua │ │ ├── options.lua │ │ └── utils │ │ │ ├── buffer.lua │ │ │ ├── ffi.lua │ │ │ ├── git.lua │ │ │ ├── init.lua │ │ │ ├── lsp.lua │ │ │ ├── mason.lua │ │ │ ├── status.lua │ │ │ ├── status │ │ │ ├── component.lua │ │ │ ├── condition.lua │ │ │ ├── env.lua │ │ │ ├── heirline.lua │ │ │ ├── hl.lua │ │ │ ├── init.lua │ │ │ ├── provider.lua │ │ │ └── utils.lua │ │ │ ├── ui.lua │ │ │ └── updater.lua │ │ ├── dash │ │ ├── buttons.lua │ │ ├── docker.lua │ │ ├── ghprs.lua │ │ ├── header.lua │ │ ├── info.lua │ │ └── init.lua │ │ ├── lazy_snapshot.lua │ │ ├── plugins │ │ ├── alpha.lua │ │ ├── cmp.lua │ │ ├── configs │ │ │ ├── alpha.lua │ │ │ ├── cmp-dap.lua │ │ │ ├── guess-indent.lua │ │ │ ├── heirline.lua │ │ │ ├── lspconfig.lua │ │ │ ├── lspkind.lua │ │ │ ├── luasnip.lua │ │ │ ├── mason-lspconfig.lua │ │ │ ├── mason-null-ls.lua │ │ │ ├── mason-nvim-dap.lua │ │ │ ├── mason.lua │ │ │ ├── notify.lua │ │ │ ├── nvim-autopairs.lua │ │ │ ├── nvim-dap-ui.lua │ │ │ ├── nvim-treesitter.lua │ │ │ ├── nvim-web-devicons.lua │ │ │ ├── telescope.lua │ │ │ └── which-key.lua │ │ ├── core.lua │ │ ├── dap.lua │ │ ├── git.lua │ │ ├── heirline.lua │ │ ├── lsp.lua │ │ ├── mason.lua │ │ ├── neo-tree.lua │ │ ├── telescope.lua │ │ ├── treesitter.lua │ │ └── ui.lua │ │ ├── plugs │ │ ├── cheatsheet.lua │ │ ├── cmp.lua │ │ ├── copilot.lua │ │ ├── crates.lua │ │ ├── crates_plug.lua │ │ ├── heirline.lua │ │ ├── hop.lua │ │ ├── hop_plug.lua │ │ ├── illuminate.lua │ │ ├── init.lua │ │ ├── lsplines.lua │ │ ├── markdown.lua │ │ ├── neotree.lua │ │ ├── noice.lua │ │ ├── overseer.lua │ │ ├── syntax.lua │ │ ├── tabline.lua │ │ ├── terminal.lua │ │ ├── theme.lua │ │ ├── trouble.lua │ │ └── which.lua │ │ ├── resession │ │ └── extensions │ │ │ └── astronvim.lua │ │ ├── user │ │ ├── dash │ │ │ ├── buttons.lua │ │ │ ├── docker.lua │ │ │ ├── ghprs.lua │ │ │ ├── header.lua │ │ │ ├── info.lua │ │ │ └── init.lua │ │ ├── diagnostics.lua │ │ ├── externals │ │ │ ├── copilot.lua │ │ │ ├── dap.lua │ │ │ ├── dashboard.lua │ │ │ ├── illuminate.lua │ │ │ ├── init.lua │ │ │ ├── leap.lua │ │ │ ├── lsp.lua │ │ │ ├── noice.lua │ │ │ ├── overrides.lua │ │ │ ├── styling.lua │ │ │ ├── syntax_tree_surfer.lua │ │ │ └── tabline.lua │ │ ├── highlights.lua │ │ ├── init.lua │ │ ├── lazy.lua │ │ ├── lsp.lua │ │ ├── maps.lua │ │ ├── options.lua │ │ ├── plugs │ │ │ ├── cheatsheet.lua │ │ │ ├── cmp.lua │ │ │ ├── copilot.lua │ │ │ ├── crates.lua │ │ │ ├── dash.lua │ │ │ ├── dash │ │ │ │ ├── buttons.lua │ │ │ │ ├── docker.lua │ │ │ │ ├── ghprs.lua │ │ │ │ ├── head.lua │ │ │ │ ├── headers.lua │ │ │ │ ├── info.lua │ │ │ │ └── init.lua │ │ │ ├── heirline.lua │ │ │ ├── hop.lua │ │ │ ├── illuminate.lua │ │ │ ├── init.lua │ │ │ ├── leap.lua │ │ │ ├── lsplines.lua │ │ │ ├── neotree.lua │ │ │ ├── noice.lua │ │ │ ├── overseer.lua │ │ │ ├── syntax.lua │ │ │ ├── tabline.lua │ │ │ ├── terminal.lua │ │ │ ├── theme.lua │ │ │ ├── trouble.lua │ │ │ └── which.lua │ │ ├── polishing.lua │ │ ├── solidity_lsp.lua │ │ ├── updater.lua │ │ ├── user_mappings.lua │ │ └── utils │ │ │ ├── cargo.lua │ │ │ ├── docker.lua │ │ │ └── golang.lua │ │ └── utils │ │ ├── cargo.lua │ │ ├── docker.lua │ │ └── golang.lua ├── shell │ └── .zshrc ├── sketchybar │ ├── colors.sh │ ├── items │ │ ├── app.sh │ │ ├── apple.sh │ │ ├── battery.sh │ │ ├── calendar.sh │ │ ├── clock.sh │ │ ├── docker.sh │ │ ├── navigator.sh │ │ ├── raycast.sh │ │ ├── space_separator.sh │ │ ├── spotify.sh │ │ ├── volume.sh │ │ ├── vpn.sh │ │ └── wifi.sh │ ├── plugins │ │ ├── battery.sh │ │ ├── clock.sh │ │ ├── docker.sh │ │ ├── front_app.sh │ │ ├── sound.sh │ │ ├── space.sh │ │ ├── spotify.sh │ │ ├── volume.sh │ │ ├── vpn.sh │ │ └── wifi.sh │ └── sketchybarrc ├── skhd │ └── skhdrc ├── tmux │ └── .tmux.conf └── yabai │ └── yabairc ├── docs ├── Alacritty.md ├── Dependencies.md ├── Fonts.md ├── README.md └── neovim │ └── Install.md ├── static ├── code.png ├── revm.png └── screengrab.png └── utils ├── Makefile ├── inspect.lua └── netcap.lua /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | 3 | **/node_modules** - contains all the dependencies for the project 4 | 5 | confs/tmux/.tmux/plugins/** 6 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 refcell.eth 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: install clean load push backup recover new_branch 2 | 3 | all: backup 4 | 5 | install: 6 | @make backup 7 | @echo "Proceeding with installation..." 8 | @cp ./confs/shell/.zshrc ~/.zshrc 9 | @cp ./confs/shell/robbyrussell-mod.zsh-theme ~/.oh-my-zsh/themes/robbyrussell.zsh-theme 10 | @cp ./confs/tmux/.tmux.conf ~/.tmux.conf 11 | @cp ./confs/tmux/.tmux ~/.tmux 12 | @cp -R ./confs/nvim ~/.config/nvim 13 | @mkdir -p ~/.gm 14 | @cp -R ./confs/gm/* ~/.gm/ 15 | @(cd ~/.gm/codebase && cargo build --release) 16 | @cp ~/.gm/codebase/target/release/gm ~/.gm/bin/gm 17 | @rm -rf ~/.gm/codebase/target 18 | 19 | clean: 20 | @rm -rf ./confs/* 21 | 22 | #################################################### 23 | # Load Targets: Load local dotfiles into dots/confs 24 | #################################################### 25 | 26 | load: load-nvim load-sketchybar load-yabai load-skhd load-dynamic-island-sketchybar 27 | 28 | load-dynamic-island-sketchybar: 29 | @rm -rf ./confs/dynamic-island-sketchybar 30 | @mkdir -p ./confs/dynamic-island-sketchybar 31 | @cp -R ~/.config/dynamic-island-sketchybar/* ./confs/dynamic-island-sketchybar/ 32 | 33 | load-nvim: 34 | @mkdir -p ./confs/nvim 35 | @cp -R ~/.config/nvim/* ./confs/nvim/ 36 | 37 | load-sketchybar: 38 | @rm -rf ./confs/sketchybar 39 | @mkdir -p ./confs/sketchybar 40 | @cp -R ~/.config/sketchybar/* ./confs/sketchybar/ 41 | 42 | load-yabai: 43 | @rm -rf ./confs/yabai 44 | @mkdir -p ./confs/yabai 45 | @cp -R ~/.config/yabai/* ./confs/yabai/ 46 | 47 | load-skhd: 48 | @rm -rf ./confs/skhd 49 | @mkdir -p ./confs/skhd 50 | @cp -R ~/.config/skhd/* ./confs/skhd/ 51 | 52 | loads: 53 | @mkdir -p ./confs/shell 54 | @cp ~/.zshrc ./confs/shell/.zshrc 55 | @mkdir -p ./confs/tmux 56 | @cp ~/.tmux.conf ./confs/tmux/.tmux.conf 57 | @cp -R ~/.tmux ./confs/tmux/ 58 | @cp ~/.alacritty.yml ./confs/alacritty/.alacritty.yml 59 | @mkdir -p ./confs/gm 60 | @cp -R ~/.gm/* ./confs/gm 61 | 62 | push: 63 | @make clean 64 | @make load 65 | @git add . 66 | @git commit -m "automated dot updates :camera_flash:" 67 | @git push 68 | @echo "Successfully pushed to dots 🚀" 69 | 70 | backup: 71 | @mkdir -p ~/.dotbackup/ 72 | @cp -R ~/.zshrc ~/.dotbackup/ 73 | @cp -R -f ~/.oh-my-zsh/ ~/.dotbackup/ 74 | @cp ~/.tmux.conf ~/.dotbackup/ 75 | @cp -R -f ~/.config ~/.dotbackup/ 76 | @cp -R ~/.gm ~/.dotbackup/ 77 | @echo "All dotfiles backed up..." 78 | 79 | recover: 80 | @cp -R ~/.dotbackup/* ~/ 81 | @echo "All backup files successfully recovered!" 82 | 83 | new_branch: 84 | @git checkout -b update/$$(date +%Y-%m-%d) 85 | @git add . 86 | @git commit -m "automated dot updates :camera_flash:" 87 | @git push 88 | -------------------------------------------------------------------------------- /confs/alacritty/alacritty.toml: -------------------------------------------------------------------------------- 1 | import = ["~/.config/alacritty/catppuccin/catppuccin-mocha.toml"] 2 | 3 | [cursor.style] 4 | blinking = "On" 5 | shape = "Beam" 6 | 7 | [env] 8 | TERM = "xterm-256color" 9 | 10 | [font] 11 | normal = { family = "MesloLGS Nerd Font" } 12 | 13 | [[keyboard.bindings]] 14 | chars = "\u001BF" 15 | key = "Right" 16 | mods = "Alt" 17 | 18 | [[keyboard.bindings]] 19 | chars = "\u001BB" 20 | key = "Left" 21 | mods = "Alt" 22 | 23 | [selection] 24 | save_to_clipboard = true 25 | 26 | [window] 27 | decorations = "Transparent" 28 | 29 | [window.padding] 30 | x = 8 31 | y = 30 32 | -------------------------------------------------------------------------------- /confs/alacritty/catppuccin/catppuccin-mocha.toml: -------------------------------------------------------------------------------- 1 | [colors.primary] 2 | background = "#1E1E2E" 3 | foreground = "#CDD6F4" 4 | dim_foreground = "#CDD6F4" 5 | bright_foreground = "#CDD6F4" 6 | 7 | [colors.cursor] 8 | text = "#1E1E2E" 9 | cursor = "#F5E0DC" 10 | 11 | [colors.vi_mode_cursor] 12 | text = "#1E1E2E" 13 | cursor = "#B4BEFE" 14 | 15 | [colors.search.matches] 16 | foreground = "#1E1E2E" 17 | background = "#A6ADC8" 18 | 19 | [colors.search.focused_match] 20 | foreground = "#1E1E2E" 21 | background = "#A6E3A1" 22 | 23 | [colors.footer_bar] 24 | foreground = "#1E1E2E" 25 | background = "#A6ADC8" 26 | 27 | [colors.hints.start] 28 | foreground = "#1E1E2E" 29 | background = "#F9E2AF" 30 | 31 | [colors.hints.end] 32 | foreground = "#1E1E2E" 33 | background = "#A6ADC8" 34 | 35 | [colors.selection] 36 | text = "#1E1E2E" 37 | background = "#F5E0DC" 38 | 39 | [colors.normal] 40 | black = "#45475A" 41 | red = "#F38BA8" 42 | green = "#A6E3A1" 43 | yellow = "#F9E2AF" 44 | blue = "#89B4FA" 45 | magenta = "#F5C2E7" 46 | cyan = "#94E2D5" 47 | white = "#BAC2DE" 48 | 49 | [colors.bright] 50 | black = "#585B70" 51 | red = "#F38BA8" 52 | green = "#A6E3A1" 53 | yellow = "#F9E2AF" 54 | blue = "#89B4FA" 55 | magenta = "#F5C2E7" 56 | cyan = "#94E2D5" 57 | white = "#A6ADC8" 58 | 59 | [colors.dim] 60 | black = "#45475A" 61 | red = "#F38BA8" 62 | green = "#A6E3A1" 63 | yellow = "#F9E2AF" 64 | blue = "#89B4FA" 65 | magenta = "#F5C2E7" 66 | cyan = "#94E2D5" 67 | white = "#BAC2DE" 68 | 69 | [[colors.indexed_colors]] 70 | index = 16 71 | color = "#FAB387" 72 | 73 | [[colors.indexed_colors]] 74 | index = 17 75 | color = "#F5E0DC" 76 | -------------------------------------------------------------------------------- /confs/btop/themes/catppuccin.theme: -------------------------------------------------------------------------------- 1 | # Main background, empty for terminal default, need to be empty if you want transparent background 2 | theme[main_bg]="" 3 | 4 | # Main text color 5 | theme[main_fg]="#CDD6F4" 6 | 7 | # Title color for boxes 8 | theme[title]="#CDD6F4" 9 | 10 | # Highlight color for keyboard shortcuts 11 | theme[hi_fg]="#89B4FA" 12 | 13 | # Background color of selected item in processes box 14 | theme[selected_bg]="#45475A" 15 | 16 | # Foreground color of selected item in processes box 17 | theme[selected_fg]="#89B4FA" 18 | 19 | # Color of inactive/disabled text 20 | theme[inactive_fg]="#7F849C" 21 | 22 | # Color of text appearing on top of graphs, i.e uptime and current network graph scaling 23 | theme[graph_text]="#F5E0DC" 24 | 25 | # Background color of the percentage meters 26 | theme[meter_bg]="#45475A" 27 | 28 | # Misc colors for processes box including mini cpu graphs, details memory graph and details status text 29 | theme[proc_misc]="#F5E0DC" 30 | 31 | # CPU, Memory, Network, Proc box outline colors 32 | theme[cpu_box]="#cba6f7" #Mauve 33 | theme[mem_box]="#a6e3a1" #Green 34 | theme[net_box]="#eba0ac" #Maroon 35 | theme[proc_box]="#89b4fa" #Blue 36 | 37 | # Box divider line and small boxes line color 38 | theme[div_line]="#6C7086" 39 | 40 | # Temperature graph color (Green -> Yellow -> Red) 41 | theme[temp_start]="#a6e3a1" 42 | theme[temp_mid]="#f9e2af" 43 | theme[temp_end]="#f38ba8" 44 | 45 | # CPU graph colors (Teal -> Lavender) 46 | theme[cpu_start]="#94e2d5" 47 | theme[cpu_mid]="#74c7ec" 48 | theme[cpu_end]="#b4befe" 49 | 50 | # Mem/Disk free meter (Mauve -> Lavender -> Blue) 51 | theme[free_start]="#cba6f7" 52 | theme[free_mid]="#b4befe" 53 | theme[free_end]="#89b4fa" 54 | 55 | # Mem/Disk cached meter (Sapphire -> Lavender) 56 | theme[cached_start]="#74c7ec" 57 | theme[cached_mid]="#89b4fa" 58 | theme[cached_end]="#b4befe" 59 | 60 | # Mem/Disk available meter (Peach -> Red) 61 | theme[available_start]="#fab387" 62 | theme[available_mid]="#eba0ac" 63 | theme[available_end]="#f38ba8" 64 | 65 | # Mem/Disk used meter (Green -> Sky) 66 | theme[used_start]="#a6e3a1" 67 | theme[used_mid]="#94e2d5" 68 | theme[used_end]="#89dceb" 69 | 70 | # Download graph colors (Peach -> Red) 71 | theme[download_start]="#fab387" 72 | theme[download_mid]="#eba0ac" 73 | theme[download_end]="#f38ba8" 74 | 75 | # Upload graph colors (Green -> Sky) 76 | theme[upload_start]="#a6e3a1" 77 | theme[upload_mid]="#94e2d5" 78 | theme[upload_end]="#89dceb" 79 | 80 | # Process box color gradient for threads, mem and cpu usage (Sapphire -> Mauve) 81 | theme[process_start]="#74C7EC" 82 | theme[process_mid]="#89DCEB" 83 | theme[process_end]="#cba6f7" 84 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 crissNb 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/helper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DYNAMIC_ISLAND_DIR=$( 3 | cd "$(dirname "${BASH_SOURCE[0]}")" || exit 4 | pwd -P 5 | ) 6 | 7 | # run helper program 8 | ISLANDHELPER=git.crissnb.islandhelper 9 | killall islandhelper 10 | cd "$DYNAMIC_ISLAND_DIR"/helper/ && make 11 | "$DYNAMIC_ISLAND_DIR"/helper/islandhelper "$ISLANDHELPER" & 12 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/helper/dynamicisland.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define MAX_QUEUE_SIZE 16 6 | 7 | struct dynamicIsland { 8 | char command[512]; 9 | }; 10 | 11 | struct islandItem { 12 | char identifier[32]; 13 | char args[512]; 14 | }; 15 | 16 | struct islandItemNode { 17 | struct islandItem *data; 18 | struct islandItemNode *nextNode; 19 | }; 20 | 21 | struct islandItemNode *head = NULL; 22 | struct islandItemNode *current = NULL; 23 | char currentDisplaying[32]; 24 | int isDisplaying = 0; 25 | 26 | static inline void dynamic_island_init(struct dynamicIsland *dynamic_island) { 27 | snprintf(dynamic_island->command, 512, ""); 28 | } 29 | 30 | static inline void pop_head() { 31 | if (head == NULL) { 32 | return; 33 | } 34 | 35 | // Redirect head to the second item 36 | struct islandItemNode *nextNode = NULL; 37 | nextNode = head->nextNode; 38 | 39 | free(head); 40 | 41 | head = nextNode; 42 | if (head == NULL) { 43 | current = NULL; 44 | } 45 | } 46 | 47 | static inline void sendCommand(struct dynamicIsland *dynamic_island, 48 | int overrideSetting) { 49 | if (head == NULL) { 50 | return; 51 | } 52 | snprintf(dynamic_island->command, 512, 53 | "--trigger di_helper_listener_event IDENTIFIER=\"%s\" OVERRIDE=%d " 54 | "ARGS=\"%s\"", 55 | head->data->identifier, overrideSetting, head->data->args); 56 | strcpy(currentDisplaying, head->data->identifier); 57 | isDisplaying = 1; 58 | } 59 | 60 | static inline int display(struct dynamicIsland *dynamic_island) { 61 | if (head == NULL) { 62 | // Do not apply any command 63 | return 0; 64 | } 65 | 66 | if (isDisplaying == 0) { 67 | sendCommand(dynamic_island, 0); 68 | return 1; 69 | } else { 70 | if (head->nextNode != NULL) { 71 | if (strcmp(currentDisplaying, head->nextNode->data->identifier) == 0) { 72 | pop_head(); 73 | sendCommand(dynamic_island, 1); 74 | return 1; 75 | } 76 | } 77 | } 78 | 79 | return 0; 80 | } 81 | 82 | static inline int queue_island(struct dynamicIsland *dynamic_island, 83 | struct islandItem *itemToQueue) { 84 | // Create a new node and attach to the latest node 85 | struct islandItemNode *newNode = 86 | (struct islandItemNode *)malloc(sizeof(struct islandItemNode)); 87 | newNode->data = itemToQueue; 88 | 89 | if (currentDisplaying[0] != 0) { 90 | if (strcmp(currentDisplaying, newNode->data->identifier) == 0) { 91 | // Redirect the node 92 | newNode->nextNode = head->nextNode; 93 | 94 | // Insert right after head 95 | head->nextNode = newNode; 96 | } else { 97 | if (current != NULL) { 98 | struct islandItemNode *temp = head->nextNode; 99 | 100 | while (temp != NULL) { 101 | if (strcmp(temp->data->identifier, newNode->data->identifier) == 0) { 102 | temp->data = newNode->data; 103 | free(newNode); 104 | return 0; 105 | } 106 | temp = temp->nextNode; 107 | } 108 | current->nextNode = newNode; 109 | } 110 | } 111 | } 112 | current = newNode; 113 | 114 | if (head == NULL) { 115 | head = current; 116 | } 117 | 118 | return display(dynamic_island); 119 | } 120 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/helper/islandhelper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/refcell/dots/3a3cba9cb4ea2b3eb2f167cb45c491874ec80bf8/confs/dynamic-island-sketchybar/helper/islandhelper -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/helper/islandhelper.c: -------------------------------------------------------------------------------- 1 | #include "notificationhelper.h" 2 | #include "sketchybar.h" 3 | #include 4 | 5 | struct dynamicIsland g_dynamic_island; 6 | struct notificationHelper g_notification_helper; 7 | 8 | void handler(env env) { 9 | // Environment variables passed from sketchybar can be accessed as seen below 10 | char *name = env_get_value_for_key(env, "NAME"); 11 | char *sender = env_get_value_for_key(env, "SENDER"); 12 | char *id = env_get_value_for_key(env, "INFO"); 13 | char *args = env_get_value_for_key(env, "ISLAND_ARGS"); 14 | 15 | if (strcmp(sender, "dynamic_island_request") == 0) { 16 | // Request to deliver new island 17 | isDisplaying = 0; 18 | 19 | // clear current displaying 20 | memset(currentDisplaying, 0, 32); 21 | snprintf(g_dynamic_island.command, 512, ""); 22 | 23 | pop_head(); 24 | 25 | if (display(&g_dynamic_island) == 1) { 26 | sketchybar(g_dynamic_island.command); 27 | } 28 | } else if (strcmp(sender, "dynamic_island_queue") == 0) { 29 | // Check data is not null 30 | if (args[0] == '\0' || id[0] == '\0') { 31 | return; 32 | } 33 | 34 | // Create new queuable item 35 | struct islandItem *newItem = 36 | (struct islandItem *)malloc(sizeof(struct islandItem)); 37 | sprintf(newItem->identifier, "%s", id); 38 | sprintf(newItem->args, "%s", args); 39 | 40 | // Get item from queue and apply to dynamic island 41 | if (queue_island(&g_dynamic_island, newItem) == 1) { 42 | sketchybar(g_dynamic_island.command); 43 | } 44 | } else if ((strcmp(sender, "routine") == 0) || 45 | (strcmp(sender, "forced") == 0)) { 46 | // Check notifications 47 | 48 | // check environment variable exists to prevent seg fault 49 | if (getenv("P_DYNAMIC_ISLAND_NOTIFICATION_ENABLED") == NULL) { 50 | return; 51 | } 52 | 53 | if (*getenv("P_DYNAMIC_ISLAND_NOTIFICATION_ENABLED") == (char)'1') { 54 | struct islandItem *notificationItem = 55 | check_notifications(&g_notification_helper); 56 | 57 | if (notificationItem != NULL) { 58 | // Queue notification item to display 59 | if (queue_island(&g_dynamic_island, notificationItem) == 1) { 60 | sketchybar(g_dynamic_island.command); 61 | } 62 | } 63 | } 64 | } 65 | } 66 | 67 | int main(int argc, char **argv) { 68 | if (argc < 2) { 69 | printf("Usage: provider \"\"\n"); 70 | exit(1); 71 | } 72 | 73 | dynamic_island_init(&g_dynamic_island); 74 | 75 | if (getenv("P_DYNAMIC_ISLAND_NOTIFICATION_ENABLED") == NULL && 76 | *getenv("P_DYNAMIC_ISLAND_NOTIFICATION_ENABLED") == (char)'1') { 77 | database_init(&g_notification_helper); 78 | } 79 | 80 | event_server_begin(handler, argv[1]); 81 | return 0; 82 | } 83 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/helper/makefile: -------------------------------------------------------------------------------- 1 | islandhelper: islandhelper.c dynamicisland.h sketchybar.h notificationhelper.h 2 | clang -std=c99 -O3 islandhelper.c -o islandhelper -l sqlite3 -framework CoreFoundation 3 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/images/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/refcell/dots/3a3cba9cb4ea2b3eb2f167cb45c491874ec80bf8/confs/dynamic-island-sketchybar/images/demo.gif -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/images/fullupdated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/refcell/dots/3a3cba9cb4ea2b3eb2f167cb45c491874ec80bf8/confs/dynamic-island-sketchybar/images/fullupdated.png -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/listener.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export DYNAMIC_ISLAND_DIR 3 | DYNAMIC_ISLAND_DIR=$( 4 | cd "$(dirname "${BASH_SOURCE[0]}")" || exit 5 | pwd -P 6 | ) 7 | 8 | listener=( 9 | script="$DYNAMIC_ISLAND_DIR/process.sh" 10 | width=0 11 | ) 12 | 13 | dynamic-island-sketchybar --add item di_helper_listener center \ 14 | --add event di_helper_listener_event \ 15 | --subscribe di_helper_listener di_helper_listener_event \ 16 | --set di_helper_listener "${listener[@]}" 17 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/process.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # provided "arguments": 3 | # $IDENTIFIER - identifier of the dynamic island element 4 | # $OVERRIDE - whether or not to override the existing dynamic island element 5 | # $ARGS - necessary arguments to activate the dynamic island element 6 | export DYNAMIC_ISLAND_DIR 7 | DYNAMIC_ISLAND_DIR=$( 8 | cd "$(dirname "${BASH_SOURCE[0]}")" || exit 9 | pwd -P 10 | ) 11 | 12 | ISLAND_DIR="$DYNAMIC_ISLAND_DIR/scripts/islands" 13 | 14 | case $IDENTIFIER in 15 | "appswitch") 16 | if [[ $OVERRIDE == 1 ]]; then 17 | pkill -f "$ISLAND_DIR/appswitch/appswitch_island.sh" 18 | fi 19 | # arg: app name 20 | bash "$ISLAND_DIR/appswitch/appswitch_island.sh" "$OVERRIDE|$ARGS" 21 | ;; 22 | "volume") 23 | if [[ $OVERRIDE == 1 ]]; then 24 | pkill -f "$ISLAND_DIR/volume/volume_island.sh" 25 | fi 26 | # arg: volume amt 27 | bash "$ISLAND_DIR/volume/volume_island.sh" "$OVERRIDE|$ARGS" 28 | ;; 29 | "brightness") 30 | if [[ $OVERRIDE == 1 ]]; then 31 | pkill -f "$ISLAND_DIR/brightness/brightness_island.sh" 32 | fi 33 | # arg: volume amt 34 | bash "$ISLAND_DIR/brightness/brightness_island.sh" "$OVERRIDE|$ARGS" 35 | ;; 36 | "pause") 37 | if [[ $OVERRIDE == 1 ]]; then 38 | pkill -f "$ISLAND_DIR/music/pause_island.sh" 39 | fi 40 | # arg: pause status 41 | bash "$ISLAND_DIR/music/pause_island.sh" "$OVERRIDE|$ARGS" 42 | ;; 43 | "wifi") 44 | if [[ $OVERRIDE == 1 ]]; then 45 | pkill -f "$ISLAND_DIR/wifi/wifi_island.sh" 46 | fi 47 | # arg: wifi details 48 | bash "$ISLAND_DIR/wifi/wifi_island.sh" "$OVERRIDE|$ARGS" 49 | ;; 50 | "power") 51 | if [[ $OVERRIDE == 1 ]]; then 52 | pkill -f "$ISLAND_DIR/power/power_island.sh" 53 | fi 54 | # arg: connection type 55 | bash "$ISLAND_DIR/power/power_island.sh" "$OVERRIDE|$ARGS" 56 | ;; 57 | "music") 58 | if [[ $OVERRIDE == 1 ]]; then 59 | pkill -f "$ISLAND_DIR/music/music_island.sh" 60 | fi 61 | # arg: none 62 | bash "$ISLAND_DIR/music/music_island.sh" "$OVERRIDE" 63 | ;; 64 | "notifications") 65 | if [[ $OVERRIDE == 1 ]]; then 66 | pkill -f "$ISLAND_DIR/notification/notification_island.sh" 67 | fi 68 | # args: notification details 69 | bash "$ISLAND_DIR/notification/notification_island.sh" "$OVERRIDE|$ARGS" 70 | ;; 71 | esac 72 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/appswitch/appswitch_island.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source "$DYNAMIC_ISLAND_DIR/userconfig.sh" 3 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/clear.sh" 4 | 5 | MAX_EXPAND_HEIGHT=$(($P_DYNAMIC_ISLAND_APPSWITCH_EXPAND_HEIGHT + ($P_DYNAMIC_ISLAND_SQUISH_AMOUNT / 2))) 6 | 7 | args=$* 8 | IFS='|' 9 | read -ra strarr <<<"$args" 10 | unset IFS 11 | 12 | # $1 - override 13 | # $2 - front app name 14 | override="${strarr[0]}" 15 | appName="${strarr[1]}" 16 | BUNDLENAME=$(osascript -e "id of app \"$appName\"") 17 | 18 | if [[ $override == "0" ]]; then 19 | dynamic-island-sketchybar --set island.appname drawing=on \ 20 | --set island.applogo drawing=on 21 | fi 22 | 23 | dynamic-island-sketchybar --set island.appname label="$appName" 24 | 25 | # determine expand width based on the character length 26 | char_length=${#appName} 27 | expand_size=$(bc -l <<<"$P_DYNAMIC_ISLAND_APPSWITCH_MAX_EXPAND_WIDTH+$char_length*7") 28 | expand_squish=$(($expand_size + $P_DYNAMIC_ISLAND_SQUISH_AMOUNT)) 29 | 30 | expand_size_margin=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $expand_size)) 31 | expand_squish_margin=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $expand_squish)) 32 | 33 | 34 | if [[ $override == "0" ]]; then 35 | 36 | target_width=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $P_DYNAMIC_ISLAND_DEFAULT_WIDTH - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT)) 37 | 38 | dynamic-island-sketchybar --animate tanh 8 --bar margin="$target_width" margin="$expand_squish_margin" margin="$expand_size_margin" \ 39 | --animate tanh 10 --bar height="$MAX_EXPAND_HEIGHT" height="$P_DYNAMIC_ISLAND_APPSWITCH_EXPAND_HEIGHT" \ 40 | --animate tanh 10 --bar corner_radius="$P_DYNAMIC_ISLAND_APPSWITCH_CORNER_RAD" 41 | else 42 | dynamic-island-sketchybar --animate tanh 10 --bar margin="$expand_squish_margin" margin="$expand_size_margin" \ 43 | --animate tanh 10 --bar height="$MAX_EXPAND_HEIGHT" height="$P_DYNAMIC_ISLAND_APPSWITCH_EXPAND_HEIGHT" \ 44 | --animate tanh 10 --bar corner_radius="$P_DYNAMIC_ISLAND_APPSWITCH_CORNER_RAD" 45 | fi 46 | 47 | sleep 0.1 48 | 49 | dynamic-island-sketchybar --animate sin 15 --set island.appname label.color="$P_DYNAMIC_ISLAND_COLOR_WHITE" \ 50 | --animate sin 15 --set island.applogo background.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 51 | 52 | sleep 0.8 53 | 54 | dynamic-island-sketchybar --animate tanh 15 --set island.appname label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" \ 55 | --animate tanh 15 --set island.applogo background.color="$P_DYNAMIC_ISLAND_COLOR_ICON_HIDDEN" 56 | 57 | sleep 0.1 58 | 59 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/restore.sh" 60 | sleep 0.4 61 | 62 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/appswitch/reset.sh" 63 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/appswitch/creator.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env/bash 2 | 3 | appname=( 4 | width=10 5 | label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 6 | label.font="$P_DYNAMIC_ISLAND_FONT:Bold:12.0" 7 | label.y_offset=-5 8 | label.align=right 9 | padding_left=0 10 | padding_right=10 11 | drawing=off 12 | ) 13 | 14 | applogo=( 15 | background.color="$P_DYNAMIC_ISLAND_COLOR_ICON_HIDDEN" 16 | padding_left=20 17 | padding_right=5 18 | background.image.scale="$P_DYNAMIC_ISLAND_APPSWITCH_ICON_SIZE" 19 | y_offset=-16 20 | drawing=off 21 | ) 22 | 23 | dynamic-island-sketchybar --add item island.appname right \ 24 | --set island.appname "${appname[@]}" \ 25 | --add item island.applogo left \ 26 | --set island.applogo "${applogo[@]}" 27 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/appswitch/handler.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | case "$SENDER" in 3 | "front_app_switched") 4 | echo "front_app_switched" 5 | echo "$INFO" 6 | 7 | dynamic-island-sketchybar --trigger dynamic_island_queue INFO="appswitch" ISLAND_ARGS="$INFO" 8 | ;; 9 | esac 10 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/appswitch/reset.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | dynamic-island-sketchybar --set island.applogo drawing=off \ 3 | --set island.appname drawing=off 4 | sleep 0.1 5 | 6 | # call end event 7 | dynamic-island-sketchybar --trigger dynamic_island_request 8 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/brightness/creator.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | icon=( 4 | icon="$ICON" 5 | icon.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 6 | icon.font="$P_DYNAMIC_ISLAND_FONT:Bold:14.0" 7 | icon.y_offset=2 8 | padding_left=10 9 | padding_right=0 10 | width=0 11 | drawing=off 12 | ) 13 | 14 | bar=( 15 | background.height=2 16 | background.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 17 | background.border_color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 18 | background.y_offset=0 19 | background.shadow.drawing=off 20 | drawing=off 21 | y_offset=-19 22 | padding_left=10 23 | ) 24 | 25 | #create brightness items 26 | dynamic-island-sketchybar --add item island.brightness_icon left \ 27 | --set island.brightness_icon "${icon[@]}" \ 28 | --add item island.brightness_bar left \ 29 | --set island.brightness_bar "${bar[@]}" 30 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/brightness/handler.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | echo "brightness" 3 | echo "$INFO" 4 | 5 | dynamic-island-sketchybar --trigger dynamic_island_queue INFO="brightness" ISLAND_ARGS="$INFO" 6 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/brightness/reset.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # call end event 3 | dynamic-island-sketchybar --trigger dynamic_island_request 4 | 5 | dynamic-island-sketchybar --set island.brightness_icon drawing=off \ 6 | --set island.brightness_bar drawing=off \ 7 | 8 | sleep 0.1 9 | 10 | dynamic-island-sketchybar --set island popup.drawing=false 11 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/clear.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env/bash 2 | if [[ $P_DYNAMIC_ISLAND_MUSIC_ENABLED == 1 ]]; then 3 | dynamic-island-sketchybar --animate tanh 10 --set island.small_artwork background.color="$P_DYNAMIC_ISLAND_COLOR_ICON_HIDDEN" \ 4 | --animate tanh 10 --set island.music_visualizer label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 5 | fi 6 | 7 | sleep 0.2 8 | 9 | if [[ $P_DYNAMIC_ISLAND_MUSIC_ENABLED == 1 ]]; then 10 | dynamic-island-sketchybar --set island.music_visualizer drawing=off \ 11 | --set island.small_artwork drawing=off 12 | fi 13 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/music/cava.conf: -------------------------------------------------------------------------------- 1 | [general] 2 | framerate=60 3 | bars=6 4 | [input] 5 | method = portaudio 6 | source = "Background Music" 7 | [output] 8 | method=raw 9 | data_format=ascii 10 | ascii_max_range=8 11 | bar_delimiter=32 12 | channels=mono 13 | mono_option=average 14 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/music/cava.sh: -------------------------------------------------------------------------------- 1 | CONF_FILE="$HOME/.config/dynamic-island-sketchybar/scripts/islands/music/cava.conf" 2 | 3 | while true 4 | do 5 | cava -p "$CONF_FILE" | sed -u 's/ //g; s/0/▁/g; s/1/▂/g; s/2/▃/g; s/3/▄/g; s/4/▅/g; s/5/▆/g; s/6/▇/g; s/7/█/g; s/8/█/g' | while read line; do 6 | dynamic-island-sketchybar --set $NAME label=$line 7 | done 8 | echo "TEST" 9 | sleep 5 10 | done 11 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/music/creator.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ARTWORK_LOCATION="$DYNAMIC_ISLAND_DIR/scripts/islands/music/artwork.jpg" 3 | 4 | artwork=( 5 | background.color="$P_DYNAMIC_ISLAND_COLOR_ICON_HIDDEN" 6 | padding_left=5 7 | padding_right=0 8 | background.image.scale=0.12 9 | y_offset=0 10 | drawing=off 11 | width=50 12 | background.image="$ARTWORK_LOCATION" 13 | ) 14 | 15 | title=( 16 | width=0 17 | label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 18 | label.padding_left=0 19 | label.padding_right=0 20 | label.font="$P_DYNAMIC_ISLAND_FONT:Bold:14.0" 21 | y_offset=-10 22 | padding_left=-80 23 | padding_right=0 24 | label.width=550 25 | drawing=off 26 | ) 27 | 28 | artist=( 29 | width=0 30 | label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 31 | label.padding_left=0 32 | label.padding_right=0 33 | padding_left=-80 34 | padding_right=0 35 | label.width=550 36 | label.font="$P_DYNAMIC_ISLAND_FONT:Semibold:12.0" 37 | label.y_offset=-30 38 | drawing=off 39 | ) 40 | 41 | resume_text=( 42 | label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 43 | label.padding_right=0 44 | label.font="$P_DYNAMIC_ISLAND_FONT:Bold:12.0" 45 | padding_left=0 46 | padding_right=10 47 | width=30 48 | y_offset=-5 49 | drawing=off 50 | ) 51 | 52 | visualizer=( 53 | drawing=off 54 | update_freq=0 55 | y_offset=-10 56 | label.font="$P_DYNAMIC_ISLAND_FONT:Bold:10.0" 57 | script="$DYNAMIC_ISLAND_DIR/scripts/islands/music/cava.sh" 58 | label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 59 | ) 60 | 61 | small_artwork=( 62 | background.color="$P_DYNAMIC_ISLAND_COLOR_ICON_HIDDEN" 63 | padding_left=10 64 | padding_right=0 65 | background.image.scale=0.04 66 | y_offset=-5 67 | drawing=off 68 | width=50 69 | background.image="$ARTWORK_LOCATION" 70 | ) 71 | 72 | # music island 73 | dynamic-island-sketchybar --add item island.music_artwork left \ 74 | --set island.music_artwork "${artwork[@]}" \ 75 | --add item island.music_title center \ 76 | --set island.music_title "${title[@]}" \ 77 | --add item island.music_artist center \ 78 | --set island.music_artist "${artist[@]}" \ 79 | 80 | # pause island 81 | dynamic-island-sketchybar --add item island.resume_text right \ 82 | --set island.resume_text "${resume_text[@]}" 83 | 84 | # idle island 85 | dynamic-island-sketchybar --add item island.music_visualizer right \ 86 | --set island.music_visualizer "${visualizer[@]}" \ 87 | --add item island.small_artwork left \ 88 | --set island.small_artwork "${small_artwork[@]}" 89 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/music/get_artwork.scpt: -------------------------------------------------------------------------------- 1 | tell application "Music" 2 | set currentTrack to current track 3 | set artworkData to raw data of artwork 1 of currentTrack 4 | end tell 5 | 6 | set tempFile to (path to temporary items folder as string) & "artwork_temp.jpg" 7 | set fileRef to open for access tempFile with write permission 8 | write artworkData to fileRef 9 | close access fileRef 10 | 11 | set resizeCommand to "sips -Z 600 " & quoted form of POSIX path of tempFile 12 | do shell script resizeCommand 13 | 14 | set currentFolder to POSIX path of ((path to me as string) & "::") 15 | set newFile to currentFolder & "artwork.jpg" 16 | set moveCommand to "mv " & quoted form of POSIX path of tempFile & " " & quoted form of newFile 17 | do shell script moveCommand 18 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/music/handler.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | PREVIOUS_ISLAND_CACHE="$HOME/.config/dynamic-island-sketchybar/scripts/islands/previous_island" 3 | 4 | script_dir=$( 5 | cd "$(dirname "${BASH_SOURCE[0]}")" || exit 6 | pwd -P 7 | ) 8 | 9 | echo "music" 10 | echo "$INFO" 11 | 12 | # $1: MUSIC_SOURCE 13 | 14 | # check if music app is running 15 | RUNNING=$(pgrep -x "$1") 16 | if [[ ! "$RUNNING" ]]; then 17 | exit 0 18 | fi 19 | 20 | if [ "$(echo "$INFO" | jq -r '.["Player State"]')" = "Stopped" ]; then 21 | exit 0 22 | fi 23 | 24 | cache="$script_dir/cache" 25 | PLAYER_STATE=$(osascript -e "tell application \"$1\" to return (get player state)") 26 | 27 | if ! test -f $cache; then 28 | printf 1 >"$cache" 29 | fi 30 | 31 | if [[ $(cat "$cache") == 0 ]]; then 32 | # resume 33 | printf 1 >"$cache" 34 | dynamic-island-sketchybar --trigger dynamic_island_queue INFO="pause" ISLAND_ARGS="1" 35 | if [[ ! $(grep -Fxq "music" "$PREVIOUS_ISLAND_CACHE") ]]; then 36 | echo "music" >> "$PREVIOUS_ISLAND_CACHE" 37 | fi 38 | exit 0 39 | fi 40 | 41 | if [[ $PLAYER_STATE == "paused" ]]; then 42 | # paused 43 | printf 0 >"$cache" 44 | dynamic-island-sketchybar --trigger dynamic_island_queue INFO="pause" ISLAND_ARGS="0" 45 | if [[ ! $(grep -Fxq "music" "$PREVIOUS_ISLAND_CACHE") ]]; then 46 | true > "$PREVIOUS_ISLAND_CACHE" 47 | fi 48 | exit 0 49 | fi 50 | 51 | # music display 52 | dynamic-island-sketchybar --trigger dynamic_island_queue INFO="music" ISLAND_ARGS=" " 53 | 54 | # add "music" to previous island cache as a new line if it doesn't exist 55 | 56 | if [[ ! $(grep -Fxq "music" "$PREVIOUS_ISLAND_CACHE") ]]; then 57 | echo "music" >> "$PREVIOUS_ISLAND_CACHE" 58 | fi 59 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/music/pause_island.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source "$HOME/.config/dynamic-island-sketchybar/userconfig.sh" 3 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/clear.sh" 4 | 5 | RESUME_MAX_EXPAND_HEIGHT=$(($P_DYNAMIC_ISLAND_MUSIC_RESUME_EXPAND_HEIGHT + $P_DYNAMIC_ISLAND_SQUISH_AMOUNT)) 6 | EXPAND_SIZE=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $P_DYNAMIC_ISLAND_MUSIC_RESUME_MAX_EXPAND_WIDTH)) 7 | 8 | args=$* 9 | IFS='|' 10 | read -ra strarr <<<"$args" 11 | unset IFS 12 | 13 | override="${strarr[0]}" 14 | pauseStatus="${strarr[1]}" 15 | 16 | # enable 17 | dynamic-island-sketchybar --set island.resume_text drawing=on 18 | 19 | if [[ $pauseStatus == "0" ]]; then 20 | # paused 21 | dynamic-island-sketchybar --set island.resume_text label="Paused" 22 | else 23 | # resume 24 | dynamic-island-sketchybar --set island.resume_text label="Resumed" 25 | fi 26 | 27 | if [[ $override == "0" ]]; then 28 | target_width=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $P_DYNAMIC_ISLAND_DEFAULT_WIDTH - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT)) 29 | 30 | # animate 31 | dynamic-island-sketchybar --animate tanh 8 --bar margin=$target_width margin="$(($EXPAND_SIZE - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT))" margin="$EXPAND_SIZE" \ 32 | --animate tanh 10 --bar height=$RESUME_MAX_EXPAND_HEIGHT height="$P_DYNAMIC_ISLAND_MUSIC_RESUME_EXPAND_HEIGHT" \ 33 | --animate tanh 10 --bar corner_radius="$P_DYNAMIC_ISLAND_MUSIC_RESUME_CORNER_RAD" 34 | 35 | sleep 0.45 36 | dynamic-island-sketchybar --animate sin 10 --set island.resume_text label.color="$P_DYNAMIC_ISLAND_COLOR_WHITE" 37 | else 38 | dynamic-island-sketchybar --animate tanh 8 --bar margin="$(($EXPAND_SIZE - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT))" margin="$EXPAND_SIZE" \ 39 | --animate tanh 10 --bar height=$RESUME_MAX_EXPAND_HEIGHT height="$P_DYNAMIC_ISLAND_MUSIC_RESUME_EXPAND_HEIGHT" \ 40 | --animate tanh 10 --bar corner_radius="$P_DYNAMIC_ISLAND_MUSIC_RESUME_CORNER_RAD" 41 | dynamic-island-sketchybar --animate sin 10 --set island.resume_text label.color="$P_DYNAMIC_ISLAND_COLOR_WHITE" 42 | fi 43 | 44 | sleep 0.8 45 | 46 | dynamic-island-sketchybar --animate tanh 10 --set island.resume_text label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 47 | 48 | sleep 0.1 49 | 50 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/restore.sh" 51 | sleep 0.7 52 | 53 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/music/reset-resume.sh" 54 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/music/reset-resume.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | dynamic-island-sketchybar --set island.resume_text drawing=off 3 | sleep 0.1 4 | 5 | # call end event 6 | dynamic-island-sketchybar --trigger dynamic_island_request 7 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/music/reset.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | dynamic-island-sketchybar --set island.music_title drawing=off \ 3 | --set island.music_artist drawing=off \ 4 | --set island.music_artwork drawing=off 5 | 6 | sleep 0.1 7 | 8 | # call end event 9 | dynamic-island-sketchybar --trigger dynamic_island_request 10 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/notification/creator.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | title=( 4 | width=0 5 | label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 6 | label.padding_left=0 7 | label.padding_right=0 8 | label.font="$P_DYNAMIC_ISLAND_FONT:Bold:16.0" 9 | label.y_offset=-6 10 | background.height=0 11 | background.padding_left=12 12 | background.padding_right=0 13 | drawing=off 14 | ) 15 | 16 | subtitle=( 17 | label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 18 | label.padding_left=0 19 | label.padding_right=0 20 | background.height=0 21 | background.padding_left=0 22 | background.padding_right=0 23 | width=0 24 | label.font="$P_DYNAMIC_ISLAND_FONT:Italic:12.0" 25 | label.y_offset=-24 26 | drawing=off 27 | ) 28 | 29 | body=( 30 | label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 31 | label.padding_left=0 32 | label.padding_right=0 33 | background.padding_left=0 34 | background.height=0 35 | background.padding_right=0 36 | label.font="$P_DYNAMIC_ISLAND_FONT:Semibold:14.0" 37 | label.y_offset=-43 38 | label.width="$P_DYNAMIC_ISLAND_NOTIFICATION_MAX_ALLOWED_BODY" 39 | width=0 40 | drawing=off 41 | ) 42 | 43 | logo=( 44 | background.color="$P_DYNAMIC_ISLAND_COLOR_ICON_HIDDEN" 45 | background.padding_left=20 46 | background.padding_right=12 47 | background.image.scale=0.8 48 | background.height=0 49 | y_offset=-10 50 | width=0 51 | drawing=off 52 | ) 53 | 54 | dynamic-island-sketchybar --add item island.notification_title popup.island \ 55 | --set island.notification_title "${title[@]}" \ 56 | --add item island.notification_subtitle popup.island \ 57 | --set island.notification_subtitle "${subtitle[@]}" \ 58 | --add item island.notification_body popup.island \ 59 | --set island.notification_body "${body[@]}" \ 60 | --add item island.notification_logo popup.island \ 61 | --set island.notification_logo "${logo[@]}" 62 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/notification/notification_island.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source "$HOME/.config/dynamic-island-sketchybar/userconfig.sh" 3 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/clear.sh" 4 | 5 | MAX_EXPAND_HEIGHT=$(($P_DYNAMIC_ISLAND_NOTIFICATION_EXPAND_HEIGHT + $P_DYNAMIC_ISLAND_SQUISH_AMOUNT)) 6 | EXPAND_SIZE=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $P_DYNAMIC_ISLAND_NOTIFICATION_MAX_EXPAND_WIDTH)) 7 | 8 | args=$* 9 | IFS='|' 10 | read -ra strarr <<<"$args" 11 | unset IFS 12 | 13 | # 1 - override 14 | # 2 - title 15 | # 3 - subtitle 16 | # 4 - message - message1 17 | # 5 - app bundle identifier 18 | override="${strarr[0]}" 19 | title="${strarr[1]}" 20 | subtitle="${strarr[2]}" 21 | message="${strarr[3]}" 22 | appId="${strarr[4]%% *}" 23 | 24 | logo=( 25 | drawing=on 26 | background.color="$P_DYNAMIC_ISLAND_COLOR_ICON_HIDDEN" 27 | background.image="app.$appId" 28 | width=50 29 | ) 30 | 31 | # Enable 32 | dynamic-island-sketchybar --set island.notification_title drawing=on \ 33 | label="$title" \ 34 | --set island.notification_subtitle drawing=on \ 35 | label="$subtitle" \ 36 | --set island.notification_body drawing=on \ 37 | label="$message" \ 38 | --set island.notification_logo "${logo[@]}" \ 39 | 40 | target_width=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $P_DYNAMIC_ISLAND_DEFAULT_WIDTH - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT)) 41 | 42 | dynamic-island-sketchybar --animate tanh 8 --bar margin="$target_width" margin="$(($EXPAND_SIZE - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT))" margin="$EXPAND_SIZE" \ 43 | --animate tanh 10 --bar height="$MAX_EXPAND_HEIGHT" height="$P_DYNAMIC_ISLAND_NOTIFICATION_EXPAND_HEIGHT" \ 44 | --animate tanh 10 --bar corner_radius="$P_DYNAMIC_ISLAND_NOTIFICATION_CORNER_RAD" 45 | 46 | sleep 0.45 47 | dynamic-island-sketchybar --animate sin 20 --set island.notification_title label.color="$P_DYNAMIC_ISLAND_COLOR_WHITE" \ 48 | --animate sin 20 --set island.notification_subtitle label.color="$P_DYNAMIC_ISLAND_COLOR_WHITE" \ 49 | --animate sin 20 --set island.notification_body label.color="$P_DYNAMIC_ISLAND_COLOR_WHITE" \ 50 | --animate sin 20 --set island.notification_logo background.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 51 | 52 | sleep 2.25 53 | 54 | dynamic-island-sketchybar --animate tanh 20 --set island.notification_title label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" \ 55 | --animate tanh 20 --set island.notification_subtitle label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" \ 56 | --animate tanh 20 --set island.notification_body label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" \ 57 | --animate tanh 20 --set island.notification_logo background.color="$P_DYNAMIC_ISLAND_COLOR_ICON_HIDDEN" 58 | 59 | sleep 0.15 60 | 61 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/restore.sh" 62 | 63 | sleep 0.7 64 | 65 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/notification/reset.sh" 66 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/notification/reset.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | dynamic-island-sketchybar --set island.notification_title drawing=off \ 3 | --set island.notification_subtitle drawing=off \ 4 | --set island.notification_body drawing=off \ 5 | --set island.notification_logo drawing=off \ 6 | 7 | sleep 0.1 8 | 9 | # call end event 10 | dynamic-island-sketchybar --trigger dynamic_island_request 11 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/power/creator.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env/bash 2 | 3 | power_text=( 4 | width=0 5 | label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 6 | label.font="$P_DYNAMIC_ISLAND_FONT:Bold:12.0" 7 | label.y_offset=-5 8 | label.align=right 9 | padding_left=0 10 | padding_right=10 11 | drawing=off 12 | ) 13 | 14 | power_icon=( 15 | label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 16 | label.font="$P_DYNAMIC_ISLAND_FONT:Bold:12.0" 17 | y_offset=-5 18 | padding_right=10 19 | drawing=off 20 | ) 21 | 22 | dynamic-island-sketchybar --add item island.power_text right \ 23 | --set island.power_text "${power_text[@]}" \ 24 | --add item island.power_icon left \ 25 | --set island.power_icon "${power_icon[@]}" 26 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/power/handler.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | dynamic-island-sketchybar --trigger dynamic_island_queue INFO="power" ISLAND_ARGS="$INFO" 3 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/power/power_island.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source "$HOME/.config/dynamic-island-sketchybar/userconfig.sh" 3 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/clear.sh" 4 | 5 | MAX_EXPAND_HEIGHT=$(($P_DYNAMIC_ISLAND_BATTERY_EXPAND_HEIGHT + $P_DYNAMIC_ISLAND_SQUISH_AMOUNT)) 6 | EXPAND_SIZE=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $P_DYNAMIC_ISLAND_BATTERY_MAX_EXPAND_WIDTH)) 7 | 8 | args=$* 9 | IFS='|' 10 | read -ra strarr <<<"$args" 11 | unset IFS 12 | 13 | # $1 - override 14 | # $2 - connection type 15 | override="${strarr[0]}" 16 | power_source="${strarr[1]}" 17 | icon=$P_DYNAMIC_ISLAND_ICON_BATTERY_ONBATTERY 18 | 19 | if [ "$power_source" == "AC" ]; then 20 | icon=$P_DYNAMIC_ISLAND_ICON_BATTERY_CONNECTEDAC 21 | fi 22 | 23 | if [[ $override == "0" ]]; then 24 | dynamic-island-sketchybar --set island.power_text drawing=on \ 25 | --set island.power_icon drawing=on 26 | fi 27 | 28 | dynamic-island-sketchybar --set island.power_icon label="$icon" \ 29 | --set island.power_text label="$power_source" 30 | 31 | if [[ $override == "0" ]]; then 32 | target_width=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $P_DYNAMIC_ISLAND_DEFAULT_WIDTH - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT)) 33 | 34 | dynamic-island-sketchybar --animate tanh 8 --bar margin="$target_width" margin="$(($EXPAND_SIZE - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT))" margin="$EXPAND_SIZE" \ 35 | --animate tanh 10 --bar height="$MAX_EXPAND_HEIGHT" height="$P_DYNAMIC_ISLAND_BATTERY_EXPAND_HEIGHT" \ 36 | --animate tanh 10 --bar corner_radius="$P_DYNAMIC_ISLAND_BATTERY_CORNER_RAD" 37 | else 38 | dynamic-island-sketchybar --animate tanh 8 --bar margin="$(($EXPAND_SIZE - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT))" margin="$EXPAND_SIZE" \ 39 | --animate tanh 10 --bar height="$MAX_EXPAND_HEIGHT" height="$P_DYNAMIC_ISLAND_BATTERY_EXPAND_HEIGHT" \ 40 | --animate tanh 10 --bar corner_radius="$P_DYNAMIC_ISLAND_BATTERY_CORNER_RAD" 41 | fi 42 | 43 | sleep 0.1 44 | 45 | dynamic-island-sketchybar --animate sin 15 --set island.power_text label.color="$P_DYNAMIC_ISLAND_COLOR_WHITE" \ 46 | --animate sin 15 --set island.power_icon label.color="$P_DYNAMIC_ISLAND_COLOR_WHITE" 47 | 48 | sleep 0.8 49 | 50 | dynamic-island-sketchybar --animate tanh 15 --set island.power_text label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" \ 51 | --animate tanh 15 --set island.power_icon label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 52 | 53 | sleep 0.1 54 | 55 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/restore.sh" 56 | sleep 0.4 57 | 58 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/power/reset.sh" 59 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/power/reset.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | dynamic-island-sketchybar --set island.power_text drawing=off \ 3 | --set island.power_icon drawing=off \ 4 | 5 | sleep 0.1 6 | 7 | # call end event 8 | dynamic-island-sketchybar --trigger dynamic_island_request 9 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/previous_island: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/refcell/dots/3a3cba9cb4ea2b3eb2f167cb45c491874ec80bf8/confs/dynamic-island-sketchybar/scripts/islands/previous_island -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/restore.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env/bash 2 | PREVIOUS_ISLAND_CACHE="$HOME/.config/dynamic-island-sketchybar/scripts/islands/previous_island" 3 | 4 | dynamic-island-sketchybar --animate tanh 10 --bar height="$P_DYNAMIC_ISLAND_DEFAULT_HEIGHT" \ 5 | --animate sin 10 --bar corner_radius="$P_DYNAMIC_ISLAND_CORNER_RADIUS" 6 | 7 | TARGET_WIDTH="$P_DYNAMIC_ISLAND_DEFAULT_WIDTH" 8 | 9 | while IFS= read -r line 10 | do 11 | echo "$line" 12 | if [[ $line == "music" ]]; then 13 | if [[ $TARGET_WIDTH -lt $P_DYNAMIC_ISLAND_MUSIC_IDLE_EXPAND_WIDTH ]]; then 14 | TARGET_WIDTH="$P_DYNAMIC_ISLAND_MUSIC_IDLE_EXPAND_WIDTH" 15 | fi 16 | fi 17 | done < "$PREVIOUS_ISLAND_CACHE" 18 | 19 | dynamic-island-sketchybar --animate tanh 10 --bar margin=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $TARGET_WIDTH + $P_DYNAMIC_ISLAND_SQUISH_AMOUNT)) margin=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $TARGET_WIDTH)) 20 | 21 | sleep 0.2 22 | 23 | # Restore elements 24 | while IFS= read -r line 25 | do 26 | echo "$line" 27 | if [[ $line == "music" ]]; then 28 | dynamic-island-sketchybar --set island.music_visualizer drawing=on \ 29 | --set island.small_artwork drawing=on 30 | 31 | dynamic-island-sketchybar --animate tanh 10 --set island.music_visualizer label.color="$P_DYNAMIC_ISLAND_COLOR_WHITE" \ 32 | --animate tanh 10 --set island.small_artwork background.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 33 | fi 34 | done < "$PREVIOUS_ISLAND_CACHE" 35 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/volume/creator.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | volume_icon=( 4 | icon.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 5 | icon.font="$P_DYNAMIC_ISLAND_FONT:Bold:14.0" 6 | icon.y_offset=2 7 | padding_left=10 8 | padding_right=0 9 | width=0 10 | drawing=off 11 | ) 12 | 13 | volume_bar=( 14 | background.height=2 15 | background.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 16 | background.border_color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 17 | background.y_offset=0 18 | background.shadow.drawing=off 19 | drawing=off 20 | y_offset=-19 21 | padding_left=10 22 | ) 23 | 24 | dynamic-island-sketchybar --add item island.volume_icon left \ 25 | --set island.volume_icon "${volume_icon[@]}" \ 26 | --add item island.volume_bar left \ 27 | --set island.volume_bar "${volume_bar[@]}" 28 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/volume/handler.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | echo "volume" 3 | echo "$INFO" 4 | 5 | dynamic-island-sketchybar --trigger dynamic_island_queue INFO="volume" ISLAND_ARGS="$INFO" 6 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/volume/reset.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | dynamic-island-sketchybar --set island.volume_icon drawing=off \ 3 | --set island.volume_bar drawing=off \ 4 | 5 | sleep 0.1 6 | 7 | # call end event 8 | dynamic-island-sketchybar --trigger dynamic_island_request 9 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/volume/volume_island.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source "$HOME/.config/dynamic-island-sketchybar/userconfig.sh" 3 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/clear.sh" 4 | 5 | MAX_EXPAND_HEIGHT=$(($P_DYNAMIC_ISLAND_VOLUME_EXPAND_HEIGHT + ($P_DYNAMIC_ISLAND_SQUISH_AMOUNT / 2))) 6 | EXPAND_SIZE=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $P_DYNAMIC_ISLAND_VOLUME_MAX_EXPAND_WIDTH)) 7 | 8 | args=$* 9 | IFS='|' 10 | read -ra strarr <<<"$args" 11 | unset IFS 12 | 13 | # $1 - override 14 | # $2 - volume 15 | override="${strarr[0]}" 16 | volume="${strarr[1]}" 17 | 18 | # calculate volume logo 19 | case $volume in 20 | 100) ICON=$P_DYNAMIC_ISLAND_ICON_VOLUME_MAX ;; 21 | 9[0-9]) ICON=$P_DYNAMIC_ISLAND_ICON_VOLUME_MAX ;; 22 | 8[0-9]) ICON=$P_DYNAMIC_ISLAND_ICON_VOLUME_MAX ;; 23 | 7[0-9]) ICON=$P_DYNAMIC_ISLAND_ICON_VOLUME_MAX ;; 24 | 6[0-9]) ICON=$P_DYNAMIC_ISLAND_ICON_VOLUME_MED ;; 25 | 5[0-9]) ICON=$P_DYNAMIC_ISLAND_ICON_VOLUME_MED ;; 26 | 4[0-9]) ICON=$P_DYNAMIC_ISLAND_ICON_VOLUME_MED ;; 27 | 3[0-9]) ICON=$P_DYNAMIC_ISLAND_ICON_VOLUME_LOW ;; 28 | 2[0-9]) ICON=$P_DYNAMIC_ISLAND_ICON_VOLUME_LOW ;; 29 | 1[0-9]) ICON=$P_DYNAMIC_ISLAND_ICON_VOLUME_LOW ;; 30 | [0-9]) ICON=$P_DYNAMIC_ISLAND_ICON_VOLUME_MUTED ;; 31 | *) ICON=$P_DYNAMIC_ISLAND_ICON_VOLUME_MUTED ;; 32 | esac 33 | 34 | if [[ $override == "0" ]]; then 35 | # enable 36 | dynamic-island-sketchybar --set island.volume_icon drawing=on \ 37 | icon="$ICON" \ 38 | --set island.volume_bar drawing=on 39 | fi 40 | 41 | if [[ $override == "0" ]]; then 42 | target_width=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $P_DYNAMIC_ISLAND_DEFAULT_WIDTH - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT)) 43 | 44 | dynamic-island-sketchybar --animate tanh 8 --bar margin="$target_width" margin="$(($EXPAND_SIZE - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT))" margin="$EXPAND_SIZE" \ 45 | --animate tanh 10 --bar corner_radius="$P_DYNAMIC_ISLAND_VOLUME_CORNER_RAD" \ 46 | --animate tanh 10 --bar height="$MAX_EXPAND_HEIGHT" height="$P_DYNAMIC_ISLAND_VOLUME_EXPAND_HEIGHT" 47 | else 48 | dynamic-island-sketchybar --animate tanh 10 --bar margin="$(($EXPAND_SIZE + $P_DYNAMIC_ISLAND_SQUISH_AMOUNT))" margin="$EXPAND_SIZE" \ 49 | --animate tanh 10 --bar corner_radius="$P_DYNAMIC_ISLAND_VOLUME_CORNER_RAD" \ 50 | --animate tanh 10 --bar height="$MAX_EXPAND_HEIGHT" height="$P_DYNAMIC_ISLAND_VOLUME_EXPAND_HEIGHT" 51 | fi 52 | 53 | sleep 0.1 54 | 55 | # subtract 20, because we're using padding value of 10. 56 | barWidth=$(bc -l <<<"$volume/100*$(($P_DYNAMIC_ISLAND_VOLUME_MAX_EXPAND_WIDTH * 2 - 20))") 57 | barWidth=$(printf "%.0f" "$barWidth") 58 | dynamic-island-sketchybar --animate tanh 15 --set island.volume_bar width="$barWidth" 59 | 60 | dynamic-island-sketchybar --animate sin 10 --set island.volume_bar background.color="$P_DYNAMIC_ISLAND_COLOR_WHITE" \ 61 | --animate sin 10 --set island.volume_bar background.border_color="$P_DYNAMIC_ISLAND_COLOR_WHITE" \ 62 | --animate sin 10 --set island.volume_icon icon.color="$P_DYNAMIC_ISLAND_COLOR_WHITE" 63 | 64 | sleep 0.8 65 | 66 | dynamic-island-sketchybar --animate tanh 15 --set island.volume_icon icon.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" \ 67 | --animate tanh 15 --set island.volume_bar background.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 68 | 69 | sleep 0.1 70 | 71 | dynamic-island-sketchybar --animate tanh 5 --set island.volume_bar width=0 72 | 73 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/restore.sh" 74 | sleep 0.4 75 | 76 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/volume/reset.sh" 77 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/wifi/creator.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env/sh 2 | dynamic-island-sketchybar --add item island.wifi_ssid right \ 3 | --set island.wifi_ssid width=0 \ 4 | label.color=$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT \ 5 | label.font="$P_DYNAMIC_ISLAND_FONT:Bold:12.0" \ 6 | label.y_offset=-5 \ 7 | label.align=right \ 8 | padding_left=0 \ 9 | padding_right=10 \ 10 | drawing=off \ 11 | --add item island.wifi_icon left \ 12 | --set island.wifi_icon label.color=$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT \ 13 | label.font="$P_DYNAMIC_ISLAND_FONT:Bold:12.0" \ 14 | y_offset=-5 \ 15 | padding_right=10 \ 16 | drawing=off 17 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/wifi/handler.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | echo "wifi" 3 | echo "$INFO" 4 | 5 | dynamic-island-sketchybar --trigger dynamic_island_queue INFO="wifi" ISLAND_ARGS="$INFO" 6 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/wifi/reset.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | dynamic-island-sketchybar --set island.wifi_icon drawing=off \ 3 | --set island.wifi_ssid drawing=off \ 4 | 5 | sleep 0.1 6 | 7 | # call end event 8 | dynamic-island-sketchybar --trigger dynamic_island_request 9 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/scripts/islands/wifi/wifi_island.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source "$HOME/.config/dynamic-island-sketchybar/userconfig.sh" 3 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/clear.sh" 4 | 5 | MAX_EXPAND_HEIGHT=$(($P_DYNAMIC_ISLAND_WIFI_EXPAND_HEIGHT + $P_DYNAMIC_ISLAND_SQUISH_AMOUNT)) 6 | EXPAND_SIZE=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $P_DYNAMIC_ISLAND_WIFI_MAX_EXPAND_WIDTH)) 7 | 8 | args=$* 9 | IFS='|' 10 | read -ra strarr <<<"$args" 11 | unset IFS 12 | 13 | # $1 - override 14 | # $2 - ssid 15 | override="${strarr[0]}" 16 | ssid="${strarr[1]}" 17 | icon=$P_DYNAMIC_ISLAND_ICON_WIFI_CONNECTED 18 | 19 | if [ -z "$ssid" ]; then 20 | icon=$P_DYNAMIC_ISLAND_ICON_WIFI_DISCONNECTED 21 | ssid="Disconnected" 22 | fi 23 | 24 | if [[ $override == "0" ]]; then 25 | dynamic-island-sketchybar --set island.wifi_ssid drawing=on \ 26 | --set island.wifi_icon drawing=on 27 | fi 28 | 29 | dynamic-island-sketchybar --set island.wifi_icon label="$icon" \ 30 | --set island.wifi_ssid label="$ssid" 31 | 32 | if [[ $override == "0" ]]; then 33 | target_width=$(($P_DYNAMIC_ISLAND_MONITOR_HORIZONTAL_RESOLUTION / 2 - $P_DYNAMIC_ISLAND_DEFAULT_WIDTH - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT)) 34 | 35 | dynamic-island-sketchybar --animate tanh 8 --bar margin="$target_width" margin="$(($EXPAND_SIZE - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT))" margin="$EXPAND_SIZE" \ 36 | --animate tanh 10 --bar height="$MAX_EXPAND_HEIGHT" height="$P_DYNAMIC_ISLAND_WIFI_EXPAND_HEIGHT" \ 37 | --animate tanh 10 --bar corner_radius="$P_DYNAMIC_ISLAND_WIFI_CORNER_RAD" 38 | else 39 | dynamic-island-sketchybar --animate tanh 8 --bar margin="$(($EXPAND_SIZE - $P_DYNAMIC_ISLAND_SQUISH_AMOUNT))" margin="$EXPAND_SIZE" \ 40 | --animate tanh 10 --bar height="$MAX_EXPAND_HEIGHT" height="$P_DYNAMIC_ISLAND_WIFI_EXPAND_HEIGHT" \ 41 | --animate tanh 10 --bar corner_radius="$P_DYNAMIC_ISLAND_WIFI_CORNER_RAD" 42 | fi 43 | 44 | sleep 0.1 45 | 46 | dynamic-island-sketchybar --animate sin 15 --set island.wifi_ssid label.color="$P_DYNAMIC_ISLAND_COLOR_WHITE" \ 47 | --animate sin 15 --set island.wifi_icon label.color="$P_DYNAMIC_ISLAND_COLOR_WHITE" 48 | 49 | sleep 0.8 50 | 51 | dynamic-island-sketchybar --animate tanh 15 --set island.wifi_ssid label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" \ 52 | --animate tanh 15 --set island.wifi_icon label.color="$P_DYNAMIC_ISLAND_COLOR_TRANSPARENT" 53 | 54 | sleep 0.1 55 | 56 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/restore.sh" 57 | sleep 0.4 58 | 59 | source "$DYNAMIC_ISLAND_DIR/scripts/islands/wifi/reset.sh" 60 | -------------------------------------------------------------------------------- /confs/dynamic-island-sketchybar/sketchybarrc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | DYNAMIC_ISLAND_DIR="$HOME/.config/dynamic-island-sketchybar" 4 | 5 | source "$DYNAMIC_ISLAND_DIR/item.sh" # Loads Dynamic-Island item 6 | 7 | dynamic-island-sketchybar --update 8 | -------------------------------------------------------------------------------- /confs/gm/codebase/.gitignore: -------------------------------------------------------------------------------- 1 | # Rust target 2 | target/ 3 | -------------------------------------------------------------------------------- /confs/gm/codebase/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "gm" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | clap = { version = "3.2.15", features = ["derive"] } 8 | spinners-rs = "2.3.0" 9 | yansi = "0.5.1" 10 | lazy_static = "1.4.0" 11 | hyper = { version = "0.14.20", features = ["full"] } 12 | tokio = { version = "1.20.1", features = ["full"] } 13 | serde = "1.0.140" 14 | serde_derive = "1.0.140" 15 | serde_json = "1.0.82" 16 | home = "0.5.3" 17 | eyre = "0.6.8" 18 | 19 | [[bin]] 20 | name = "gm" 21 | path = "src/gm.rs" 22 | doc = false 23 | 24 | -------------------------------------------------------------------------------- /confs/gm/codebase/README.md: -------------------------------------------------------------------------------- 1 | # GM 2 | 3 | A simple CLI to update various toolchains in one go each morning. 4 | -------------------------------------------------------------------------------- /confs/gm/codebase/src/gm.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | extern crate lazy_static; 3 | extern crate hyper; 4 | extern crate tokio; 5 | 6 | use eyre::Result; 7 | use home::home_dir; 8 | use hyper::{Client, Uri}; 9 | use serde_derive::{Deserialize, Serialize}; 10 | use spinners_rs::{Spinner, Spinners}; 11 | use std::error::Error; 12 | use std::path::PathBuf; 13 | use std::str; 14 | use std::{fs, process}; 15 | use yansi::Paint; 16 | 17 | lazy_static! { 18 | static ref CONFIG_PATH: PathBuf = 19 | PathBuf::from(format!("{}/.gm/config.json", home_dir().unwrap().display())); 20 | } 21 | 22 | const GM: &str = r#" 23 | ___ 24 | .'/ \ 25 | __ __ ___ / / \ 26 | .--./) | |/ `.' `. | | | 27 | /.''\\ | .-. .-. '| | | 28 | | | | | | | | | | ||/`. .' 29 | \`-' / | | | | | | `.| | 30 | /("'` | | | | | | ||___| 31 | \ '---. | | | | | | |/___/ 32 | /'""'.\|__| |__| |__| .'.--. 33 | || || | | | 34 | \'. __// \_\ / 35 | `'---' `''--' 36 | "#; 37 | 38 | #[derive(Deserialize, Serialize)] 39 | struct Config { 40 | pub commands: Vec, 41 | } 42 | 43 | #[derive(Deserialize, Serialize)] 44 | struct Command { 45 | loading_text: String, 46 | command: String, 47 | args: Vec, 48 | } 49 | 50 | #[derive(Deserialize, Serialize)] 51 | struct QuoteApiResponse<'a> { 52 | pub author: &'a str, 53 | pub content: &'a str, 54 | } 55 | 56 | #[tokio::main] 57 | async fn main() -> Result<()> { 58 | // Load our config 59 | let config_content = 60 | fs::read_to_string(CONFIG_PATH.as_path()).expect("Missing config at \"~/.gm/config.json\""); 61 | let config: Config = serde_json::from_str(&config_content)?; 62 | 63 | // Get a quote to display 64 | let client = Client::new(); 65 | let res = client 66 | .get(Uri::from_static("http://api.quotable.io/random")) 67 | .await?; 68 | let res = hyper::body::to_bytes(res).await?; 69 | let quote: QuoteApiResponse<'_> = serde_json::from_str(str::from_utf8(&res)?)?; 70 | 71 | // Print GM Prompt 72 | println!("{}", Paint::green(GM)); 73 | // Print Quote 74 | println!( 75 | "\n 👉 \"{}\" - {}\n", 76 | quote.content, 77 | Paint::cyan(quote.author) 78 | ); 79 | 80 | // Run commands 81 | for command in config.commands { 82 | run_command(command.loading_text, command.command, command.args); 83 | } 84 | 85 | // Exit 86 | println!("\n{} Have a good day!", Paint::cyan("🎉 Done!")); 87 | Ok(()) 88 | } 89 | 90 | /// Run a command and display a spinner while it is running 91 | fn run_command(message: String, command: String, args: Vec) { 92 | let mut sp = Spinner::new(Spinners::Aesthetic, Paint::green(message)); 93 | sp.start(); 94 | if let Err(err) = process::Command::new(command).args(args).output() { 95 | print_error_message(err); 96 | process::exit(1); 97 | }; 98 | sp.stop(); 99 | } 100 | 101 | /// Print an error message 102 | fn print_error_message(err: T) { 103 | eprintln!("\n\n{}", Paint::red("Uh oh! An error occurred:")); 104 | eprintln!("{}", err); 105 | } 106 | -------------------------------------------------------------------------------- /confs/gm/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "commands": [ 3 | { 4 | "command": "huffup", 5 | "args": [], 6 | "loading_text": "Updating huff-rs..." 7 | }, 8 | { 9 | "command": "foundryup", 10 | "args": [], 11 | "loading_text": "Updating Foundry..." 12 | }, 13 | { 14 | "command": "rustup", 15 | "args": ["update", "nightly"], 16 | "loading_text": "Updating the Rust nightly toolchain..." 17 | }, 18 | { 19 | "command": "rustup", 20 | "args": ["update"], 21 | "loading_text": "Updating the Rust toolchain..." 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /confs/nvim/README.md: -------------------------------------------------------------------------------- 1 | # Modern Astronvim Configuration 2 | 3 | **Pre-requisites** 4 | 5 | Install `lua` and `luarocks`. On mac, you can run: 6 | ```bash 7 | brew upgrade 8 | brew install lua 9 | brew install luarocks 10 | ``` 11 | 12 | ### Quickstart 13 | 14 | // TODO: 15 | -------------------------------------------------------------------------------- /confs/nvim/config.ld: -------------------------------------------------------------------------------- 1 | project='AstroNvim' 2 | title='AstroNvim API' 3 | description='Documentation of AstroNvim\'s core API' 4 | format = 'markdown' 5 | file='lua' 6 | dir='docs' 7 | no_space_before_args=true 8 | -------------------------------------------------------------------------------- /confs/nvim/init.lua: -------------------------------------------------------------------------------- 1 | if vim.loader and vim.fn.has "nvim-0.9.1" == 1 then vim.loader.enable() end 2 | 3 | for _, source in ipairs { 4 | "astronvim.bootstrap", 5 | "astronvim.options", 6 | "astronvim.lazy", 7 | "astronvim.autocmds", 8 | "astronvim.mappings", 9 | } do 10 | local status_ok, fault = pcall(require, source) 11 | if not status_ok then vim.api.nvim_err_writeln("Failed to load " .. source .. "\n\n" .. fault) end 12 | end 13 | 14 | if astronvim.default_colorscheme then 15 | if not pcall(vim.cmd.colorscheme, astronvim.default_colorscheme) then 16 | require("astronvim.utils").notify( 17 | ("Error setting up colorscheme: `%s`"):format(astronvim.default_colorscheme), 18 | vim.log.levels.ERROR 19 | ) 20 | end 21 | end 22 | 23 | require("astronvim.utils").conditional_func(astronvim.user_opts("polish", nil, false), true) 24 | -------------------------------------------------------------------------------- /confs/nvim/lua/astronvim/health.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | -- TODO: remove deprecated method check after dropping support for neovim v0.9 4 | local health = { 5 | start = vim.health.start or vim.health.report_start, 6 | ok = vim.health.ok or vim.health.report_ok, 7 | warn = vim.health.warn or vim.health.report_warn, 8 | error = vim.health.error or vim.health.report_error, 9 | info = vim.health.info or vim.health.report_info, 10 | } 11 | 12 | function M.check() 13 | health.start "AstroNvim" 14 | 15 | health.info("AstroNvim Version: " .. require("astronvim.utils.updater").version(true)) 16 | health.info("Neovim Version: v" .. vim.fn.matchstr(vim.fn.execute "version", "NVIM v\\zs[^\n]*")) 17 | 18 | if vim.version().prerelease then 19 | health.warn "Neovim nightly is not officially supported and may have breaking changes" 20 | elseif vim.fn.has "nvim-0.8" == 1 then 21 | health.ok "Using stable Neovim >= 0.8.0" 22 | else 23 | health.error "Neovim >= 0.8.0 is required" 24 | end 25 | 26 | local programs = { 27 | { 28 | cmd = { "git" }, 29 | type = "error", 30 | msg = "Used for core functionality such as updater and plugin management", 31 | extra_check = function(program) 32 | local git_version = require("astronvim.utils.git").git_version() 33 | if git_version then 34 | if git_version.major < 2 or (git_version.major == 2 and git_version.min < 19) then 35 | program.msg = ("Git %s installed, >= 2.19.0 is required"):format(git_version.str) 36 | else 37 | return true 38 | end 39 | else 40 | program.msg = "Unable to validate git version" 41 | end 42 | end, 43 | }, 44 | { 45 | cmd = { "xdg-open", "open", "explorer" }, 46 | type = "warn", 47 | msg = "Used for `gx` mapping for opening files with system opener (Optional)", 48 | }, 49 | { cmd = { "lazygit" }, type = "warn", msg = "Used for mappings to pull up git TUI (Optional)" }, 50 | { cmd = { "node" }, type = "warn", msg = "Used for mappings to pull up node REPL (Optional)" }, 51 | { cmd = { "gdu" }, type = "warn", msg = "Used for mappings to pull up disk usage analyzer (Optional)" }, 52 | { cmd = { "btm" }, type = "warn", msg = "Used for mappings to pull up system monitor (Optional)" }, 53 | { cmd = { "python", "python3" }, type = "warn", msg = "Used for mappings to pull up python REPL (Optional)" }, 54 | } 55 | 56 | for _, program in ipairs(programs) do 57 | local name = table.concat(program.cmd, "/") 58 | local found = false 59 | for _, cmd in ipairs(program.cmd) do 60 | if vim.fn.executable(cmd) == 1 then 61 | name = cmd 62 | if not program.extra_check or program.extra_check(program) then found = true end 63 | break 64 | end 65 | end 66 | 67 | if found then 68 | health.ok(("`%s` is installed: %s"):format(name, program.msg)) 69 | else 70 | health[program.type](("`%s` is not installed: %s"):format(name, program.msg)) 71 | end 72 | end 73 | end 74 | 75 | return M 76 | -------------------------------------------------------------------------------- /confs/nvim/lua/astronvim/icons/nerd_font.lua: -------------------------------------------------------------------------------- 1 | return { 2 | ActiveLSP = "", 3 | ActiveTS = "", 4 | ArrowLeft = "", 5 | ArrowRight = "", 6 | Bookmarks = "", 7 | BufferClose = "󰅖", 8 | DapBreakpoint = "", 9 | DapBreakpointCondition = "", 10 | DapBreakpointRejected = "", 11 | DapLogPoint = ".>", 12 | DapStopped = "󰁕", 13 | Debugger = "", 14 | DefaultFile = "󰈙", 15 | Diagnostic = "󰒡", 16 | DiagnosticError = "", 17 | DiagnosticHint = "󰌵", 18 | DiagnosticInfo = "󰋼", 19 | DiagnosticWarn = "", 20 | Ellipsis = "…", 21 | FileNew = "", 22 | FileModified = "", 23 | FileReadOnly = "", 24 | FoldClosed = "", 25 | FoldOpened = "", 26 | FoldSeparator = " ", 27 | FolderClosed = "", 28 | FolderEmpty = "", 29 | FolderOpen = "", 30 | Git = "󰊢", 31 | GitAdd = "", 32 | GitBranch = "", 33 | GitChange = "", 34 | GitConflict = "", 35 | GitDelete = "", 36 | GitIgnored = "◌", 37 | GitRenamed = "➜", 38 | GitSign = "▎", 39 | GitStaged = "✓", 40 | GitUnstaged = "✗", 41 | GitUntracked = "★", 42 | LSPLoaded = "", -- TODO: Remove unused icon in AstroNvim v4 43 | LSPLoading1 = "", 44 | LSPLoading2 = "󰀚", 45 | LSPLoading3 = "", 46 | MacroRecording = "", 47 | Package = "󰏖", 48 | Paste = "󰅌", 49 | Refresh = "", 50 | Search = "", 51 | Selected = "❯", 52 | Session = "󱂬", 53 | Sort = "󰒺", 54 | Spellcheck = "󰓆", 55 | Tab = "󰓩", 56 | TabClose = "󰅙", 57 | Terminal = "", 58 | Window = "", 59 | WordFile = "󰈭", 60 | } 61 | -------------------------------------------------------------------------------- /confs/nvim/lua/astronvim/icons/text.lua: -------------------------------------------------------------------------------- 1 | return { 2 | ActiveLSP = "LSP:", 3 | ArrowLeft = "<", 4 | ArrowRight = ">", 5 | BufferClose = "x", 6 | DapBreakpoint = "B", 7 | DapBreakpointCondition = "C", 8 | DapBreakpointRejected = "R", 9 | DapLogPoint = "L", 10 | DapStopped = ">", 11 | DefaultFile = "[F]", 12 | DiagnosticError = "X", 13 | DiagnosticHint = "?", 14 | DiagnosticInfo = "i", 15 | DiagnosticWarn = "!", 16 | Ellipsis = "...", 17 | FileModified = "*", 18 | FileReadOnly = "[lock]", 19 | FoldClosed = "+", 20 | FoldOpened = "-", 21 | FoldSeparator = " ", 22 | FolderClosed = "[D]", 23 | FolderEmpty = "[E]", 24 | FolderOpen = "[O]", 25 | GitAdd = "[+]", 26 | GitChange = "[/]", 27 | GitConflict = "[!]", 28 | GitDelete = "[-]", 29 | GitIgnored = "[I]", 30 | GitRenamed = "[R]", 31 | GitSign = "|", 32 | GitStaged = "[S]", 33 | GitUnstaged = "[U]", 34 | GitUntracked = "[?]", 35 | MacroRecording = "Recording:", 36 | Paste = "[PASTE]", 37 | Search = "?", 38 | Selected = "*", 39 | Spellcheck = "[SPELL]", 40 | TabClose = "X", 41 | } 42 | -------------------------------------------------------------------------------- /confs/nvim/lua/astronvim/lazy.lua: -------------------------------------------------------------------------------- 1 | local git_version = vim.fn.system { "git", "--version" } 2 | if vim.api.nvim_get_vvar "shell_error" ~= 0 then 3 | vim.api.nvim_err_writeln("Git doesn't appear to be available...\n\n" .. git_version) 4 | end 5 | local major, min, _ = unpack(vim.tbl_map(tonumber, vim.split(git_version:match "%d+%.%d+%.%d", "%."))) 6 | local modern_git = major > 2 or (major == 2 and min >= 19) 7 | 8 | local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" 9 | if not (vim.uv or vim.loop).fs_stat(lazypath) then -- TODO: REMOVE vim.loop WHEN DROPPING SUPPORT FOR Neovim v0.9 10 | local clone = { "git", "clone", modern_git and "--filter=blob:none" or nil } 11 | local output = 12 | vim.fn.system(vim.list_extend(clone, { "--branch=stable", "https://github.com/folke/lazy.nvim.git", lazypath })) 13 | if vim.api.nvim_get_vvar "shell_error" ~= 0 then 14 | vim.api.nvim_err_writeln("Error cloning lazy.nvim repository...\n\n" .. output) 15 | end 16 | local oldcmdheight = vim.opt.cmdheight:get() 17 | vim.opt.cmdheight = 1 18 | vim.notify "Please wait while plugins are installed..." 19 | vim.api.nvim_create_autocmd("User", { 20 | desc = "Load Mason and Treesitter after Lazy installs plugins", 21 | once = true, 22 | pattern = "LazyInstall", 23 | callback = function() 24 | vim.cmd.bw() 25 | vim.opt.cmdheight = oldcmdheight 26 | vim.tbl_map(function(module) pcall(require, module) end, { "nvim-treesitter", "mason" }) 27 | require("astronvim.utils").notify "Mason is installing packages if configured, check status with `:Mason`" 28 | end, 29 | }) 30 | end 31 | vim.opt.rtp:prepend(lazypath) 32 | 33 | local user_plugins = astronvim.user_opts "plugins" 34 | for _, config_dir in ipairs(astronvim.supported_configs) do 35 | if vim.fn.isdirectory(config_dir .. "/lua/user/plugins") == 1 then user_plugins = { import = "user.plugins" } end 36 | end 37 | 38 | local spec = astronvim.updater.options.pin_plugins and { { import = astronvim.updater.snapshot.module } } or {} 39 | vim.list_extend(spec, { { import = "plugins" }, user_plugins }) 40 | 41 | local colorscheme = astronvim.default_colorscheme and { astronvim.default_colorscheme } or nil 42 | 43 | require("lazy").setup(astronvim.user_opts("lazy", { 44 | spec = spec, 45 | defaults = { lazy = true }, 46 | git = { filter = modern_git }, 47 | install = { colorscheme = colorscheme }, 48 | performance = { 49 | rtp = { 50 | paths = astronvim.supported_configs, 51 | disabled_plugins = { "tohtml", "gzip", "zipPlugin", "netrwPlugin", "tarPlugin" }, 52 | }, 53 | }, 54 | lockfile = vim.fn.stdpath "data" .. "/lazy-lock.json", 55 | })) 56 | -------------------------------------------------------------------------------- /confs/nvim/lua/astronvim/utils/ffi.lua: -------------------------------------------------------------------------------- 1 | -- ### AstroNvim C Extensions 2 | 3 | local ffi = require "ffi" 4 | 5 | -- Custom C extension to get direct fold information from Neovim 6 | ffi.cdef [[ 7 | typedef struct {} Error; 8 | typedef struct {} win_T; 9 | typedef struct { 10 | int start; // line number where deepest fold starts 11 | int level; // fold level, when zero other fields are N/A 12 | int llevel; // lowest level that starts in v:lnum 13 | int lines; // number of lines from v:lnum to end of closed fold 14 | } foldinfo_T; 15 | foldinfo_T fold_info(win_T* wp, int lnum); 16 | win_T *find_window_by_handle(int Window, Error *err); 17 | int compute_foldcolumn(win_T *wp, int col); 18 | ]] 19 | 20 | return ffi 21 | -------------------------------------------------------------------------------- /confs/nvim/lua/astronvim/utils/status.lua: -------------------------------------------------------------------------------- 1 | return { 2 | component = require "astronvim.utils.status.component", 3 | condition = require "astronvim.utils.status.condition", 4 | env = require "astronvim.utils.status.env", 5 | heirline = require "astronvim.utils.status.heirline", 6 | hl = require "astronvim.utils.status.hl", 7 | init = require "astronvim.utils.status.init", 8 | provider = require "astronvim.utils.status.provider", 9 | utils = require "astronvim.utils.status.utils", 10 | } 11 | -------------------------------------------------------------------------------- /confs/nvim/lua/dash/buttons.lua: -------------------------------------------------------------------------------- 1 | -- Section Buttons -- 2 | 3 | function btns() 4 | local keybind_opts = { silent = true, noremap = true } 5 | vim.api.nvim_create_autocmd({ "User" }, { 6 | pattern = { "AlphaReady" }, 7 | callback = function(_) 8 | -- Lazy 9 | vim.api.nvim_buf_set_keymap(0, "n", "z", ":Lazy", keybind_opts) 10 | 11 | -- Toggleterm / telescope 12 | vim.api.nvim_buf_set_keymap(0, "n", "g", ":lua require('astronvim.utils').toggle_term_cmd('lazygit')", keybind_opts) 13 | vim.api.nvim_buf_set_keymap(0, "n", "t", ":ToggleTerm", keybind_opts) 14 | vim.api.nvim_buf_set_keymap(0, "n", "s", ":Telescope live_grep", keybind_opts) 15 | vim.api.nvim_buf_set_keymap(0, "n", "f", ":Telescope find_files", keybind_opts) 16 | 17 | -- Neovim Sessions 18 | vim.api.nvim_buf_set_keymap(0, "n", "l", ":SessionManager! load_session", keybind_opts) 19 | vim.api.nvim_buf_set_keymap(0, "n", "c", ":SessionManager! load_current_dir_session", keybind_opts) 20 | 21 | -- Quit 22 | vim.api.nvim_buf_set_keymap(0, "n", "q", "q", keybind_opts) 23 | end, 24 | }) 25 | 26 | -- "Function" is light blue - replaced with white 27 | local button_hl = { 28 | { "Constant", 1, 4 }, 29 | { "white", 5, 18 }, 30 | { "String", 19, 25 }, 31 | { "Comment", 25, 32 }, 32 | { "Constant", 32, 38 }, 33 | { "white", 38, 50 }, 34 | { "String", 51, 55 }, 35 | } 36 | return { 37 | { 38 | type = "text", 39 | val = { 40 | " find file f │  terminal t", 41 | " lazygit g │  quit q", 42 | "鈴 lazy z │  search s", 43 | " load session l │  dir session c", 44 | }, 45 | opts = { 46 | shrink_margin = false, 47 | position = "center", 48 | hl = { 49 | button_hl, button_hl, button_hl, button_hl, 50 | } 51 | }, 52 | }, 53 | } 54 | end 55 | 56 | return { type = "group", val = btns }; 57 | -------------------------------------------------------------------------------- /confs/nvim/lua/dash/docker.lua: -------------------------------------------------------------------------------- 1 | -- Docker Section -- 2 | 3 | local DOCKER_CONTAINER_INIT = " Loading docker containers... " 4 | local docker_containers = DOCKER_CONTAINER_INIT 5 | 6 | function docker() 7 | function LoadDockerContainers() 8 | if docker_containers == DOCKER_CONTAINER_INIT then 9 | vim.fn.jobstart( 10 | "docker ps --format 'table {{.Image}}\t{{.ID}}\t{{.Status}}'", 11 | { on_stdout = ContainerCallback, stdout_buffered = true } 12 | ) 13 | end 14 | pcall(vim.cmd.AlphaRedraw) 15 | end 16 | 17 | vim.api.nvim_create_autocmd({ "User" }, { 18 | pattern = { "LazyVimStarted" }, 19 | callback = LoadDockerContainers, 20 | }) 21 | 22 | function ContainerCallback(job_id, data, event) 23 | if job_id > 0 then 24 | docker_containers = data 25 | pcall(vim.cmd.AlphaRedraw) 26 | end 27 | end 28 | 29 | return { 30 | { 31 | type = "text", 32 | val = docker_containers, 33 | opts = { 34 | shrink_margin = false, 35 | position = "center", 36 | hl = "SpecialComment", 37 | }, 38 | }, 39 | } 40 | end 41 | 42 | return { type = "group", val = docker }; 43 | -------------------------------------------------------------------------------- /confs/nvim/lua/dash/ghprs.lua: -------------------------------------------------------------------------------- 1 | -- Github PRs Section -- 2 | 3 | local GITHUB_PR_INIT = " Loading github pull requests... " 4 | local github_prs = GITHUB_PR_INIT 5 | 6 | local ghlist = "gh pr list -R ethereum-optimism/optimism -L 1000 -a '@me' " 7 | local ghjson = "--json number,headRefName,state,title " 8 | local ghtemplate = "--template '{{range .}}{{tablerow (printf \"#%v\" .number) .title}}{{tablerow (printf \"- %v\" .state) .headRefName}}{{end}}' " 9 | local ghgrep = "| grep '^'" 10 | 11 | function github() 12 | function LoadGithubPrs() 13 | if github_prs == GITHUB_PR_INIT then 14 | vim.fn.jobstart( 15 | ghlist .. ghjson .. ghtemplate .. ghgrep, 16 | { on_stdout = GithubPrCallback, stdout_buffered = true } 17 | ) 18 | end 19 | pcall(vim.cmd.AlphaRedraw) 20 | end 21 | 22 | vim.api.nvim_create_autocmd({ "User" }, { 23 | pattern = { "LazyVimStarted" }, 24 | callback = LoadGithubPrs, 25 | }) 26 | 27 | function GithubPrCallback(job_id, data, event) 28 | if job_id > 0 then 29 | github_prs = data 30 | pcall(vim.cmd.AlphaRedraw) 31 | end 32 | end 33 | 34 | return { 35 | { 36 | type = "text", 37 | val = github_prs, 38 | opts = { 39 | align_shortcut = "left", 40 | shrink_margin = false, 41 | position = "center", 42 | hl = "Question", 43 | }, 44 | }, 45 | } 46 | end 47 | 48 | return { type = "group", val = github }; 49 | -------------------------------------------------------------------------------- /confs/nvim/lua/dash/header.lua: -------------------------------------------------------------------------------- 1 | -- Section Header -- 2 | 3 | local headers = { 4 | { 5 | " ** ", 6 | " * ", 7 | " *** ", 8 | " * * ", 9 | " *************************** ", 10 | " * * ", 11 | " ** ** ", 12 | " * * ", 13 | " ** ", 14 | " * ", 15 | " ** ", 16 | }, 17 | }; 18 | 19 | math.randomseed(os.time()) 20 | 21 | return { 22 | type = "text", 23 | val = headers[1], 24 | opts = { 25 | position = "center", 26 | shrink_margin = false, 27 | hl = "WarningMsg", 28 | }, 29 | }; 30 | -------------------------------------------------------------------------------- /confs/nvim/lua/dash/info.lua: -------------------------------------------------------------------------------- 1 | -- Info Section -- 2 | 3 | local docker = { 4 | default = " Loading docker version... ", 5 | version = " Loading docker version... ", 6 | } 7 | 8 | local golang = { 9 | default = " Loading cargo version... ", 10 | version = " Loading cargo version... ", 11 | } 12 | 13 | local cargo = { 14 | default = " Loading cargo version... ", 15 | version = " Loading cargo version... ", 16 | } 17 | 18 | function infos() 19 | local datetime = os.date(" %A %m-%d-%Y") 20 | local lazy_stats = require("lazy").stats() 21 | local ms = (math.floor(lazy_stats.startuptime * 100 + 0.5) / 100) 22 | local version = vim.version() 23 | 24 | require("utils.docker")(docker) 25 | require("utils.cargo")(cargo) 26 | require("utils.golang")(golang) 27 | 28 | -- "Substitute" is light pink - replaced with white 29 | local datetime_hl = { 30 | { "white", 1, 4 }, 31 | { "white", 5, 18 }, 32 | { "WarningMsg", 28, 30 }, 33 | { "white", 40, 60 }, 34 | } 35 | 36 | local green_hl = { { "String", 0, 3 } } 37 | local blue_hl = { { "Function", 0, 3 } } 38 | local red_hl = { { "CursorLineNr", 0, 3 } } 39 | 40 | local stats = " " .. lazy_stats.loaded .. "/" .. lazy_stats.count .. " in " .. ms .. " ms" 41 | local version = " v" .. version.major .. "." .. version.minor .. "." .. version.patch 42 | 43 | return { 44 | { 45 | type = "text", 46 | val = { 47 | version, 48 | docker.version, 49 | golang.version, 50 | cargo.version, 51 | datetime .. " " .. stats .. " ", 52 | }, 53 | opts = { 54 | shrink_margin = false, 55 | position = "center", 56 | hl = { 57 | green_hl, 58 | blue_hl, 59 | blue_hl, 60 | red_hl, 61 | datetime_hl, 62 | }, 63 | }, 64 | }, 65 | } 66 | end 67 | 68 | return { type = "group", val = infos }; 69 | -------------------------------------------------------------------------------- /confs/nvim/lua/dash/init.lua: -------------------------------------------------------------------------------- 1 | -- Dashboard Config -- 2 | 3 | vim.b.miniindentscope_disable = true 4 | 5 | -- Automatically open neotree on startup -- 6 | local function open_tree() 7 | vim.cmd "Neotree" 8 | vim.cmd.wincmd "p" 9 | end 10 | vim.api.nvim_create_autocmd({ "User" }, { pattern = { "AlphaReady" }, callback = open_tree }) 11 | 12 | -- Builtin Neovim Highlight Groups -- 13 | -- https://neovim.io/doc/user/syntax.html#highlight-groups -- 14 | 15 | local dashconf = { 16 | layout = { 17 | { type = "padding", val = vim.fn.max { 2, vim.fn.floor(vim.fn.winheight(0) * 0.25) } }, 18 | require("dash.header"), 19 | { type = "padding", val = 1 }, 20 | { type = "padding", val = 1 }, 21 | require("dash.info"), 22 | { type = "padding", val = 1 }, 23 | require("dash.buttons"), 24 | { type = "padding", val = 1 }, 25 | require("dash.docker"), 26 | { type = "padding", val = 1 }, 27 | { 28 | type = "text", 29 | val = "󰓂 My Github PRs ", 30 | opts = { 31 | position = "center", 32 | hl = "ModeMsg", 33 | }, 34 | }, 35 | require("dash.ghprs"), 36 | } 37 | } 38 | 39 | return { 40 | "goolord/alpha-nvim", 41 | config = function() 42 | require("alpha").setup(dashconf) 43 | end 44 | }; 45 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/alpha.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "goolord/alpha-nvim", 3 | cmd = "Alpha", 4 | opts = function() 5 | local dashboard = require "alpha.themes.dashboard" 6 | dashboard.section.header.val = { 7 | " █████ ███████ ████████ ██████ ██████", 8 | "██ ██ ██ ██ ██ ██ ██ ██", 9 | "███████ ███████ ██ ██████ ██ ██", 10 | "██ ██ ██ ██ ██ ██ ██ ██", 11 | "██ ██ ███████ ██ ██ ██ ██████", 12 | " ", 13 | " ███ ██ ██ ██ ██ ███ ███", 14 | " ████ ██ ██ ██ ██ ████ ████", 15 | " ██ ██ ██ ██ ██ ██ ██ ████ ██", 16 | " ██ ██ ██ ██ ██ ██ ██ ██ ██", 17 | " ██ ████ ████ ██ ██ ██", 18 | } 19 | dashboard.section.header.opts.hl = "DashboardHeader" 20 | dashboard.section.footer.opts.hl = "DashboardFooter" 21 | 22 | local button, get_icon = require("astronvim.utils").alpha_button, require("astronvim.utils").get_icon 23 | dashboard.section.buttons.val = { 24 | button("LDR n ", get_icon("FileNew", 2, true) .. "New File "), 25 | button("LDR f f", get_icon("Search", 2, true) .. "Find File "), 26 | button("LDR f o", get_icon("DefaultFile", 2, true) .. "Recents "), 27 | button("LDR f w", get_icon("WordFile", 2, true) .. "Find Word "), 28 | button("LDR f '", get_icon("Bookmarks", 2, true) .. "Bookmarks "), 29 | button("LDR S l", get_icon("Refresh", 2, true) .. "Last Session "), 30 | } 31 | 32 | dashboard.config.layout = { 33 | { type = "padding", val = vim.fn.max { 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) } }, 34 | dashboard.section.header, 35 | { type = "padding", val = 5 }, 36 | dashboard.section.buttons, 37 | { type = "padding", val = 3 }, 38 | dashboard.section.footer, 39 | } 40 | dashboard.config.opts.noautocmd = true 41 | return dashboard 42 | end, 43 | config = require "plugins.configs.alpha", 44 | } 45 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/alpha.lua: -------------------------------------------------------------------------------- 1 | return function(_, opts) 2 | require("alpha").setup(opts.config) 3 | 4 | vim.api.nvim_create_autocmd("User", { 5 | pattern = "LazyVimStarted", 6 | desc = "Add Alpha dashboard footer", 7 | once = true, 8 | callback = function() 9 | local stats = require("lazy").stats() 10 | local ms = math.floor(stats.startuptime * 100 + 0.5) / 100 11 | opts.section.footer.val = { "AstroNvim loaded " .. stats.count .. " plugins  in " .. ms .. "ms" } 12 | pcall(vim.cmd.AlphaRedraw) 13 | end, 14 | }) 15 | end 16 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/cmp-dap.lua: -------------------------------------------------------------------------------- 1 | return function() 2 | require("cmp").setup.filetype({ "dap-repl", "dapui_watches", "dapui_hover" }, { 3 | sources = { 4 | { name = "dap" }, 5 | }, 6 | }) 7 | end 8 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/guess-indent.lua: -------------------------------------------------------------------------------- 1 | return function(_, opts) 2 | require("guess-indent").setup(opts) 3 | vim.cmd.lua { args = { "require('guess-indent').set_from_buffer('auto_cmd')" }, mods = { silent = true } } 4 | end 5 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/lspconfig.lua: -------------------------------------------------------------------------------- 1 | return function(_, _) 2 | local lsp = require "astronvim.utils.lsp" 3 | local utils = require "astronvim.utils" 4 | local get_icon = utils.get_icon 5 | local signs = { 6 | { name = "DiagnosticSignError", text = get_icon "DiagnosticError", texthl = "DiagnosticSignError" }, 7 | { name = "DiagnosticSignWarn", text = get_icon "DiagnosticWarn", texthl = "DiagnosticSignWarn" }, 8 | { name = "DiagnosticSignHint", text = get_icon "DiagnosticHint", texthl = "DiagnosticSignHint" }, 9 | { name = "DiagnosticSignInfo", text = get_icon "DiagnosticInfo", texthl = "DiagnosticSignInfo" }, 10 | { name = "DapStopped", text = get_icon "DapStopped", texthl = "DiagnosticWarn" }, 11 | { name = "DapBreakpoint", text = get_icon "DapBreakpoint", texthl = "DiagnosticInfo" }, 12 | { name = "DapBreakpointRejected", text = get_icon "DapBreakpointRejected", texthl = "DiagnosticError" }, 13 | { name = "DapBreakpointCondition", text = get_icon "DapBreakpointCondition", texthl = "DiagnosticInfo" }, 14 | { name = "DapLogPoint", text = get_icon "DapLogPoint", texthl = "DiagnosticInfo" }, 15 | } 16 | 17 | for _, sign in ipairs(signs) do 18 | vim.fn.sign_define(sign.name, sign) 19 | end 20 | lsp.setup_diagnostics(signs) 21 | 22 | local orig_handler = vim.lsp.handlers["$/progress"] 23 | vim.lsp.handlers["$/progress"] = function(_, msg, info) 24 | local progress, id = astronvim.lsp.progress, ("%s.%s"):format(info.client_id, msg.token) 25 | progress[id] = progress[id] and utils.extend_tbl(progress[id], msg.value) or msg.value 26 | if progress[id].kind == "end" then 27 | vim.defer_fn(function() 28 | progress[id] = nil 29 | utils.event "LspProgress" 30 | end, 100) 31 | end 32 | utils.event "LspProgress" 33 | orig_handler(_, msg, info) 34 | end 35 | 36 | if vim.g.lsp_handlers_enabled then 37 | vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded", silent = true }) 38 | vim.lsp.handlers["textDocument/signatureHelp"] = 39 | vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded", silent = true }) 40 | end 41 | local setup_servers = function() 42 | vim.tbl_map(require("astronvim.utils.lsp").setup, astronvim.user_opts "lsp.servers") 43 | vim.api.nvim_exec_autocmds("FileType", {}) 44 | require("astronvim.utils").event "LspSetup" 45 | end 46 | if require("astronvim.utils").is_available "mason-lspconfig.nvim" then 47 | vim.api.nvim_create_autocmd("User", { 48 | desc = "set up LSP servers after mason-lspconfig", 49 | pattern = "AstroMasonLspSetup", 50 | once = true, 51 | callback = setup_servers, 52 | }) 53 | else 54 | setup_servers() 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/lspkind.lua: -------------------------------------------------------------------------------- 1 | return function(_, opts) require("lspkind").init(opts) end 2 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/luasnip.lua: -------------------------------------------------------------------------------- 1 | return function(_, opts) 2 | if opts then require("luasnip").config.setup(opts) end 3 | vim.tbl_map(function(type) require("luasnip.loaders.from_" .. type).lazy_load() end, { "vscode", "snipmate", "lua" }) 4 | end 5 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/mason-lspconfig.lua: -------------------------------------------------------------------------------- 1 | return function(_, opts) 2 | require("mason-lspconfig").setup(opts) 3 | require("astronvim.utils").event "MasonLspSetup" 4 | end 5 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/mason-null-ls.lua: -------------------------------------------------------------------------------- 1 | -- TODO: REMOVE THIS UNNECESSARY FILE 2 | return function(_, opts) 3 | local mason_null_ls = require "mason-null-ls" 4 | mason_null_ls.setup(opts) 5 | end 6 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/mason-nvim-dap.lua: -------------------------------------------------------------------------------- 1 | -- TODO: remove unnecessary file in AstroNvim v4 2 | return function(_, opts) 3 | local mason_nvim_dap = require "mason-nvim-dap" 4 | mason_nvim_dap.setup(opts) 5 | end 6 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/mason.lua: -------------------------------------------------------------------------------- 1 | return function(_, opts) 2 | require("mason").setup(opts) 3 | 4 | -- TODO: AstroNvim v4: change these auto command names to not conflict with core Mason commands 5 | local cmd = vim.api.nvim_create_user_command 6 | cmd("MasonUpdate", function(options) require("astronvim.utils.mason").update(options.fargs) end, { 7 | nargs = "*", 8 | desc = "Update Mason Package", 9 | complete = function(arg_lead) 10 | local _ = require "mason-core.functional" 11 | return _.sort_by( 12 | _.identity, 13 | _.filter(_.starts_with(arg_lead), require("mason-registry").get_installed_package_names()) 14 | ) 15 | end, 16 | }) 17 | cmd( 18 | "MasonUpdateAll", 19 | function() require("astronvim.utils.mason").update_all() end, 20 | { desc = "Update Mason Packages" } 21 | ) 22 | 23 | for _, plugin in ipairs { "mason-lspconfig", "mason-null-ls", "mason-nvim-dap" } do 24 | pcall(require, plugin) 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/notify.lua: -------------------------------------------------------------------------------- 1 | return function(_, opts) 2 | local notify = require "notify" 3 | notify.setup(opts) 4 | vim.notify = notify 5 | end 6 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/nvim-autopairs.lua: -------------------------------------------------------------------------------- 1 | return function(_, opts) 2 | local npairs = require "nvim-autopairs" 3 | npairs.setup(opts) 4 | 5 | if not vim.g.autopairs_enabled then npairs.disable() end 6 | local cmp_status_ok, cmp = pcall(require, "cmp") 7 | if cmp_status_ok then 8 | cmp.event:on("confirm_done", require("nvim-autopairs.completion.cmp").on_confirm_done { tex = false }) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/nvim-dap-ui.lua: -------------------------------------------------------------------------------- 1 | return function(_, opts) 2 | local dap, dapui = require "dap", require "dapui" 3 | dap.listeners.after.event_initialized["dapui_config"] = function() dapui.open() end 4 | dap.listeners.before.event_terminated["dapui_config"] = function() dapui.close() end 5 | dap.listeners.before.event_exited["dapui_config"] = function() dapui.close() end 6 | dapui.setup(opts) 7 | end 8 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/nvim-treesitter.lua: -------------------------------------------------------------------------------- 1 | return function(_, opts) require("nvim-treesitter.configs").setup(opts) end 2 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/nvim-web-devicons.lua: -------------------------------------------------------------------------------- 1 | -- TODO: remove unnecessary file in AstroNvim v4 2 | return function(_, opts) 3 | require("nvim-web-devicons").set_default_icon(require("astronvim.utils").get_icon "DefaultFile", "#6d8086", "66") 4 | require("nvim-web-devicons").set_icon(opts) 5 | end 6 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/telescope.lua: -------------------------------------------------------------------------------- 1 | return function(_, opts) 2 | local telescope = require "telescope" 3 | telescope.setup(opts) 4 | local utils = require "astronvim.utils" 5 | local conditional_func = utils.conditional_func 6 | conditional_func(telescope.load_extension, pcall(require, "notify"), "notify") 7 | conditional_func(telescope.load_extension, pcall(require, "aerial"), "aerial") 8 | conditional_func(telescope.load_extension, utils.is_available "telescope-fzf-native.nvim", "fzf") 9 | end 10 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/configs/which-key.lua: -------------------------------------------------------------------------------- 1 | return function(_, opts) 2 | require("which-key").setup(opts) 3 | require("astronvim.utils").which_key_register() 4 | end 5 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/dap.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "mfussenegger/nvim-dap", 3 | enabled = vim.fn.has "win32" == 0, 4 | dependencies = { 5 | { 6 | "jay-babu/mason-nvim-dap.nvim", 7 | dependencies = { "nvim-dap" }, 8 | cmd = { "DapInstall", "DapUninstall" }, 9 | opts = { handlers = {} }, 10 | }, 11 | { 12 | "rcarriga/nvim-dap-ui", 13 | opts = { floating = { border = "rounded" } }, 14 | config = require "plugins.configs.nvim-dap-ui", 15 | }, 16 | { 17 | "rcarriga/cmp-dap", 18 | dependencies = { "nvim-cmp" }, 19 | config = require "plugins.configs.cmp-dap", 20 | }, 21 | }, 22 | event = "User AstroFile", 23 | } 24 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/git.lua: -------------------------------------------------------------------------------- 1 | local get_icon = require("astronvim.utils").get_icon 2 | return { 3 | "lewis6991/gitsigns.nvim", 4 | enabled = vim.fn.executable "git" == 1, 5 | event = "User AstroGitFile", 6 | opts = { 7 | signs = { 8 | add = { text = get_icon "GitSign" }, 9 | change = { text = get_icon "GitSign" }, 10 | delete = { text = get_icon "GitSign" }, 11 | topdelete = { text = get_icon "GitSign" }, 12 | changedelete = { text = get_icon "GitSign" }, 13 | untracked = { text = get_icon "GitSign" }, 14 | }, 15 | worktrees = vim.g.git_worktrees, 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/lsp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "b0o/SchemaStore.nvim", 3 | { 4 | "folke/neodev.nvim", 5 | opts = { 6 | override = function(root_dir, library) 7 | for _, astronvim_config in ipairs(astronvim.supported_configs) do 8 | if root_dir:match(astronvim_config) then 9 | library.plugins = true 10 | break 11 | end 12 | end 13 | vim.b.neodev_enabled = library.enabled 14 | end, 15 | }, 16 | }, 17 | { 18 | "neovim/nvim-lspconfig", 19 | dependencies = { 20 | { 21 | "folke/neoconf.nvim", 22 | opts = function() 23 | local global_settings, file_found 24 | local _, depth = vim.fn.stdpath("config"):gsub("/", "") 25 | for _, dir in ipairs(astronvim.supported_configs) do 26 | dir = dir .. "/lua/user" 27 | if vim.fn.isdirectory(dir) == 1 then 28 | local path = dir .. "/neoconf.json" 29 | if vim.fn.filereadable(path) == 1 then 30 | file_found = true 31 | global_settings = path 32 | elseif not file_found then 33 | global_settings = path 34 | end 35 | end 36 | end 37 | return { global_settings = global_settings and string.rep("../", depth):sub(1, -2) .. global_settings } 38 | end, 39 | }, 40 | { 41 | "williamboman/mason-lspconfig.nvim", 42 | cmd = { "LspInstall", "LspUninstall" }, 43 | opts = function(_, opts) 44 | if not opts.handlers then opts.handlers = {} end 45 | opts.handlers[1] = function(server) require("astronvim.utils.lsp").setup(server) end 46 | end, 47 | config = require "plugins.configs.mason-lspconfig", 48 | }, 49 | }, 50 | cmd = function(_, cmds) -- HACK: lazy load lspconfig on `:Neoconf` if neoconf is available 51 | if require("astronvim.utils").is_available "neoconf.nvim" then table.insert(cmds, "Neoconf") end 52 | end, 53 | event = "User AstroFile", 54 | config = require "plugins.configs.lspconfig", 55 | }, 56 | { 57 | "jose-elias-alvarez/null-ls.nvim", 58 | dependencies = { 59 | { 60 | "jay-babu/mason-null-ls.nvim", 61 | cmd = { "NullLsInstall", "NullLsUninstall" }, 62 | opts = { handlers = {} }, 63 | }, 64 | }, 65 | event = "User AstroFile", 66 | opts = function() return { on_attach = require("astronvim.utils.lsp").on_attach } end, 67 | }, 68 | { 69 | "stevearc/aerial.nvim", 70 | event = "User AstroFile", 71 | opts = { 72 | attach_mode = "global", 73 | backends = { "lsp", "treesitter", "markdown", "man" }, 74 | disable_max_lines = vim.g.max_file.lines, 75 | disable_max_size = vim.g.max_file.size, 76 | layout = { min_width = 28 }, 77 | show_guides = true, 78 | filter_kind = false, 79 | guides = { 80 | mid_item = "├ ", 81 | last_item = "└ ", 82 | nested_top = "│ ", 83 | whitespace = " ", 84 | }, 85 | keymaps = { 86 | ["[y"] = "actions.prev", 87 | ["]y"] = "actions.next", 88 | ["[Y"] = "actions.prev_up", 89 | ["]Y"] = "actions.next_up", 90 | ["{"] = false, 91 | ["}"] = false, 92 | ["[["] = false, 93 | ["]]"] = false, 94 | }, 95 | }, 96 | }, 97 | } 98 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/mason.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "williamboman/mason.nvim", 4 | cmd = { 5 | "Mason", 6 | "MasonInstall", 7 | "MasonUninstall", 8 | "MasonUninstallAll", 9 | "MasonLog", 10 | "MasonUpdate", -- AstroNvim extension here as well 11 | "MasonUpdateAll", -- AstroNvim specific 12 | }, 13 | opts = { 14 | ui = { 15 | icons = { 16 | package_installed = "✓", 17 | package_uninstalled = "✗", 18 | package_pending = "⟳", 19 | }, 20 | }, 21 | }, 22 | build = ":MasonUpdate", 23 | config = require "plugins.configs.mason", 24 | }, 25 | } 26 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-telescope/telescope.nvim", 3 | dependencies = { 4 | { "nvim-telescope/telescope-fzf-native.nvim", enabled = vim.fn.executable "make" == 1, build = "make" }, 5 | }, 6 | cmd = "Telescope", 7 | opts = function() 8 | local actions = require "telescope.actions" 9 | local get_icon = require("astronvim.utils").get_icon 10 | return { 11 | defaults = { 12 | git_worktrees = vim.g.git_worktrees, 13 | prompt_prefix = get_icon("Selected", 1), 14 | selection_caret = get_icon("Selected", 1), 15 | path_display = { "truncate" }, 16 | sorting_strategy = "ascending", 17 | layout_config = { 18 | horizontal = { prompt_position = "top", preview_width = 0.55 }, 19 | vertical = { mirror = false }, 20 | width = 0.87, 21 | height = 0.80, 22 | preview_cutoff = 120, 23 | }, 24 | mappings = { 25 | i = { 26 | [""] = actions.cycle_history_next, 27 | [""] = actions.cycle_history_prev, 28 | [""] = actions.move_selection_next, 29 | [""] = actions.move_selection_previous, 30 | }, 31 | n = { q = actions.close }, 32 | }, 33 | }, 34 | } 35 | end, 36 | config = require "plugins.configs.telescope", 37 | } 38 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/cheatsheet.lua: -------------------------------------------------------------------------------- 1 | -- Cheatsheet for plugins -- 2 | return { 3 | 'sudormrfbin/cheatsheet.nvim', 4 | requires = { 5 | {'nvim-telescope/telescope.nvim'}, 6 | {'nvim-lua/popup.nvim'}, 7 | {'nvim-lua/plenary.nvim'}, 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/cmp.lua: -------------------------------------------------------------------------------- 1 | -- Add crates to cmp sources 2 | return { 3 | "hrsh7th/nvim-cmp", 4 | opts = function(_, opts) 5 | opts.sources[#opts.sources + 1] = { name = "crates" } 6 | end, 7 | }; 8 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/copilot.lua: -------------------------------------------------------------------------------- 1 | -- Lua Copilot -- 2 | return { 3 | "zbirenbaum/copilot.lua", 4 | lazy = false, 5 | event = "VimEnter", 6 | config = function() 7 | vim.defer_fn(function() 8 | require("copilot").setup { 9 | panel = { 10 | enabled = true, 11 | auto_refresh = true, 12 | ---@type table<'accept'|'next'|'prev'|'dismiss', false|string> 13 | keymap = { 14 | jump_prev = "[[", 15 | jump_next = "]]", 16 | accept = "", 17 | refresh = "gr", 18 | open = "", 19 | }, 20 | }, 21 | suggestion = { 22 | enabled = true, 23 | auto_trigger = true, 24 | debounce = 50, 25 | keymap = { 26 | accept = "", 27 | next = "", 28 | prev = "", 29 | dismiss = "", 30 | }, 31 | }, 32 | } 33 | end, 100) 34 | end, 35 | }; 36 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/crates.lua: -------------------------------------------------------------------------------- 1 | -- Crates (Rust) 2 | return { 3 | "saecki/crates.nvim", 4 | tag = "v0.3.0", 5 | requires = { "nvim-lua/plenary.nvim" }, 6 | config = function() 7 | require("crates").setup() 8 | end, 9 | event = { "BufEnter Cargo.toml" }, 10 | }; 11 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/crates_plug.lua: -------------------------------------------------------------------------------- 1 | -- Crates (Rust) 2 | return { 3 | "saecki/crates.nvim", 4 | tag = "v0.3.0", 5 | requires = { "nvim-lua/plenary.nvim" }, 6 | config = function() 7 | require("crates").setup() 8 | end, 9 | event = { "BufEnter Cargo.toml" }, 10 | }; 11 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/heirline.lua: -------------------------------------------------------------------------------- 1 | -- Heirline Statusline Configs -- 2 | local statusline_config = function(_, opts) 3 | local status = require "astronvim.utils.status" 4 | local mocha = require("catppuccin.palettes").get_palette("mocha") 5 | opts.statusline = { 6 | hl = { fg = "fg", bg = "bg" }, 7 | status.component.mode { 8 | hl = { fg = "#000000" }, 9 | mode_text = { icon = { kind = "VimIcon", padding = { right = 1, left = 1 } } }, 10 | surround = { 11 | separator = "left", 12 | color = function() 13 | return { 14 | main = status.hl.mode_bg(), 15 | } 16 | end, 17 | }, 18 | padding = { right = 1 }, 19 | update = "ModeChanged", 20 | }, 21 | status.component.git_branch { 22 | surround = { 23 | separator = "left", 24 | color = { 25 | main = mocha.surface0, 26 | right = mocha.green, 27 | }, 28 | condition = status.condition.is_git_repo, 29 | padding = { left = 1 }, 30 | }, 31 | hl = { fg = mocha.green }, 32 | padding = { right = 1 }, 33 | }, 34 | status.component.file_info { 35 | file_icon = { highlight = true, padding = { left = 0 } }, 36 | filetype = {}, 37 | filename = false, 38 | file_modified = false, 39 | surround = { separator = "left" }, 40 | padding = { right = 1 }, 41 | }, 42 | status.component.git_diff { 43 | surround = { separator = "none" }, 44 | }, 45 | status.component.diagnostics { 46 | padding = { left = 1 }, 47 | surround = { separator = "none" }, 48 | }, 49 | status.component.fill(), 50 | status.component.builder { 51 | { provider = "🧙" }, 52 | surround = { separator = "none", color = { main = "bg" } }, 53 | hl = { 54 | fg = mocha.overlay2, 55 | }, 56 | }, 57 | status.component.treesitter { 58 | str = { str = "🌲🪑", icon = { kind = "ActiveTS" }, padding = { left = 1 } }, 59 | surround = { 60 | separator = "right", 61 | color = { 62 | main = mocha.lavender, 63 | }, 64 | padding = { right = 1 }, 65 | }, 66 | }, 67 | status.component.nav { 68 | surround = { 69 | separator = "right", 70 | padding = { left = 1 }, 71 | }, 72 | ruler = { padding = { left = 1 } }, 73 | }, 74 | status.component.mode { 75 | surround = { 76 | separator = "right", 77 | color = function() 78 | return { 79 | main = status.hl.mode_bg(), 80 | } 81 | end, 82 | }, 83 | update = "ModeChanged", 84 | }, 85 | } 86 | return opts 87 | end 88 | 89 | return { "rebelot/heirline.nvim", opts = statusline_config }; 90 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/hop.lua: -------------------------------------------------------------------------------- 1 | -- Leap -- 2 | return { 3 | 'phaazon/hop.nvim', 4 | branch = 'v2', 5 | config = function() 6 | -- you can configure Hop the way you like here; see :h hop-config 7 | require("hop").setup({ keys = "etovxqpdygfblzhckisuran" }) 8 | end 9 | }; 10 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/hop_plug.lua: -------------------------------------------------------------------------------- 1 | -- Leap -- 2 | return { 3 | 'phaazon/hop.nvim', 4 | branch = 'v2', 5 | config = function() 6 | -- you can configure Hop the way you like here; see :h hop-config 7 | require("hop").setup({ keys = "etovxqpdygfblzhckisuran" }) 8 | end 9 | }; 10 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/illuminate.lua: -------------------------------------------------------------------------------- 1 | -- Highlight words under the cursor that match the provider regex 2 | return { 3 | "rrethy/vim-illuminate", 4 | config = { 5 | under_cursor = true, 6 | providers = { 7 | 'lsp', 8 | 'treesitter', 9 | 'regex', 10 | }, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- Rust Tools -- 3 | { "simrat39/rust-tools.nvim", lazy = false }, 4 | 5 | -- Huff Syntax Highlighting -- 6 | { "wuwe1/vim-huff", lazy = false }, 7 | 8 | -- Rainbow Brackets -- 9 | { "p00f/nvim-ts-rainbow", lazy = false }, 10 | 11 | -- Wakatime 12 | { "wakatime/vim-wakatime" }, 13 | 14 | -- Docker Tools -- 15 | { "kkvh/vim-docker-tools", lazy = false }, 16 | 17 | -- Disable nvim-dap 18 | { "mfussenegger/nvim-dap", enabled = false }, 19 | { "jay-babu/mason-nvim-dap.nvim", enabled = false }, 20 | { "rcarriga/nvim-dap-ui", enabled = false }, 21 | 22 | require("dash"), 23 | 24 | require("plugs.markdown"), 25 | require("plugs.hop_plug"), 26 | require("plugs.heirline"), 27 | require("plugs.which"), 28 | require("plugs.theme"), 29 | require("plugs.overseer"), 30 | require("plugs.cmp"), 31 | require("plugs.illuminate"), 32 | require("plugs.cheatsheet"), 33 | require("plugs.trouble"), 34 | require("plugs.tabline"), 35 | require("plugs.syntax"), 36 | require("plugs.noice"), 37 | require("plugs.copilot"), 38 | require("plugs.lsplines"), 39 | require("plugs.neotree"), 40 | require("plugs.terminal"), 41 | require("plugs.crates_plug"), 42 | }; 43 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/lsplines.lua: -------------------------------------------------------------------------------- 1 | -- LSP Lines Prettified Diagnostics -- 2 | return { 3 | "https://git.sr.ht/~whynothugo/lsp_lines.nvim", 4 | lazy = false, 5 | after = "mason-lspconfig.nvim", 6 | module = "lsp_lines", 7 | config = function() require("lsp_lines").setup() end, 8 | }; 9 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/markdown.lua: -------------------------------------------------------------------------------- 1 | -- Markdown Preview -- 2 | -- This requires installing glow -- 3 | -- https://github.com/charmbracelet/glow?tab=readme-ov-file#installation 4 | return { 5 | "ellisonleao/glow.nvim", 6 | config = function() 7 | local float_width = math.floor(math.abs(vim.api.nvim_win_get_width(0) * 0.7)) 8 | local float_height = math.floor(math.abs(vim.api.nvim_win_get_height(0) * 0.7)) 9 | if float_width == 0 then 10 | float_width = 100 11 | end 12 | if float_height == 0 then 13 | float_height = 100 14 | end 15 | 16 | require("glow").setup({ 17 | -- glow_path = "", -- will be filled automatically with your glow bin in $PATH, if any 18 | install_path = "~/.local/bin", -- default path for installing glow binary 19 | border = {'╭', '─', '╮', '│', '╯', '─', '╰', '│'}, 20 | width = float_width, 21 | height = float_height, 22 | }) 23 | end, 24 | cmd = "Glow", 25 | }; 26 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/neotree.lua: -------------------------------------------------------------------------------- 1 | -- Override NeoTree Position Config -- 2 | return { 3 | "nvim-neo-tree/neo-tree.nvim", 4 | keys = { { "E", "fE", desc = "Explorer NeoTree (cwd)", remap = true } }, 5 | opts = { 6 | filesystem = { 7 | bind_to_cwd = false, 8 | follow_current_file = true, 9 | filtered_items = { 10 | visible = true, 11 | hide_dotfiles = false, 12 | hide_gitignored = false, 13 | hide_hidden = false, 14 | }, 15 | }, 16 | window = { position = "right" }, 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/noice.lua: -------------------------------------------------------------------------------- 1 | -- Noice (cmdline, messages, popupmenu) -- 2 | -- https://github.com/folke/noice.nvim -- 3 | return { 4 | "folke/noice.nvim", 5 | after = "nui.nvim", 6 | -- dependencies = { 7 | -- -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries 8 | -- "MunifTanjim/nui.nvim", 9 | -- -- OPTIONAL: 10 | -- -- `nvim-notify` is only needed, if you want to use the notification view. 11 | -- -- If not available, we use `mini` as the fallback 12 | -- "rcarriga/nvim-notify", 13 | -- }, 14 | event = "VimEnter", 15 | config = function() 16 | require("noice").setup { 17 | presets = { 18 | command_palette = true, -- position the cmdline and popupmenu together 19 | lsp_doc_border = false, -- add a border to hover docs and signature help 20 | }, 21 | notify = { 22 | enabled = false, 23 | background_colour = "#000000", 24 | }, 25 | messages = { enabled = false }, 26 | -- cmdline = { 27 | -- enabled = true, -- enables the Noice cmdline UI 28 | -- view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom 29 | -- opts = {}, 30 | -- format = { 31 | -- cmdline = { pattern = "^:", icon = "", lang = "vim" }, 32 | -- search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" }, 33 | -- search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" }, 34 | -- filter = { pattern = "^:%s!", icon = "$", lang = "bash" }, 35 | -- lua = { pattern = { "^:%slua%s+", "^:%slua%s=%s", "^:%s=%s" }, icon = "", lang = "lua" }, 36 | -- help = { pattern = "^:%she?l?p?%s+", icon = "" }, 37 | -- input = {}, 38 | -- }, 39 | -- }, 40 | -- messages = { 41 | -- -- NOTE: If you enable messages, then the cmdline is enabled automatically. 42 | -- -- This is a current Neovim limitation. 43 | -- enabled = true, -- enables the Noice messages UI 44 | -- view = "notify", -- default view for messages 45 | -- view_error = "notify", -- view for errors 46 | -- view_warn = "notify", -- view for warnings 47 | -- view_history = "messages", -- view for :messages 48 | -- view_search = "virtualtext", -- view for search count messages. Set to `false` to disable 49 | -- }, 50 | -- popupmenu = { 51 | -- enabled = true, -- enables the Noice popupmenu UI 52 | -- ---@type 'nui'|'cmp' 53 | -- backend = "nui", -- backend to use to show regular cmdline completions 54 | -- ---@type NoicePopupmenuItemKind|false 55 | -- -- Icons for completion item kinds (see defaults at noice.config.icons.kinds) 56 | -- kind_icons = {}, -- set to `false` to disable icons 57 | -- }, 58 | lsp = { 59 | -- override = { 60 | -- ["vim.lsp.util.convert_input_to_markdown_lines"] = true, 61 | -- ["vim.lsp.util.stylize_markdown"] = true, 62 | -- ["cmp.entry.get_documentation"] = true, 63 | -- }, 64 | hover = { 65 | enabled = false, 66 | }, 67 | signature = { 68 | enabled = false, 69 | }, 70 | }, 71 | } 72 | end, 73 | }; 74 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/overseer.lua: -------------------------------------------------------------------------------- 1 | -- Overseer Session Manager 2 | -- https://github.com/stevearc/overseer.nvim 3 | return { 4 | 'stevearc/overseer.nvim', 5 | opts = {}, 6 | }; 7 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/syntax.lua: -------------------------------------------------------------------------------- 1 | -- Syntax Tree Surfer -- 2 | return { 3 | "ziontee113/syntax-tree-surfer", 4 | after = "nvim-treesitter", 5 | config = function() 6 | require("syntax-tree-surfer").setup {} 7 | 8 | local opts = { noremap = true, silent = true } 9 | 10 | -- Normal Mode Swapping: 11 | -- Swap The Master Node relative to the cursor with it's siblings, Dot Repeatable 12 | vim.keymap.set("n", "vU", function() 13 | vim.opt.opfunc = "v:lua.STSSwapUpNormal_Dot" 14 | return "g@l" 15 | end, { silent = true, expr = true }) 16 | vim.keymap.set("n", "vD", function() 17 | vim.opt.opfunc = "v:lua.STSSwapDownNormal_Dot" 18 | return "g@l" 19 | end, { silent = true, expr = true }) 20 | 21 | -- Swap Current Node at the Cursor with it's siblings, Dot Repeatable 22 | vim.keymap.set("n", "vd", function() 23 | vim.opt.opfunc = "v:lua.STSSwapCurrentNodeNextNormal_Dot" 24 | return "g@l" 25 | end, { silent = true, expr = true }) 26 | vim.keymap.set("n", "vu", function() 27 | vim.opt.opfunc = "v:lua.STSSwapCurrentNodePrevNormal_Dot" 28 | return "g@l" 29 | end, { silent = true, expr = true }) 30 | 31 | -- Visual Selection from Normal Mode 32 | vim.keymap.set("n", "vx", "STSSelectMasterNode", opts) 33 | vim.keymap.set("n", "vn", "STSSelectCurrentNode", opts) 34 | 35 | -- Select Nodes in Visual Mode 36 | vim.keymap.set("x", "J", "STSSelectNextSiblingNode", opts) 37 | vim.keymap.set("x", "K", "STSSelectPrevSiblingNode", opts) 38 | vim.keymap.set("x", "H", "STSSelectParentNode", opts) 39 | vim.keymap.set("x", "L", "STSSelectChildNode", opts) 40 | 41 | -- Swapping Nodes in Visual Mode 42 | vim.keymap.set("x", "", "STSSwapNextVisual", opts) 43 | vim.keymap.set("x", "", "STSSwapPrevVisual", opts) 44 | end, 45 | }; 46 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/tabline.lua: -------------------------------------------------------------------------------- 1 | -- Tabline -- 2 | return { 3 | 'kdheepak/tabline.nvim', 4 | config = function() 5 | require'tabline'.setup { 6 | -- Defaults configuration options 7 | enable = true, 8 | options = { 9 | section_separators = {'', ''}, 10 | component_separators = {'', ''}, 11 | max_bufferline_percent = 66, 12 | show_tabs_always = false, -- this shows tabs only when there are more than one tab or if the first tab is named 13 | show_devicons = true, -- this shows devicons in buffer section 14 | show_bufnr = false, -- this appends [bufnr] to buffer section, 15 | show_filename_only = false, -- shows base filename only instead of relative path in filename 16 | modified_icon = "+ ", -- change the default modified icon 17 | modified_italic = false, -- set to true by default; this determines whether the filename turns italic if modified 18 | show_tabs_only = false, -- this shows only tabs instead of tabs + buffers 19 | } 20 | } 21 | vim.cmd[[ 22 | set guioptions-=e " Use showtabline in gui vim 23 | set sessionoptions+=tabpages,globals " store tabpages and globals in session 24 | ]] 25 | end, 26 | requires = { { 'hoob3rt/lualine.nvim', opt=true }, {'kyazdani42/nvim-web-devicons', opt = true} } 27 | }; 28 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/terminal.lua: -------------------------------------------------------------------------------- 1 | -- Override ToggleTerm Mapping -- 2 | return { 3 | "akinsho/toggleterm.nvim", 4 | opts = { open_mapping = [[]] }, 5 | }; 6 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/trouble.lua: -------------------------------------------------------------------------------- 1 | -- Trouble -- 2 | return { 3 | "folke/trouble.nvim", 4 | requires = "nvim-tree/nvim-web-devicons", 5 | config = function() 6 | require("trouble").setup { } 7 | end 8 | }; 9 | -------------------------------------------------------------------------------- /confs/nvim/lua/plugs/which.lua: -------------------------------------------------------------------------------- 1 | -- WhichKey -- 2 | -- This plugin creates a popup with possible command suggestions -- 3 | -- see: https://github.com/folke/which-key.nvim -- 4 | return { 5 | "folke/which-key.nvim", 6 | event = "VeryLazy", 7 | init = function() 8 | vim.o.timeout = true 9 | vim.o.timeoutlen = 300 10 | end, 11 | opts = {} 12 | }; 13 | -------------------------------------------------------------------------------- /confs/nvim/lua/resession/extensions/astronvim.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.on_save = function() 4 | -- initiate astronvim data 5 | local data = { bufnrs = {}, tabs = {} } 6 | 7 | local buf_utils = require "astronvim.utils.buffer" 8 | 9 | data.current_buf = buf_utils.current_buf 10 | data.last_buf = buf_utils.last_buf 11 | 12 | -- save tab scoped buffers and buffer numbers from buffer name 13 | for new_tabpage, tabpage in ipairs(vim.api.nvim_list_tabpages()) do 14 | data.tabs[new_tabpage] = vim.t[tabpage].bufs 15 | for _, bufnr in ipairs(data.tabs[new_tabpage]) do 16 | data.bufnrs[vim.api.nvim_buf_get_name(bufnr)] = bufnr 17 | end 18 | end 19 | 20 | return data 21 | end 22 | 23 | M.on_load = function(data) 24 | -- create map from old buffer numbers to new buffer numbers 25 | local new_bufnrs = {} 26 | for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do 27 | local bufname = vim.api.nvim_buf_get_name(bufnr) 28 | if bufname and data.bufnrs[bufname] then new_bufnrs[data.bufnrs[bufname]] = bufnr end 29 | end 30 | -- build new tab scoped buffer lists 31 | for tabpage, tabs in pairs(data.tabs) do 32 | vim.t[tabpage].bufs = vim.tbl_map(function(bufnr) return new_bufnrs[bufnr] end, tabs) 33 | end 34 | 35 | local buf_utils = require "astronvim.utils.buffer" 36 | buf_utils.current_buf = new_bufnrs[data.current_buf] 37 | buf_utils.last_buf = new_bufnrs[data.last_buf] 38 | 39 | require("astronvim.utils").event "BufsUpdated" 40 | 41 | if vim.opt.bufhidden:get() == "wipe" and vim.fn.bufnr() ~= buf_utils.current_buf then 42 | vim.cmd.b(buf_utils.current_buf) 43 | end 44 | end 45 | 46 | return M 47 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/dash/buttons.lua: -------------------------------------------------------------------------------- 1 | -- Section Buttons -- 2 | 3 | function btns() 4 | local keybind_opts = { silent = true, noremap = true } 5 | vim.api.nvim_create_autocmd({ "User" }, { 6 | pattern = { "AlphaReady" }, 7 | callback = function(_) 8 | -- Lazy 9 | vim.api.nvim_buf_set_keymap(0, "n", "z", ":Lazy", keybind_opts) 10 | 11 | -- Toggleterm / telescope 12 | vim.api.nvim_buf_set_keymap(0, "n", "g", ":lua require('astronvim.utils').toggle_term_cmd('lazygit')", keybind_opts) 13 | vim.api.nvim_buf_set_keymap(0, "n", "t", ":ToggleTerm", keybind_opts) 14 | vim.api.nvim_buf_set_keymap(0, "n", "s", ":Telescope live_grep", keybind_opts) 15 | vim.api.nvim_buf_set_keymap(0, "n", "f", ":Telescope find_files", keybind_opts) 16 | 17 | -- Neovim Sessions 18 | vim.api.nvim_buf_set_keymap(0, "n", "l", ":SessionManager! load_session", keybind_opts) 19 | vim.api.nvim_buf_set_keymap(0, "n", "c", ":SessionManager! load_current_dir_session", keybind_opts) 20 | 21 | -- Quit 22 | vim.api.nvim_buf_set_keymap(0, "n", "q", "q", keybind_opts) 23 | end, 24 | }) 25 | 26 | -- "Function" is light blue - replaced with white 27 | local button_hl = { 28 | { "Constant", 1, 4 }, 29 | { "white", 5, 18 }, 30 | { "String", 19, 25 }, 31 | { "Comment", 25, 32 }, 32 | { "Constant", 32, 38 }, 33 | { "white", 38, 50 }, 34 | { "String", 51, 55 }, 35 | } 36 | return { 37 | { 38 | type = "text", 39 | val = { 40 | " find file f │  terminal t", 41 | " lazygit g │  quit q", 42 | "鈴 lazy z │  search s", 43 | " load session l │  dir session c", 44 | }, 45 | opts = { 46 | shrink_margin = false, 47 | position = "center", 48 | hl = { 49 | button_hl, button_hl, button_hl, button_hl, 50 | } 51 | }, 52 | }, 53 | } 54 | end 55 | 56 | return { type = "group", val = btns }; 57 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/dash/docker.lua: -------------------------------------------------------------------------------- 1 | -- Docker Section -- 2 | 3 | local DOCKER_CONTAINER_INIT = " Loading docker containers... " 4 | local docker_containers = DOCKER_CONTAINER_INIT 5 | 6 | function docker() 7 | function LoadDockerContainers() 8 | if docker_containers == DOCKER_CONTAINER_INIT then 9 | vim.fn.jobstart( 10 | "docker ps --format 'table {{.Image}}\t{{.ID}}\t{{.Status}}'", 11 | { on_stdout = ContainerCallback, stdout_buffered = true } 12 | ) 13 | end 14 | pcall(vim.cmd.AlphaRedraw) 15 | end 16 | 17 | vim.api.nvim_create_autocmd({ "User" }, { 18 | pattern = { "LazyVimStarted" }, 19 | callback = LoadDockerContainers, 20 | }) 21 | 22 | function ContainerCallback(job_id, data, event) 23 | if job_id > 0 then 24 | docker_containers = data 25 | pcall(vim.cmd.AlphaRedraw) 26 | end 27 | end 28 | 29 | return { 30 | { 31 | type = "text", 32 | val = docker_containers, 33 | opts = { 34 | shrink_margin = false, 35 | position = "center", 36 | hl = "SpecialComment", 37 | }, 38 | }, 39 | } 40 | end 41 | 42 | return { type = "group", val = docker }; 43 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/dash/ghprs.lua: -------------------------------------------------------------------------------- 1 | -- Github PRs Section -- 2 | 3 | local GITHUB_PR_INIT = " Loading github pull requests... " 4 | local github_prs = GITHUB_PR_INIT 5 | 6 | local ghlist = "gh pr list -R ethereum-optimism/optimism -L 1000 -a '@me' " 7 | local ghjson = "--json number,headRefName,state,title " 8 | local ghtemplate = "--template '{{range .}}{{tablerow (printf \"#%v\" .number) .title}}{{tablerow .state .headRefName}}{{end}}' " 9 | local ghgrep = "| grep '^'" 10 | 11 | function github() 12 | function LoadGithubPrs() 13 | if github_prs == GITHUB_PR_INIT then 14 | vim.fn.jobstart( 15 | ghlist .. ghjson .. ghtemplate .. ghgrep, 16 | { on_stdout = GithubPrCallback, stdout_buffered = true } 17 | ) 18 | end 19 | pcall(vim.cmd.AlphaRedraw) 20 | end 21 | 22 | vim.api.nvim_create_autocmd({ "User" }, { 23 | pattern = { "LazyVimStarted" }, 24 | callback = LoadGithubPrs, 25 | }) 26 | 27 | function GithubPrCallback(job_id, data, event) 28 | if job_id > 0 then 29 | github_prs = data 30 | pcall(vim.cmd.AlphaRedraw) 31 | end 32 | end 33 | 34 | return { 35 | { 36 | type = "text", 37 | val = github_prs, 38 | opts = { 39 | align_shortcut = "left", 40 | shrink_margin = false, 41 | position = "center", 42 | hl = "Question", 43 | }, 44 | }, 45 | } 46 | end 47 | 48 | return { type = "group", val = github }; 49 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/dash/header.lua: -------------------------------------------------------------------------------- 1 | -- Section Header -- 2 | 3 | local headers = { 4 | { 5 | " ** ", 6 | " * ", 7 | " *** ", 8 | " * * ", 9 | " *************************** ", 10 | " * * ", 11 | " ** ** ", 12 | " * * ", 13 | " ** ", 14 | " * ", 15 | " ** ", 16 | }, 17 | }; 18 | 19 | math.randomseed(os.time()) 20 | 21 | return { 22 | type = "text", 23 | val = headers[1], 24 | opts = { 25 | position = "center", 26 | shrink_margin = false, 27 | hl = "WarningMsg", 28 | }, 29 | }; 30 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/dash/info.lua: -------------------------------------------------------------------------------- 1 | -- Info Section -- 2 | 3 | local DOCKER_VERSION_INIT = " Loading docker version... " 4 | local docker_version = DOCKER_VERSION_INIT 5 | 6 | local docker = { 7 | default = " Loading docker version... ", 8 | version = " Loading docker version... ", 9 | } 10 | 11 | local golang = { 12 | default = " Loading cargo version... ", 13 | version = " Loading cargo version... ", 14 | } 15 | 16 | local cargo = { 17 | default = " Loading cargo version... ", 18 | version = " Loading cargo version... ", 19 | } 20 | 21 | function infos() 22 | local datetime = os.date(" %A %m-%d-%Y") 23 | local lazy_stats = require("lazy").stats() 24 | local ms = (math.floor(lazy_stats.startuptime * 100 + 0.5) / 100) 25 | local version = vim.version() 26 | 27 | require("user.utils.docker")(docker) 28 | require("user.utils.cargo")(cargo) 29 | require("user.utils.golang")(golang) 30 | 31 | -- "Substitute" is light pink - replaced with white 32 | local datetime_hl = { 33 | { "white", 1, 4 }, 34 | { "white", 5, 18 }, 35 | { "Comment", 28, 34 }, 36 | { "Function", 34, 38 }, 37 | { "white", 40, 60 }, 38 | } 39 | 40 | local stats_hl = { 41 | { "WarningMsg", 1, 4 }, 42 | { "white", 5, 28 }, 43 | { "Comment", 28, 34 }, 44 | { "String", 34, 38 }, 45 | { "white", 40, 60 }, 46 | } 47 | 48 | local versions_hl = { 49 | { "Function", 1, 4 }, 50 | { "white", 5, 28 }, 51 | { "Comment", 28, 34 }, 52 | { "CursorLineNr", 34, 38 }, 53 | { "white", 40, 60 }, 54 | } 55 | 56 | local stats = " " .. lazy_stats.loaded .. "/" .. lazy_stats.count .. " in " .. ms .. " ms" 57 | local version = " v" .. version.major .. "." .. version.minor .. "." .. version.patch 58 | 59 | return { 60 | { 61 | type = "text", 62 | val = { 63 | datetime .. " │ " .. docker.version .. " ", 64 | stats .. " │ " .. version, 65 | golang.version .. " │ " .. cargo.version, 66 | }, 67 | opts = { 68 | shrink_margin = false, 69 | position = "center", 70 | hl = { datetime_hl, stats_hl, versions_hl }, 71 | }, 72 | }, 73 | } 74 | end 75 | 76 | return { type = "group", val = infos }; 77 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/dash/init.lua: -------------------------------------------------------------------------------- 1 | -- Dashboard Config -- 2 | 3 | vim.b.miniindentscope_disable = true 4 | 5 | -- Automatically open neotree on startup -- 6 | local function open_tree() 7 | vim.cmd "Neotree" 8 | vim.cmd.wincmd "p" 9 | end 10 | vim.api.nvim_create_autocmd({ "User" }, { pattern = { "AlphaReady" }, callback = open_tree }) 11 | 12 | -- Builtin Neovim Highlight Groups -- 13 | -- https://neovim.io/doc/user/syntax.html#highlight-groups -- 14 | 15 | local dashconf = { 16 | layout = { 17 | { type = "padding", val = vim.fn.max { 2, vim.fn.floor(vim.fn.winheight(0) * 0.25) } }, 18 | require("user.dash.header"), 19 | { type = "padding", val = 1 }, 20 | { type = "padding", val = 1 }, 21 | require("user.dash.info"), 22 | { type = "padding", val = 1 }, 23 | require("user.dash.buttons"), 24 | { type = "padding", val = 1 }, 25 | require("user.dash.docker"), 26 | { type = "padding", val = 1 }, 27 | { 28 | type = "text", 29 | val = "󰓂 My Github PRs ", 30 | opts = { 31 | position = "center", 32 | hl = "ModeMsg", 33 | }, 34 | }, 35 | require("user.dash.ghprs"), 36 | } 37 | } 38 | 39 | return { 40 | "goolord/alpha-nvim", 41 | config = function() 42 | require("alpha").setup(dashconf) 43 | end 44 | }; 45 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/diagnostics.lua: -------------------------------------------------------------------------------- 1 | -- Diagnostics -- 2 | -- Automatically picked up by astronvim -- 3 | local diagnostics = { 4 | virtual_lines = false, 5 | virtual_text = true, 6 | underline = true, 7 | }; 8 | 9 | return diagnostics; 10 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/externals/copilot.lua: -------------------------------------------------------------------------------- 1 | -- Github Copilot Config -- 2 | local config = { 3 | -- Lua copilot 4 | { 5 | "zbirenbaum/copilot.lua", 6 | lazy = false, 7 | event = "VimEnter", 8 | config = function() 9 | vim.defer_fn(function() 10 | require("copilot").setup { 11 | panel = { 12 | enabled = true, 13 | auto_refresh = true, 14 | ---@type table<'accept'|'next'|'prev'|'dismiss', false|string> 15 | keymap = { 16 | jump_prev = "[[", 17 | jump_next = "]]", 18 | accept = "", 19 | refresh = "gr", 20 | open = "", 21 | }, 22 | }, 23 | suggestion = { 24 | enabled = true, 25 | auto_trigger = true, 26 | debounce = 50, 27 | keymap = { 28 | accept = "", 29 | next = "", 30 | prev = "", 31 | dismiss = "", 32 | }, 33 | }, 34 | } 35 | end, 100) 36 | end, 37 | }, 38 | }; 39 | 40 | return config; 41 | 42 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/externals/dap.lua: -------------------------------------------------------------------------------- 1 | -- Override Nvim DAP -- 2 | local config = { 3 | -- Disable nvim-dap 4 | { "mfussenegger/nvim-dap", enabled = false }, 5 | { "jay-babu/mason-nvim-dap.nvim", enabled = false }, 6 | { "rcarriga/nvim-dap-ui", enabled = false }, 7 | }; 8 | 9 | return config; 10 | 11 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/externals/dashboard.lua: -------------------------------------------------------------------------------- 1 | -- Dashboard Config -- 2 | 3 | local headers = require "user.headers" 4 | math.randomseed(os.time()) 5 | 6 | local config = { 7 | { 8 | 'glepnir/dashboard-nvim', 9 | event = 'VimEnter', 10 | theme = 'hyper', 11 | config = function() 12 | require('dashboard').setup { 13 | shortcut = { 14 | { desc = string, group = 'highlight group', key = 'shortcut key', action = 'action when you press key' }, 15 | }, 16 | packages = { enable = true }, 17 | project = { enable = true, limit = 8, icon = 'your icon', label = '', action = 'Telescope find_files cwd=' }, 18 | mru = { limit = 10, icon = 'your icon', label = '', }, 19 | footer = {}, 20 | } 21 | end, 22 | dependencies = { {'nvim-tree/nvim-web-devicons'}} 23 | }, 24 | { 25 | "goolord/alpha-nvim", 26 | opts = function(_, opts) 27 | opts.section.header.val = headers[math.random(#headers)] 28 | return opts 29 | end, 30 | } 31 | }; 32 | 33 | return config; 34 | 35 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/externals/illuminate.lua: -------------------------------------------------------------------------------- 1 | -- Illuminate Config -- 2 | -- Highlight words under the cursor that match the provider regex -- 3 | local config = { 4 | { 5 | "rrethy/vim-illuminate", 6 | providers = { 7 | 'lsp', 8 | 'treesitter', 9 | 'regex', 10 | }, 11 | } 12 | }; 13 | 14 | return config; 15 | 16 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/externals/init.lua: -------------------------------------------------------------------------------- 1 | 2 | --[[ Helper function to recursively print the table for debugging --]] 3 | local function printTable(t, indent) 4 | indent = indent or 0 5 | for k, v in pairs(t) do 6 | if type(v) == "table" then 7 | print(string.rep(" ", indent) .. tostring(k) .. ":") 8 | printTable(v, indent + 1) 9 | else 10 | print(string.rep(" ", indent) .. tostring(k) .. ": " .. tostring(v)) 11 | end 12 | end 13 | end 14 | 15 | --[[ Function to load and execute a Lua file --]] 16 | local function loadLuaFile(file) 17 | local chunk, err = loadfile(file) 18 | if not chunk then 19 | print("Error loading file:", err) 20 | return nil 21 | end 22 | return chunk() 23 | end 24 | 25 | --[[ We comment out the below since we only want to run this as a script 26 | 27 | -- Loads files using the luafilesystem -- 28 | local function lfs_load() 29 | local lfs = require("lfs") 30 | -- Iterate through all files in the current directory -- 31 | for file in lfs.dir(lfs.currentdir()) do 32 | -- Check if it's a Lua file and not init.lua 33 | if file:match("%.lua$") and file ~= "init.lua" then 34 | local var_name = file:match("^(.+)%.") 35 | local file_chunk = loadLuaFile(file) 36 | _ENV[var_name] = file_chunk 37 | -- Expect configs to be nested. 38 | -- Allows for multiple configs in any given external file. 39 | for _, v in pairs(file_chunk) do 40 | table.insert(config_table, v) 41 | end 42 | end 43 | end 44 | end 45 | 46 | --]] 47 | 48 | config_table = {} 49 | 50 | local function import_all_lua_files() 51 | local dir = vim.fn.expand(':p:h') 52 | local files = vim.fn.globpath(dir, '*.lua', false, true) 53 | 54 | for _, file in ipairs(files) do 55 | local filename = vim.fn.fnamemodify(file, ':t:r') 56 | if filename ~= 'init' then 57 | local module_name = string.format('%s.%s', dir, filename):gsub('/', '.') 58 | local imported_module = require(module_name) 59 | for _, v in pairs(imported_module) do 60 | table.insert(config_table, v) 61 | end 62 | end 63 | end 64 | print("Loading config_table") 65 | print(config_table) 66 | printTable(config_table, 0) 67 | end 68 | 69 | import_all_lua_files() 70 | 71 | return config_table 72 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/externals/leap.lua: -------------------------------------------------------------------------------- 1 | -- Leap Config -- 2 | local config = { 3 | -- Leap 4 | { 5 | "ggandor/leap.nvim", 6 | lazy = false, 7 | config = function() 8 | local leap = require "leap" 9 | leap.setup { 10 | highlight_unlabeled_phase_one_targets = false, 11 | } 12 | leap.add_default_mappings() 13 | end, 14 | }, 15 | }; 16 | 17 | return config; 18 | 19 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/externals/lsp.lua: -------------------------------------------------------------------------------- 1 | -- LSP Config -- 2 | 3 | local config = { 4 | -- LSP Lines Prettified Diagnostics -- 5 | { 6 | "https://git.sr.ht/~whynothugo/lsp_lines.nvim", 7 | lazy = false, 8 | after = "mason-lspconfig.nvim", 9 | module = "lsp_lines", 10 | config = function() require("lsp_lines").setup() end, 11 | }, 12 | }; 13 | 14 | return config; 15 | 16 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/externals/noice.lua: -------------------------------------------------------------------------------- 1 | -- Noice Config -- 2 | 3 | local config = { 4 | -- noice (cmd bar, notify, etc.) 5 | { 6 | "folke/noice.nvim", 7 | after = "nui.nvim", 8 | event = "VimEnter", 9 | config = function() 10 | require("noice").setup { 11 | notify = { enabled = false }, 12 | messages = { enabled = false }, 13 | lsp = { 14 | hover = { 15 | enabled = false, 16 | }, 17 | signature = { 18 | enabled = false, 19 | }, 20 | }, 21 | } 22 | end, 23 | }, 24 | }; 25 | 26 | return config; 27 | 28 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/externals/overrides.lua: -------------------------------------------------------------------------------- 1 | -- Override Configs -- 2 | 3 | local config = { 4 | -- Override ToggleTerm Mapping -- 5 | { 6 | "akinsho/toggleterm.nvim", 7 | opts = { open_mapping = [[]] }, 8 | }, 9 | 10 | -- Override NeoTree Position Config 11 | { 12 | "nvim-neo-tree/neo-tree.nvim", 13 | keys = { { "E", "fE", desc = "Explorer NeoTree (cwd)", remap = true } }, 14 | opts = { 15 | filesystem = { 16 | bind_to_cwd = false, 17 | follow_current_file = true, 18 | filtered_items = { 19 | visible = true, 20 | hide_dotfiles = false, 21 | hide_gitignored = false, 22 | }, 23 | }, 24 | window = { position = "right" }, 25 | }, 26 | }, 27 | }; 28 | 29 | return config; 30 | 31 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/externals/syntax_tree_surfer.lua: -------------------------------------------------------------------------------- 1 | -- Syntax Tree Surfer Config -- 2 | local config = { 3 | { 4 | "ziontee113/syntax-tree-surfer", 5 | after = "nvim-treesitter", 6 | config = function() 7 | require("syntax-tree-surfer").setup {} 8 | 9 | local opts = { noremap = true, silent = true } 10 | 11 | -- Normal Mode Swapping: 12 | -- Swap The Master Node relative to the cursor with it's siblings, Dot Repeatable 13 | vim.keymap.set("n", "vU", function() 14 | vim.opt.opfunc = "v:lua.STSSwapUpNormal_Dot" 15 | return "g@l" 16 | end, { silent = true, expr = true }) 17 | vim.keymap.set("n", "vD", function() 18 | vim.opt.opfunc = "v:lua.STSSwapDownNormal_Dot" 19 | return "g@l" 20 | end, { silent = true, expr = true }) 21 | 22 | -- Swap Current Node at the Cursor with it's siblings, Dot Repeatable 23 | vim.keymap.set("n", "vd", function() 24 | vim.opt.opfunc = "v:lua.STSSwapCurrentNodeNextNormal_Dot" 25 | return "g@l" 26 | end, { silent = true, expr = true }) 27 | vim.keymap.set("n", "vu", function() 28 | vim.opt.opfunc = "v:lua.STSSwapCurrentNodePrevNormal_Dot" 29 | return "g@l" 30 | end, { silent = true, expr = true }) 31 | 32 | -- Visual Selection from Normal Mode 33 | vim.keymap.set("n", "vx", "STSSelectMasterNode", opts) 34 | vim.keymap.set("n", "vn", "STSSelectCurrentNode", opts) 35 | 36 | -- Select Nodes in Visual Mode 37 | vim.keymap.set("x", "J", "STSSelectNextSiblingNode", opts) 38 | vim.keymap.set("x", "K", "STSSelectPrevSiblingNode", opts) 39 | vim.keymap.set("x", "H", "STSSelectParentNode", opts) 40 | vim.keymap.set("x", "L", "STSSelectChildNode", opts) 41 | 42 | -- Swapping Nodes in Visual Mode 43 | vim.keymap.set("x", "", "STSSwapNextVisual", opts) 44 | vim.keymap.set("x", "", "STSSwapPrevVisual", opts) 45 | end, 46 | } 47 | }; 48 | 49 | return config; 50 | 51 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/externals/tabline.lua: -------------------------------------------------------------------------------- 1 | -- Tabline Configuration -- 2 | local config = { 3 | { 4 | 'kdheepak/tabline.nvim', 5 | config = function() 6 | require'tabline'.setup { 7 | -- Defaults configuration options 8 | enable = true, 9 | options = { 10 | section_separators = {'', ''}, 11 | component_separators = {'', ''}, 12 | max_bufferline_percent = 66, 13 | show_tabs_always = false, -- this shows tabs only when there are more than one tab or if the first tab is named 14 | show_devicons = true, -- this shows devicons in buffer section 15 | show_bufnr = false, -- this appends [bufnr] to buffer section, 16 | show_filename_only = false, -- shows base filename only instead of relative path in filename 17 | modified_icon = "+ ", -- change the default modified icon 18 | modified_italic = false, -- set to true by default; this determines whether the filename turns italic if modified 19 | show_tabs_only = false, -- this shows only tabs instead of tabs + buffers 20 | } 21 | } 22 | vim.cmd[[ 23 | set guioptions-=e " Use showtabline in gui vim 24 | set sessionoptions+=tabpages,globals " store tabpages and globals in session 25 | ]] 26 | end, 27 | requires = { { 'hoob3rt/lualine.nvim', opt=true }, {'kyazdani42/nvim-web-devicons', opt = true} } 28 | } 29 | }; 30 | 31 | return config; 32 | 33 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/highlights.lua: -------------------------------------------------------------------------------- 1 | -- Highlights -- 2 | local highlights = { 3 | -- NvChad-esq Telescope Theme for Catppuccin 4 | catppuccin = function() 5 | -- Pull in the catppuccin mocha colors 6 | local mocha = require("catppuccin.palettes").get_palette("mocha") 7 | local fg, bg = mocha.text, mocha.base 8 | local bg_alt = mocha.mantle 9 | local mauve = mocha.mauve 10 | local green = mocha.green 11 | 12 | -- return a table of highlights for telescope based on colors gotten from highlight groups 13 | return { 14 | TelescopeBorder = { fg = bg_alt, bg = bg }, 15 | TelescopeNormal = { bg = bg }, 16 | TelescopePreviewBorder = { fg = bg, bg = bg }, 17 | TelescopePreviewNormal = { bg = bg }, 18 | TelescopePreviewTitle = { fg = bg, bg = mauve }, 19 | TelescopePromptBorder = { fg = bg_alt, bg = bg_alt }, 20 | TelescopePromptNormal = { fg = fg, bg = bg_alt }, 21 | TelescopePromptPrefix = { fg = green, bg = bg_alt }, 22 | TelescopePromptTitle = { fg = bg, bg = green }, 23 | TelescopeResultsBorder = { fg = bg, bg = bg }, 24 | TelescopeResultsNormal = { bg = bg }, 25 | TelescopeResultsTitle = { fg = bg, bg = bg }, 26 | } 27 | end, 28 | }; 29 | 30 | return highlights; 31 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/init.lua: -------------------------------------------------------------------------------- 1 | -- Configuration -- 2 | local config = { 3 | plugins = require("plugs"), 4 | 5 | lsp = require("user.lsp"), 6 | mappings = require("user.maps"), 7 | updater = require("user.updater"), 8 | options = require("user.options"), 9 | polish = require("user.polishing"), 10 | highlights = require("user.highlights"), 11 | 12 | -- Styling -- 13 | colorscheme = "catppuccin", 14 | icons = { VimIcon = "", }, 15 | heirline = { separators = { left = { "", " " }, right = { " ", "" } } }, 16 | }; 17 | 18 | return config; 19 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/lazy.lua: -------------------------------------------------------------------------------- 1 | -- Lazy Config -- 2 | -- automatically picked up by astronvim -- 3 | local lazy = { 4 | defaults = { lazy = true }, 5 | performance = { 6 | rtp = { 7 | disabled_plugins = { "tohtml", "gzip", "matchit", "zipPlugin", "netrwPlugin", "tarPlugin", "matchparen" }, 8 | }, 9 | }, 10 | }; 11 | 12 | return lazy; 13 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/lsp.lua: -------------------------------------------------------------------------------- 1 | -- LSP Extensions -- 2 | local lsp = { 3 | -- Enable servers that you already have installed without mason. 4 | servers = { 5 | "nomic_solidity", 6 | "gopls", 7 | }, 8 | 9 | formatting = { 10 | format_on_save = { 11 | enabled = true, 12 | allow_filetypes = {}, 13 | ignore_filetypes = { "solidity" }, 14 | }, 15 | timeout_ms = 1000, 16 | }, 17 | 18 | mappings = { n = {} }, 19 | 20 | -- override the LSP setup handler function based on server name 21 | setup_handlers = { 22 | rust_analyzer = function(_, opts) require("rust-tools").setup { server = opts } end 23 | }, 24 | 25 | -- Add overrides for LSP server settings, the keys are the name of the server 26 | config = { 27 | yamlls = { 28 | settings = { 29 | yaml = { 30 | schemas = { 31 | ["http://json.schemastore.org/github-workflow"] = ".github/workflows/*.{yml,yaml}", 32 | ["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}", 33 | ["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}", 34 | }, 35 | }, 36 | }, 37 | }, 38 | 39 | -- Nomic Solidity -- 40 | nomic_solidity = { 41 | cmd = { "nomicfoundation-solidity-language-server", "--stdio" }, 42 | -- root_dir = require("lspconfig.util").root_pattern "foundry.toml", 43 | filetypes = { "solidity" }, 44 | single_file_support = true, 45 | }, 46 | 47 | -- Rust Analyzer -- 48 | rust_analyzer = { 49 | settings = { 50 | ["rust-analyzer"] = { cargo = { 51 | features = { "optimism" }, 52 | } }, 53 | }, 54 | }, 55 | }, 56 | }; 57 | 58 | return lsp; 59 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/options.lua: -------------------------------------------------------------------------------- 1 | -- Vim Config Options -- 2 | 3 | local options = { 4 | opt = { 5 | -- set to true or false etc. 6 | relativenumber = false, -- sets vim.opt.relativenumber 7 | number = true, -- sets vim.opt.number 8 | spell = false, -- sets vim.opt.spell 9 | signcolumn = "auto", -- sets vim.opt.signcolumn to auto 10 | wrap = false, -- sets vim.opt.wrap 11 | }, 12 | g = { 13 | mapleader = " ", -- sets vim.g.mapleader 14 | autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled) 15 | cmp_enabled = true, -- enable completion at start 16 | autopairs_enabled = true, -- enable autopairs at start 17 | diagnostics_enabled = true, -- enable diagnostics at start 18 | status_diagnostics_enabled = true, -- enable diagnostics in statusline 19 | icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing) 20 | ui_notifications_enabled = false, -- disable notifications when toggling UI elements 21 | Illuminate_useDeprecated = 1, -- enable deprecated highlight groups 22 | }, 23 | }; 24 | 25 | return options; 26 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/cheatsheet.lua: -------------------------------------------------------------------------------- 1 | -- Cheatsheet for plugins -- 2 | return { 3 | 'sudormrfbin/cheatsheet.nvim', 4 | requires = { 5 | {'nvim-telescope/telescope.nvim'}, 6 | {'nvim-lua/popup.nvim'}, 7 | {'nvim-lua/plenary.nvim'}, 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/cmp.lua: -------------------------------------------------------------------------------- 1 | -- Add crates to cmp sources 2 | return { 3 | "hrsh7th/nvim-cmp", 4 | opts = function(_, opts) 5 | opts.sources[#opts.sources + 1] = { name = "crates" } 6 | end, 7 | }; 8 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/copilot.lua: -------------------------------------------------------------------------------- 1 | -- Lua Copilot -- 2 | return { 3 | "zbirenbaum/copilot.lua", 4 | lazy = false, 5 | event = "VimEnter", 6 | config = function() 7 | vim.defer_fn(function() 8 | require("copilot").setup { 9 | panel = { 10 | enabled = true, 11 | auto_refresh = true, 12 | ---@type table<'accept'|'next'|'prev'|'dismiss', false|string> 13 | keymap = { 14 | jump_prev = "[[", 15 | jump_next = "]]", 16 | accept = "", 17 | refresh = "gr", 18 | open = "", 19 | }, 20 | }, 21 | suggestion = { 22 | enabled = true, 23 | auto_trigger = true, 24 | debounce = 50, 25 | keymap = { 26 | accept = "", 27 | next = "", 28 | prev = "", 29 | dismiss = "", 30 | }, 31 | }, 32 | } 33 | end, 100) 34 | end, 35 | }; 36 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/crates.lua: -------------------------------------------------------------------------------- 1 | -- Crates (Rust) 2 | return { 3 | "saecki/crates.nvim", 4 | tag = "v0.3.0", 5 | requires = { "nvim-lua/plenary.nvim" }, 6 | config = function() 7 | require("crates").setup() 8 | end, 9 | event = { "BufEnter Cargo.toml" }, 10 | }; 11 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/dash.lua: -------------------------------------------------------------------------------- 1 | -- Dashboard -- 2 | return require("user.dash") 3 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/dash/buttons.lua: -------------------------------------------------------------------------------- 1 | -- Section Buttons -- 2 | 3 | function btns() 4 | local keybind_opts = { silent = true, noremap = true } 5 | vim.api.nvim_create_autocmd({ "User" }, { 6 | pattern = { "AlphaReady" }, 7 | callback = function(_) 8 | -- Lazy 9 | vim.api.nvim_buf_set_keymap(0, "n", "z", ":Lazy", keybind_opts) 10 | 11 | -- Toggleterm / telescope 12 | vim.api.nvim_buf_set_keymap(0, "n", "g", ":lua require('astronvim.utils').toggle_term_cmd('lazygit')", keybind_opts) 13 | vim.api.nvim_buf_set_keymap(0, "n", "t", ":ToggleTerm", keybind_opts) 14 | vim.api.nvim_buf_set_keymap(0, "n", "s", ":Telescope live_grep", keybind_opts) 15 | vim.api.nvim_buf_set_keymap(0, "n", "f", ":Telescope find_files", keybind_opts) 16 | 17 | -- Quit 18 | vim.api.nvim_buf_set_keymap(0, "n", "q", "q", keybind_opts) 19 | end, 20 | }) 21 | 22 | local button_hl = { 23 | { "Constant", 1, 4 }, 24 | { "Function", 5, 18 }, 25 | { "String", 19, 25 }, 26 | { "Comment", 25, 32 }, 27 | { "Constant", 32, 38 }, 28 | { "Function", 38, 50 }, 29 | { "String", 51, 55 }, 30 | } 31 | return { 32 | { 33 | type = "text", 34 | val = { 35 | " find file f │  terminal t", 36 | " lazygit g │  quit q", 37 | "鈴 lazy z │  search s", 38 | }, 39 | opts = { 40 | shrink_margin = false, 41 | position = "center", 42 | hl = { 43 | button_hl, button_hl, button_hl, 44 | } 45 | }, 46 | }, 47 | } 48 | end 49 | 50 | return { type = "group", val = btns }; 51 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/dash/docker.lua: -------------------------------------------------------------------------------- 1 | -- Docker Section -- 2 | 3 | local DOCKER_CONTAINER_INIT = " Loading docker containers... " 4 | local docker_containers = DOCKER_CONTAINER_INIT 5 | 6 | function docker() 7 | function LoadDockerContainers() 8 | if docker_containers == DOCKER_CONTAINER_INIT then 9 | vim.fn.jobstart( 10 | "docker ps --format 'table {{.Image}}\t{{.ID}}\t{{.Status}}'", 11 | { on_stdout = ContainerCallback, stdout_buffered = true } 12 | ) 13 | end 14 | pcall(vim.cmd.AlphaRedraw) 15 | end 16 | 17 | vim.api.nvim_create_autocmd({ "User" }, { 18 | pattern = { "LazyVimStarted" }, 19 | callback = LoadDockerContainers, 20 | }) 21 | 22 | function ContainerCallback(job_id, data, event) 23 | if job_id > 0 then 24 | docker_containers = data 25 | pcall(vim.cmd.AlphaRedraw) 26 | end 27 | end 28 | 29 | return { 30 | { 31 | type = "text", 32 | val = docker_containers, 33 | opts = { 34 | shrink_margin = false, 35 | position = "center", 36 | hl = "SpecialComment", 37 | }, 38 | }, 39 | } 40 | end 41 | 42 | return { type = "group", val = docker }; 43 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/dash/ghprs.lua: -------------------------------------------------------------------------------- 1 | -- Github PRs Section -- 2 | 3 | local GITHUB_PR_INIT = " Loading github pull requests... " 4 | local github_prs = GITHUB_PR_INIT 5 | 6 | local ghlist = "gh pr list -R ethereum-optimism/optimism -L 1000 -a '@me' " 7 | local ghjson = "--json number,headRefName,state,title " 8 | local ghtemplate = "--template '{{range .}}{{tablerow (printf \"#%v\" .number) .title}}{{tablerow .state .headRefName}}{{end}}' " 9 | local ghgrep = "| grep '^'" 10 | 11 | function github() 12 | function LoadGithubPrs() 13 | if github_prs == GITHUB_PR_INIT then 14 | vim.fn.jobstart( 15 | ghlist .. ghjson .. ghtemplate .. ghgrep, 16 | { on_stdout = GithubPrCallback, stdout_buffered = true } 17 | ) 18 | end 19 | pcall(vim.cmd.AlphaRedraw) 20 | end 21 | 22 | vim.api.nvim_create_autocmd({ "User" }, { 23 | pattern = { "LazyVimStarted" }, 24 | callback = LoadGithubPrs, 25 | }) 26 | 27 | function GithubPrCallback(job_id, data, event) 28 | if job_id > 0 then 29 | github_prs = data 30 | pcall(vim.cmd.AlphaRedraw) 31 | end 32 | end 33 | 34 | return { 35 | { 36 | type = "text", 37 | val = github_prs, 38 | opts = { 39 | align_shortcut = "left", 40 | shrink_margin = false, 41 | position = "center", 42 | hl = "Question", 43 | }, 44 | }, 45 | } 46 | end 47 | 48 | return { type = "group", val = github }; 49 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/dash/head.lua: -------------------------------------------------------------------------------- 1 | -- Section Header -- 2 | 3 | local headers = require "user.plugs.dash.headers" 4 | math.randomseed(os.time()) 5 | 6 | return { 7 | type = "text", 8 | val = headers[1], 9 | opts = { 10 | position = "center", 11 | shrink_margin = false, 12 | hl = "WarningMsg", 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/dash/headers.lua: -------------------------------------------------------------------------------- 1 | -- Headers -- 2 | return { 3 | { 4 | " ** ", 5 | " * ", 6 | " *** ", 7 | " * * ", 8 | " *************************** ", 9 | " * * ", 10 | " ** ** ", 11 | " * * ", 12 | " ** ", 13 | " * ", 14 | " ** ", 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/dash/info.lua: -------------------------------------------------------------------------------- 1 | -- Info Section -- 2 | 3 | local DOCKER_VERSION_INIT = " Loading docker version... " 4 | local docker_version = DOCKER_VERSION_INIT 5 | 6 | function infos() 7 | ---@diagnostic disable-next-line:undefined-field 8 | local datetime = os.date(" %A, %d %B %Y") 9 | local lazy_stats = require("lazy").stats() 10 | local ms = (math.floor(lazy_stats.startuptime * 100 + 0.5) / 100) 11 | local version = vim.version() 12 | 13 | function LoadDockerVersion() 14 | if docker_version == DOCKER_VERSION_INIT then 15 | vim.fn.jobstart( 16 | "docker version --format '{{.Server.Version}}'", 17 | { on_stdout = VersionCallback, stdout_buffered = true } 18 | ) 19 | end 20 | pcall(vim.cmd.AlphaRedraw) 21 | end 22 | 23 | function VersionCallback(job_id, data, event) 24 | if job_id > 0 then 25 | docker_version = " " .. data[1] 26 | pcall(vim.cmd.AlphaRedraw) 27 | end 28 | end 29 | 30 | -- Fetch the docker version in the background to prevent blocking -- 31 | vim.api.nvim_create_autocmd({ "User" }, { 32 | pattern = { "LazyVimStarted" }, 33 | callback = LoadDockerVersion, 34 | }) 35 | 36 | return { 37 | { 38 | type = "text", 39 | val = { 40 | datetime .. " ", 41 | " " .. lazy_stats.loaded .. "/" .. lazy_stats.count .. " in " .. ms .. " ms", 42 | " v" .. version.major .. "." .. version.minor .. "." .. version.patch .. " | " .. docker_version, 43 | }, 44 | opts = { 45 | shrink_margin = false, 46 | position = "center", 47 | hl = "WarningMsg", 48 | }, 49 | }, 50 | } 51 | end 52 | 53 | return { type = "group", val = infos }; 54 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/dash/init.lua: -------------------------------------------------------------------------------- 1 | -- Dashboard Config -- 2 | 3 | local section_header = require "user.plugs.dash.head" 4 | local section_buttons = require "user.plugs.dash.buttons" 5 | local section_info = require "user.plugs.dash.info" 6 | local docker_info = require "user.plugs.dash.docker" 7 | local github_prs = require "user.plugs.dash.ghprs" 8 | 9 | vim.b.miniindentscope_disable = true 10 | 11 | -- Automatically open neotree on startup -- 12 | local function open_tree() 13 | vim.cmd "Neotree" 14 | vim.cmd.wincmd "p" 15 | end 16 | vim.api.nvim_create_autocmd({ "User" }, { pattern = { "AlphaReady" }, callback = open_tree }) 17 | 18 | -- Builtin Neovim Highlight Groups -- 19 | -- https://neovim.io/doc/user/syntax.html#highlight-groups -- 20 | 21 | local dashconf = { 22 | layout = { 23 | { type = "padding", val = vim.fn.max { 2, vim.fn.floor(vim.fn.winheight(0) * 0.25) } }, 24 | section_header, 25 | { type = "padding", val = 1 }, 26 | { type = "padding", val = 1 }, 27 | section_buttons, 28 | { type = "padding", val = 1 }, 29 | section_info, 30 | { type = "padding", val = 1 }, 31 | docker_info, 32 | { type = "padding", val = 1 }, 33 | { 34 | type = "text", 35 | val = "󰓂 My Github PRs ", 36 | opts = { 37 | position = "center", 38 | hl = "ModeMsg", 39 | }, 40 | }, 41 | github_prs, 42 | } 43 | } 44 | 45 | return { 46 | "goolord/alpha-nvim", 47 | config = function() 48 | require("alpha").setup(dashconf) 49 | end 50 | }; 51 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/heirline.lua: -------------------------------------------------------------------------------- 1 | -- Heirline Statusline Configs -- 2 | local statusline_config = function(_, opts) 3 | local status = require "astronvim.utils.status" 4 | local mocha = require("catppuccin.palettes").get_palette("mocha") 5 | opts.statusline = { 6 | hl = { fg = "fg", bg = "bg" }, 7 | status.component.mode { 8 | hl = { fg = "#000000" }, 9 | mode_text = { icon = { kind = "VimIcon", padding = { right = 1, left = 1 } } }, 10 | surround = { 11 | separator = "left", 12 | color = function() 13 | return { 14 | main = status.hl.mode_bg(), 15 | } 16 | end, 17 | }, 18 | padding = { right = 1 }, 19 | update = "ModeChanged", 20 | }, 21 | status.component.git_branch { 22 | surround = { 23 | separator = "left", 24 | color = { 25 | main = mocha.surface0, 26 | right = mocha.green, 27 | }, 28 | condition = status.condition.is_git_repo, 29 | padding = { left = 1 }, 30 | }, 31 | hl = { fg = mocha.green }, 32 | padding = { right = 1 }, 33 | }, 34 | status.component.file_info { 35 | file_icon = { highlight = true, padding = { left = 0 } }, 36 | filetype = {}, 37 | filename = false, 38 | file_modified = false, 39 | surround = { separator = "left" }, 40 | padding = { right = 1 }, 41 | }, 42 | status.component.git_diff { 43 | surround = { separator = "none" }, 44 | }, 45 | status.component.diagnostics { 46 | padding = { left = 1 }, 47 | surround = { separator = "none" }, 48 | }, 49 | status.component.fill(), 50 | status.component.builder { 51 | { provider = "🧙" }, 52 | surround = { separator = "none", color = { main = "bg" } }, 53 | hl = { 54 | fg = mocha.overlay2, 55 | }, 56 | }, 57 | status.component.treesitter { 58 | str = { str = "🌲🪑", icon = { kind = "ActiveTS" }, padding = { left = 1 } }, 59 | surround = { 60 | separator = "right", 61 | color = { 62 | main = mocha.lavender, 63 | }, 64 | padding = { right = 1 }, 65 | }, 66 | }, 67 | status.component.nav { 68 | surround = { 69 | separator = "right", 70 | padding = { left = 1 }, 71 | }, 72 | ruler = { padding = { left = 1 } }, 73 | }, 74 | status.component.mode { 75 | surround = { 76 | separator = "right", 77 | color = function() 78 | return { 79 | main = status.hl.mode_bg(), 80 | } 81 | end, 82 | }, 83 | update = "ModeChanged", 84 | }, 85 | } 86 | return opts 87 | end 88 | 89 | return { "rebelot/heirline.nvim", opts = statusline_config }; 90 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/hop.lua: -------------------------------------------------------------------------------- 1 | -- Leap -- 2 | return { 3 | 'phaazon/hop.nvim', 4 | branch = 'v2', 5 | config = function() 6 | -- you can configure Hop the way you like here; see :h hop-config 7 | require("hop").setup({ keys = "etovxqpdygfblzhckisuran" }) 8 | end 9 | }; 10 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/illuminate.lua: -------------------------------------------------------------------------------- 1 | -- Highlight words under the cursor that match the provider regex 2 | return { 3 | "rrethy/vim-illuminate", 4 | config = { 5 | under_cursor = true, 6 | providers = { 7 | 'lsp', 8 | 'treesitter', 9 | 'regex', 10 | }, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- Rust Tools -- 3 | { "simrat39/rust-tools.nvim", lazy = false }, 4 | 5 | -- Huff Syntax Highlighting -- 6 | { "wuwe1/vim-huff", lazy = false }, 7 | 8 | -- Rainbow Brackets -- 9 | { "p00f/nvim-ts-rainbow", lazy = false }, 10 | 11 | -- Wakatime 12 | { "wakatime/vim-wakatime" }, 13 | 14 | -- Docker Tools -- 15 | { "kkvh/vim-docker-tools", lazy = false }, 16 | 17 | -- Disable nvim-dap 18 | { "mfussenegger/nvim-dap", enabled = false }, 19 | { "jay-babu/mason-nvim-dap.nvim", enabled = false }, 20 | { "rcarriga/nvim-dap-ui", enabled = false }, 21 | 22 | require("user.plugs.hop"), 23 | require("user.plugs.heirline"), 24 | require("user.plugs.dash"), 25 | require("user.plugs.which"), 26 | require("user.plugs.theme"), 27 | require("user.plugs.overseer"), 28 | require("user.plugs.cmp"), 29 | require("user.plugs.illuminate"), 30 | require("user.plugs.cheatsheet"), 31 | require("user.plugs.trouble"), 32 | require("user.plugs.tabline"), 33 | require("user.plugs.syntax"), 34 | require("user.plugs.noice"), 35 | require("user.plugs.copilot"), 36 | require("user.plugs.lsplines"), 37 | require("user.plugs.neotree"), 38 | require("user.plugs.terminal"), 39 | require("user.plugs.crates"), 40 | 41 | -- Replaced leap with hop 42 | -- require "user.plugs.leap", 43 | }; 44 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/leap.lua: -------------------------------------------------------------------------------- 1 | -- Leap -- 2 | return { 3 | "ggandor/leap.nvim", 4 | lazy = false, 5 | config = function() 6 | local leap = require "leap" 7 | leap.setup { 8 | highlight_unlabeled_phase_one_targets = false, 9 | } 10 | leap.add_default_mappings() 11 | end, 12 | }; 13 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/lsplines.lua: -------------------------------------------------------------------------------- 1 | -- LSP Lines Prettified Diagnostics -- 2 | return { 3 | "https://git.sr.ht/~whynothugo/lsp_lines.nvim", 4 | lazy = false, 5 | after = "mason-lspconfig.nvim", 6 | module = "lsp_lines", 7 | config = function() require("lsp_lines").setup() end, 8 | }; 9 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/neotree.lua: -------------------------------------------------------------------------------- 1 | -- Override NeoTree Position Config -- 2 | return { 3 | "nvim-neo-tree/neo-tree.nvim", 4 | keys = { { "E", "fE", desc = "Explorer NeoTree (cwd)", remap = true } }, 5 | opts = { 6 | filesystem = { 7 | bind_to_cwd = false, 8 | follow_current_file = true, 9 | filtered_items = { 10 | visible = true, 11 | hide_dotfiles = false, 12 | hide_gitignored = false, 13 | hide_hidden = false, 14 | }, 15 | }, 16 | window = { position = "right" }, 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/noice.lua: -------------------------------------------------------------------------------- 1 | -- Noice (cmdline, messages, popupmenu) -- 2 | -- https://github.com/folke/noice.nvim -- 3 | return { 4 | "folke/noice.nvim", 5 | after = "nui.nvim", 6 | -- dependencies = { 7 | -- -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries 8 | -- "MunifTanjim/nui.nvim", 9 | -- -- OPTIONAL: 10 | -- -- `nvim-notify` is only needed, if you want to use the notification view. 11 | -- -- If not available, we use `mini` as the fallback 12 | -- "rcarriga/nvim-notify", 13 | -- }, 14 | event = "VimEnter", 15 | config = function() 16 | require("noice").setup { 17 | presets = { 18 | command_palette = true, -- position the cmdline and popupmenu together 19 | lsp_doc_border = false, -- add a border to hover docs and signature help 20 | }, 21 | notify = { enabled = false }, 22 | messages = { enabled = false }, 23 | -- cmdline = { 24 | -- enabled = true, -- enables the Noice cmdline UI 25 | -- view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom 26 | -- opts = {}, 27 | -- format = { 28 | -- cmdline = { pattern = "^:", icon = "", lang = "vim" }, 29 | -- search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" }, 30 | -- search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" }, 31 | -- filter = { pattern = "^:%s!", icon = "$", lang = "bash" }, 32 | -- lua = { pattern = { "^:%slua%s+", "^:%slua%s=%s", "^:%s=%s" }, icon = "", lang = "lua" }, 33 | -- help = { pattern = "^:%she?l?p?%s+", icon = "" }, 34 | -- input = {}, 35 | -- }, 36 | -- }, 37 | -- messages = { 38 | -- -- NOTE: If you enable messages, then the cmdline is enabled automatically. 39 | -- -- This is a current Neovim limitation. 40 | -- enabled = true, -- enables the Noice messages UI 41 | -- view = "notify", -- default view for messages 42 | -- view_error = "notify", -- view for errors 43 | -- view_warn = "notify", -- view for warnings 44 | -- view_history = "messages", -- view for :messages 45 | -- view_search = "virtualtext", -- view for search count messages. Set to `false` to disable 46 | -- }, 47 | -- popupmenu = { 48 | -- enabled = true, -- enables the Noice popupmenu UI 49 | -- ---@type 'nui'|'cmp' 50 | -- backend = "nui", -- backend to use to show regular cmdline completions 51 | -- ---@type NoicePopupmenuItemKind|false 52 | -- -- Icons for completion item kinds (see defaults at noice.config.icons.kinds) 53 | -- kind_icons = {}, -- set to `false` to disable icons 54 | -- }, 55 | lsp = { 56 | -- override = { 57 | -- ["vim.lsp.util.convert_input_to_markdown_lines"] = true, 58 | -- ["vim.lsp.util.stylize_markdown"] = true, 59 | -- ["cmp.entry.get_documentation"] = true, 60 | -- }, 61 | hover = { 62 | enabled = false, 63 | }, 64 | signature = { 65 | enabled = false, 66 | }, 67 | }, 68 | } 69 | end, 70 | }; 71 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/overseer.lua: -------------------------------------------------------------------------------- 1 | -- Overseer Session Manager 2 | -- https://github.com/stevearc/overseer.nvim 3 | return { 4 | 'stevearc/overseer.nvim', 5 | opts = {}, 6 | }; 7 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/syntax.lua: -------------------------------------------------------------------------------- 1 | -- Syntax Tree Surfer -- 2 | return { 3 | "ziontee113/syntax-tree-surfer", 4 | after = "nvim-treesitter", 5 | config = function() 6 | require("syntax-tree-surfer").setup {} 7 | 8 | local opts = { noremap = true, silent = true } 9 | 10 | -- Normal Mode Swapping: 11 | -- Swap The Master Node relative to the cursor with it's siblings, Dot Repeatable 12 | vim.keymap.set("n", "vU", function() 13 | vim.opt.opfunc = "v:lua.STSSwapUpNormal_Dot" 14 | return "g@l" 15 | end, { silent = true, expr = true }) 16 | vim.keymap.set("n", "vD", function() 17 | vim.opt.opfunc = "v:lua.STSSwapDownNormal_Dot" 18 | return "g@l" 19 | end, { silent = true, expr = true }) 20 | 21 | -- Swap Current Node at the Cursor with it's siblings, Dot Repeatable 22 | vim.keymap.set("n", "vd", function() 23 | vim.opt.opfunc = "v:lua.STSSwapCurrentNodeNextNormal_Dot" 24 | return "g@l" 25 | end, { silent = true, expr = true }) 26 | vim.keymap.set("n", "vu", function() 27 | vim.opt.opfunc = "v:lua.STSSwapCurrentNodePrevNormal_Dot" 28 | return "g@l" 29 | end, { silent = true, expr = true }) 30 | 31 | -- Visual Selection from Normal Mode 32 | vim.keymap.set("n", "vx", "STSSelectMasterNode", opts) 33 | vim.keymap.set("n", "vn", "STSSelectCurrentNode", opts) 34 | 35 | -- Select Nodes in Visual Mode 36 | vim.keymap.set("x", "J", "STSSelectNextSiblingNode", opts) 37 | vim.keymap.set("x", "K", "STSSelectPrevSiblingNode", opts) 38 | vim.keymap.set("x", "H", "STSSelectParentNode", opts) 39 | vim.keymap.set("x", "L", "STSSelectChildNode", opts) 40 | 41 | -- Swapping Nodes in Visual Mode 42 | vim.keymap.set("x", "", "STSSwapNextVisual", opts) 43 | vim.keymap.set("x", "", "STSSwapPrevVisual", opts) 44 | end, 45 | }; 46 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/tabline.lua: -------------------------------------------------------------------------------- 1 | -- Tabline -- 2 | return { 3 | 'kdheepak/tabline.nvim', 4 | config = function() 5 | require'tabline'.setup { 6 | -- Defaults configuration options 7 | enable = true, 8 | options = { 9 | section_separators = {'', ''}, 10 | component_separators = {'', ''}, 11 | max_bufferline_percent = 66, 12 | show_tabs_always = false, -- this shows tabs only when there are more than one tab or if the first tab is named 13 | show_devicons = true, -- this shows devicons in buffer section 14 | show_bufnr = false, -- this appends [bufnr] to buffer section, 15 | show_filename_only = false, -- shows base filename only instead of relative path in filename 16 | modified_icon = "+ ", -- change the default modified icon 17 | modified_italic = false, -- set to true by default; this determines whether the filename turns italic if modified 18 | show_tabs_only = false, -- this shows only tabs instead of tabs + buffers 19 | } 20 | } 21 | vim.cmd[[ 22 | set guioptions-=e " Use showtabline in gui vim 23 | set sessionoptions+=tabpages,globals " store tabpages and globals in session 24 | ]] 25 | end, 26 | requires = { { 'hoob3rt/lualine.nvim', opt=true }, {'kyazdani42/nvim-web-devicons', opt = true} } 27 | }; 28 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/terminal.lua: -------------------------------------------------------------------------------- 1 | -- Override ToggleTerm Mapping -- 2 | return { 3 | "akinsho/toggleterm.nvim", 4 | opts = { open_mapping = [[]] }, 5 | }; 6 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/trouble.lua: -------------------------------------------------------------------------------- 1 | -- Trouble -- 2 | return { 3 | "folke/trouble.nvim", 4 | requires = "nvim-tree/nvim-web-devicons", 5 | config = function() 6 | require("trouble").setup { } 7 | end 8 | }; 9 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/plugs/which.lua: -------------------------------------------------------------------------------- 1 | -- WhichKey -- 2 | -- This plugin creates a popup with possible command suggestions -- 3 | -- see: https://github.com/folke/which-key.nvim -- 4 | return { 5 | "folke/which-key.nvim", 6 | event = "VeryLazy", 7 | init = function() 8 | vim.o.timeout = true 9 | vim.o.timeoutlen = 300 10 | end, 11 | opts = {} 12 | }; 13 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/polishing.lua: -------------------------------------------------------------------------------- 1 | -- Polish -- 2 | local polishing = function() 3 | require("notify").setup { background_colour = "#000000" } 4 | require("nvim-treesitter.configs").setup { 5 | highlight = { 6 | enable = true, 7 | }, 8 | rainbow = { 9 | enable = true, 10 | extended_mode = true, 11 | }, 12 | } 13 | end; 14 | 15 | return polishing; 16 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/solidity_lsp.lua: -------------------------------------------------------------------------------- 1 | -- Sets up the Nomic Solidity LSP 2 | -- Will be removed once the LSP is merged into the nvim-lspconfig repo 3 | local setup_lsp = function() 4 | -- Nomic Solidity LSP 5 | local configs = require('lspconfig.configs') 6 | local lspconfig = require('lspconfig') 7 | if not configs.solidity then 8 | configs.solidity = { 9 | default_config = { 10 | cmd = { "nomicfoundation-solidity-language-server", "--stdio" }, 11 | -- root_dir = lspconfig.util.find_git_ancestor, 12 | filetypes = { "solidity" }, 13 | single_file_support = true, 14 | }, 15 | } 16 | end 17 | 18 | -- Use an on_attach function to only map the following keys 19 | -- after the language server attaches to the current buffer 20 | local on_attach = function(_, bufnr) 21 | -- Enable completion triggered by 22 | vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') 23 | 24 | -- Mappings. 25 | -- See `:help vim.lsp.*` for documentation on any of the below functions 26 | local bufopts = { noremap = true, silent = true, buffer = bufnr } 27 | -- vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) 28 | vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) 29 | vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) 30 | -- vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) 31 | vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) 32 | -- vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) 33 | vim.keymap.set('n', 'lr', vim.lsp.buf.rename, bufopts) 34 | vim.keymap.set('n', 'la', vim.lsp.buf.code_action, bufopts) 35 | vim.keymap.set('n', 'lR', vim.lsp.buf.references, bufopts) 36 | vim.keymap.set('n', 'lf', function() vim.lsp.buf.format { async = true } end, bufopts) 37 | end 38 | 39 | -- lspconfig.solidity.setup { 40 | -- on_attach = on_attach, 41 | -- flags = { 42 | -- debounce_text_changes = 150, 43 | -- } 44 | -- } 45 | end 46 | 47 | return setup_lsp 48 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/updater.lua: -------------------------------------------------------------------------------- 1 | -- Updater -- 2 | -- These are AstroNvim repository updates 3 | local updater = { 4 | remote = "origin", 5 | channel = "nightly", 6 | version = "latest", 7 | branch = "nightly", 8 | commit = nil, 9 | pin_plugins = nil, 10 | skip_prompts = false, 11 | show_changelog = true, 12 | auto_quit = false, 13 | }; 14 | 15 | return updater; 16 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/utils/cargo.lua: -------------------------------------------------------------------------------- 1 | -- Cargo Helpers -- 2 | 3 | function CreatCargoVersionCallback(cargo) 4 | function LoadCargoVersion() 5 | if cargo.version == cargo.default then 6 | vim.fn.jobstart( 7 | "cargo --version | grep -Eo '[0-9]\\.[0-9]+\\.[0-9]+'", 8 | { on_stdout = CargoVersionCallback, stdout_buffered = true } 9 | ) 10 | end 11 | pcall(vim.cmd.AlphaRedraw) 12 | end 13 | 14 | function CargoVersionCallback(job_id, data, event) 15 | if job_id > 0 then 16 | cargo.version = " v" .. data[1] 17 | pcall(vim.cmd.AlphaRedraw) 18 | end 19 | end 20 | 21 | vim.api.nvim_create_autocmd({ "User" }, { 22 | pattern = { "LazyVimStarted" }, 23 | callback = LoadCargoVersion, 24 | }) 25 | end 26 | 27 | return CreatCargoVersionCallback; 28 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/utils/docker.lua: -------------------------------------------------------------------------------- 1 | -- Docker Helpers -- 2 | 3 | function CreatDockerVersionCallback(docker) 4 | function LoadDockerVersion() 5 | if docker.version == docker.default then 6 | vim.fn.jobstart( 7 | "docker version --format '{{.Server.Version}}'", 8 | { on_stdout = DockerVersionCallback, stdout_buffered = true } 9 | ) 10 | end 11 | pcall(vim.cmd.AlphaRedraw) 12 | end 13 | 14 | function DockerVersionCallback(job_id, data, event) 15 | if job_id > 0 then 16 | docker.version = " v" .. data[1] 17 | pcall(vim.cmd.AlphaRedraw) 18 | end 19 | end 20 | 21 | vim.api.nvim_create_autocmd({ "User" }, { 22 | pattern = { "LazyVimStarted" }, 23 | callback = LoadDockerVersion, 24 | }) 25 | end 26 | 27 | return CreatDockerVersionCallback; 28 | -------------------------------------------------------------------------------- /confs/nvim/lua/user/utils/golang.lua: -------------------------------------------------------------------------------- 1 | -- Golang Helpers -- 2 | 3 | function CreatGolangVersionCallback(golang) 4 | function LoadGolangVersion() 5 | if golang.version == golang.default then 6 | vim.fn.jobstart( 7 | "go version | grep -Eo '[0-9]\\.[0-9]+\\.[0-9]+'", 8 | { on_stdout = GolangVersionCallback, stdout_buffered = true } 9 | ) 10 | end 11 | pcall(vim.cmd.AlphaRedraw) 12 | end 13 | 14 | function GolangVersionCallback(job_id, data, event) 15 | if job_id > 0 then 16 | golang.version = " v" .. data[1] 17 | pcall(vim.cmd.AlphaRedraw) 18 | end 19 | end 20 | 21 | vim.api.nvim_create_autocmd({ "User" }, { 22 | pattern = { "LazyVimStarted" }, 23 | callback = LoadGolangVersion, 24 | }) 25 | end 26 | 27 | return CreatGolangVersionCallback; 28 | -------------------------------------------------------------------------------- /confs/nvim/lua/utils/cargo.lua: -------------------------------------------------------------------------------- 1 | -- Cargo Helpers -- 2 | 3 | function CreatCargoVersionCallback(cargo) 4 | function LoadCargoVersion() 5 | if cargo.version == cargo.default then 6 | vim.fn.jobstart( 7 | "cargo --version | grep -Eo '[0-9]\\.[0-9]+\\.[0-9]+'", 8 | { on_stdout = CargoVersionCallback, stdout_buffered = true } 9 | ) 10 | end 11 | pcall(vim.cmd.AlphaRedraw) 12 | end 13 | 14 | function CargoVersionCallback(job_id, data, event) 15 | if job_id > 0 then 16 | cargo.version = " v" .. data[1] 17 | pcall(vim.cmd.AlphaRedraw) 18 | end 19 | end 20 | 21 | vim.api.nvim_create_autocmd({ "User" }, { 22 | pattern = { "LazyVimStarted" }, 23 | callback = LoadCargoVersion, 24 | }) 25 | end 26 | 27 | return CreatCargoVersionCallback; 28 | -------------------------------------------------------------------------------- /confs/nvim/lua/utils/docker.lua: -------------------------------------------------------------------------------- 1 | -- Docker Helpers -- 2 | 3 | function CreatDockerVersionCallback(docker) 4 | function LoadDockerVersion() 5 | if docker.version == docker.default then 6 | vim.fn.jobstart( 7 | "docker version --format '{{.Server.Version}}'", 8 | { on_stdout = DockerVersionCallback, stdout_buffered = true } 9 | ) 10 | end 11 | pcall(vim.cmd.AlphaRedraw) 12 | end 13 | 14 | function DockerVersionCallback(job_id, data, event) 15 | if job_id > 0 then 16 | docker.version = " v" .. data[1] 17 | pcall(vim.cmd.AlphaRedraw) 18 | end 19 | end 20 | 21 | vim.api.nvim_create_autocmd({ "User" }, { 22 | pattern = { "LazyVimStarted" }, 23 | callback = LoadDockerVersion, 24 | }) 25 | end 26 | 27 | return CreatDockerVersionCallback; 28 | -------------------------------------------------------------------------------- /confs/nvim/lua/utils/golang.lua: -------------------------------------------------------------------------------- 1 | -- Golang Helpers -- 2 | 3 | function CreatGolangVersionCallback(golang) 4 | function LoadGolangVersion() 5 | if golang.version == golang.default then 6 | vim.fn.jobstart( 7 | "go version | grep -Eo '[0-9]\\.[0-9]+\\.[0-9]+'", 8 | { on_stdout = GolangVersionCallback, stdout_buffered = true } 9 | ) 10 | end 11 | pcall(vim.cmd.AlphaRedraw) 12 | end 13 | 14 | function GolangVersionCallback(job_id, data, event) 15 | if job_id > 0 then 16 | golang.version = " v" .. data[1] 17 | pcall(vim.cmd.AlphaRedraw) 18 | end 19 | end 20 | 21 | vim.api.nvim_create_autocmd({ "User" }, { 22 | pattern = { "LazyVimStarted" }, 23 | callback = LoadGolangVersion, 24 | }) 25 | end 26 | 27 | return CreatGolangVersionCallback; 28 | -------------------------------------------------------------------------------- /confs/sketchybar/colors.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | BACKGROUND="0xAA1E1E2E" #1E1E2E 4 | FOREGROUND="0xFFCDD6F4" #CDD6F4 5 | 6 | SELECTION_BACKGROUND="0xFF2D4F67" #2D4F67 7 | SELECTION_FOREGROUND="0xFFC8C093" #C8C093 8 | URL_COLOR="0xFF72a7bc" #72a7bc 9 | CURSOR="0xFFc8c093" #c8c093 10 | 11 | ACTIVE_TAB_BACKGROUND="0xFFCDD6F4" #CDD6F4 12 | ACTIVE_TAB_FOREGROUND="0xFFC8C093" #C8C093 13 | INACTIVE_TAB_BACKGROUND="0xFFCDD6F4" #1F1F28 14 | INACTIVE_TAB_FOREGROUND="0xFFCDD6F4" #CDD6F4 15 | TAB_BAR_BACKGROUND="0xFF1E1E2E" #1E1E2E 16 | 17 | BLACK_BORDER="0xe0282828" #282828 18 | YELLOW_BORDER="0xe0d79921" #d79921 19 | RED_BORDER="0xe0cc241d" #cc241d 20 | GREEN_BORDER="0xe098971a" #98971a 21 | BLUE_BORDER="0xe0458588" #458588 22 | PINK_BORDER="0xe0d892aa" #d892aa 23 | CYAN_BORDER="0xe0689d6a" #689d6a 24 | BROWN_BORDER="0xe0a89984" #a89984 25 | PURPLE_BORDER="0xe0C3B1E1" #C3B1E1 26 | 27 | COLOR0="0xFF16161D" #16161D 28 | COLOR1="0xFFC34043" #C34043 29 | COLOR2="0xFF76946A" #76946A 30 | COLOR3="0xFFC0A36E" #C0A36E 31 | COLOR4="0xFF7E9CD8" #7E9CD8 32 | COLOR5="0xFF957FB8" #957FB8 33 | COLOR6="0xFF6A9589" #6A9589 34 | COLOR7="0xFFC8C093" #C8C093 35 | COLOR8="0xFF727169" #727169 36 | COLOR9="0xFFE82424" #E82424 37 | COLOR10="0xFF98BB6C" #98BB6C 38 | COLOR11="0xFFE6C384" #E6C384 39 | COLOR12="0xFF7FB4CA" #7FB4CA 40 | COLOR13="0xFF938AA9" #938AA9 41 | COLOR14="0xFF7AA89F" #7AA89F 42 | COLOR15="0xFFDCD7BA" #DCD7BA 43 | COLOR16="0xFFFFA066" #FFA066 44 | COLOR17="0xFFFF5D62" #FF5D62 45 | -------------------------------------------------------------------------------- /confs/sketchybar/items/app.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | 5 | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" 6 | 7 | opts=( 8 | update_freq=10 9 | script="$PLUGIN_DIR/front_app.sh" 10 | icon.drawing=off 11 | background.color="$BACKGROUND" 12 | padding_left=2 13 | icon.padding_left=2 14 | icon.padding_right=2 15 | label.padding_left=6 16 | label.padding_right=6 17 | padding_right=8 18 | background.height=22 19 | background.corner_radius=8 20 | background.border_width=0 21 | ) 22 | 23 | sketchybar --add item app left --set app "${opts[@]}" --subscribe app front_app_switched 24 | -------------------------------------------------------------------------------- /confs/sketchybar/items/apple.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | 5 | apple_logo=( 6 | icon="" 7 | padding_left=0 8 | icon.padding_left=12 9 | icon.padding_right=12 10 | label.padding_right=0 11 | label.padding_left=0 12 | # icon.color=$RED_BORDER 13 | click_script="open -a 'System Preferences'; sketchybar --set apple.logo popup.drawing=off" 14 | background.color="$BACKGROUND" 15 | background.corner_radius=8 16 | # background.border_color="$RED_BORDER" 17 | ) 18 | 19 | sketchybar --add item apple left --set apple "${apple_logo[@]}" 20 | -------------------------------------------------------------------------------- /confs/sketchybar/items/battery.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | 5 | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" 6 | 7 | opts=( 8 | update_freq=120 9 | script="$PLUGIN_DIR/battery.sh" 10 | icon.padding_left=12 11 | icon.padding_right=2 12 | icon.color="$COLOR14" 13 | label.padding_left=4 14 | label.padding_right=12 15 | background.color="$BACKGROUND" 16 | background.corner_radius=8 17 | background.border_color="$COLOR14" 18 | ) 19 | 20 | sketchybar --add item battery right --set battery "${opts[@]}" --subscribe battery system_woke power_source_change 21 | -------------------------------------------------------------------------------- /confs/sketchybar/items/calendar.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" 5 | 6 | opts=( 7 | icon= 8 | icon.color="$BROWN_BORDER" 9 | script="$PLUGIN_DIR/calendar.sh" 10 | click_script="open -a 'Calendar'; sketchybar --set calendar popup.drawing=off" 11 | icon.padding_left=12 12 | icon.padding_right=12 13 | label.padding_left=0 14 | label.padding_right=0 15 | label.drawing=off 16 | background.color="$BACKGROUND" 17 | background.corner_radius=8 18 | background.border_color="$BROWN_BORDER" 19 | ) 20 | 21 | sketchybar --add item calendar right --set calendar "${opts[@]}" 22 | -------------------------------------------------------------------------------- /confs/sketchybar/items/clock.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | 5 | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" 6 | 7 | clock=( 8 | icon=󰅐 9 | update_freq=10 10 | script="$PLUGIN_DIR/clock.sh" 11 | icon.padding_left=12 12 | icon.padding_right=2 13 | icon.color="$PURPLE_BORDER" 14 | label.padding_left=4 15 | label.padding_right=12 16 | background.color="$BACKGROUND" 17 | background.corner_radius=8 18 | background.border_color="$PURPLE_BORDER" 19 | ) 20 | 21 | sketchybar --add item clock right --set clock "${clock[@]}" 22 | -------------------------------------------------------------------------------- /confs/sketchybar/items/docker.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | 5 | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" 6 | 7 | opts=( 8 | icon= 9 | update_freq=60 10 | script="$PLUGIN_DIR/docker.sh" 11 | click_script="open /Applications/Docker.app" 12 | icon.padding_left=12 13 | icon.padding_right=12 14 | label.padding_left=0 15 | label.padding_right=0 16 | background.color="$BACKGROUND" 17 | background.corner_radius=8 18 | background.border_color="$COLOR12" 19 | ) 20 | 21 | sketchybar --add item docker right --set docker "${opts[@]}" 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /confs/sketchybar/items/navigator.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | ITEM_DIR="$HOME/.config/sketchybar/items" 5 | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" 6 | 7 | opts=( 8 | background.corner_radius=8 9 | background.height=22 10 | background.padding_top=20 11 | background.color=0x30ffffff 12 | background.drawing=off 13 | background.border_width=0 14 | label.drawing=off 15 | script="$PLUGIN_DIR/space.sh" 16 | ) 17 | 18 | SPACE_ICONS=("2" "3" "4" "5" "6" "7" "8" "9" "10") 19 | 20 | spaces=( 21 | space.1 22 | ) 23 | sketchybar --add space space.1 left \ 24 | --set space.1 associated_space=1 \ 25 | icon=1 \ 26 | click_script="yabai -m space --focus 1" \ 27 | background.padding_left=12 \ 28 | background.padding_right=2 \ 29 | "${opts[@]}" 30 | for i in "${!SPACE_ICONS[@]}" 31 | do 32 | sid=$(($i+2)) 33 | spaces+=(space.$sid) 34 | sketchybar --add space space.$sid left \ 35 | --set space.$sid associated_space=$sid \ 36 | icon=${SPACE_ICONS[i]} \ 37 | click_script="yabai -m space --focus $sid" \ 38 | background.padding_left=8 \ 39 | background.padding_right=2 \ 40 | "${opts[@]}" 41 | done 42 | 43 | source "$ITEM_DIR/space_separator.sh" 44 | source "$ITEM_DIR/app.sh" 45 | 46 | sketchybar --add bracket spaces "${spaces[@]}" space_separator app \ 47 | --set spaces background.color=$BACKGROUND \ 48 | background.corner_radius=8 \ 49 | background.border_color="$YELLOW_BORDER" 50 | -------------------------------------------------------------------------------- /confs/sketchybar/items/raycast.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" 5 | 6 | opts=( 7 | icon= 8 | icon.color="$PURPLE_BORDER" 9 | script="$PLUGIN_DIR/raycast.sh" 10 | click_script="open -a 'Raycast'; sketchybar --set raycast popup.drawing=off" 11 | icon.padding_left=12 12 | icon.padding_right=12 13 | label.padding_left=0 14 | label.padding_right=0 15 | label.drawing=off 16 | background.color="$BACKGROUND" 17 | background.corner_radius=8 18 | background.border_color="$PURPLE_BORDER" 19 | ) 20 | 21 | sketchybar --add item raycast left --set raycast "${opts[@]}" 22 | -------------------------------------------------------------------------------- /confs/sketchybar/items/space_separator.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | 5 | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" 6 | 7 | opts=( 8 | icon= 9 | padding_left=6 10 | padding_right=6 11 | label.drawing=off 12 | icon.color="$YELLOW_BORDER" 13 | ) 14 | 15 | sketchybar --add item space_separator left --set space_separator "${opts[@]}" 16 | -------------------------------------------------------------------------------- /confs/sketchybar/items/volume.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | 5 | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" 6 | 7 | opts=( 8 | script="$PLUGIN_DIR/volume.sh" 9 | click_script="$PLUGIN_DIR/sound.sh" 10 | icon.padding_left=12 11 | icon.padding_right=12 12 | icon.color="0xFFCDD6F4" 13 | label.padding_left=0 14 | label.padding_right=0 15 | label.drawing=off 16 | background.color="$BACKGROUND" 17 | background.corner_radius=8 18 | background.border_color="0xFFCDD6F4" 19 | ) 20 | 21 | sketchybar --add item volume right --set volume "${opts[@]}" --subscribe volume volume_change 22 | -------------------------------------------------------------------------------- /confs/sketchybar/items/vpn.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | 5 | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" 6 | 7 | opts=( 8 | icon=󱗼 9 | update_freq=60 10 | script="$PLUGIN_DIR/vpn.sh" 11 | click_script="open /Applications/Tailscale.app" 12 | icon.padding_left=12 13 | icon.padding_right=2 14 | label.padding_right=12 15 | background.color="$BACKGROUND" 16 | background.corner_radius=8 17 | background.border_color="$PINK_BORDER" 18 | ) 19 | 20 | sketchybar --add item vpn right --set vpn "${opts[@]}" 21 | -------------------------------------------------------------------------------- /confs/sketchybar/items/wifi.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | 5 | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" 6 | 7 | opts=( 8 | icon=󰖩 9 | script="$PLUGIN_DIR/wifi.sh" 10 | click_script="open /System/Library/PreferencePanes/Network.prefPane/" 11 | icon.padding_left=12 12 | icon.padding_right=2 13 | label.padding_left=4 14 | label.padding_right=12 15 | background.color="$BACKGROUND" 16 | background.corner_radius=8 17 | background.border_color="$COLOR11" 18 | ) 19 | 20 | sketchybar --add item wifi right --set wifi "${opts[@]}" --subscribe wifi wifi_change 21 | -------------------------------------------------------------------------------- /confs/sketchybar/plugins/battery.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | 5 | PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1) 6 | CHARGING=$(pmset -g batt | grep 'AC Power') 7 | 8 | if [ $PERCENTAGE = "" ]; then 9 | exit 0 10 | fi 11 | 12 | case ${PERCENTAGE} in 13 | 9[0-9]|100) ICON="" COLOR=$COLOR14 14 | ;; 15 | [6-8][0-9]) ICON="" COLOR=$COLOR14 16 | ;; 17 | [3-5][0-9]) ICON="" COLOR=$COLOR14 18 | ;; 19 | [1-2][0-9]) ICON="" COLOR=$COLOR9 20 | ;; 21 | *) ICON="" COLOR=$COLOR9 22 | esac 23 | 24 | if [[ $CHARGING != "" ]]; then 25 | ICON="" COLOR=$COLOR16 26 | fi 27 | 28 | # The item invoking this script (name $NAME) will get its icon and label 29 | # updated with the current battery status 30 | sketchybar --set $NAME icon="$ICON" label="${PERCENTAGE}%" icon.color="$COLOR" 31 | -------------------------------------------------------------------------------- /confs/sketchybar/plugins/clock.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # The $NAME variable is passed from sketchybar and holds the name of 4 | # the item invoking this script: 5 | # https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting 6 | 7 | source $HOME/.config/sketchybar/colors.sh 8 | 9 | label="$(date '+%I:%M %m/%d')" 10 | 11 | sketchybar --set $NAME label="$label" 12 | -------------------------------------------------------------------------------- /confs/sketchybar/plugins/docker.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | 5 | if (/usr/local/bin/docker stats --no-stream &> /dev/null) then 6 | sketchybar --set $NAME icon="" icon.color="$COLOR12" 7 | else 8 | sketchybar --set $NAME icon="" icon.color="$FOREGROUND" 9 | # sketchybar --remove $NAME 10 | fi 11 | -------------------------------------------------------------------------------- /confs/sketchybar/plugins/front_app.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | QUERIED_APP=$(yabai -m query --windows --window | jq ".app") 4 | QUERIED_APP=${QUERIED_APP//\"/} 5 | INFO=${INFO:-$QUERIED_APP} 6 | INFO=${INFO:-""} 7 | 8 | sketchybar --set $NAME label="$INFO" 9 | -------------------------------------------------------------------------------- /confs/sketchybar/plugins/sound.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | CURRENT_VOLUME=$(osascript -e 'output volume of (get volume settings)') 4 | 5 | if [ $CURRENT_VOLUME -eq 0 ]; then 6 | osascript -e "set Volume 3" 7 | else 8 | osascript -e "set Volume 0" 9 | fi 10 | -------------------------------------------------------------------------------- /confs/sketchybar/plugins/space.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # The $SELECTED variable is available for space components and indicates if 4 | # the space invoking this script (with name: $NAME) is currently selected: 5 | # https://felixkratz.github.io/SketchyBar/config/components#space----associate-mission-control-spaces-with-an-item 6 | 7 | sketchybar --set $NAME background.drawing=$SELECTED 8 | -------------------------------------------------------------------------------- /confs/sketchybar/plugins/spotify.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | next () 4 | { 5 | osascript -e 'tell application "Music" to play next track' 6 | } 7 | 8 | back () 9 | { 10 | osascript -e 'tell application "Music" to play previous track' 11 | } 12 | 13 | play () 14 | { 15 | osascript -e 'tell application "Music" to playpause' 16 | } 17 | 18 | repeat () 19 | { 20 | REPEAT=$(osascript -e 'tell application "Music" to get repeating') 21 | if [ "$REPEAT" = "false" ]; then 22 | sketchybar -m --set music.repeat icon.highlight=on 23 | osascript -e 'tell application "Music" to set repeating to true' 24 | else 25 | sketchybar -m --set music.repeat icon.highlight=off 26 | osascript -e 'tell application "Music" to set repeating to false' 27 | fi 28 | } 29 | 30 | shuffle () 31 | { 32 | SHUFFLE=$(osascript -e 'tell application "Music" to get shuffling') 33 | if [ "$SHUFFLE" = "false" ]; then 34 | sketchybar -m --set music.shuffle icon.highlight=on 35 | osascript -e 'tell application "Music" to set shuffling to true' 36 | else 37 | sketchybar -m --set music.shuffle icon.highlight=off 38 | osascript -e 'tell application "Music" to set shuffling to false' 39 | fi 40 | } 41 | 42 | update () 43 | { 44 | PLAYING=1 45 | if [ "$(echo "$INFO" | jq -r '.["Player State"]')" = "Playing" ]; then 46 | PLAYING=0 47 | TRACK="$(echo "$INFO" | jq -r .Name | cut -c1-25)" 48 | ARTIST="$(echo "$INFO" | jq -r .Artist | cut -c1-25)" 49 | ALBUM="$(echo "$INFO" | jq -r .Album | cut -c1-25)" 50 | SHUFFLE=$(osascript -e 'tell application "Music" to get shuffling') 51 | REPEAT=$(osascript -e 'tell application "Music" to get repeating') 52 | COVER=$(osascript -e 'tell application "Music" to get artwork url of current track') 53 | fi 54 | 55 | args=() 56 | if [ $PLAYING -eq 0 ]; then 57 | curl -s --max-time 20 "$COVER" -o /tmp/cover.jpg 58 | if [ "$ARTIST" == "" ]; then 59 | args+=(--set music.title label="$TRACK" drawing=on \ 60 | --set music.artist label="$ALBUM" drawing=on ) 61 | else 62 | args+=(--set music.title label="$TRACK" drawing=on \ 63 | --set music.artist label="$ARTIST" drawing=on) 64 | fi 65 | args+=(--set music.play icon=􀊆 \ 66 | --set music.shuffle icon.highlight=$SHUFFLE \ 67 | --set music.repeat icon.highlight=$REPEAT \ 68 | --set music.cover popup.background.image="/tmp/cover.jpg" \ 69 | popup.background.color=0x000000 \ 70 | --set music drawing=on ) 71 | else 72 | args+=(--set music.title drawing=off \ 73 | --set music.artist drawing=off \ 74 | --set music.cover popup.drawing=off \ 75 | --set music.play icon=􀊄 ) 76 | fi 77 | sketchybar -m "${args[@]}" 78 | } 79 | 80 | mouse_clicked () { 81 | case "$NAME" in 82 | "music.next") next 83 | ;; 84 | "music.back") back 85 | ;; 86 | "music.play") play 87 | ;; 88 | "music.shuffle") shuffle 89 | ;; 90 | "music.repeat") repeat 91 | ;; 92 | *) exit 93 | ;; 94 | esac 95 | } 96 | 97 | popup () { 98 | sketchybar --set music.cover popup.drawing=$1 99 | } 100 | 101 | case "$SENDER" in 102 | "mouse.clicked") mouse_clicked 103 | ;; 104 | "mouse.entered") popup on 105 | ;; 106 | "mouse.exited"|"mouse.exited.global") popup off 107 | ;; 108 | *) update 109 | ;; 110 | esac 111 | -------------------------------------------------------------------------------- /confs/sketchybar/plugins/volume.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # The volume_change event supplies a $INFO variable in which the current volume 4 | # percentage is passed to the script. 5 | 6 | VOLUME=$INFO 7 | 8 | case $VOLUME in 9 | [6-9][0-9]|100) ICON="󰕾" 10 | ;; 11 | [3-5][0-9]) ICON="󰖀" 12 | ;; 13 | [1-9]|[1-2][0-9]) ICON="󰕿" 14 | ;; 15 | *) ICON="󰖁" 16 | esac 17 | 18 | sketchybar --set $NAME icon="$ICON" 19 | -------------------------------------------------------------------------------- /confs/sketchybar/plugins/vpn.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | 5 | TAILSCALE_BIN=$(which tailscale) 6 | TAILSCALE_BIN=${TAILSCALE_BIN:-"/Applications/Tailscale.app/Contents/MacOS/Tailscale"} 7 | TAILSCALE_STATUS=$($TAILSCALE_BIN status --json | jq ".Self.Online") 8 | TAILSCALE_HOST=$($TAILSCALE_BIN status --json | jq ".Self.HostName") 9 | TAILSCALE_HOST=${TAILSCALE_HOST//\"/} 10 | TAILSCALE_LABEL=${TAILSCALE_HOST:-"Connected"} 11 | 12 | echo $TAILSCALE_STATUS 13 | echo $TAILSCALE_HOST 14 | echo $TAILSCALE_LABEL 15 | 16 | if [[ $TAILSCALE_STATUS == "true" ]]; then 17 | sketchybar --set $NAME icon=󱗼 label="${TAILSCALE_LABEL}" icon.color="$PINK_BORDER" 18 | else 19 | sketchybar --set $NAME icon=󱗼 icon.color="$FOREGROUND" label.color="$FOREGROUND" 20 | # sketchybar --remove $NAME 21 | fi 22 | -------------------------------------------------------------------------------- /confs/sketchybar/plugins/wifi.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | source $HOME/.config/sketchybar/colors.sh 4 | 5 | WIFI=$(networksetup -getairportnetwork en0 | cut -c 24-) 6 | WIFI=${WIFI:-"Not Connected"} 7 | WIFI=${INFO:-$WIFI} 8 | 9 | sketchybar --set $NAME label="${WIFI}" icon.color="$COLOR11" 10 | -------------------------------------------------------------------------------- /confs/sketchybar/sketchybarrc: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | FONT="MesloLGS Nerd Font" # Font used for all of sketchybar 4 | ITEM_DIR="$HOME/.config/sketchybar/items" # Directory where the items are configured 5 | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" # Directory where plugin scripts are stored 6 | source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors 7 | 8 | # Unload the macOS on screen indicator overlay for volume change 9 | launchctl unload -F /System/Library/LaunchAgents/com.apple.OSDUIHelper.plist > /dev/null 2>&1 & 10 | 11 | # Set up the general bar properties 12 | bar=( 13 | height=100 14 | position=top 15 | notch_width=188 16 | sticky=on 17 | padding_left=48 18 | padding_top=50 19 | padding_right=48 20 | color=0x00000000 21 | ) 22 | sketchybar --bar "${bar[@]}" 23 | 24 | # Set up the default item properties 25 | # https://felixkratz.github.io/SketchyBar/config/items 26 | default=( 27 | icon.font="$FONT:Regular:11.0" 28 | icon.color="$FOREGROUND" 29 | label.font="$FONT:Regular:11.0" 30 | label.color="$FOREGROUND" 31 | background.height=34 32 | background.border_color="0xffe1e3e4" 33 | background.border_width=2 34 | padding_left=3 35 | padding_right=3 36 | label.padding_left=6 37 | label.padding_right=6 38 | icon.padding_left=6 39 | icon.padding_right=6 40 | ) 41 | sketchybar --default "${default[@]}" 42 | 43 | # Left hand side items 44 | source "$ITEM_DIR/apple.sh" 45 | source "$ITEM_DIR/raycast.sh" 46 | source "$ITEM_DIR/navigator.sh" 47 | source "$ITEM_DIR/spotify.sh" 48 | 49 | # Right hand side items 50 | source "$ITEM_DIR/clock.sh" 51 | source "$ITEM_DIR/wifi.sh" 52 | source "$ITEM_DIR/volume.sh" 53 | source "$ITEM_DIR/battery.sh" 54 | source "$ITEM_DIR/vpn.sh" 55 | source "$ITEM_DIR/calendar.sh" 56 | source "$ITEM_DIR/docker.sh" 57 | 58 | # Finalizing Setup 59 | sketchybar --update 60 | 61 | # Dynamic Island 62 | dynamic-island-sketchybar 63 | -------------------------------------------------------------------------------- /confs/tmux/.tmux.conf: -------------------------------------------------------------------------------- 1 | # Make my neovim themes work >_> 2 | set -g default-terminal "tmux-256color" 3 | set -ga terminal-overrides ",*256col*:Tc" 4 | 5 | # Override the leader to Ctrl + space 6 | unbind C-Space 7 | set -g prefix C-Space 8 | bind C-Space send-prefix 9 | 10 | # Enable mouse support 11 | set -g mouse on 12 | 13 | # Expand the history limit 14 | set-option -g history-limit 5000 15 | 16 | # Prevent indexing gaps on window closure 17 | set -g renumber-windows on 18 | 19 | bind Space last-window 20 | bind-key b switch-client -l 21 | 22 | # scratch notes 23 | bind-key h split-window -h "nvim ~/scratch/notes.md" 24 | 25 | # Resizing options 26 | bind -r C-j resize-pane -D 15 27 | bind -r C-k resize-pane -U 15 28 | bind -r C-h resize-pane -L 15 29 | bind -r C-l resize-pane -R 15 30 | 31 | # Persist path in new windows 32 | bind c new-window -c "#{pane_current_path}" 33 | 34 | # Set the horizontal and vertical split identifiers 35 | bind-key "|" split-window -h -c "#{pane_current_path}" 36 | bind-key "\\" split-window -fh -c "#{pane_current_path}" 37 | bind-key "-" split-window -v -c "#{pane_current_path}" 38 | bind-key "_" split-window -fv -c "#{pane_current_path}" 39 | 40 | # Mark jumping 41 | bind \` switch-client -t'{marked}' 42 | 43 | # Enable the plugin manager 44 | set -g @plugin 'tmux-plugins/tpm' 45 | set -g @plugin 'tmux-plugins/tmux-sensible' 46 | 47 | # catppuccin theme 48 | set -g @plugin 'catppuccin/tmux' 49 | 50 | set -g @catppuccin_flavour "mocha" 51 | 52 | # Left side of status bar 53 | set -g @catppuccin_window_left_separator "" 54 | set -g @catppuccin_window_right_separator " " 55 | set -g @catppuccin_window_middle_separator " █" 56 | set -g @catppuccin_window_number_position "right" 57 | 58 | set -g @catppuccin_window_default_fill "number" 59 | set -g @catppuccin_window_default_text "#W" 60 | 61 | set -g @catppuccin_window_current_fill "number" 62 | set -g @catppuccin_window_current_text "#W" 63 | 64 | set -g @catppuccin_status_modules "application session battery date_time host" 65 | set -g @catppuccin_status_left_separator "" 66 | set -g @catppuccin_status_right_separator " " 67 | set -g @catppuccin_status_right_separator_inverse "yes" 68 | set -g @catppuccin_status_fill "all" 69 | set -g @catppuccin_status_connect_separator "no" 70 | 71 | # Battery plugin 72 | set -g @plugin 'tmux-plugins/tmux-battery' 73 | 74 | # Enable manual session saves and restores 75 | set -g @plugin 'tmux-plugins/tmux-resurrect' 76 | set -g @resurrect-strategy-vim 'session' 77 | set -g @resurrect-strategy-nvim 'session' 78 | 79 | # Automatically saves and restore tmux sessions 80 | set -g @plugin 'tmux-plugins/tmux-continuum' 81 | set -g @continuum-restore 'on' 82 | set -g @continuum-save-interval '1' 83 | 84 | # Initialize TMUX plugin manager 85 | # This must be the last line of tmux.conf 86 | run '~/.tmux/plugins/tpm/tpm' 87 | 88 | # Transparent statusbar background 89 | set -g status-style "bg=default" 90 | -------------------------------------------------------------------------------- /confs/yabai/yabairc: -------------------------------------------------------------------------------- 1 | 2 | # default layout (can be bsp, stack or float) 3 | yabai -m config layout bsp 4 | 5 | # New window spawns to the right if vertical split, or bottom if horizontal split 6 | yabai -m config window_placement second_child 7 | 8 | # padding set to 12px 9 | yabai -m config top_padding 50 10 | yabai -m config bottom_padding 20 11 | yabai -m config left_padding 50 12 | yabai -m config right_padding 50 13 | yabai -m config window_gap 12 14 | 15 | # center mouse on window with focus 16 | yabai -m config mouse_follows_focus on 17 | 18 | # modifier for clicking and dragging with mouse 19 | yabai -m config mouse_modifier alt 20 | # set modifier + left-click drag to move window 21 | yabai -m config mouse_action1 move 22 | # set modifier + right-click drag to resize window 23 | yabai -m config mouse_action2 resize 24 | 25 | 26 | # when window is dropped in center of another window, swap them (on edges it will split it) 27 | yabai -m mouse_drop_action swap 28 | 29 | yabai -m rule --add app="^System Settings$" manage=off 30 | yabai -m rule --add app="^Calculator$" manage=off 31 | yabai -m rule --add app="^Karabiner-Elements$" manage=off 32 | -------------------------------------------------------------------------------- /docs/Alacritty.md: -------------------------------------------------------------------------------- 1 | ## Alacritty 2 | 3 | Theme: https://github.com/catppuccin/alacritty 4 | -------------------------------------------------------------------------------- /docs/Dependencies.md: -------------------------------------------------------------------------------- 1 | ## Dependencies 2 | 3 | ### Shell 4 | * [zsh](https://github.com/zsh-users/zsh) 5 | * [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) 6 | 7 | ### Editor 8 | * [Neovim](https://github.com/neovim/neovim) 9 | * [AstroNvim](https://github.com/AstroNvim/AstroNvim) 10 | * **NOTE:** Currently on the `v3` branch. 11 | 12 | ### Terminal Multiplexer 13 | * [tmux](https://github.com/tmux/tmux) 14 | 15 | ### Version Managers 16 | * [nvm](https://github.com/nvm-sh/nvm) 17 | * [svm-rs](https://github.com/roynalnaruto/svm-rs) 18 | 19 | ### CLI Tools 20 | * [gm](./.gm/codebase) 21 | * [zoxide](https://github.com/ajeetdsouza/zoxide) 22 | * [delta](https://github.com/dandavison/delta) 23 | * [lsd](https://github.com/Peltoche/lsd) 24 | * [fzf](https://github.com/junegunn/fzf) 25 | * [bat](https://github.com/sharkdp/bat) 26 | * [bpytop](https://github.com/aristocratos/bpytop) 27 | * [hyperfine](https://github.com/sharkdp/hyperfine) 28 | * [graphite CLI](https://github.com/withgraphite/graphite-cli) 29 | 30 | ### Smart Contract Development 31 | * [foundry](https://github.com/foundry-rs/foundry) 32 | * [huff-rs](https://github.com/huff-language/huff-rs) 33 | * [slither](https://github.com/crytic/slither) 34 | * [echidna](https://github.com/crytic/echidna) 35 | 36 | ### Misc 37 | * [rust](https://rustup.rs/) 38 | * [golang](https://go.dev/learn/) 39 | * [gotestsum](https://github.com/gotestyourself/gotestsum) 40 | 41 | ## Install 42 | 43 | > **Note** 44 | > Make sure all dependencies are installed! 45 | 46 | ``` 47 | make install 48 | ``` 49 | -------------------------------------------------------------------------------- /docs/Fonts.md: -------------------------------------------------------------------------------- 1 | ## Fonts 2 | 3 | Install a [patched font](https://www.nerdfonts.com/font-downloads). 4 | 5 | To do this on a linux distribution, follow these steps. 6 | 7 | 1. Download a [Nerd Font](http://nerdfonts.com/) 8 | 2. Unzip and copy to `~/.fonts` 9 | 3. Run the command `fc-cache -fv` to manually rebuild the font cache 10 | 11 | On Mac, you can should be able to simply "double click" on the `*.ttf` files instead of running `fc-cache -fv` command. 12 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # dots documentation 2 | 3 | ## Introduction 4 | 5 | Welcome to Refcell's dots. 6 | This is a collection of various dotfiles, configs, and other tooling. 7 | 8 | These docs walk through a bunch of configuration steps. 9 | You do not need to read it like a book, instead, simply skip 10 | to whichever chapter/tool is of use to you. 11 | 12 | ## Table of Contents 13 | 14 | - [`Fonts`](./Fonts.md) 15 | - 16 | 17 | ## Quickstart 18 | 19 | > **Warning** 20 | > 21 | > The commands below will override any local configuration files that 22 | > conflict with the files in this repository. Please double check that 23 | > you do not have conflicts that you don't want to override. We run an 24 | > additional step to make sure any potentially conflicting files are 25 | > backed up, but you should still manually verify to understand what 26 | > this code is doing. 27 | 28 | _Note: See [backup](#-backup) for more info on where backup files are copied._ 29 | 30 | Clone this repository: `git clone https://github.com/refcell/dots`. 31 | 32 | Enter into the repo directory: `cd dots`. 33 | 34 | Copy the configuration files to your local files: `make install`. 35 | 36 | 37 | ## Backup 38 | 39 | The [Makefile](./Makefile) `install` target run in the [Quickstart](#-quickstart) 40 | backs up all potentially overriden files to a directory in `~/.dotbackup/`. 41 | 42 | To recover these files, run `make recover`, which will copy files from the 43 | `~/.dotbackup` location to their original locations. 44 | 45 | -------------------------------------------------------------------------------- /docs/neovim/Install.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/refcell/dots/3a3cba9cb4ea2b3eb2f167cb45c491874ec80bf8/docs/neovim/Install.md -------------------------------------------------------------------------------- /static/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/refcell/dots/3a3cba9cb4ea2b3eb2f167cb45c491874ec80bf8/static/code.png -------------------------------------------------------------------------------- /static/revm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/refcell/dots/3a3cba9cb4ea2b3eb2f167cb45c491874ec80bf8/static/revm.png -------------------------------------------------------------------------------- /static/screengrab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/refcell/dots/3a3cba9cb4ea2b3eb2f167cb45c491874ec80bf8/static/screengrab.png -------------------------------------------------------------------------------- /utils/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ndpi: 3 | brew install coreutils gcc git gettext flex bison libtool autoconf automake pkg-config libpcap json-c pcre2 libmaxminddb rrdtool 4 | 5 | exec: 6 | brew install luarocks 7 | luarocks install ltui 8 | luarocks install lua-pcap 9 | lua netcap.lua 10 | 11 | inspect: 12 | brew install luarocks 13 | luarocks install ljndpi 14 | lua inspect.lua 15 | -------------------------------------------------------------------------------- /utils/inspect.lua: -------------------------------------------------------------------------------- 1 | local ndpi = require "ndpi" 2 | local TICK_RESOLUTION = 1000 -- Samples per second 3 | local detector = ndpi.detection_module(TICK_RESOLUTION) 4 | detector:set_protocol_bitmask(ndpi.protocol_bitmask():set_all()) 5 | 6 | local flows = {} 7 | for packet in iterate_packets() do 8 | -- Obtain a unique identifier for a flow, most likely using 9 | -- the source/destination IP addresses, ports, and VLAN tag. 10 | local flow_id = get_flow_id(packet) 11 | local flow = flows[flow_id] 12 | if not flow then 13 | -- Add any other flow-specific information needed by your application. 14 | flow = { 15 | ndpi_flow = ndpi.flow(), 16 | ndpi_src_id = ndpi.id(), 17 | ndpi_dst_id = ndpi.id(), 18 | protocol = ndpi.protocol.PROTOCOL_UNKNOWN, 19 | } 20 | flows[flow_id] = flow 21 | end 22 | 23 | if flow.protocol ~= ndpi.protocol.PROTOCOL_UNKNOWN then 24 | print("Identified protocol: " .. ndpi.protocol[flow.protocol]) 25 | else 26 | flow.protocol = detector:process_packet(flow.ndpi_flow, 27 | get_ip_data_pointer(packet), 28 | get_ip_data_length(packet), 29 | os.time(), 30 | flow.ndpi_src_id, 31 | flow.ndpi_dst_id) 32 | end 33 | end -------------------------------------------------------------------------------- /utils/netcap.lua: -------------------------------------------------------------------------------- 1 | local tui = require('tui') 2 | local pcap = require('pcap') 3 | 4 | local function format_packet_header(ts, len) 5 | return string.format('Timestamp: %s | Packet Length: %d', os.date('%Y-%m-%d %H:%M:%S', ts), len) 6 | end 7 | 8 | local function analyze_packet(userdata, pkthdr, packet) 9 | local formatted_header = format_packet_header(pkthdr.ts.tv_sec, pkthdr.len) 10 | userdata.buffer:add_string(formatted_header) 11 | userdata.buffer:add_string('\n----------------------------------------\n') 12 | end 13 | 14 | local function main() 15 | local screen = tui.screen_setup() 16 | local buffer = tui.buffer() 17 | 18 | local list_view = tui.create_list_view(buffer, 0, 0, screen:width(), screen:height() - 1) 19 | 20 | local status_bar = tui.create_status_bar(screen:width()) 21 | status_bar:set_text("Capturing network traffic... Press 'q' to quit.") 22 | 23 | screen:add_view(list_view) 24 | screen:add_view(status_bar) 25 | 26 | local userdata = { buffer = buffer } 27 | local pcap_session = pcap.open_live('any', 65535, true, 0) 28 | pcap.loop(pcap_session, -1, analyze_packet, userdata) 29 | 30 | screen:draw() 31 | 32 | while true do 33 | local event = screen:get_event() 34 | if event and event.type == 'key' then 35 | if event.key_name == 'q' then 36 | break 37 | end 38 | end 39 | end 40 | 41 | screen:shutdown() 42 | pcap.close(pcap_session) 43 | end 44 | 45 | main() 46 | --------------------------------------------------------------------------------