diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 946dca7..a3b91f9 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -13,4 +13,4 @@ end # Add to PATH fish_add_path $GOPATH/bin -fish_add_path $HOME/.local/bin \ No newline at end of file +fish_add_path $XDG_CONFIG_HOME/fish/scripts \ No newline at end of file diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index b10e29e..8070b83 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables @@ -1,6 +1,6 @@ # This file contains fish universal variable definitions. # VERSION: 3.0 -SETUVAR __fish_initialized:3400 +SETUVAR __fish_initialized:3800 SETUVAR fish_color_autosuggestion:707A8C SETUVAR fish_color_cancel:\x2d\x2dreverse SETUVAR fish_color_command:00ff00 @@ -42,4 +42,4 @@ SETUVAR fish_pager_color_selected_completion:\x1d SETUVAR fish_pager_color_selected_description:\x1d SETUVAR fish_pager_color_selected_prefix:\x1d SETUVAR fish_prompt_pwd_dir_length:0 -SETUVAR fish_user_paths:/home/eduard/\x2elocal/share/go/bin\x1e/home/eduard/\x2elocal/bin +SETUVAR fish_user_paths:/home/eduard/\x2econfig/fish/scripts\x1e/home/eduard/\x2elocal/share/go/bin\x1e/home/eduard/\x2elocal/bin diff --git a/.config/fish/scripts/backup b/.config/fish/scripts/backup new file mode 100755 index 0000000..626b4c8 --- /dev/null +++ b/.config/fish/scripts/backup @@ -0,0 +1,20 @@ +#!/bin/fish +set DIRECTORIES documents music pictures projects videos +set EXCLUDES node_modules .cache .godot .svelte-kit +set FLAGS -avz --delete +set HOSTS $argv +set USER (whoami) +set DESTINATION "~/files/" + +for exclude in $EXCLUDES + set -a FLAGS --exclude $exclude +end + +for host in $HOSTS + echo "[$host]" + + for DIR in $DIRECTORIES + echo "Backing up $DIR..." + rsync $FLAGS ~/$DIR $USER@$host:$DESTINATION + end +end \ No newline at end of file diff --git a/.config/fish/scripts/gitloc b/.config/fish/scripts/gitloc new file mode 100755 index 0000000..c9ea178 --- /dev/null +++ b/.config/fish/scripts/gitloc @@ -0,0 +1,26 @@ +#!/bin/fish +echo "This will modify your git repository to count the lines of code for each commit." +read -l -P "Do you want to continue? [y/N] " CONFIRM + +if test -z $CONFIRM; or test $CONFIRM != 'y' + return +end + +if not command -q tokei + echo "tokei is not installed" + return +end + +if not command -q jq + echo "jq is not installed" + return +end + +git log --pretty=format:"%h" --reverse | read -za COMMITS + +for commit in $COMMITS + git checkout $commit &> /dev/null + tokei --output json | jq ".Total.code" +end + +git checkout main &> /dev/null \ No newline at end of file