Añadir configuración de emacs, licencia y mejora instalación

This commit is contained in:
drymer 2016-11-10 12:57:53 +01:00
parent a79fbed045
commit 0370bdcff1
9 changed files with 2278 additions and 28 deletions

15
LICENSE Normal file
View File

@ -0,0 +1,15 @@
Author:: drymer <drymer [ EN ] autistici.org>
Copyright:: Copyright (c) 2016, drymer
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@ -1,4 +1,15 @@
# dotfiles<a id="orgheadline1"></a>
<div id="table-of-contents">
<h2>&Iacute;ndice</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgb5c9783">1. dotfiles</a></li>
</ul>
</div>
</div>
<a id="orgb5c9783"></a>
# dotfiles
Este repositorio contiene los siguientes archivos y directorios:
@ -15,8 +26,12 @@ Este repositorio contiene los siguientes archivos y directorios:
- `scripts`: varios scripts para i3blocks y i3
- El directorio `mutt` que contiene archivos de configuración y scripts para neomutt, offlineimap, abook y notmuch. Los nombres de los archivos son lógicos, por lo que no requieren explicación. Se puede leer más sobre el tema en este [articulo](https://daemons.cf/posts/neomutt-offlineimap-notmuch-abook-sustituyendo-a-los-gestores-de-correo-monstruosos/index.html).
- El directorio `mutt`, que contiene archivos de configuración y scripts para neomutt, offlineimap, abook y notmuch. Los nombres de los archivos son lógicos, por lo que no requieren explicación. Se puede leer más sobre el tema en este [articulo](https://daemons.cf/posts/neomutt-offlineimap-notmuch-abook-sustituyendo-a-los-gestores-de-correo-monstruosos/index.html).
- El directorio `qutebrowser` que contiene archivos de configuración para qutebrowser. Incluye el script para capturar links en `org-mode` y para reproducir videos.
- El directorio `qutebrowser`, que contiene archivos de configuración para qutebrowser. Incluye el script para capturar links en `org-mode` y para reproducir videos.
Ver ayuda con `bash instala.sh`.
- El directorio `emacs.d`, que contiene archivos de configuración de emacs. Incluye el script para capturar links de de `qutebrowser` y el script para usar emacs.
Uso:
./instala.sh {all, X, i3, tmux, qutebrowser, emacs}

View File

@ -15,8 +15,14 @@ Este repositorio contiene los siguientes archivos y directorios:
+ =scripts=: varios scripts para i3blocks y i3
- El directorio =mutt= que contiene archivos de configuración y scripts para neomutt, offlineimap, abook y notmuch. Los nombres de los archivos son lógicos, por lo que no requieren explicación. Se puede leer más sobre el tema en este [[https://daemons.cf/posts/neomutt-offlineimap-notmuch-abook-sustituyendo-a-los-gestores-de-correo-monstruosos/index.html][articulo]].
- El directorio =mutt=, que contiene archivos de configuración y scripts para neomutt, offlineimap, abook y notmuch. Los nombres de los archivos son lógicos, por lo que no requieren explicación. Se puede leer más sobre el tema en este [[https://daemons.cf/posts/neomutt-offlineimap-notmuch-abook-sustituyendo-a-los-gestores-de-correo-monstruosos/index.html][articulo]].
- El directorio =qutebrowser= que contiene archivos de configuración para qutebrowser. Incluye el script para capturar links en =org-mode= y para reproducir videos.
- El directorio =qutebrowser=, que contiene archivos de configuración para qutebrowser. Incluye el script para capturar links en =org-mode= y para reproducir videos.
Ver ayuda con =bash instala.sh=.
- El directorio =emacs.d=, que contiene archivos de configuración de emacs. Incluye el script para capturar links de de =qutebrowser= y el script para usar emacs.
Uso:
#+BEGIN_SRC bash :results raw
./instala.sh {all, X, i3, tmux, qutebrowser, emacs}
#+END_SRC

22
emacs.d/capture Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# windows: bind Y spawn mintty --nopin -w hide -e C:\\cygwin\\usr\\local\\bin\\capture.py {url};; yank -t
# gnu/linux: bind Y yank -t;; spawn capture {url}
#
# (setq org-capture-templates
# ...
# ("w" "Marcadors" entry (file "~/org/web.org")
# "* %x\n %U\n %c"
# :empty-lines 1)
# ...
# ))
from urllib import quote
from sys import argv, exit
from subprocess import call
url = quote(argv[1], safe='')
call(['emacsclient', 'org-protocol:/capture:/w/' + url])

10
emacs.d/demacs Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
USERID=`id -u`
if [[ ! -e /tmp/emacs$USERID/server ]]
then
emacs --daemon
emacsclient -c -n -e '(load-file "/tmp/powerline.el")' -e "(org-agenda-list)"
else
emacsclient -c -n -e "(org-agenda-list)"
fi

2121
emacs.d/init-literate.org Normal file

File diff suppressed because it is too large Load Diff

21
emacs.d/init.el Normal file
View File

@ -0,0 +1,21 @@
;; Antes que nada, quitamos del path el org-mode que viene con emacs, por que es viejo
(dolist (val load-path)
(if (string-match "lisp\/org" val)
(progn
(setq org-viejo val)
(delete val load-path)
)
)
)
;; Se añade la ruta del org-mode nuevo
(add-to-list 'load-path (concat user-emacs-directory "el-get/org-mode-maint/lisp/"))
;; Se intenta cargar el org-mode más nuevo. Si falla, vuelve a añadir al path la versión vieja para poder cargar el fichero de configuración
(unless (require 'org nil 'noerror)
(add-to-list 'load-path org-viejo)
)
;; Se carga la configuración pública y la privada
(org-babel-load-file (concat user-emacs-directory "init-literate.org"))
(org-babel-load-file (concat user-emacs-directory "private-literate.org"))

View File

@ -187,6 +187,8 @@ exec --no-startup-id bash ~/.i3/scripts/autolock.sh
exec --no-startup-id parcellite
# Move programs to workspace
assign [title="emacs@netbook"] $ws1
assign [title="emacs-24.5@netbook"] $ws1
assign [class="(?i)firefox"] $ws2
assign [class="(?i)tor"] $ws2
assign [class="(?i)qutebrowser"] $ws2
@ -195,8 +197,6 @@ assign [title="mutt"] $ws9
assign [class="(?i)keepassx"] $ws5
assign [class="(?i)mumble"] $ws8
assign [title="bittorrent"] $ws3
assign [title="emacs-24.5-with-x11@slacky"] $ws1
assign [title="emacs@netbook"] $ws1
assign [title="Steam"] $ws7
assign [class="(?i)mpv"] $ws8

View File

@ -1,42 +1,82 @@
#!/bin/bash
#
# Author:: drymer <drymer [ EN ] autistici.org>
# Copyright:: Copyright (c) 2016, drymer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
if [[ $1 = "all" ]]
then
for file in `ls | grep -v "README\|instala.sh"`
do
cp -r $(pwd)/$file $HOME/.$file
done
bash instala.sh X
bash instala.sh i3
bash instala.sh tmux
bash instala.sh qutebrowser
bash instala.sh emacs
elif [[ $1 = "X" ]]
then
cp $(pwd)/Xdefaults $HOME/.Xdefaults
cp $(pwd)/Xmodmap $HOME/.Xmodmap
ln -sf $(pwd)/Xdefaults $HOME/.Xdefaults
ln -sf $(pwd)/Xmodmap $HOME/.Xmodmap
elif [[ $1 = "i3" ]]
then
cp -r $(pwd)/i3 $HOME/.i3
cp $(pwd)/i3/i3blocks.conf $HOME/.i3blocks.conf
ln -sf $(pwd)/i3 $HOME/.i3
ln -sf $(pwd)/i3/i3blocks.conf $HOME/.i3blocks.conf
elif [[ $1 = "mutt" ]]
then
cp -r $(pwd)/mutt $HOME/.mutt
cp $(pwd)/mutt/muttrc.example $HOME/.muttrc
cp $(pwd)/mutt/offlineimaprc.example $HOME/.offlineimaprc
ln -sf $(pwd)/mutt $HOME/.mutt
ln -sf $(pwd)/mutt/muttrc.example $HOME/.muttrc
ln -sf $(pwd)/mutt/offlineimaprc.example $HOME/.offlineimaprc
elif [[ $1 = "tmux" ]]
then
cp $(pwd)/tmux.conf $HOME/.tmux.conf
ln -sf $(pwd)/tmux.conf $HOME/.tmux.conf
elif [[ $1 = "qutebrowser" ]]
then
mkdir -p $HOME/.config/qutebrowser/
cp -r $(pwd)/qutebrowser/*.conf $HOME/.config/qutebrowser/
ln -sf $(pwd)/qutebrowser/{qutebrowser.conf,keys.conf} $HOME/.config/qutebrowser/
echo "Necesito permiso de superusuaria para copiar los archivos hosts, capture y umpv a su sitio."
sudo cp $(pwd)/qutebrowser/{capture,umpv} /usr/local/bin/
sudo cp $(pwd)/qutebrwoser/hosts/ /etc/hosts
sudo ln -sf $(pwd)/qutebrowser/{capture,umpv} /usr/local/bin/
sudo ln -sf $(pwd)/qutebrwoser/hosts/ /etc/hosts
elif [[ $1 = "emacs" ]]
then
EMACSDIR="$HOME/.emacs.d"
mkdir -p $EMACSDIR
cp $(pwd)/emacs.d/{init.el,init-literate.org} $EMACSDIR
# crear private-literate.org si no existe para que no se queje init.el
if [[ ! -e $EMACSDIR/private-literate.org ]]
then
echo -e "* Vacio\n#+BEGIN_SRC emacs-lisp\n#+END_SRC" > $EMACSDIR/private-literate.org
fi
echo "Instalando paquetes de emacs."
emacs -Q --batch --eval "(ignore-errors (load-file \""$EMACSDIR/"init.el\"))"
emacs -Q --batch --eval "(ignore-errors (load-file \""$EMACSDIR/"init-literate.el\"))"
emacs -Q --batch --eval '(ignore-errors (load-file "/tmp/powerline.el"))'
# Por algun motivo al compilar desde el-get mete una ruta incorrecta en org-loaddefs.el
find $EMACSDIR -name 'org-loaddefs.el' | xargs sed -i "s,org-mode-maint/lisp/,,g"
echo "Necesito permiso de superusuario para copiar los scripts capture y demacs en /usr/local/bin/."
sudo ln -sf $(pwd)/emacs.d/{capture,demacs} /usr/local/bin/
elif [[ $1 = "" ]]
then
echo "bash instala.sh {all, X, i3, tmux, qutebrowser}"
echo "./instala.sh {all, X, i3, tmux, qutebrowser, emacs}"
else
echo "No existe ese parámetro. Escoge: {all, X, i3, tmux, qutebrowser}"
echo "No existe ese parámetro. Escoge: {all, X, i3, tmux, qutebrowser, emacs}"
fi