diff options
author | dx <aryadevchavali1@gmail.com> | 2020-05-17 09:26:37 +0100 |
---|---|---|
committer | dx <aryadevchavali1@gmail.com> | 2020-05-17 09:26:37 +0100 |
commit | 546e3b18043ba424b661cff773c388a3931305e2 (patch) | |
tree | 4c1f3e6722c82cd399914d620901c43ca4bb1399 /Install.org | |
parent | d483094f0c7dfd421e4be59f3d4fabb263c3885e (diff) | |
download | dotfiles-546e3b18043ba424b661cff773c388a3931305e2.tar.gz dotfiles-546e3b18043ba424b661cff773c388a3931305e2.tar.bz2 dotfiles-546e3b18043ba424b661cff773c388a3931305e2.zip |
+support for deleting a modules
Refactored the code a bit to make it a bit cleaner, added support for
deleting modules in dotfiles
Diffstat (limited to 'Install.org')
-rw-r--r-- | Install.org | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/Install.org b/Install.org index dc734e5..4808922 100644 --- a/Install.org +++ b/Install.org @@ -11,19 +11,35 @@ for pkg in $folders; do stow $pkg done #+END_SRC -* Stow specific module +* Emacs support +** Get all modules in Dotfiles +The main function used to retrieve all the stowable modules in the Dotfiles directory. +#+BEGIN_SRC elisp +(defun get-modules () + (interactive) + (cdr + (reverse + (split-string + (shell-command-to-string "find . -maxdepth 1 -type 'd' -not -name '.git' -not -name '.'") + "\n")))) +#+END_SRC +** Stow module Little elisp snippet to stow a specific module in the Dotfiles folder using ivy. #+BEGIN_SRC elisp (ivy-read - "Enter module: " - (cdr - (reverse - (split-string - (shell-command-to-string "find . -maxdepth 1 -type 'd' -not -name '.git' -not -name '.'") - "\n"))) + "Stow module: " + (get-modules) :require-match t :action (lambda (choice) (async-shell-command (format "stow %s" choice) "*stow-output*" "*stow-error*"))) #+END_SRC +** Delete module +#+BEGIN_SRC elisp +(ivy-read + "Delete module: " + (get-modules) + :require-match t + :action (lambda (choice) (async-shell-command (format "stow -D %s" choice) "*stow-output*" "*stow-error*"))) +#+END_SRC * Generate user directories This makes some useful directories that are used by the system and/or by me. I split these into two sections so you can execute the ones you think are useful. |