First commit
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Mon, 6 Oct 2014 13:53:49 +0000 (15:53 +0200)
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Mon, 6 Oct 2014 13:53:49 +0000 (15:53 +0200)
.gitignore [new file with mode: 0644]
.wl [new file with mode: 0644]
.xinitrc [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..1189c62
--- /dev/null
@@ -0,0 +1,2 @@
+*\#*
+*~
diff --git a/.wl b/.wl
new file mode 100644 (file)
index 0000000..577129b
--- /dev/null
+++ b/.wl
@@ -0,0 +1,153 @@
+;; mode: -*-emacs-lisp-*-
+
+(setq wl-stay-folder-window t
+      wl-local-domain "gpcf.eu"
+      wl-message-id-domain "aubergine.gpcf.eu"
+      wl-from (concat user-full-name " <" user-mail-address ">")
+      ;; here starts all the maildir stuff
+      elmo-maildir-folder-path "~/Maildir"
+      wl-fcc ".sent"
+      wl-trash-folder ".trash" 
+      wl-queue-folder ".queue"
+      signature-file-name "~/.signature"
+      signature-insert-at-eof t
+      signature-delete-blank-lines-at-eof t
+      wl-draft-send-mail-function 'wl-draft-send-mail-with-sendmail
+      sendmail-program (expand-file-name "~/software/mail/savemail.py")
+      default-mime-charset 'utf8
+      wl-fcc-force-as-read t
+      wl-interactive-send nil
+      )
+
+(setq mime-edit-insert-user-agent-field nil)
+
+(setq wl-generate-mailer-string-function
+      ; set X-Mailer string
+      (function
+       (lambda ()
+         (format "GNU Emacs Version 24.3, %s, GNU/Linux" (product-string-1 'wl-version)))))
+
+(setq wl-demo-display-logo nil)
+(mc-install-read-mode)
+
+
+(defun mc-wl-verify-signature ()
+  (interactive)
+  (save-window-excursion
+    (wl-summary-jump-to-current-message)
+    (mc-verify)))
+
+(defun mc-wl-decrypt-message ()
+  (interactive)
+;  (wl-summary-enter-handler)
+  (save-window-excursion
+    (wl-summary-jump-to-current-message)
+    (gpcf-decrypt-mail)))
+
+(eval-after-load "mailcrypt"
+  '(setq mc-modes-alist
+       (append
+        (quote
+         ((wl-draft-mode (encrypt . mc-encrypt-message)
+            (sign . mc-sign-message))
+          (wl-summary-mode (decrypt . mc-wl-decrypt-message)
+            (verify . mc-wl-verify-signature))))
+        mc-modes-alist)))
+(add-hook 'wl-summary-mode-hook
+         ;; Set keybindings for
+         ;; PGP-Inline
+         '(lambda ()
+            (local-set-key "k" 'mc-wl-decrypt-message)
+            (local-set-key "0" 'mc-wl-verify-signature)
+            (local-set-key "X" '(lambda ()
+                                       ; checks for mail remotely using rsync.
+                                  (interactive)
+                                  (shell-command 
+                                  (concat (expand-file-name "~/software/mail/getmail.sh") " > /dev/null 2>&1"))
+                                  (wl-summary-incorporate)
+                                  ))
+))
+(defun gpcf-decrypt-mail ()
+  "Decrypts mail in MIME preview buffer. Works with both PGP/MIME
+and PGP-Inline"
+  (interactive)
+  (save-excursion
+    (beginning-of-buffer)
+    (cond 
+     ;; PGP/MIME
+     ((search-forward "<application/pgp-encrypted" nil t)
+      (let ((id "") (mess ""))
+       (save-window-excursion 
+         (mime-preview-extract-current-entity)
+         (when (string-match "-[0-9]+" (buffer-name))
+           (setq id (substring (buffer-name) (match-beginning 0) (match-end 0)))
+           ))
+       (search-forward "]")
+       (save-window-excursion 
+         (switch-to-buffer (concat "*Preview- *WL:Message*" id "*"))
+         (let ((temp-point (point)))
+           (end-of-buffer)
+           (setq mess (buffer-substring temp-point (point)))
+           (kill-buffer))
+         )
+       (let ((temp-point (point)) (inhibit-read-only t))
+         (search-backward "This part is encrypted" nil t)
+         (delete-region (point) temp-point)
+         (insert mess)
+         )))
+     ;;; PGP/INLINE
+     ((search-forward "-----BEGIN PGP MESSAGE-----" nil t)
+      (let ((inhibit-read-only t))
+       (mc-decrypt)))
+     (t (error "No GPG encrypted message found in this file."))))
+  )
+
+(autoload 'sm-add-emacs-name "silly-mail" nil t)
+(defun gpcf-setup-mail ()
+  "This function prepares the draft mode.
+It add headers and defines keyboard shortcuts.  Before the
+message is sent, it adds the user's signature."
+  (if  (string= "*draft*" (buffer-name))
+      (progn
+       (setq enc-color (face-remap-add-relative 'mode-line :background "dark red"))
+       (set-input-method "TeX")
+       (sm-add-emacs-name) ;; add silly headers
+       (sm-add-microsoft)
+       (sm-put-header "X-PGP-Key" "http://gpcf.eu/key.asc") 
+       (local-set-key (kbd "C-c e") '(lambda () 
+                                       (interactive)
+                                       (mime-edit-set-encrypt t)
+                                       (mime-edit-set-sign t)                                
+                                       (message 
+                                        "This message will be signed and encrypted") 
+                                       (face-remap-remove-relative enc-color)
+                                       ))
+       (local-set-key (kbd "C-c s") 'ispell-message)
+       (local-set-key (kbd "C-c c") '(lambda ()
+                                     ;;; save email to queue and send it using SSH.
+                                       (interactive)
+                                       (wl-draft-send-and-exit)
+                                       (call-process-shell-command 
+                                        (concat (expand-file-name "~/software/mail/sendmail.sh") "&") 
+                                        nil 0)
+                                       ))
+       (delete-other-windows))
+    (mail-signature) ;; add signature
+    ))
+
+(add-hook 'mime-edit-mode-hook 'gpcf-setup-mail)
+; single window mode.
+(setq wl-stay-folder-window nil
+      wl-draft-use-frame    nil
+      wl-summary-move-order 'unread
+)
+;; Prevent wl from splitting large messages
+(setq mime-edit-split-message nil)
+
+;; my E-Mail addresses:
+(setq wl-user-mail-address-list  '("gabriel@gpcf.eu"
+                                  "gpcf@gpcf.eu"))
+(setq wl-summary-showto-folder-regexp ".*sent.*")
+
+;; AUTO-REFILE rules
+(load "~/.emacs.d/files/refile-rules.el")
diff --git a/.xinitrc b/.xinitrc
new file mode 100644 (file)
index 0000000..e86e8d7
--- /dev/null
+++ b/.xinitrc
@@ -0,0 +1,56 @@
+#!/bin/bash
+# Copyright (c) 2014 Gabriel Perez-Cerezo.
+while true
+do
+       TIME="<span foreground=\"#F0F\" >  $(date "+%-d/%-m/%y %H:%M")</span>"
+       MESSAGES="$(find /home/gpcf/Maildir/inbox/new -type f | wc -l)"
+       QUEUE="$(ls /home/gpcf/Maildir/queue/cur | wc -l)"
+       if [ $QUEUE -gt 0 ] 
+       then
+           COLOR="#FA0"
+       else
+           COLOR="#F0F"
+       fi
+       TIME="<span foreground=\"#0FA\"><i>$QUEUE</i></span> <span font_desc=\"Icons 10\" foreground=\"$COLOR\"></span> | $TIME"
+       if [ $MESSAGES -gt 0 ]
+       then
+           COLOR="#0AF"
+       else
+           COLOR="#0F0"
+       fi
+       TIME="<span foreground=\"#F0A\"><i>$MESSAGES</i></span> <span font_desc=\"Icons 10\" foreground=\"$COLOR\"></span> | $TIME"
+       if ssh-add -l > /dev/null
+       then
+           COLOR="#0FA"
+       else
+           COLOR="#F00"
+       fi
+       TIME="<span foreground=\"$COLOR\" font_desc=\"Icons 10\" ></span> | $TIME"
+       if acpi -a | grep off-line > /dev/null
+       then
+           BAT="$(acpi -b | cut -d " " -f 4-5 | tr -d ',')"
+           AVAILABLE="$(echo $BAT | cut -d '%' -f 1)"
+           if [ $AVAILABLE -gt 90 ]
+               then 
+               COLOR="#0F0"
+           elif [ $AVAILABLE -gt 20 ]
+               then
+               COLOR="yellow"
+           else
+               COLOR="red\" weight=\"bold"
+           fi
+           BAT="<span foreground=\"$COLOR\" >$BAT</span>"
+           TIME="$BAT | $TIME"
+       fi
+       TIME="<span foreground=\"#FF0\" font_desc=\"Icons 10\" ></span> | $TIME"
+
+       xsetroot -name "$TIME"
+       sleep 5
+done &
+
+
+
+feh --bg-fill ~/Pictures/granada/DSCN0459.JPG
+emacs &
+
+exec msva-perl dwm