...
 
Commits (9)
......@@ -35,7 +35,7 @@ super + space
# lock screen
super + shift + l
xlock
xautolock -locknow
# screen capture
super + @Print
......
#!/bin/sh
#!/bin/bash
# cbd -- clear the clipboard every 4 minutes of X inactivity
#
# This tool is designed to prevent accidental pastes or leaks of data collected
......
......@@ -34,9 +34,9 @@ SCTD_TEMP_TABLE=(
while true; do
now=$(date +"%H")
ind=$((now + 1))
#ind=$(bc <<< "$now + 1")
ind=$((10#$now + 1))
val=${SCTD_TEMP_TABLE[$ind]}
sct "$val" && echo "i:$ind v:$val"
sleep 240
done
......@@ -6,22 +6,38 @@
# See Xsession(5) for more information.
#
# turn off display after 8 minutes of inactivity
xset dpms 480 480 480
# DPMS (Energy Start)
if [ "${X_DPMS}" = "yes" ]; then
# turn off display after 8 minutes of inactivity
xset dpms 480 480 480
else
# disable DPMS features
xset dpms 0 0 0
xset -dpms
fi
# auto lock screen after 8 minutes of inactivity
xautolock -secure -time 8 -locker xlock &
# inhibit lid suspend switch
if [ "${X_LIDSUSPEND}" = "no" ]; then
systemd-inhibit --what=handle-lid-switch sleep 365d &
fi
# start system's default terminal emulator
x-terminal-emulator &
# auto lock screen after TIME minutes of inactivity
# suspend-then-hibernate after KILLTIME minutes
xautolock -detectsleep \
-time "$X_LOCKTIME" -locker "xlock" \
-killtime "$X_KILLTIME" -killer "systemctl suspend-then-hibernate" &
# start notification server
/usr/lib/notification-daemon/notification-daemon &
# start the hotkey daemon (see ~/.config/sxhkd/sxhkdrc)
sxhkd &
#pkill -USR1 -x sxhkd || sxhkd &
# screen color temperature daemon
sctd &
#setsid sctd >/dev/null 2>&1 < /dev/null &
# clear clipboard when user is idle
cbd &
# set wallpaper and cursor
xsetroot -cursor_name left_ptr
......
......@@ -16,8 +16,15 @@
# set wallpaper to filename or solid color
export X_WALLPAPER="${X_WALLPAPER:-#222222}"
# define bpswm colors
# bspwm
export BSPWM_BORDER_COLOR="${BSPWM_BORDER_COLOR:-#888888}"
export BSPWM_FOCUSED_COLOR="${BSPWM_FOCUSED_COLOR:-#FFFFFF}"
export BSPWM_PRESEL_COLOR="${BSPWM_PRESEL_COLOR:-$BSPWM_FOCUSED_COLOR}"
# xautolock
export X_LOCKTIME="${X_LOCKTIME:-8}"
export X_KILLTIME="${X_KILLTIME:-24}"
# power management
export X_DPMS="${X_DPMS:-yes}"
export X_LIDSUSPEND="${X_LIDSUSPEND:-yes}"
......@@ -18,6 +18,8 @@
(require 'cl)
(defvar user-home-directory (getenv "HOME"))
(progn
......@@ -44,18 +46,6 @@ And load `use-package'..."
(require 'use-package))
(progn
"Load local settings
These settings are often sensitive or too much specific and not
worth to share."
;; Load local settings if it exists
(load "~/etc/emacs/local.el.gpg" t))
(progn
......@@ -82,6 +72,17 @@ user)."
(setq file (concat "/sudo::" file)))
(find-file file)))
(defun semente-call-or-switch-to-buffer (function buffer-name)
"Invoke FUNCTION if there is no buffer with BUFFER-NAME.
Otherwise switch to the buffer named BUFFER-NAME. Don't clobber
the current buffer."
(if (not (get-buffer buffer-name))
(progn
(split-window-sensibly (selected-window))
(other-window 1)
(funcall function))
(switch-to-buffer-other-window buffer-name)))
(defun semente-switch-to-minibuffer ()
"Switch to minibuffer window."
(interactive)
......@@ -127,9 +128,8 @@ You may find other key bindings inside use-package statements."
"General and most essential settings"
(setq user-full-name semente-full-name
user-mail-address semente-mail-address
user-home-directory (getenv "HOME"))
(setq user-full-name "semente"
user-mail-address "semente@localhost")
;; This variable is the equivalent of the PATH environment variable for Emacs
(setq exec-path
......@@ -169,6 +169,9 @@ You may find other key bindings inside use-package statements."
'((:eval (if buffer-file-name "%f" "%b")) " - " "Emacs")
icon-title-format frame-title-format)
(add-to-list 'default-frame-alist '(height . 30))
(add-to-list 'default-frame-alist '(width . 90))
;; If you are using emacs under X you might like the following
;; setting which puts the underline below the font bottomline
;; instead of the baseline.
......@@ -226,7 +229,7 @@ You may find other key bindings inside use-package statements."
tab-width 4)
;; column beyond which automatic line-wrapping should happen
(setq-default fill-column 80)
(setq-default fill-column 70)
(defalias 'yes-or-no-p 'y-or-n-p)
(put 'narrow-to-region 'disabled nil)
......@@ -235,9 +238,12 @@ You may find other key bindings inside use-package statements."
(menu-bar-mode -1)
(tool-bar-mode -1)
(set-scroll-bar-mode nil)
(show-paren-mode t)
(electric-pair-mode 1)
(show-paren-mode t)
(setq show-paren-when-point-inside-paren t
show-paren-when-point-in-periphery t)
;; cursor
(blink-cursor-mode t)
(setq blink-cursor-blinks 5)
......@@ -819,10 +825,18 @@ You may find other key bindings inside use-package statements."
:defer
:init
(add-hook 'emacs-lisp-mode-hook 'checkdoc-minor-mode)
(add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
(add-hook 'emacs-lisp-mode-hook 'eldoc-mode))
(use-package highlight-parentheses
:ensure t
:config
(setq show-paren-when-point-inside-paren t
show-paren-when-point-in-periphery t))
(setq hl-paren-colors '(nil nil nil nil)
hl-paren-attributes
'((:inherit show-paren-match)
(:weight bold)
(:weight bold)
(:weight bold)))
(global-highlight-parentheses-mode))
(use-package lisp-extra-font-lock
:ensure t
......@@ -1028,8 +1042,7 @@ You may find other key bindings inside use-package statements."
(diminish 'orgtbl-mode "") ; XXX: not working
(setq org-babel-load-languages '((emacs-lisp . t) (shell . t) (python . t))
org-export-backends '(ascii html icalendar latex odt md)
org-capture-templates semente-org-capture-templates)
org-export-backends '(ascii html icalendar latex odt md))
(setq org-archive-default-command 'org-archive-subtree
org-archive-location "~/org/archive.org.gpg::* %s :archive:"
org-archive-reversed-order t)
......@@ -1096,42 +1109,58 @@ You may find other key bindings inside use-package statements."
"E-mail"
(use-package notmuch
:defer
:bind ("C-c r" . 'notmuch)
:bind ("C-c r" . 'semente-notmuch)
:bind ("C-x m" . 'notmuch-mua-mail)
:preface
(defun semente-notmuch ()
(interactive)
(semente-call-or-switch-to-buffer 'semente-notmuch-and-poll "*notmuch-hello*"))
(defun semente-notmuch-and-poll ()
(interactive)
(notmuch-poll)
(notmuch)
(notmuch-refresh-all-buffers))
:config
(setq notmuch-show-logo nil
notmuch-hello-thousands-separator ""
notmuch-fcc-dirs (concat (format-time-string "%Y") " +sent -unread")
notmuch-crypto-process-mime t
mail-user-agent 'message-user-agent)
(setq notmuch-hello-sections
'(notmuch-hello-insert-header
;; notmuch-hello-insert-inbox
notmuch-hello-insert-saved-searches
notmuch-hello-insert-alltags
notmuch-hello-insert-recent-searches))
(setq notmuch-saved-searches
'((:name "inbox" :query "tag:inbox" :key "i")
(:name "unread" :query "tag:unread" :key "u")
(:name "priority" :query "tag:inbox tag:flagged -tag:list -tag:note -tag:junk" :key "p")
(:name "notes" :query "tag:note" :key "n")
(:name "junk" :query "tag:junk" :key "j")
(:name "flagged" :query "tag:flagged" :key "f")
(:name "sent" :query "tag:sent" :key "t")
(:name "drafts" :query "tag:draft" :key "d")
(:name "spam" :query "tag:spam" :key "s")
(:name "all mail" :query "*" :key "a")))
'((:name "inbox" :key "i" :query "tag:inbox" )
(:name "unread" :key "u" :query "tag:unread" )
(:name "flagged" :key "f" :query "tag:flagged")
(:name "last-7d" :key "7" :search-type tree
:query "date:7-days.. OR (date:7-days.. AND (tag:deleted OR tag:spam))")
(:name "blitz" :key "b" :query "tag:blitz")
(:name "list" :key "l" :query "tag:list and tag:unread")
(:name "news" :key "n" :query "tag:news and tag:unread")
(:name "junk" :key "j" :query "tag:junk and tag:unread")
(:name "spam" :key "s" :query "tag:spam" )
(:name "sent" :key "t" :query "tag:sent" )
(:name "drafts" :key "d" :query "tag:draft")
(:name "all mail" :key "a" :query "*")))
(setq notmuch-search-result-format
'(("date" . "%12s ")
("count" . "%s ")
("authors" . "%14s ")
("tags" . "%s ")
("subject" . "%s")))
("count" . "%-7s ")
("authors" . "%-12s ")
("subject" . "%s ")
("tags" . "%s")))
(setq notmuch-tree-result-format
'(("date" . "%12s ")
("authors" . "%-12s ")
((("tree" . "%s")
("subject" . "%s"))
. " %-54s ")
("tags" . "%s")))
(setq notmuch-tag-formats
'(("unread"
(propertize tag 'face 'notmuch-tag-unread))
......@@ -1142,6 +1171,12 @@ You may find other key bindings inside use-package statements."
(use-package message
:defer
:config
;; support for format=flowed messages
(add-hook 'message-mode-hook
(defun semente-use-hard-lines ()
"Use hard newlines, so outgoing mails will have format=flowed (RFC 3676)."
(use-hard-newlines t 'guess)))
(setq message-directory "~/mail"
message-alternative-emails nil ; will use notmuch builtin support
message-dont-reply-to-names message-alternative-emails
......@@ -1152,16 +1187,19 @@ You may find other key bindings inside use-package statements."
message-subject-re-regexp
"^[ ]*\\([Rr][Ee][Ss]?\\(\\[[0-9]*\\]\\)*:[ ]*\\)*[ ]*")
;; msmtp
(progn
(setq sendmail-program "/usr/bin/msmtp"
send-mail-function 'sendmail-send-it
mail-specify-envelope-from t
mail-envelope-from 'header)
(setq message-send-mail-function 'message-send-mail-with-sendmail
message-sendmail-extra-arguments '("--read-envelope-from")
message-sendmail-envelope-from 'header
message-sendmail-f-is-evil t)))
;; It has been suggested that 66 character lines are the most readable
(setq message-fill-column 66))
;; msmtp
(progn
(setq sendmail-program "/usr/bin/msmtp"
send-mail-function 'sendmail-send-it
mail-specify-envelope-from t
mail-envelope-from 'header)
(setq message-send-mail-function 'message-send-mail-with-sendmail
message-sendmail-extra-arguments '("--read-envelope-from")
message-sendmail-envelope-from 'header
message-sendmail-f-is-evil t))
;; PGP setup
(progn
......@@ -1190,4 +1228,15 @@ You may find other key bindings inside use-package statements."
(load custom-file))
(progn
"Load local settings
These settings are often sensitive or too much specific and not
worth to share."
;; Load local settings if it exists
(load "~/etc/emacs/local.el.gpg" t))
;;; .emacs ends here
# -*- mode: conf -*-
MAILDIR="$HOME/mail"
LOGFILE="$MAILDIR/procmail.log"
LOCKFILE="$MAILDIR/procmail.lock"
LOGFILE="$MAILDIR/procmail.log"
LOGABSTRACT=yes
VERBOSE=yes
YEARFOLDER=`date +'%Y'`
DEFAULT="$MAILDIR/${YEARFOLDER}/"
DUMMY=`test -d "${DEFAULT}" || mkdir -p "${DEFAULT}"`
INCLUDERC="$HOME/etc/recipesrc"
# no duplicates
:0 Wh: msgid.lock
| formail -D "8192" "${MAILDIR}/msgid.cache"
# add the X-Spam headers with SpamAssassin
:0fw: spamassassin.lock
* < 512000
| spamassassin