diff --git a/contrib/paradox/README.md b/contrib/paradox/README.md new file mode 100644 index 000000000..d647c54b7 --- /dev/null +++ b/contrib/paradox/README.md @@ -0,0 +1,43 @@ +# Paradox + +This contrib layer switches the old list-packages for the more feature +rich Paradox package. you can find more info +[here](https://github.com/Bruce-Connor/paradox). Important this will +override your old `list-packages`. + +## Usage + +You can do `SPC a P` to open paradox-list-packages. Sad part is that +for now you can only swap to evil-emacs-state `C-z` and navigate with +n and p, other helpful tips show when you press `h`. Refer to the +github page of the package for more info. + +## Repo stars + +To be able to star packages you have to create a github +[token](https://github.com/settings/tokens/new) and only add Read +permissions to your public repos then you set it in your +configuration files like this: + +```elisp + (setq paradox-github-token "") +``` + +### OR + +If you are feeling like so, create a .authinfo.gpg file in your home +directory. (With Emacs, obviously... `C-x C-f ~/.authinfo.gpg RET`). + +The contents of this file follow +[netrc guidelines](http://www.gnu.org/software/emacs/manual/html_node/auth/Help-for-users.html). +You should have a file like this: + +``` +machine github.com user paradox password port paradox +``` + +And then proceed to save that buffer. Just going for `OK` in the pop up +menu is OK. Enter your super secure password and now you have your +GitHub token being accesed securely ( even though you only gave +permissions to read your public repos, I'm sure I'll find another use +for this code later) diff --git a/contrib/paradox/packages.el b/contrib/paradox/packages.el new file mode 100644 index 000000000..9af18df61 --- /dev/null +++ b/contrib/paradox/packages.el @@ -0,0 +1,43 @@ +(defvar paradox-packages + '( + paradox + ) + "List of all packages to install and/or initialize. Built-in packages +which require an initialization must be listed explicitly in the list.") + +(defvar paradox-excluded-packages '() + "List of packages to exclude.") + +;; For each package, define a function paradox/init- +;; +(defun paradox/init-paradox () + (use-package paradox + :commands paradox-list-packages + :defer t + :init + (progn + (defun spacemacs/paradox-list-packages () + (interactive) + (require 'epa-file) + (require 'auth-source) + (when (and (not (boundp 'paradox-github-token)) + (file-exists-p "~/.authinfo.gpg")) + (let ((authinfo-result (car (auth-source-search + :max 1 + :host "github.com" + :port "paradox" + :user "paradox" + :require '(:secret))))) + (let ((paradox-token (plist-get authinfo-result :secret))) + (setq paradox-github-token (if (functionp paradox-token) + (funcall paradox-token) + paradox-token))))) + (paradox-list-packages nil)) + + (eval-after-load "evil-leader" + (evil-leader/set-key + "aP" 'spacemacs/paradox-list-packages)) + ) + )) + +