diff --git a/.config/nvim/after/ftplugin/gdscript.lua b/.config/nvim/after/ftplugin/gdscript.lua deleted file mode 100644 index c69f5c3..0000000 --- a/.config/nvim/after/ftplugin/gdscript.lua +++ /dev/null @@ -1,12 +0,0 @@ -local port = os.getenv("GDScript_Port") or "6005" -local cmd = vim.lsp.rpc.connect("127.0.0.1", port) -local pipe = "/tmp/godot.pipe" - -vim.lsp.start({ - name = "Godot", - cmd = cmd, - root_dir = vim.fs.dirname(vim.fs.find({ "project.godot", ".git" }, { upward = true })[1]), - on_attach = function(client, bufnr) - vim.api.nvim_command('echo serverstart("' .. pipe .. '")') - end, -}) diff --git a/.config/nvim/lua/nvwynd/plugins/zen.lua b/.config/nvim/lua/nvwynd/plugins/zen.lua deleted file mode 100644 index 0ae1ad3..0000000 --- a/.config/nvim/lua/nvwynd/plugins/zen.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - { - "folke/twilight.nvim", - opts = {}, - }, - - { - "folke/zen-mode.nvim", - opts = {}, - }, -} diff --git a/.config/nvim/queries/c3/highlights.scm b/.config/nvim/queries/c3/highlights.scm deleted file mode 100644 index 4589f13..0000000 --- a/.config/nvim/queries/c3/highlights.scm +++ /dev/null @@ -1,323 +0,0 @@ -;; NOTE In this file later patterns are assumed to have priority! - -;; Punctuation -["(" ")" "[" "]" "{" "}" "(<" ">)" "[<" ">]" "{|" "|}"] @punctuation.bracket -[";" "," ":" "::"] @punctuation.delimiter - -;; Constant -(const_ident) @constant -["true" "false"] @boolean -["null"] @constant.builtin - -;; Variable -[(ident) (ct_ident)] @variable -;; 1) Member -(field_expr field: (access_ident (ident) @variable.member)) -(struct_member_declaration (ident) @variable.member) -(struct_member_declaration (identifier_list (ident) @variable.member)) -(bitstruct_member_declaration (ident) @variable.member) -(initializer_list (arg (param_path (param_path_element (ident) @variable.member)))) -;; 2) Parameter -(parameter name: (_) @variable.parameter) -(call_invocation (arg (param_path (param_path_element [(ident) (ct_ident)] @variable.parameter)))) -(enum_param_declaration (ident) @variable.parameter) -;; 3) Declaration -(global_declaration (ident) @variable.declaration) -(local_decl_after_type name: [(ident) (ct_ident)] @variable.declaration) -(var_decl name: [(ident) (ct_ident)] @variable.declaration) -(try_unwrap (ident) @variable.declaration) -(catch_unwrap (ident) @variable.declaration) - -;; Keyword (from `c3c --list-keywords`) -[ - "assert" - "asm" - "catch" - "defer" - "try" - "var" -] @keyword - -[ - "$alignof" - "$and" - "$append" - "$assert" - "$assignable" - "$case" - "$concat" - "$default" - "$defined" - "$echo" - "$else" - "$embed" - "$endfor" - "$endforeach" - "$endif" - "$endswitch" - "$eval" - "$evaltype" - "$error" - "$exec" - "$extnameof" - "$feature" - "$for" - "$foreach" - "$if" - "$include" - "$is_const" - "$nameof" - "$offsetof" - "$or" - "$qnameof" - "$sizeof" - "$stringify" - "$switch" - "$typefrom" - "$typeof" - "$vacount" - "$vatype" - "$vaconst" - "$varef" - "$vaarg" - "$vaexpr" - "$vasplat" -] @keyword.directive - -"fn" @keyword.function -"macro" @keyword.function -"return" @keyword.return -"import" @keyword.import -"module" @keyword.module - -[ - "bitstruct" - "def" - "distinct" - "enum" - "fault" - "interface" - "struct" - "union" -] @keyword.type - -[ - "case" - "default" - "else" - "if" - "nextcase" - "switch" -] @keyword.conditional - -[ - "break" - "continue" - "do" - "for" - "foreach" - "foreach_r" - "while" -] @keyword.repeat - -[ - "const" - "extern" - "inline" - "static" - "tlocal" -] @keyword.modifier - -;; Operator (from `c3c --list-operators`) -[ - "&" - "!" - "~" - "|" - "^" - ;; ":" - ;; "," - ;; ";" - "=" - ">" - "/" - "." - ;; "#" - "<" - ;; "{" - ;; "[" - ;; "(" - "-" - "%" - "+" - "?" - ;; "}" - ;; "]" - ;; ")" - "*" - ;; "_" - "&&" - ;; "->" - "!!" - "&=" - "|=" - "^=" - "/=" - ".." - "?:" - "==" - ">=" - "=>" - "<=" - ;; "{|" - ;; "(<" - ;; "[<" - "-=" - "--" - "%=" - "*=" - "!=" - "||" - "+=" - "++" - ;; "|}" - ;; ">)" - ;; ">]" - "??" - ;; "::" - "<<" - ">>" - "..." - "<<=" - ">>=" -] @operator - -(range_expr ":" @operator) -(foreach_cond ":" @operator) - -(ternary_expr - [ - "?" - ":" - ] @keyword.conditional.ternary) - -(elvis_orelse_expr - [ - "?:" - "??" - ] @keyword.conditional.ternary) - -;; Literal -(integer_literal) @number -(real_literal) @number.float -(char_literal) @character -(bytes_literal) @number - -;; String -(string_literal) @string -(raw_string_literal) @string - -;; Escape Sequence -(escape_sequence) @string.escape - -;; Builtin (constants) -((builtin) @constant.builtin (#match? @constant.builtin "_*[A-Z][_A-Z0-9]*")) - -;; Type Property (from `c3c --list-type-properties`) -(type_access_expr (access_ident [(ident) "typeid"] @variable.builtin - (#any-of? @variable.builtin - "alignof" - "associated" - "elements" - "extnameof" - "inf" - "is_eq" - "is_ordered" - "is_substruct" - "len" - "max" - "membersof" - "min" - "nan" - "inner" - "kindof" - "names" - "nameof" - "params" - "parentof" - "qnameof" - "returns" - "sizeof" - "values" - ;; Extra token - "typeid"))) - -;; Label -[ - (label) - (label_target) -] @label - -;; Module -(module_resolution (ident) @module) -(module (path_ident (ident) @module)) -(import_declaration (path_ident (ident) @module)) - -;; Attribute -(attribute name: (_) @attribute) -(define_attribute name: (_) @attribute) -(call_inline_attributes (at_ident) @attribute) -(asm_block_stmt (at_ident) @attribute) - -;; Type -[ - (type_ident) - (ct_type_ident) -] @type -(base_type_name) @type.builtin - -;; Function Definition -(func_header name: (_) @function) -(func_header method_type: (_) name: (_) @function.method) -;; NOTE macro_declaration can also have a func_header -(macro_header name: (_) @function) -(macro_header method_type: (_) name: (_) @function.method) - -;; Function Call -(call_expr function: [(ident) (at_ident)] @function.call) -(call_expr function: [(builtin)] @function.builtin.call) -(call_expr function: (module_ident_expr ident: (_) @function.call)) -(call_expr function: (trailing_generic_expr argument: (module_ident_expr ident: (_) @function.call))) -(call_expr function: (field_expr field: (access_ident [(ident) (at_ident)] @function.method.call))) ; NOTE Ambiguous, could be calling a method or function pointer -;; Method on type -(call_expr function: (type_access_expr field: (access_ident [(ident) (at_ident)] @function.method.call))) - -;; Assignment -;; (assignment_expr left: (ident) @variable.member) -;; (assignment_expr left: (module_ident_expr (ident) @variable.member)) -;; (assignment_expr left: (field_expr field: (_) @variable.member)) -;; (assignment_expr left: (unary_expr operator: "*" @variable.member)) -;; (assignment_expr left: (subscript_expr ["[" "]"] @variable.member)) - -;; (update_expr argument: (ident) @variable.member) -;; (update_expr argument: (module_ident_expr ident: (ident) @variable.member)) -;; (update_expr argument: (field_expr field: (_) @variable.member)) -;; (update_expr argument: (unary_expr operator: "*" @variable.member)) -;; (update_expr argument: (subscript_expr ["[" "]"] @variable.member)) - -;; (unary_expr operator: ["--" "++"] argument: (ident) @variable.member) -;; (unary_expr operator: ["--" "++"] argument: (module_ident_expr (ident) @variable.member)) -;; (unary_expr operator: ["--" "++"] argument: (field_expr field: (access_ident (ident)) @variable.member)) -;; (unary_expr operator: ["--" "++"] argument: (subscript_expr ["[" "]"] @variable.member)) - -;; Asm -(asm_instr [(ident) "int"] @function.builtin) -(asm_expr [(ct_ident) (ct_const_ident)] @variable.builtin) - -;; Comment -[ - (line_comment) - (block_comment) -] @comment @spell - -(doc_comment) @comment.documentation @spell diff --git a/.local/bin/set-folder-icons.sh b/.local/bin/set-folder-icons.sh deleted file mode 100755 index 16fa200..0000000 --- a/.local/bin/set-folder-icons.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -( -for FOLDER in ./*/; do - # gio set "$FOLDER" -t unset metadata::custom-icon - for img in ./"$FOLDER"/*; do - if [[ ${img##*.} == "jpg" ]] || [[ ${img##*.} == "png" ]] || [[ ${img##*.} == "webp" ]]; then - IMAGENAME="$(basename "$img")" - break - fi - done - if [[ -n $IMAGENAME ]]; then - gio set "$FOLDER" -t string metadata::custom-icon "$IMAGENAME" - unset IMAGENAME - fi -done -) diff --git a/extras/fstab b/backup/etc/fstab similarity index 100% rename from extras/fstab rename to backup/etc/fstab diff --git a/extras/hosts b/backup/etc/hosts similarity index 92% rename from extras/hosts rename to backup/etc/hosts index 0249059..2d87904 100644 --- a/extras/hosts +++ b/backup/etc/hosts @@ -9,3 +9,4 @@ 127.0.0.1 food.wynd.local 127.0.0.1 firefly.wynd.local 127.0.0.1 vault.wynd.local +127.0.0.1 test.wynd.local diff --git a/.config/alacritty/alacritty.toml b/backup/home/wynd/.config/alacritty/alacritty.toml similarity index 100% rename from .config/alacritty/alacritty.toml rename to backup/home/wynd/.config/alacritty/alacritty.toml diff --git a/.config/alacritty/catppuccin-macchiato.toml b/backup/home/wynd/.config/alacritty/catppuccin-macchiato.toml similarity index 100% rename from .config/alacritty/catppuccin-macchiato.toml rename to backup/home/wynd/.config/alacritty/catppuccin-macchiato.toml diff --git a/.config/btop/btop.conf b/backup/home/wynd/.config/btop/btop.conf similarity index 100% rename from .config/btop/btop.conf rename to backup/home/wynd/.config/btop/btop.conf diff --git a/.config/mpv/input.conf b/backup/home/wynd/.config/mpv/input.conf similarity index 100% rename from .config/mpv/input.conf rename to backup/home/wynd/.config/mpv/input.conf diff --git a/.config/mpv/mpv.conf b/backup/home/wynd/.config/mpv/mpv.conf similarity index 100% rename from .config/mpv/mpv.conf rename to backup/home/wynd/.config/mpv/mpv.conf diff --git a/.config/nvim/README.md b/backup/home/wynd/.config/nvim/README.md similarity index 96% rename from .config/nvim/README.md rename to backup/home/wynd/.config/nvim/README.md index b424c6c..a665bbf 100644 --- a/.config/nvim/README.md +++ b/backup/home/wynd/.config/nvim/README.md @@ -2,32 +2,33 @@ ## plugins used +- [telescope-fzf-native.nvim](https://github.com/nvim-telescope/telescope-fzf-native.nvim.git) +- [luvit-meta](https://github.com/Bilal2453/luvit-meta.git) - [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim.git) +- [nvim-notify](https://github.com/rcarriga/nvim-notify.git) - [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons.git) -- [hurl.nvim](https://github.com/jellydn/hurl.nvim.git) +- [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim.git) +- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim.git) - [nui.nvim](https://github.com/MunifTanjim/nui.nvim.git) +- [mini.map](https://github.com/echasnovski/mini.map.git) +- [plenary.nvim](https://github.com/nvim-lua/plenary.nvim.git) +- [which-key.nvim](https://github.com/folke/which-key.nvim.git) +- [lazy.nvim](https://github.com/folke/lazy.nvim.git) - [git-conflict.nvim](https://github.com/akinsho/git-conflict.nvim.git) +- [friendly-snippets](https://github.com/rafamadriz/friendly-snippets.git) +- [hurl.nvim](https://github.com/jellydn/hurl.nvim.git) +- [outline.nvim](https://github.com/hedyhli/outline.nvim.git) +- [vim-cool](https://github.com/romainl/vim-cool.git) +- [trouble.nvim](https://github.com/folke/trouble.nvim.git) +- [conform.nvim](https://github.com/stevearc/conform.nvim.git) +- [Comment.nvim](https://github.com/numToStr/Comment.nvim.git) +- [todo-comments.nvim](https://github.com/folke/todo-comments.nvim.git) +- [nvim-ts-autotag](https://github.com/windwp/nvim-ts-autotag.git) - [dressing.nvim](https://github.com/stevearc/dressing.nvim.git) - [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig.git) -- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim.git) -- [which-key.nvim](https://github.com/folke/which-key.nvim.git) -- [fidget.nvim](https://github.com/j-hui/fidget.nvim.git) -- [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim.git) -- [lazydev.nvim](https://github.com/folke/lazydev.nvim.git) -- [plenary.nvim](https://github.com/nvim-lua/plenary.nvim.git) -- [luvit-meta](https://github.com/Bilal2453/luvit-meta.git) -- [mini.map](https://github.com/echasnovski/mini.map.git) -- [nvim-ts-autotag](https://github.com/windwp/nvim-ts-autotag.git) -- [lazy.nvim](https://github.com/folke/lazy.nvim.git) -- [vim-cool](https://github.com/romainl/vim-cool.git) -- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter.git) -- [conform.nvim](https://github.com/stevearc/conform.nvim.git) -- [todo-comments.nvim](https://github.com/folke/todo-comments.nvim.git) -- [catppuccin](https://github.com/catppuccin/nvim.git) -- [Comment.nvim](https://github.com/numToStr/Comment.nvim.git) -- [nvim-notify](https://github.com/rcarriga/nvim-notify.git) - [nvim-surround](https://github.com/kylechui/nvim-surround.git) +- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter.git) +- [fidget.nvim](https://github.com/j-hui/fidget.nvim.git) +- [catppuccin](https://github.com/catppuccin/nvim.git) +- [lazydev.nvim](https://github.com/folke/lazydev.nvim.git) - [blink.cmp](https://github.com/saghen/blink.cmp.git) -- [trouble.nvim](https://github.com/folke/trouble.nvim.git) -- [telescope-fzf-native.nvim](https://github.com/nvim-telescope/telescope-fzf-native.nvim.git) -- [friendly-snippets](https://github.com/rafamadriz/friendly-snippets.git) diff --git a/.config/nvim/after/ftplugin/markdown.lua b/backup/home/wynd/.config/nvim/after/ftplugin/markdown.lua similarity index 100% rename from .config/nvim/after/ftplugin/markdown.lua rename to backup/home/wynd/.config/nvim/after/ftplugin/markdown.lua diff --git a/.config/nvim/init.lua b/backup/home/wynd/.config/nvim/init.lua similarity index 100% rename from .config/nvim/init.lua rename to backup/home/wynd/.config/nvim/init.lua diff --git a/.config/nvim/lazy-lock.json b/backup/home/wynd/.config/nvim/lazy-lock.json similarity index 100% rename from .config/nvim/lazy-lock.json rename to backup/home/wynd/.config/nvim/lazy-lock.json diff --git a/.config/nvim/lua/nvwynd/autocmds.lua b/backup/home/wynd/.config/nvim/lua/nvwynd/autocmds.lua similarity index 87% rename from .config/nvim/lua/nvwynd/autocmds.lua rename to backup/home/wynd/.config/nvim/lua/nvwynd/autocmds.lua index 7d158b8..71fb2ba 100644 --- a/.config/nvim/lua/nvwynd/autocmds.lua +++ b/backup/home/wynd/.config/nvim/lua/nvwynd/autocmds.lua @@ -16,10 +16,12 @@ autocmd("BufEnter", { user_command("ExportPlugins", function() local plugins = require("lazy").plugins() - local f, err = io.open("plugins", "w+") + local f, err = io.open("README.md", "w+") if f then + f:write("# neovim config\n\n") + f:write("## plugins used\n\n") for _, v in ipairs(plugins) do - local plugin = string.format("[%s](%s)\n", v.name, v.url) + local plugin = string.format("- [%s](%s)\n", v.name, v.url) f:write(plugin) end diff --git a/.config/nvim/lua/nvwynd/init.lua b/backup/home/wynd/.config/nvim/lua/nvwynd/init.lua similarity index 100% rename from .config/nvim/lua/nvwynd/init.lua rename to backup/home/wynd/.config/nvim/lua/nvwynd/init.lua diff --git a/.config/nvim/lua/nvwynd/keymaps.lua b/backup/home/wynd/.config/nvim/lua/nvwynd/keymaps.lua similarity index 100% rename from .config/nvim/lua/nvwynd/keymaps.lua rename to backup/home/wynd/.config/nvim/lua/nvwynd/keymaps.lua diff --git a/.config/nvim/lua/nvwynd/options.lua b/backup/home/wynd/.config/nvim/lua/nvwynd/options.lua similarity index 100% rename from .config/nvim/lua/nvwynd/options.lua rename to backup/home/wynd/.config/nvim/lua/nvwynd/options.lua diff --git a/.config/nvim/lua/nvwynd/plugins/colorscheme.lua b/backup/home/wynd/.config/nvim/lua/nvwynd/plugins/colorscheme.lua similarity index 100% rename from .config/nvim/lua/nvwynd/plugins/colorscheme.lua rename to backup/home/wynd/.config/nvim/lua/nvwynd/plugins/colorscheme.lua diff --git a/.config/nvim/lua/nvwynd/plugins/completion.lua b/backup/home/wynd/.config/nvim/lua/nvwynd/plugins/completion.lua similarity index 100% rename from .config/nvim/lua/nvwynd/plugins/completion.lua rename to backup/home/wynd/.config/nvim/lua/nvwynd/plugins/completion.lua diff --git a/.config/nvim/lua/nvwynd/plugins/editor.lua b/backup/home/wynd/.config/nvim/lua/nvwynd/plugins/editor.lua similarity index 100% rename from .config/nvim/lua/nvwynd/plugins/editor.lua rename to backup/home/wynd/.config/nvim/lua/nvwynd/plugins/editor.lua diff --git a/.config/nvim/lua/nvwynd/plugins/formatting.lua b/backup/home/wynd/.config/nvim/lua/nvwynd/plugins/formatting.lua similarity index 100% rename from .config/nvim/lua/nvwynd/plugins/formatting.lua rename to backup/home/wynd/.config/nvim/lua/nvwynd/plugins/formatting.lua diff --git a/.config/nvim/lua/nvwynd/plugins/lsp.lua b/backup/home/wynd/.config/nvim/lua/nvwynd/plugins/lsp.lua similarity index 100% rename from .config/nvim/lua/nvwynd/plugins/lsp.lua rename to backup/home/wynd/.config/nvim/lua/nvwynd/plugins/lsp.lua diff --git a/.config/nvim/lua/nvwynd/plugins/treesitter.lua b/backup/home/wynd/.config/nvim/lua/nvwynd/plugins/treesitter.lua similarity index 100% rename from .config/nvim/lua/nvwynd/plugins/treesitter.lua rename to backup/home/wynd/.config/nvim/lua/nvwynd/plugins/treesitter.lua diff --git a/.config/nvim/lua/nvwynd/plugins/ui.lua b/backup/home/wynd/.config/nvim/lua/nvwynd/plugins/ui.lua similarity index 100% rename from .config/nvim/lua/nvwynd/plugins/ui.lua rename to backup/home/wynd/.config/nvim/lua/nvwynd/plugins/ui.lua diff --git a/.config/nvim/lua/nvwynd/plugins/util.lua b/backup/home/wynd/.config/nvim/lua/nvwynd/plugins/util.lua similarity index 100% rename from .config/nvim/lua/nvwynd/plugins/util.lua rename to backup/home/wynd/.config/nvim/lua/nvwynd/plugins/util.lua diff --git a/.config/nvim/spell/en.utf-8.add b/backup/home/wynd/.config/nvim/spell/en.utf-8.add similarity index 100% rename from .config/nvim/spell/en.utf-8.add rename to backup/home/wynd/.config/nvim/spell/en.utf-8.add diff --git a/.config/nvim/spell/en.utf-8.add.spl b/backup/home/wynd/.config/nvim/spell/en.utf-8.add.spl similarity index 100% rename from .config/nvim/spell/en.utf-8.add.spl rename to backup/home/wynd/.config/nvim/spell/en.utf-8.add.spl diff --git a/.config/starship.toml b/backup/home/wynd/.config/starship.toml similarity index 100% rename from .config/starship.toml rename to backup/home/wynd/.config/starship.toml diff --git a/.config/tmux/tmux.conf b/backup/home/wynd/.config/tmux/tmux.conf similarity index 100% rename from .config/tmux/tmux.conf rename to backup/home/wynd/.config/tmux/tmux.conf diff --git a/.gitconfig b/backup/home/wynd/.gitconfig similarity index 100% rename from .gitconfig rename to backup/home/wynd/.gitconfig diff --git a/.local/bin/best-gif.sh b/backup/home/wynd/.local/bin/best-gif.sh old mode 100644 new mode 100755 similarity index 100% rename from .local/bin/best-gif.sh rename to backup/home/wynd/.local/bin/best-gif.sh diff --git a/.local/bin/make-gif.sh b/backup/home/wynd/.local/bin/make-gif.sh old mode 100644 new mode 100755 similarity index 100% rename from .local/bin/make-gif.sh rename to backup/home/wynd/.local/bin/make-gif.sh diff --git a/.local/bin/nvimstart.sh b/backup/home/wynd/.local/bin/nvimstart.sh old mode 100644 new mode 100755 similarity index 100% rename from .local/bin/nvimstart.sh rename to backup/home/wynd/.local/bin/nvimstart.sh diff --git a/.local/bin/obstoggle.py b/backup/home/wynd/.local/bin/obstoggle.py similarity index 100% rename from .local/bin/obstoggle.py rename to backup/home/wynd/.local/bin/obstoggle.py diff --git a/backup/home/wynd/.local/bin/repoc.sh b/backup/home/wynd/.local/bin/repoc.sh new file mode 100755 index 0000000..fc2e515 --- /dev/null +++ b/backup/home/wynd/.local/bin/repoc.sh @@ -0,0 +1,5 @@ +( +ROOT="$(pwd)" +clear +git-heatmap -a="Wynd" --root-dir "$ROOT" --split-months --months-per-row 7 --format numbers --use-author-time $@ +) diff --git a/backup/home/wynd/.local/bin/repoc5y.sh b/backup/home/wynd/.local/bin/repoc5y.sh new file mode 100755 index 0000000..760b66d --- /dev/null +++ b/backup/home/wynd/.local/bin/repoc5y.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +( +ROOT="$(pwd)" +clear +git-heatmap \ + -r "$ROOT" -b "" \ + -a "Wynd" --since $(date -d "5 years ago" +%Y-%m-%d) --until today \ + --months-per-row 12 --split-months --use-author-time $@ +) diff --git a/backup/home/wynd/.local/bin/repos.sh b/backup/home/wynd/.local/bin/repos.sh new file mode 100755 index 0000000..6a3c494 --- /dev/null +++ b/backup/home/wynd/.local/bin/repos.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +( +paths=( + "/home/wynd/Programming/Archive" + "/home/wynd/Programming/Active" + "/home/wynd/Lab" +) + +root_dir="" +for f in ${paths[@]}; do + root_dir="$root_dir--root-dir $f " +done + +clear +git-heatmap \ + $root_dir \ + -a="Wynd" --split-months --use-author-time $@ +) diff --git a/backup/home/wynd/.local/bin/repos5y.sh b/backup/home/wynd/.local/bin/repos5y.sh new file mode 100755 index 0000000..9bdd1dd --- /dev/null +++ b/backup/home/wynd/.local/bin/repos5y.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +( +paths=( + "/home/wynd/Programming/Archive" + "/home/wynd/Programming/Active" + "/home/wynd/Lab" +) + +root_dir="" +for f in ${paths[@]}; do + root_dir="$root_dir--root-dir $f " +done + +clear +git-heatmap \ + $root_dir \ + -a "Wynd" --since $(date -d "5 years ago" +%Y-%m-%d) --until today \ + --months-per-row 12 --split-months --use-author-time $@ +) diff --git a/backup/home/wynd/.local/bin/reposn.sh b/backup/home/wynd/.local/bin/reposn.sh new file mode 100755 index 0000000..fa2c247 --- /dev/null +++ b/backup/home/wynd/.local/bin/reposn.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +( +paths=( + "/home/wynd/Programming/Archive" + "/home/wynd/Programming/Active" + "/home/wynd/Lab" +) + +root_dir="" +for f in ${paths[@]}; do + root_dir="$root_dir--root-dir $f " +done + +clear +git-heatmap \ + $root_dir \ + -a="Wynd" --split-months --months-per-row 7 --format numbers --use-author-time $@ +) diff --git a/.taplo.toml b/backup/home/wynd/.taplo.toml similarity index 100% rename from .taplo.toml rename to backup/home/wynd/.taplo.toml diff --git a/.zshrc b/backup/home/wynd/.zshrc similarity index 100% rename from .zshrc rename to backup/home/wynd/.zshrc diff --git a/dot.py b/dot.py index 7235e7e..a5742c5 100755 --- a/dot.py +++ b/dot.py @@ -2,18 +2,37 @@ import os import re -from shutil import copyfile +import shutil from toml import load from glob import glob from argparse import ArgumentParser +FG_GREEN = "\x1b[32m" +FG_RED = "\x1b[31m" +BACKUP_FOLDER = "./backup" + + +def is_root() -> bool: + """ + Not the most "correct" way but since this is for personal usage I don't care + """ + return os.geteuid() == 0 + + +def manage_dot_files(dots, deploy=False, wipe=False): + if wipe: + # Nuke everything and bring the new stuff in + # Easy way to remove old stuff thats no longer linked in dot.toml + if not deploy: + shutil.rmtree(BACKUP_FOLDER) + + os.makedirs(BACKUP_FOLDER, exist_ok=True) -def manage_dot_files(dots, deploy=False): - home_path = os.path.expanduser("~/") for dot in dots: path = os.path.expanduser(dot["path"]) if deploy: - path = str(path).replace(home_path, "./") + path = BACKUP_FOLDER + path + ignore_list = dot["ignore"] if "ignore" in dot else [] for file in glob(path, recursive=True): exp_pass = True @@ -22,14 +41,18 @@ def manage_dot_files(dots, deploy=False): if match is not None: exp_pass = False break + if exp_pass and os.path.isfile(file): if deploy: - dest_path = file.replace("./", home_path) + dest_path = file.replace(BACKUP_FOLDER, "") else: - dest_path = file.replace(home_path, "./") + dest_path = BACKUP_FOLDER + file os.makedirs(os.path.dirname(dest_path), exist_ok=True) - copyfile(file, dest_path) - print(f"{file} -> {dest_path}") + try: + shutil.copy(file, dest_path) + print(f"{FG_GREEN}{file} -> {dest_path}") + except OSError: + print(f"{FG_RED}{file} requires root access to write, skipping") if __name__ == "__main__": @@ -52,10 +75,18 @@ if __name__ == "__main__": default=False, dest="deploy", ) + parser.add_argument( + "--wipe", + action="store_true", + help="Wipes the backup folder before bringing in the new backups, only works with --init flag", + required=False, + default=True, + dest="wipe", + ) args = parser.parse_args() if args.init: - manage_dot_files(config) + manage_dot_files(config, False, args.wipe) elif args.deploy: manage_dot_files(config, True) else: diff --git a/dot.toml b/dot.toml index 758a837..3fbf772 100644 --- a/dot.toml +++ b/dot.toml @@ -15,7 +15,6 @@ path = "~/.config/tmux/tmux.conf" [[dots]] path = "~/.config/nvim/**/*" -ignore = ["README.md$", "/plugins$"] [[dots]] path = "~/.config/mpv/*.conf" @@ -38,6 +37,23 @@ path = "~/.local/bin/best-gif.sh" [[dots]] path = "~/.local/bin/make-gif.sh" -# [[dots]] -# path = "~/.config/nushell/*" -# ignore = ["history.txt", "/completions$"] +[[dots]] +path = "~/.local/bin/repos.sh" + +[[dots]] +path = "~/.local/bin/reposn.sh" + +[[dots]] +path = "~/.local/bin/repos5y.sh" + +[[dots]] +path = "~/.local/bin/repoc.sh" + +[[dots]] +path = "~/.local/bin/repoc5y.sh" + +[[dots]] +path = "/etc/hosts" + +[[dots]] +path = "/etc/fstab"