diff --git a/README.md b/README.md index 78c05fb..ef4b18e 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,9 @@ Install script for my system, basically a poor man's nix but in bash. Its also u A small python script to automate the init and deploy procedures by simply copying the files in their required spots based on the `dot.toml` config file. -`./dot.py --init` to copy all the dotfiles in the currently selected folder +`./dot.py --init` to copy all the dotfiles in a new `backup` folder created in the currently selected folder `./dot.py --deploy` to copy them back to where they're supposed to be -The script is extremely opinionated as it will always save them in the currently selected folder and load them based on the home directory of the user as such: `~/.config/nvim` folder will always be saved in `./.config/nvim` which will always be loaded in `~/.config/nvim`. As such configs or dotfiles outside of the home directory are not supported by this script (which is perfectly fine since I don't have any of those). +- some files might require `sudo` to be written +- when ran using `sudo` the `~` gets expanded into `/home/root` which most likely won't exist and therefore the home backups won't get restored, to avoid this either run this twice (once as normal user and once with `sudo`) or simply write the absolute path in the config file (`/home/user/.zshrc` instead of `~/.zshrc`) diff --git a/backup/home/wynd/.config/nvim/lua/nvwynd/plugins/treesitter.lua b/backup/home/wynd/.config/nvim/lua/nvwynd/plugins/treesitter.lua index 535a26c..cb001fa 100644 --- a/backup/home/wynd/.config/nvim/lua/nvwynd/plugins/treesitter.lua +++ b/backup/home/wynd/.config/nvim/lua/nvwynd/plugins/treesitter.lua @@ -22,13 +22,18 @@ return { "javascript", "typescript", "svelte", + "jinja", + "jinja_inline", -- config + "json", "toml", "yaml", + "kdl", "markdown", "dockerfile", "just", + "caddy", -- vim "vim", @@ -55,6 +60,7 @@ return { "groovy", "glsl", "wgsl", + "desktop", }) vim.api.nvim_create_autocmd("FileType", { diff --git a/backup/home/wynd/.local/bin/best-gif.sh b/backup/home/wynd/.local/bin/scripts/best-gif.sh similarity index 100% rename from backup/home/wynd/.local/bin/best-gif.sh rename to backup/home/wynd/.local/bin/scripts/best-gif.sh diff --git a/backup/home/wynd/.local/bin/make-gif.sh b/backup/home/wynd/.local/bin/scripts/make-gif.sh similarity index 100% rename from backup/home/wynd/.local/bin/make-gif.sh rename to backup/home/wynd/.local/bin/scripts/make-gif.sh diff --git a/backup/home/wynd/.local/bin/scripts/prep-food-pic.sh b/backup/home/wynd/.local/bin/scripts/prep-food-pic.sh new file mode 100755 index 0000000..0f9197b --- /dev/null +++ b/backup/home/wynd/.local/bin/scripts/prep-food-pic.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +for file in "$@"; do + mat2 --inplace "$file" + convert "$file" -resize '25%' "$file" +done diff --git a/backup/home/wynd/.local/bin/repoc.sh b/backup/home/wynd/.local/bin/scripts/repoc.sh similarity index 100% rename from backup/home/wynd/.local/bin/repoc.sh rename to backup/home/wynd/.local/bin/scripts/repoc.sh diff --git a/backup/home/wynd/.local/bin/repoc5y.sh b/backup/home/wynd/.local/bin/scripts/repoc5y.sh similarity index 100% rename from backup/home/wynd/.local/bin/repoc5y.sh rename to backup/home/wynd/.local/bin/scripts/repoc5y.sh diff --git a/backup/home/wynd/.local/bin/repos.sh b/backup/home/wynd/.local/bin/scripts/repos.sh similarity index 100% rename from backup/home/wynd/.local/bin/repos.sh rename to backup/home/wynd/.local/bin/scripts/repos.sh diff --git a/backup/home/wynd/.local/bin/repos5y.sh b/backup/home/wynd/.local/bin/scripts/repos5y.sh similarity index 100% rename from backup/home/wynd/.local/bin/repos5y.sh rename to backup/home/wynd/.local/bin/scripts/repos5y.sh diff --git a/backup/home/wynd/.local/bin/reposn.sh b/backup/home/wynd/.local/bin/scripts/reposn.sh similarity index 100% rename from backup/home/wynd/.local/bin/reposn.sh rename to backup/home/wynd/.local/bin/scripts/reposn.sh diff --git a/backup/home/wynd/.local/bin/scripts/set-folder-icons.sh b/backup/home/wynd/.local/bin/scripts/set-folder-icons.sh new file mode 100755 index 0000000..f13d334 --- /dev/null +++ b/backup/home/wynd/.local/bin/scripts/set-folder-icons.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env 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/backup/home/wynd/.zshrc b/backup/home/wynd/.zshrc index de57645..97dd067 100644 --- a/backup/home/wynd/.zshrc +++ b/backup/home/wynd/.zshrc @@ -133,11 +133,13 @@ function days_since() {( echo $(( ( now - input )/(60*60*24) )) )} -alias repos="~/.local/bin/repos.sh" -alias reposn="~/.local/bin/reposn.sh" -alias repoc="~/.local/bin/repoc.sh" -alias repos5y="~/.local/bin/repos5y.sh" -alias repoc5y="~/.local/bin/repoc5y.sh" +alias repos="~/.local/bin/scripts/repos.sh" +alias reposn="~/.local/bin/scripts/reposn.sh" +alias repoc="~/.local/bin/scripts/repoc.sh" +alias repos5y="~/.local/bin/scripts/repos5y.sh" +alias repoc5y="~/.local/bin/scripts/repoc5y.sh" + +export PATH="/home/wynd/.local/bin/scripts:$PATH" # private SSH stuff source ~/.piwrc diff --git a/dot.toml b/dot.toml index 3fbf772..29e5801 100644 --- a/dot.toml +++ b/dot.toml @@ -32,25 +32,7 @@ path = "~/.local/bin/nvimstart.sh" path = "~/.local/bin/obstoggle.py" [[dots]] -path = "~/.local/bin/best-gif.sh" - -[[dots]] -path = "~/.local/bin/make-gif.sh" - -[[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" +path = "~/.local/bin/scripts/*" [[dots]] path = "/etc/hosts"