I have been using my Xmonad-based desktop environment since mid 2010 and it has improved my productivity a lot. Hereby I present my configuration, which has proven to be valuable especially for text-oriented work like software development.
|
Contents
|
Xmonad is a tiling X window manager, that arranges application windows automatically. It exposes only about twenty well-defined operations with simple keybindings to control all the windows, workspaces, monitors. It has no visual overhead of overlapped windows, title bars, task bars, or graphical effects.
Xmobar
or dzen2 panel is
being recommended as a complementary program to see information about
workspaces, window title, clock, tray apps. I have tried that for a
while but it doesn't seem to affect productivity at all. Panel
clutters the workspace, showing information that is not needed most of
the time. It is not that difficult to remember which workspace is used
for some activity, and it can be checked quickly if
forgotten. Workspaces can be used instead of tray apps. When you need
to know current time, type date to a nearby console, or
use M-! date/M-x display-time in Emacs.
Here is the main configuration file:
-- ~/.xmonad/xmonad.hs
import XMonad
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Util.Run
import XMonad.Layout.HintedTile
import XMonad.Layout.NoBorders
import qualified XMonad.StackSet as W
myManageHook = composeAll
[ className =? "Gimp" --> doFloat ]
myLayoutHook = smartBorders (hintedTile XMonad.Layout.HintedTile.Tall ||| hintedTile Wide ||| Full)
where
-- default tiling algorithm partitions the screen into two panes
hintedTile = HintedTile nmaster delta ratio TopLeft
-- The default number of windows in the master pane
nmaster = 1
-- Default proportion of screen occupied by master pane
ratio = 6/10
-- Percent of screen to increment by when resizing panes
delta = 3/100
-- for better multimon support
myWorkspaces = ["1","2","3","4","5","6","7","8","9"]
myConfig = defaultConfig
{ manageHook = myManageHook
, layoutHook = myLayoutHook
, modMask = mod4Mask
, terminal = "urxvt"
, focusFollowsMouse = False
, workspaces = myWorkspaces
} `additionalKeys`
([((mod4Mask, xK_z), spawn "xscreensaver-command -lock")]
++
-- better multimon support, do not use greedyView stealing
-- workspaces from screens
[((m .|. mod4Mask, k), windows $ f i)
| (i, k) <- zip myWorkspaces [xK_1 .. xK_9]
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]])
main = xmonad myConfig
I tried to use magnifiercz (myLayouts = magnifiercz' 1.4 $
tiled ||| Mirror tiled ||| Full) and it didn't work well. Most
applications do not handle resizing properly. Fox example, Firefox
changed the displayed document position (what was visible) when
magnified.
I tried to spawn applications in xmonad's main function instead
of ~/.xinitrc, so I would be able to start xmonad using
GDM and /usr/share/xsessions/xmonad.desktop. It didn't
work well because of two reasons: 1. you cannot reload your
configuration file without running all the applications again;
2. ck-launch-session needs to execute xmonad, and not the
other way. From older configuration:
main = do spawn "stalonetray &" spawn "nm-applet &" spawn "start-pulseaudio-x11" spawn "/usr/libexec/gnome-settings-daemon" spawn "gnome-volume-control-applet &" spawn "system-config-printer-applet &" spawn "gnome-power-manager &" spawn "gnome-terminal &" spawn "emacs &" spawn "conky | dzen2 -x 600 -y 0 -w 600 -h 18 -ta 'r' -bg '#333333' -fg '#dfdfdf' -fn '-*-terminus-*-*-*-*-12-*-*-*-*-*-*-*' &" mainSbar <- spawnPipe "dzen2 -p -x '0' -y '0' -w '600' -h '18' -ta 'l' -fg '#dfdfdf' -bg '#242424' -fn '-*-terminus-*-*-*-*-12-*-*-*-*-*-*-*'"
Here is the session file, run when xmonad is started via GDM:
# ~/.xmonad/session xrdb -merge ~/.Xresources xsetroot -solid black xsetroot -cursor_name left_ptr setxkbmap -model pc105 -layout "us,cz" -variant ",qwerty" -option "grp:switch" -option "ctrl:nocaps" [ "`hostname`" != "alzbeta" ] && numlockx unclutter & xscreensaver &
I have only suffered from three issues related to Xmonad so far:
~/.xmonad/xmonad-x86_64-linux, and this
precompiled binary was depending on some no longer existing
symbol. The solution was to
delete ~/.xmonad/xmonad-x86_64-linux to force a
recompile.Xmonad doesn't support multiple mod keys. It would be handy to have a mod key available on both sides of a keyboard, without having to use Shift/Control/Alt.
A terminal emulator for the X Window System.
Configuration belongs to ~/.Xresources:
URxvt*font:xft:Dejavu Sans Mono:pixelsize=12:antialias=true:autohinting=true URxvt*loginShell: True URxvt*background: black URxvt*foreground: white URxvt*scrollBar: False URxvt*fading: 40 URxvt*fadeColor: black !!! 200000 lines were not enough to keep output of some programs URxvt*saveLines: 1000000 URxvt*scrollTtyOutput: False URxvt*scrollWithBuffer: True
A stand-alone system tray for X with minimal dependencies. No configuration is necessary, out of the box settings are ok. To be run only when testing some application which uses tray.
X.Org X11 X server.
# /etc/X11/xorg.conf.d/99-touchpad.conf Section "InputClass" Identifier "Touchpad Defaults" MatchIsTouchpad "on" Option "TapButton1" "1" Option "VertEdgeScroll" "on" EndSection
! ~/.Xresources !! !! URxvt specific !! URxvt*font:xft:Dejavu Sans Mono:pixelsize=12:antialias=true:autohinting=true URxvt*loginShell: True URxvt*background: black URxvt*foreground: white URxvt*scrollBar: False URxvt*fading: 40 URxvt*fadeColor: black !!! 200000 lines were not enough to keep output of some programs URxvt*saveLines: 1000000 URxvt*scrollTtyOutput: False URxvt*scrollWithBuffer: True !! !! Emacs specific !! emacs.background: black emacs.foreground: DarkGrey emacs.cursorColor: red4 emacs.menuBar: off emacs.toolBar: off emacs.cursorBlink: off emacs.verticalScrollBars: off
X.Org X11 X Window System xinit startup scripts.
If you want to start emacs --daemon
from ~/.xinitrc, Emacs desktop session must be disabled,
because that code sometimes asks questions on startup and expect a
terminal — it results in infinite loop, blocking the X startup.
# ~/.xinitrc xrdb -merge ~/.Xresources emacs --daemon & xsetroot -solid black xsetroot -cursor_name left_ptr setxkbmap -model pc105 -layout "us,cz" -variant ",qwerty" -option "grp:switch" -option "ctrl:nocaps" [ "`hostname`" != "alzbeta" ] && numlockx unclutter & xscreensaver & emacsclient -c & exec ck-launch-session xmonad #exec ck-launch-session gnome-session #exec ck-launch-session startkde
An utility that hides the mouse cursor from the screen when it is not moved for a specified amount of time or no buttons are pressed.
An utility that turns the numlock on in X. To be run
from ~/.xinitrc on desktops, but not on notebooks.
The server implementation of the freedesktop.org desktop notification specification. Notifications can be used to inform the user about an event or display some form of information without getting in the user's way.
The freedesktop.org shared MIME info database. It contains a list of default applications for mime types.
2010-12-07: filed a bug #660657 - application/xhtml+xml type missing in defaults.list. Has been fixed in Rawhide.
An extensible, customizable text editor, file browser, mail client, IRC client, organizer, calendar.
Download and check the development version:
bzr branch bzr://bzr.savannah.gnu.org/emacs/trunk emacs-trunk cd emacs-trunk ./autogen.sh ./configure make bootstrap
;-*- mode:lisp;coding:utf-8 -*-
(setq user-full-name "Karel Klíč")
(setq user-mail-address "kklic@redhat.com")
;; No splash screen
(setq inhibit-startup-message t)
;; No menu and tool bars in emacsclient frames (for pure emacs this is
;; also done via Xresources to avoid blinking on startup).
(menu-bar-mode -1)
(tool-bar-mode -1)
;; Highlight the matching paren
(show-paren-mode 1)
;; Beside the row I'd also like to see the column in the mode line
(column-number-mode 1)
;; Faster cross-window movement (meta-left.right,up,down).
(windmove-default-keybindings 'meta)
;; C-c left,right moves between window configuration.
(winner-mode 1)
;; Parse opened files with Semantic
(semantic-mode 1)
;; Enable EDE
(global-ede-mode 1)
;; Add .xhtml to html-mode extensions.
(if (string-match "23" (emacs-version)) ;; Merged in Emacs 24
(setq auto-mode-alist (cons '("\\.xhtml$" . html-mode) auto-mode-alist)))
;; Custom packages reside in .emacs.d
(setq load-path (cons "~/.emacs.d" load-path))
;; Load extension libraries only if they are present on the system
(if (locate-library "gtags") (require 'gtags))
(if (locate-library "git") (require 'git))
(setq scheme-program-name "guile")
;; List of variable-value pairs that are considered safe to be in file
;; local variable list.
(setq safe-local-variable-values '((py-indent-offset . 4)))
;; Set a sane font for emacs no matter how many fonts are available on
;; the system.
(add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-10"))
;;;=============================================================================
;;; Calendar
;;;=============================================================================
;; Set geographical and timezone variables
(setq calendar-latitude 49.2)
(setq calendar-longitude 16.6)
(setq calendar-location-name "Prague, CZ")
(setq calendar-time-zone 60)
(setq calendar-standard-time-zone-name "CET")
(setq calendar-week-start-day 1)
(setq display-time-24hr-format t)
;;;=============================================================================
;;; Trailing whitespace
;;;=============================================================================
;; Highlight trailing whitespaces. We do not want this enabled in
;; every mode, especially not in terminal, calc, gnus, compilation,
;; language interpreters.
(mapc '(lambda (mode)
(add-hook mode (lambda()
(setq show-trailing-whitespace t))))
;; Keep the list sorted alphabetically.
'(LaTeX-mode-hook
R-mode-hook
c-mode-common-hook
emacs-lisp-mode-hook
html-mode-hook
java-mode-hook
lisp-mode-hook
makefile-automake-mode-hook
makefile-mode-hook
python-mode-hook
rpm-spec-mode-hook
scheme-mode-hook
sh-mode-hook
text-mode-hook))
;;;=============================================================================
;;; Hideshow Mode
;;;=============================================================================
(mapc '(lambda (mode)
(add-hook mode (lambda()
(hs-minor-mode 1))))
;; Keep the list sorted alphabetically.
'(c-mode-common-hook
emacs-lisp-mode-hook
html-mode-hook
java-mode-hook
lisp-mode-hook
python-mode-hook
rpm-spec-mode-hook
scheme-mode-hook
sh-mode-hook))
;;;=============================================================================
;;; Dired
;;;=============================================================================
;; Enable Dired-X in dired
(add-hook 'dired-load-hook
(lambda ()
(load "dired-x")
;; Set dired-x global variables here.
(setq dired-omit-files
(concat dired-omit-files "\\|^\\..+$"))))
;; Set preferred commands for & and !.
(setq dired-guess-shell-alist-user
(list '("\\.avi$" "mplayer")
'("\\.wmv$" "mplayer")
'("\\.ogg$" "mplayer")
'("\\.flac$" "mplayer")
'("\\.mp3$" "mplayer")
'("\\.pdf$" "evince")
'("\\.jpg$" "eog")
'("\\.png$" "eog")))
;;;=============================================================================
;;; Snippets
;;;=============================================================================
;; Load yasnippet
(require 'yasnippet)
(yas/initialize)
(yas/load-directory "~/.emacs.d/snippets/")
;;;=============================================================================
;;; Spell check
;;;=============================================================================
(require 'ispell)
(setq-default ispell-program-name "aspell")
(setq ispell-dictionary "en")
;;;=============================================================================
;;; EDiff and Diff
;;;=============================================================================
;;; Colors make diff much more readable.
(custom-set-faces
'(diff-added ((t (:foreground "Green"))) 'now)
'(diff-removed ((t (:foreground "Red"))) 'now))
;; Use single frame for EDiff sessions. Neccessary when using a tiling
;; window manager.
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
;;;=============================================================================
;;; ERC
;;;=============================================================================
(require 'erc)
;;; Finally, connect to the networks.
(defun erc-connect ()
"Connect to IRC."
(interactive)
(erc :server "irc.freenode.net" :port 6667
:nick "kklic" :full-name "Karel Klic")
(erc :server "irc.eng.brq.redhat.com" :port 6667
:nick "kklic" :full-name "Karel Klic"))
;;;=============================================================================
;;; EMMS
;;;=============================================================================
(if (locate-library "emms")
(progn
(require 'emms-info-libtag)
(emms-devel)
(setq emms-player-list 'emms-player-mplayer)
(setq emms-info-functions 'emms-info-libtag)
(setq emms-source-file-default-directory "~/music/")
(global-set-key (kbd "C-c +") 'emms-volume-mode-plus)
(global-set-key (kbd "C-c -") 'emms-volume-mode-minus)
(global-set-key (kbd "C-c p s") 'emms-smart-browse)
(global-set-key (kbd "C-c p b") 'emms-browser)
(global-set-key (kbd "C-c p p") 'emms-playlist-mode-go)
(global-set-key (kbd "C-c p m") 'emms-metaplaylist-mode-go)))
;;;=============================================================================
;;; Org Mode
;;;=============================================================================
(require 'org-install)
(global-set-key (kbd "C-c 1") 'org-store-link)
(global-set-key (kbd "C-c b") 'org-iswitchb)
(global-set-key (kbd "C-c a") 'org-agenda)
(if (string-match "23" (emacs-version))
(progn
(add-hook 'remember-mode-hook 'org-remember-apply-template)
(org-remember-insinuate)
(global-set-key (kbd "C-c c") 'org-remember)
(setq org-remember-templates
'(("todo" ?t
"* TODO %?\n %U\n %a" "~/notes/refile.org")
("note" ?n
"* %?\n :NOTE:\n %U\n %a" "~/notes/refile.org")
("journal" ?j
"* %?\n %U" "~/notes/diary.org"))))
(progn ;; Emacs 24+
(global-set-key (kbd "C-c c") 'org-capture)
(setq org-capture-templates '(("t" "todo" entry (file "~/notes/refile.org")
"* TODO %?\n %U\n %a"
:clock-in t :clock-resume t)
("n" "note" entry (file "~/notes/refile.org")
"* %?\n :NOTE:\n %U\n %a\n :LOGBOOK:\n :END:"
:clock-in t :clock-resume t)
("j" "journal" entry (file+datetree "~/notes/diary.org")
"* %?\n %U"
:clock-in t :clock-resume t)))))
(setq org-todo-keywords '((sequence "TODO(t)" "NEXT(n)"
"STARTED(s)" "WAITING(w@/!)"
"SOMEDAY(S!)" "DELEGATED(D!)" "|"
"DONE(d!/!)" "CANCELLED(c@/!)")))
(setq org-todo-keyword-faces
'(("TODO" :foreground "red" :weight bold)
("NEXT" :foreground "blue" :weight bold)
("STARTED" :foreground "blue" :weight bold)
("DONE" :foreground "forest green" :weight bold)
("WAITING" :foreground "orange" :weight bold)
("SOMEDAY" :foreground "magenta" :weight bold)
("DELEGATED" :foreground "orange" :weight bold)
("CANCELLED" :foreground "forest green" :weight bold)))
(setq org-todo-state-tags-triggers
'(("CANCELLED" ("CANCELLED" . t))
("WAITING" ("WAITING" . t))
("SOMEDAY" ("WAITING" . t))
("DELEGATED" ("WAITING" . t))
(done ("WAITING"))
("TODO" ("WAITING") ("CANCELLED"))
("NEXT" ("WAITING"))
("STARTED" ("WAITING"))
("DONE" ("WAITING") ("CANCELLED"))))
(setq org-treat-S-cursor-todo-selection-as-state-change nil)
(add-hook 'org-mode-hook
(lambda ()
;(flyspell-mode 1)
))
(setq org-agenda-files '("~/notes"
"~/notes/health"
"~/notes/home"
"~/notes/website"
"~/notes/work"))
(setq org-default-notes-file "~/notes/refile.org")
;; Remove empty LOGBOOK drawers on clock out
(defun remove-empty-drawer-on-clock-out ()
(interactive)
(save-excursion
(beginning-of-line 0)
(org-remove-empty-drawer-at "LOGBOOK" (point))))
(add-hook 'org-clock-out-hook 'remove-empty-drawer-on-clock-out 'append)
(defun is-project-p ()
"Any task with a todo keyword subtask"
(let ((has-subtask)
(subtree-end (save-excursion (org-end-of-subtree t))))
(save-excursion
(forward-line 1)
(while (and (not has-subtask)
(< (point) subtree-end)
(re-search-forward "^\*+ " subtree-end t))
(when (member (org-get-todo-state) org-todo-keywords-1)
(setq has-subtask t))))
has-subtask))
(defun clock-in-to-started (kw)
"Switch task from TODO or NEXT to STARTED when clocking in.
Skips capture tasks and tasks with subtasks"
(if (and (member (org-get-todo-state) (list "TODO" "NEXT"))
(not (and (boundp 'org-capture-mode) org-capture-mode))
(not (is-project-p)))
"STARTED"))
; Targets start with the file name - allows creating level 1 tasks
(setq org-refile-use-outline-path (quote file))
; Targets include this file and any file contributing to the agenda - up to 5 levels deep
(setq org-refile-targets (quote ((org-agenda-files :maxlevel . 5) (nil :maxlevel . 5))))
; Allow refile to create parent tasks with confirmation
(setq org-refile-allow-creating-parent-nodes (quote confirm))
;; Yes it's long... but more is better ;)
(setq org-clock-history-length 28)
;; Resume clocking task on clock-in if the clock is open
(setq org-clock-in-resume t)
;; Change task state to NEXT when clocking in
(setq org-clock-in-switch-to-state (quote clock-in-to-started))
;; Separate drawers for clocking and logs
(setq org-drawers (quote ("PROPERTIES" "LOGBOOK")))
;; Save clock data in the CLOCK drawer and state changes and notes in the LOGBOOK drawer
(setq org-clock-into-drawer t)
;; Sometimes I change tasks I'm clocking quickly - this removes clocked tasks with 0:00 duration
(setq org-clock-out-remove-zero-time-clocks t)
;; Clock out when moving task to a done state
(setq org-clock-out-when-done t)
;; Save the running clock and all clock history when exiting Emacs, load it on startup
(setq org-clock-persist (quote history))
;; Enable auto clock resolution for finding open clocks
(setq org-clock-auto-clock-resolution (quote when-no-clock-is-running))
;; Include current clocking task in clock reports
(setq org-clock-report-include-clocking-task t)
;;;=============================================================================
;;; Terminal and shell
;;;=============================================================================
(require 'term)
;; Handle multiple asynchronous subprocesses.
;; Allows to use M-& and M-! for several tasks at once.
;; http://stackoverflow.com/questions/6895155/multiple-asynchronous-shell-commands-in-emacs-dired
(defadvice shell-command (after shell-in-new-buffer (command &optional output-buffer error-buffer))
(when (get-buffer "*Async Shell Command*")
(with-current-buffer "*Async Shell Command*"
(rename-uniquely))))
(ad-activate 'shell-command)
;; 2048 scrollback lines remembered by (ansi-)term are very
;; limiting for some outputs.
(setq term-buffer-maximum-size 131072)
;; http://www.enigmacurry.com/2008/12/26/emacs-ansi-term-tricks/
(defun visit-ansi-term ()
"If the current buffer is:
1) a running ansi-term named *ansi-term*, rename it.
2) a stopped ansi-term, kill it and create a new one.
3) a non ansi-term, go to an already running ansi-term
or start a new one while killing a defunt one"
(interactive)
(let ((is-term (string= "term-mode" major-mode))
(is-running (term-check-proc (buffer-name)))
(term-cmd "/bin/bash")
(anon-term (get-buffer "*ansi-term*")))
(if is-term
(if is-running
(if (string= "*ansi-term*" (buffer-name))
;; TODO: we need to generate a default name here and
;; offer it as a reasonable default. The name should
;; be the name of the running process between *
;; chars. If that would not be unique, append <n> to
;; it (n=number) so it becomes unique.
(call-interactively 'rename-buffer)
(if anon-term
(switch-to-buffer "*ansi-term*")
(ansi-term term-cmd)))
(kill-buffer (buffer-name))
(ansi-term term-cmd))
(if anon-term
(if (term-check-proc "*ansi-term*")
(switch-to-buffer "*ansi-term*")
(kill-buffer "*ansi-term*")
(ansi-term term-cmd))
(ansi-term term-cmd)))))
;; Replace C-z (minimize) by terminal. C-z is often pressed by
;; accident and minimize is not useful in xmonad.
(define-key term-raw-map "\C-z" 'visit-ansi-term)
(global-set-key (kbd "C-z") 'visit-ansi-term)
Tried to use the desktop sessions (saving state of Emacs from one session to another), but this feature often asks whether to load/save session during startup/exit and that is disturbing.
(desktop-save-mode 1)
A small application to play multimedia files from Emacs using external players.
(require 'nnir)
(require 'org-gnus)
;;=============================================================================
;; Accounts
;;=============================================================================
(setq gnus-select-method
'(nnml ""))
(setq gnus-secondary-select-methods
'((nnimap "kklic@redhat.com"
(nnimap-address "localhost")
(nnimap-stream network)
(nnimap-authinfo-file "~/.gnus-authinfo-redhat")
(nnir-search-engine imap))
(nnimap "karelklic@gmail.com"
(nnimap-address "localhost")
(nnimap-stream network)
(nnimap-authinfo-file "~/.gnus-authinfo-gmail")
(nnir-search-engine imap))
(nnimap "karel.klic@raging.cz"
(nnimap-address "localhost")
(nnimap-stream network)
(nnimap-authinfo-file "~/.gnus-authinfo-raging")
(nnir-search-engine imap))))
;;=============================================================================
;; Agent
;;=============================================================================
; Agent breaks visibility of emails in nnimap folders in emacs 23.2.
(setq gnus-agent nil)
;;=============================================================================
;; Sending email
;;=============================================================================
(setq message-send-mail-function 'smtpmail-send-it)
(defun set-smtp (mech server port user password)
"Set related SMTP variables for supplied parameters."
(setq smtpmail-smtp-server server
smtpmail-smtp-service port
smtpmail-auth-credentials (list (list server port user password))
smtpmail-auth-supported (list mech)
smtpmail-starttls-credentials nil)
(message "Setting SMTP server to `%s:%s' for user `%s'."
server port user))
(defun set-smtp-ssl (server port user password &optional key cert)
"Set related SMTP and SSL variables for supplied parameters."
(setq starttls-use-gnutls t
starttls-gnutls-program "gnutls-cli"
;; TODO: Add this to the server parameters
;; starttls-extra-arguments nil
smtpmail-smtp-server server
smtpmail-smtp-service port
smtpmail-auth-credentials (list (list server port user password))
smtpmail-starttls-credentials (list (list server port key cert)))
(message
"Setting SMTP server to `%s:%s' for user `%s'. (SSL enabled.)"
server port user))
(defun change-smtp ()
"Change the SMTP server according to the current from line."
(interactive)
(save-excursion
(loop with from = (save-restriction
(message-narrow-to-headers)
(message-fetch-field "from"))
for (auth-mech address . auth-spec) in smtp-accounts
when (string-match address from)
do (cond
((memq auth-mech '(cram-md5 plain login))
(return (apply 'set-smtp (cons auth-mech auth-spec))))
((eql auth-mech 'ssl)
(return (apply 'set-smtp-ssl auth-spec)))
(t (error "Unrecognized SMTP auth. mechanism: `%s'." auth-mech)))
finally (error "Cannot infer SMTP information."))))
(add-hook 'message-send-hook 'change-smtp)
(setq smtp-accounts '((ssl "kklic@redhat.com" "smtp.corp.redhat.com" "587" nil nil)
(ssl "karelklic@gmail.com" "smtp.gmail.com" "587" "karelklic@gmail.com" "passwd")
(ssl "karel.klic@raging.cz" "smtp.gmail.com" "587" "karelklic@gmail.com" "passwd")))
;;=============================================================================
;; Archiving sent mail
;;=============================================================================
(setq gnus-message-archive-method '(nnimap "kklic@redhat.com"))
(setq gnus-message-archive-group "Sent")
;;; Disable notmuch archiving
(setq notmuch-fcc-dirs nil)
;;=============================================================================
;; Offlineimap integration
;;=============================================================================
;; Start offlineimap from within Emacs
(define-key gnus-group-mode-map (kbd "vo")
(lambda ()
(interactive)
(shell-command "offlineimap && notmuch new &" "*offlineimap*" nil)))
;;=============================================================================
;; Mail search
;;=============================================================================
(if (locate-library "notmuch")
(progn
(require 'notmuch)
;; http://roland.entierement.nu/blog/2010/09/08/ \
;; gnus-dovecot-offlineimap-search-a-howto.html
(define-key gnus-group-mode-map (kbd "vg") 'notmuch-search)
(defun notmuch-file-to-group (file)
"Calculate the Gnus group name from the given file name."
(let ((group (file-name-directory (directory-file-name (file-name-directory file)))))
(message "NOTMUCH Group Before %s" group)
(setq group (replace-regexp-in-string ".*/mail/\\(.*\\)/mail/" "nnimap+\\1:" group))
(setq group (replace-regexp-in-string "/$" "" group))
(message "NOTMUCH Group After %s" group)
(if (string-match ":$" group)
(concat group "INBOX")
(replace-regexp-in-string ":\\." ":" group))))
(defun notmuch-goto-message-in-gnus ()
"Open a summary buffer containing the current notmuch article."
(interactive)
(let ((group (notmuch-file-to-group (notmuch-show-get-filename)))
(message-id (replace-regexp-in-string
"^id:" "" (notmuch-show-get-message-id))))
(if (and group message-id)
(progn
(switch-to-buffer "*Group*")
(org-gnus-follow-link group message-id))
(message "Couldn't get relevant infos for switching to Gnus."))))
(define-key notmuch-show-mode-map (kbd "C-c C-c")
'notmuch-goto-message-in-gnus)))
Local pages with the .html extension are processed
with text/html mime-type. The .xhtml
extension corresponds to application/xhtml+xml.
Development links
An open-source web browser, powered by WebKit.
A lightweight BitTorrent client.
A movie player that plays most MPEG, VOB, AVI, OGG/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, FLI, RM, NuppelVideo, yuv4mpeg, FILM, RoQ, and PVA files. You can also use it to watch VCDs, SVCDs, DVDs, 3ivx, RealMedia, and DivX movies. It supports a wide range of output drivers including X11, XVideo, DGA, OpenGL, SVGAlib, fbdev, AAlib, DirectFB etc. There are also nice antialiased shaded subtitles and OSD.
A utility for viewing and editing tags for MP3, MP2, MP4/AAC, FLAC, Ogg Vorbis, MusePack, Monkey's Audio and WavPack files.
Document preparation, book management, text processing, optical character recognition.
An ebook cataloging program. Includes library management, format conversion, e-book reader synchronization.
An e-book reader.
An open source, community-developed, office productivity suite. It includes the key desktop applications, such as a word processor, spreadsheet, presentation manager, formula editor and drawing program, with a user interface and feature set similar to other office suites. Sophisticated and flexible, LibreOffice also works transparently with a variety of file formats, including Microsoft Office File Formats.
An implementation of TeX for Linux or UNIX systems.
A commercial quality OCR engine originally developed at HP between 1985 and 1995. In 1995, this engine was among the top 3 evaluated by UNLV. It was open-sourced by HP and UNLV in 2005.
A spell checker and morphological analyzer library and program designed for languages with rich morphology and complex word compounding or character encoding.
Photography, drawing, computer aided-design.
An image manipulation program, useful for photo retouching, image composition, and image authoring.
Scanner utility with graphical user interface.
Simple-scan 2.32.0 stores invalid PDFs in Czech locale on Fedora 14, because the Czech locale uses comma for a decimal point. This is fixed in 2.32.0.1, Fedora 15. A workaround is to run simple-scan with LANG=C.
A powerful descriptive vector graphics language that provides a natural coordinate-based framework for technical drawing.
A command-line driven graphing utility.
A software for creating solid 3D CAD objects. It does not focus on the artistic aspects of 3D modelling but instead on the CAD aspects. OpenSCAD is not an interactive modeller. Instead it is something like a 3D-compiler that reads in a script file that describes the object and renders the 3D model from this script file. This gives the designer full control over the modelling process and enables you to easily change any step in the modelling process or make designes that are defined by configurable parameters.
A powerful solid modeling system that includes interactive geometry editing, high-performance ray-tracing for rendering and geometric analysis, image and signal-processing tools, a system performance analysis benchmark suite, libraries for robust geometric representation, with more than 20 years of active development.
A vector graphics editor using the W3C standard Scalable Vector Graphics (SVG) file format. It is therefore a very useful tool for web designers and as an interchange format for desktop publishing. Inkscape supports many advanced SVG features (markers, clones, alpha blending, etc.) and great care is taken in designing a streamlined interface. It is very easy to edit nodes, perform complex path operations, and trace bitmaps.
QLandkarte GT is the ultimate outdoor aficionado's tool for GPS maps in GeoTiff format as well as Garmin's img vector map format. It fills the gap Garmin leaves in refusing to support Linux.
An editor for OpenStreetMap (OSM) written in Java. It supports loading stand alone GPX track data from the OSM database, loading and editing existing nodes, ways, metadata tags and relations.
Converts map data from Open Street Map into the Garmin img map format that can be loaded onto Garmin GPS devices.
An IMAP server written with security primarily in mind. It supports mail in either of maildir or mbox formats.
Configuration:
passdb {
driver = passwd-file
args = /etc/dovecot/users
}
mail_location = maildir:/home/karel/mail/%u
userdb {
driver = passwd-file
args = /etc/dovecot/users
}
Synchronizes local and remote IMAP servers.
The autorefresh option does not work reliably in
OfflineIMAP 6.2.0.2. The program runs for an hour or two, then some
thread get stuck (maybe the server on the other side closed
connection) and one account is no longer synchronized.
Here is my ~/.offlineimaprc:
[general] accounts = aaaa,gmail,bbbb # Noninteractive interface suitable for cronning ui = Noninteractive.Basic pythonfile = /home/karel/.offlineimap.py [Account a] localrepository = a-local remoterepository = a-remote [Account b] localrepository = b-local remoterepository = b-remote [Account c] localrepository = c-local remoterepository = c-remote [Repository a-local] type = IMAP remotehost = localhost port = 143 remoteuser = a@b.com remotepass = xxxx [Repository b-local] type = IMAP remotehost = localhost port = 143 remoteuser = karel.klic@aaaa.cz remotepass = xxxx [Repository c-local] type = IMAP remotehost = localhost port = 143 remoteuser = kklic@bbbb.com remotepass = xxxx [Repository a-remote] type = IMAP remotehost = imap.a.com remoteuser = karelklic remotepass = xxxx ssl = yes nametrans = gmail_nametrans folderfilter = gmail_folderfilter [Repository b-remote] type = IMAP remotehost = mail.b.cz remoteuser = b@b.cz remotepass = xxxx ssl = yes [Repository c-remote] type = IMAP remotehost = mail.c.com remoteuser = kklic remotepass = xxxx ssl = yes
And here is ~/.offlineimap.py:
import re
def gmail_folderfilter(foldername):
return -1 == foldername.find('V&AWE-echny zpr&AOE-vy')
def gmail_nametrans(foldername):
# Remove Gmail prefix
foldername = re.sub('^\[Gmail\]/', '', foldername)
# Remove diacritics
foldername = re.sub('^Cestovn&AO0\-', 'Cestovni', foldername)
foldername = re.sub('^Pracovn&AO0\-', 'Pracovni', foldername)
foldername = re.sub('^S potvrzen&AO0\-m', 'S potvrzenim', foldername)
foldername = re.sub('^Ko&AWE\-', 'Kos', foldername)
foldername = re.sub('^Odeslan&AOE\- po&AWE\-ta', 'Odeslana posta', foldername)
foldername = re.sub('^S hv&ARs\-zdi&AQ0\-kou', 'S hvezdickou', foldername)
foldername = re.sub('^V&AWE-echny zpr&AOE-vy', 'Vsechny zpravy', foldername)
return foldername
Fast system for indexing, searching, and tagging email.
I use Notmuch as very fast and flexible mail search tool. I do not use tags and other features. The searches are invoked from Emacs, and integrated with Gnus.
My ~/.notmuch-config:
[user] name=Karel Klíč primary_email=kklic@aaaa.com other_email=karelklic@gmail.com;karel.klic@bbbb.com; # Configuration for "notmuch new" # # The following options are supported here: # # tags A list (separated by ';') of the tags that will be # added to all messages incorporated by "notmuch new". # [new] tags=
This program allows connecting to real X display remotely via VNC protocol.
There is a security problem: when you remotely unlock a computer and work on it, your work can be seen on the display, physical keyboard and mouse work and others might interfere.
Here is how to connect to a remote computer and start a session:
ssh -t -L 5900:localhost:5900 target_machine 'x11vnc -display :0 -ncache 10 -remap Menu-Super_L -localhost -unixpw'
Then simply join the session:
vncviewer localhost:0
Conserver works well for watching a serial consoles remotely.
Tried to use fuse-sshfs to mount remote systems to local filesystem
over SSH, but the package has serious problems with unmounting. If
the remote computer is restarted or enters suspend mode, the local
mountpoint blocks even ls in the directory where it is
and it cannot be unmounted. Not sure if that is a problem in FUSE
interface or sshfs implementation.
A client for Remote Desktop Protocol (RDP) that is used on Microsoft Windows. It had problems with Czech keyboard, but rhbz#693890 seems to solve the issue.
A VPN client compatible with Cisco's EasyVPN equipment.
A VNC client and server implementation.
Used only for simple bug testing on server machines so far.
An unsafe way how to run it on a server:
ssh root@server yum install tigervnc-server echo "VNCSERVERS=\"2:root\"" >> /etc/sysconfig/vncservers echo "VNCSERVERARGS[2]=\"-geometry 1024x768 -depth 16\"" >> /etc/sysconfig/vncservers vncpasswd service vncserver restart service iptables stop
Client connection:
vncviewer server:5902:2