dotfiles

My personal dotfiles

commit e6b2a4d18276036c1a40ec8a6a3fd1b54599645a
parent 7c1f06b79592d7c69c20bde83f84bc43e1dd1071
Author: Pablo Emilio Escobar Gaviria <pablo-escobar@riseup.net>
Date:   Fri, 29 Jan 2021 11:11:55 -0300

Updated the dotfiles

Diffstat:
M.config/fish/functions/config.fish | 25++++++++++++++++++++++++-
A.local/share/configs.list | 15+++++++++++++++
2 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/.config/fish/functions/config.fish b/.config/fish/functions/config.fish
@@ -1,6 +1,29 @@
 function config
-  argparse u/update a/add= -- $argv
+  argparse u/update a-add=+ r-rm=+ l/list -- $argv
 
+  if test -n "$_flag_list"
+    string replace --all "$HOME" '~' (cat ~/.local/share/configs.list)
+    return
+  end
+
+  # Add files to the list of dotfiles
+  for item in $_flag_add
+    echo "Adding '$item' to the list of dotfiles"
+    echo (realpath "$item") >> ~/.local/share/configs.list
+  end
+
+  # Remove files from the list of dotfiles
+  for item in $_flag_rm
+    echo "Removing '$item' from the list of dotfile"
+
+    set pattern (realpath "$item")
+    set pattern (string replace --all '/' '\/' "$pattern")
+    set pattern (string replace --all '.' '\.' "$pattern")
+
+    sed -e "/^$pattern/d" -i ~/.local/share/configs.list
+  end
+
+  # Update the repository and it's remotes
   if test -n "$_flag_update"
     # Add the relevant files to the repo
     cat ~/.local/share/configs.list \
diff --git a/.local/share/configs.list b/.local/share/configs.list
@@ -0,0 +1,15 @@
+/home/pablo/.config/alacritty
+/home/pablo/.config/bat
+/home/pablo/.config/fish/config.fish
+/home/pablo/.config/fish/functions
+/home/pablo/.config/gdb
+/home/pablo/.config/git
+/home/pablo/.config/lynx
+/home/pablo/.config/mutt/muttrc
+/home/pablo/.config/mutt/accounts/1-public.muttrc
+/home/pablo/.config/mutt/asciidoc-template
+/home/pablo/.config/nvim/init.vim
+/home/pablo/.config/ranger
+/home/pablo/.config/tmux
+/home/pablo/.local/bin/exports.sh
+/home/pablo/.local/share/configs.list