+support for deleting a modules
Refactored the code a bit to make it a bit cleaner, added support for deleting modules in dotfiles
This commit is contained in:
30
Install.org
30
Install.org
@@ -11,19 +11,35 @@ for pkg in $folders; do
|
|||||||
stow $pkg
|
stow $pkg
|
||||||
done
|
done
|
||||||
#+END_SRC
|
#+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.
|
Little elisp snippet to stow a specific module in the Dotfiles folder using ivy.
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(ivy-read
|
(ivy-read
|
||||||
"Enter module: "
|
"Stow module: "
|
||||||
(cdr
|
(get-modules)
|
||||||
(reverse
|
|
||||||
(split-string
|
|
||||||
(shell-command-to-string "find . -maxdepth 1 -type 'd' -not -name '.git' -not -name '.'")
|
|
||||||
"\n")))
|
|
||||||
:require-match t
|
:require-match t
|
||||||
:action (lambda (choice) (async-shell-command (format "stow %s" choice) "*stow-output*" "*stow-error*")))
|
:action (lambda (choice) (async-shell-command (format "stow %s" choice) "*stow-output*" "*stow-error*")))
|
||||||
#+END_SRC
|
#+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
|
* Generate user directories
|
||||||
This makes some useful directories that are used by the system and/or by me. I
|
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.
|
split these into two sections so you can execute the ones you think are useful.
|
||||||
|
|||||||
Reference in New Issue
Block a user