Difference between pages "Mutt" and "Compiz"

From Funtoo
(Difference between pages)
Jump to: navigation, search
(~/.mutt/muttrc)
 
(Configuring Compiz)
 
Line 1: Line 1:
Mutt is a popular mail reader for Linux systems. This page is being created as a good place for people to place their mutt configurations to share with others. These configuration settings go in the user's <tt>~/.muttrc</tt> file.
+
== What is Compiz? ==
  
== Essential Mutt ==
+
'''According to [http://www.compiz.org Compiz.org], Compiz is''': "... an OpenGL compositing manager that use GLX_EXT_texture_from_pixmap for binding redirected top-level windows to texture objects. It has a flexible plug-in system and it is designed to run well on most graphics hardware.
 +
Okay, this description isn’t really meaningful. In a nutshell, Compiz is a compositing manager, which means that it enhances the overall user interaction by adding fancy effects to your windows, from drop shadows to awesome desktop effects like the Desktop Cube or the Expo view.
 +
Compiz can also be a window manager, which means that it is the software between you and your desktop apps. It enables you to move or resize windows, to switch workspaces, to switch windows easily (using alt-tab or so), and so on."
  
<pre>
+
== Installing Compiz ==
set pager_stop
+
To install Compiz, you must first emerge it:
</pre>
+
  
This turns off the default behavior of mutt where hitting space to scroll will automatically move to the next message when the end of the current message is reached. This is very annoying when scrolling in long emails like cron jobs, and the line above sets this behavior to off.
+
<console>
 +
# ##i## emerge compiz compiz-fusion emerald hicolor-icon-theme
 +
</console>
  
== angry_vincent's .muttrc: ==
+
== As a standalone window manager ==
{{File
+
For Compiz to run as a standalone window manager, you must first change your ''~.xinitrc'' file:
|~/.muttrc|<pre>
+
# General config
+
# ---------------
+
 
+
set folder=~/Mail   # mail folder
+
set alias_file=~/.mail_aliases    # alises file
+
set arrow_cursor   # cursor is '->'
+
set attribution="%d, %n wrote:"    # beginning of mail answer
+
set copy=yes   # save mail copies
+
set edit_headers   # edit mail header
+
set editor="vim"                               # editor
+
set folder_format="%t%N %-30.30f %8s"                        # folder list look
+
set index_format="%4C %Z %{%b %d} %-31.31F %N (%4c) %s"      # mail list look
+
set mailcap_path="~/.mailcap"                               # path to .mailcap
+
set menu_scroll # scroll list by one line
+
set mail_check=5 # mail check interval
+
set pager_stop # at the end of mail do not move to next message
+
set postponed=+drafts # postponed mails
+
set print=ask-yes # ask before print
+
set print_command=lpr # print command
+
set record=+sent # where to save sent mails
+
set signature="~/.signature" # signature file
+
set visual=vim                  # editor caled by  ~v
+
 
+
# mail sort
+
set sort=threads
+
set sort_aux=reverse-date-received
+
set sort_browser=reverse-date
+
ignore *    # ignore headers so the mail body is not overloaded
+
unignore        from: subject to cc mail-followup-to \
+
                date x-mailer x-url user-agent reply-to  # fieids i like to see in mail body
+
 
+
# Colors
+
color index brightcyan black ~N
+
color index brightyellow black ~F
+
color index black green ~T
+
color index brightred black ~D
+
mono index bold ~N
+
mono index bold ~F
+
mono index bold ~T
+
mono index bold ~D
+
 
+
# Highlights inside the body of a message.
+
 
+
# URLs
+
color body brightgreen black "(http|ftp|news|telnet|finger)://[^ \"\t\r\n]*"
+
color body brightgreen black "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
+
mono body bold "(http|ftp|news|telnet|finger)://[^ \"\t\r\n]*"
+
mono body bold "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
+
 
+
# email addresses
+
color body brightgreen black "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"
+
mono body bold "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"
+
 
+
# header
+
color header green black "^from:"
+
color header green black "^to:"
+
color header green black "^cc:"
+
color header green black "^date:"
+
color header yellow black "^newsgroups:"
+
color header yellow black "^reply-to:"
+
color header brightcyan black "^subject:"
+
color header red black "^x-spam-rule:"
+
color header green black "^x-mailer:"
+
color header yellow black "^message-id:"
+
color header yellow black "^Organization:"
+
color header yellow black "^Organisation:"
+
color header yellow black "^User-Agent:"
+
color header yellow black "^message-id: .*pine"
+
color header yellow black "^X-Fnord:"
+
color header yellow black "^X-WebTV-Stationery:"
+
color header yellow black "^X-Message-Flag:"
+
color header yellow black "^X-Spam-Status:"
+
color header yellow black "^X-SpamProbe:"
+
color header red black "^X-SpamProbe: SPAM"
+
 
+
# Coloring quoted text - coloring the first 7 levels:
+
color quoted cyan black
+
color quoted1 yellow black
+
</pre>}}
+
 
+
== Interesting Color Options ==
+
 
+
http://github.com/altercation/mutt-colors-solarized
+
 
+
== golodhrim's mutt config ==
+
 
+
First I split up my muttconfig in several subfiles under <tt>~/.mutt</tt>. The resulting files will be:
+
 
+
* <code>~/.mutt/account_hooks</code>
+
* <code>~/.mutt/colors</code>
+
* <code>~/.mutt/folder_hooks</code>
+
* <code>~/.mutt/gpg</code>
+
* <code>~/.mutt/lists</code>
+
* <code>~/.mutt/macros</code>
+
* <code>~/.mutt/mutt-alias</code>
+
* <code>~/.mutt/muttrc</code>
+
* <code>~/.mutt/sidebar</code>
+
* <code>~/.secret/.passwd.gpg</code>
+
  
=== account_hooks ===
 
Next, edit <code>~/.mutt/account_hooks</pre>:
 
 
{{File
 
{{File
|~/.mutt/account_hooks|<pre>
+
|~/.xinitrc|<pre>
#-------------------------------------------------------------------------     
+
exec compiz ccp &
#
+
emerald --replace &
# Account Hooks
+
fusion-icon &
#-------------------------------------------------------------------------
+
gnome-terminal &
account-hook . 'unset imap_user imap_pass'
+
conky
account-hook 'imap://user@imaphost/' "set imap_user=user imap_pass=$my_pass1 "
+
 
</pre>}}
 
</pre>}}
  
=== colors ===
+
The lines after the first two can be any applications that you would like to launch when the X.org server starts.  
{{File
+
|~/.mutt/colors|<pre>
+
#-------------------------------------------------------------------------     
+
# Set colors
+
#-------------------------------------------------------------------------
+
color  attachment  brightmagenta      default
+
color  error      brightred          default
+
color  hdrdefault  red                default
+
color  indicator  brightyellow        red
+
color  markers    brightcyan          default
+
color  message    brightcyan          default
+
color  normal      default            default
+
color  quoted      brightblue          default
+
color  search      default            green
+
color  signature  red                default
+
color  status      yellow              blue
+
color  tilde      magenta            default
+
color  tree        magenta            default
+
</pre>}}
+
  
=== folder_hooks ===
+
Now, with compiz installed and ready to run, try starting it:
{{File
+
<console>
|~/.mutt/folder_hooks|<pre>
+
$ ##i## xinit
#--------------------------------------------------------------------------   
+
</console>
#
+
# Folders, mailboxes and folder hooks
+
#--------------------------------------------------------------------------
+
# Setup for imap-user in account_hooks
+
set folder="imap://user@imaphost/"
+
mailboxes =INBOX =INBOX/Archives =INBOX/Drafts =INBOX/Sent =INBOX/Trash
+
folder-hook 'imap://user@imaphost/' " \
+
    set folder=imap://user@imaphost/ \
+
        postponed=+INBOX/Drafts \
+
        record=+INBOX/Sent \
+
        smtp_url=smtp://user@smtphost \
+
        smtp_pass=$my_pass1 \
+
        #signature=~/.sig/pr.txt \
+
        from='Name Familyname <name@host> ' \
+
        realname='Realname' \
+
        pgp_sign_as='PGP-signature' \
+
        spoolfile='imap://user@imaphost/' "
+
</pre>}}
+
  
=== ~/.mutt/gpg ===
+
== Configuring Compiz ==  
{{File
+
|~/.mutt/gpg|<pre>
+
# vim:syn=muttrc                                                               
+
##
+
  
set smime_decrypt_use_default_key=yes
+
If it starts successfully, you will be greeted with a black screen and whatever programs you added to your ''~/.xinitrc'' after line two. At this point, you may be wondering "Why are there no decorations around my windows?" There are no decorations because Compiz comes configured to not decorate windows. In your terminal that was launched from the ''~/.xinitrc'' file, type in:
  
# Decode application/pgp attachments like so:
+
<console>
set pgp_decode_command="/usr/bin/gpg %?p?--passphrase-fd 0? --no-verbose --batch --output - %f"
+
$##bl## ccsm
 +
</console>
 +
{| class="wikitable"
 +
|-
 +
! scope="col"| Option
 +
! scope="col"| Location
 +
! scope="col"| Effects
 +
! scope="col"| Notes
 +
|-
 +
! scope="row"| Window Decoration
 +
| Effects || Adds borders to your windows. ||
 +
|-
 +
|}
  
# And use this to verify pgp signatures:
+
Don't like the default window decorations? You can modify the window decorations to your liking by typing:  
set pgp_verify_command="/usr/bin/gpg --no-verbose --batch --output - --verify %s %f"
+
  
# How to decrypt pgp encrypted messages:
+
<console>
set pgp_decrypt_command="/usr/bin/gpg --passphrase-fd 0 --no-verbose --batch --output - %f"
+
$ ##i## emerald-theme-manager
 +
</console>
  
# How to pgp sign a message:
+
Emerald offers several different engines for theming:
set pgp_sign_command="/usr/bin/gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
+
  
# How to pgp clearsign a message:
+
* '''zootreeves''': Evolved from the legacy engine
set pgp_clearsign_command="/usr/bin/gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"
+
* '''truglass''': Glassy effects for your windows
 +
* '''vrunner''': Multiple gradients with somewhat glassy features too
 +
* '''legacy''': Based on original gnome-window-decorator
 +
* '''line''': Based on original legacy
 +
* '''pixmap''': Everything done with customizable pixmaps!
 +
* '''oxygen''': Designed to be vista-ish in nature
  
# Import a pgp key from a message into my public keyring as follows:
+
== Helpful Tricks / Tips ==
set pgp_import_command="/usr/bin/gpg --no-verbose --import -v %f"
+
{{Note}} To do.
 
+
# Use this to export a key from my public keyring:
+
set pgp_export_command="/usr/bin/gpg --no-verbose --export --armor %r"
+
 
+
# Verify key information (from the key selection menu):
+
set pgp_verify_key_command="/usr/bin/gpg --verbose --batch --fingerprint --check-sigs %r"
+
 
+
# List my public keyring like so:
+
set pgp_list_pubring_command="/usr/bin/gpg --no-verbose --batch --with-colons --list-keys %r"
+
 
+
# List my private keyring like so:
+
set pgp_list_secring_command="/usr/bin/gpg --no-verbose --batch --with-colons --list-secret-keys %r"
+
 
+
# Automatically sign outgoing messages
+
set pgp_autosign=yes
+
 
+
# Timeout (in seconds) for cached passphrases:
+
set pgp_timeout=1800
+
 
+
# Text to show before a good signature:
+
set pgp_good_sign="^gpg: Good signature from"
+
</pre>}}
+
 
+
=== ~/.mutt/lists ===
+
{{File
+
|~/.mutt/lists|<pre>
+
#-------------------------------------------------------------------------     
+
# Mailinglist Subscriptions
+
#-------------------------------------------------------------------------
+
# Syntax:
+
# subscribe mailinglist@domain.com
+
</pre>}}
+
 
+
=== ~/.mutt/macros ===
+
{{File
+
|~/.mutt/macros|<pre>
+
# Macros to toggle the sidebar visibility                                     
+
macro index b '<enter-command>toggle sidebar_visible<enter><refresh>'
+
macro pager b '<enter-command>toggle sidebar_visible<enter><redraw-screen>'
+
 
+
# abook query
+
macro index,pager A "<pipe-message>abook --add-email-quiet<return>" "add the sender address to abook"
+
macro generic,index,pager \Cb "abook" "launch abook"
+
</pre>}}
+
 
+
=== ~/.mutt/alias ===
+
{{File
+
|~/.mutt/alias|<pre>
+
alias nick Realname <email@host.tld>
+
</pre>}}
+
 
+
=== ~/.mutt/muttrc ===
+
{{File
+
|~/.mutt/muttrc|<pre>
+
# Some minimal Mutt settings, Gentoo-style.  These reflect the Gentoo
+
# predilection for maildir folders.
+
#
+
# Please don't add settings to this file to change other user
+
# preferences (such as colors), since those can be hard for a user to
+
# undo if their preference doesn't match yours!  For example, it is
+
# *impossible* currently in mutt to remove color settings from objects
+
# other than the index.
+
 
+
#-------------------------------------------------------------------------
+
# Process the password file first
+
#-------------------------------------------------------------------------
+
set my_tmp=`gpg -o ~/.secret/.tmp -d ~/.secret/.passwd.gpg`                   
+
set my_pass1=`awk '/user:/ {print $2}' ~/.secret/.tmp`
+
set my_del=`rm -f ~/.secret/.tmp`
+
+
#-------------------------------------------------------------------------
+
# Further customisations
+
#-------------------------------------------------------------------------
+
set smart_wrap = yes
+
set sort = 'threads'
+
set sort_aux = 'last-date-received'
+
set imap_check_subscribed
+
 
+
ignore "Authentication-Results:"
+
ignore "DoaminKey-Signature:"
+
ignore "DKIM-Signature:"
+
hdr_order Date From To Cc
+
 
+
#-------------------------------------------------------------------------
+
# Configuration variables
+
#-------------------------------------------------------------------------
+
set abort_nosubject=yes
+
set abort_unmodified=yes
+
set query_command="abook --mutt-query '%s'"
+
set alias_file="~/.mutt/mutt-alias"
+
set alias_format="%4n %t %a %r"
+
source $alias_file
+
set assumed_charset="utf-8"
+
set attach_charset="utf-8"
+
set charset="utf-8"
+
set date_format=""
+
set edit_headers=yes
+
set editor='vim + -c "set textwidth=72" -c "set wrap" -c "set nocp" -c "?^$"        '
+
set folder="~/.offlineimap"
+
set forward_quote=yes
+
set header_cache=~/.mutt/cache/headers
+
set message_cachedir=~/.mutt/cache/bodies
+
set certificate_file=~/.mutt/certificates
+
set help=yes
+
set imap_idle=yes
+
set imap_peek=yes
+
set imap_servernoise=no
+
set include=yes
+
set mail_check=60
+
set mbox_type=Maildir
+
set menu_move_off=no
+
set menu_scroll=no
+
set mime_forward=ask-no
+
set pager_context=2
+
set pager_stop=yes
+
set postponed="~/.mutt/mail/postponed"
+
set realname="Martin 'golodhrim' Scholz"
+
set record="~/.mutt/mail/sent"
+
set reply_regexp="^(re([\[0-9\]+])*|betr):[ \t]*"
+
#set reply_to=yes
+
set tilde=yes
+
 
+
#--------------------------------------------------------------------------
+
# muttprint for printing
+
#--------------------------------------------------------------------------
+
set print_command="muttprint"
+
 
+
#--------------------------------------------------------------------------
+
# Automatically process html mails
+
#--------------------------------------------------------------------------
+
auto_view text/html
+
 
+
#--------------------------------------------------------------------------
+
# Other configuration files
+
#--------------------------------------------------------------------------
+
source ~/.mutt/account_hooks
+
source ~/.mutt/folder_hooks
+
source ~/.mutt/colors
+
source ~/.mutt/sidebar
+
source ~/.mutt/gpg
+
source ~/.mutt/macros
+
source ~/.mutt/lists
+
</pre>}}
+
 
+
=== ~/.mutt/sidebar ===
+
<pre>
+
#--------------------------------------------------------------------------   
+
# Sidebar configuration
+
#--------------------------------------------------------------------------
+
set sidebar_width=30
+
set sidebar_visible=yes
+
set sidebar_delim='|'
+
color sidebar_new yellow default
+
 
+
#--------------------------------------------------------------------------
+
# Sidebar keys
+
#--------------------------------------------------------------------------
+
bind index \CP sidebar-prev
+
bind index \CN sidebar-next
+
bind index \CO sidebar-open
+
bind pager \CP sidebar-prev
+
bind pager \CN sidebar-next
+
bind pager \CO sidebar-open
+
</pre>
+
 
+
=== ~/.secret/.passwd.gpg ===
+
For this file follow the next steps:
+
* Step 1:
+
Create a folder <tt>~/.secret</tt> and inside a file <tt>.passwd</tt> and enter the following into it:
+
<pre>
+
user1:    passwd1
+
user2:    passwd2
+
</pre>
+
where user1 and user2 are your identifiers for the accounts you added in account_hooks and folder_hooks and at the start of muttrc.
+
* Step 2:
+
Now encrypt the file with your gpg-key, if you don't have one execute <tt>gpg --gen-key</tt> and create one first. After that don't forget to delete your unencrypted passwordstorage.
+
<console>
+
$ ##bl##gpg -r 0x<Your-ID-fingerprint> -o .passwd.gpg --encrypt .passwd
+
$ ##bl##rm -f .passwd
+
</console>
+
=== Mutt postfix setup ===
+
Postfix is another popular and powerful mail transfer agent which somehow easier to configure than sendmail. Let's start a quick postfix mail transfer setup that will work with mutt. Set <tt>sasl,berkdb</tt> USE flags to <tt>mail-mta/potsfix</tt> and <tt>mail-client/mutt</tt>
+
<console>
+
# ##i##echo "mail-mta/postfix berkdb sasl" >> /etc/portage/package.use/mail
+
# ##i##echo "mail-client/mutt berkdb sasl" >> /etc/portage/package.use/mail
+
# ##i##emerge -uN1 mutt postfix
+
</console>
+
Edit <tt>/etc/postfix/main.cf</tt> and add the following lines:
+
{{File
+
|/etc/postfix/main.cf|<pre>
+
relayhost = smtp.gmail.com:587
+
smtp_use_tls = yes
+
smtp_sasl_auth_enable = yes
+
smtp_sasl_password_maps = hash:/etc/postfix/gmail_passwd
+
smtp_sasl_security_options = noanonymous
+
</pre>}}
+
 
+
Create and edit above mentioned authorization file <tt>gmail_passwd</tt>
+
<console>
+
# ##i##touch /etc/postfix/gmail_passwd
+
# ##i##echo "smtp.gmail.com:587 my.name@gmail.com:password" >> /etc/postfix/gmail_passwd
+
</console>
+
Where <my.name> is gmail account and passwd is account password.
+
Convert <tt>gmail_passwd</tt> into Berkeley DB format, secure the file and finaly restart the postfix daemon
+
<console>
+
# ##i##postmap /etc/postfix/gmail_passwd
+
# ##i##chown root:postfix /etc/postfix/gmail_passwd*
+
# ##i##chmod 0640 /etc/postfix/gmail_passwd*
+
# ##i##/etc/init.d/postfix restart
+
</console>
+
  
[[Category:HOWTO]]
+
== To Come ==
[[Category:Featured]]
+
* Explanations of ccsm and emerald-theme-manager
 +
* Programs to use with compiz
 +
[[Category: Window Managers]]

Revision as of 04:54, 28 January 2014

Contents

What is Compiz?

According to Compiz.org, Compiz is: "... an OpenGL compositing manager that use GLX_EXT_texture_from_pixmap for binding redirected top-level windows to texture objects. It has a flexible plug-in system and it is designed to run well on most graphics hardware. Okay, this description isn’t really meaningful. In a nutshell, Compiz is a compositing manager, which means that it enhances the overall user interaction by adding fancy effects to your windows, from drop shadows to awesome desktop effects like the Desktop Cube or the Expo view. Compiz can also be a window manager, which means that it is the software between you and your desktop apps. It enables you to move or resize windows, to switch workspaces, to switch windows easily (using alt-tab or so), and so on."

Installing Compiz

To install Compiz, you must first emerge it:

#  emerge compiz compiz-fusion emerald hicolor-icon-theme

As a standalone window manager

For Compiz to run as a standalone window manager, you must first change your ~.xinitrc file:

exec compiz ccp & 
emerald --replace &
fusion-icon & 
gnome-terminal & 
conky

The lines after the first two can be any applications that you would like to launch when the X.org server starts.

Now, with compiz installed and ready to run, try starting it:

$  xinit

Configuring Compiz

If it starts successfully, you will be greeted with a black screen and whatever programs you added to your ~/.xinitrc after line two. At this point, you may be wondering "Why are there no decorations around my windows?" There are no decorations because Compiz comes configured to not decorate windows. In your terminal that was launched from the ~/.xinitrc file, type in:

$ ccsm
Option Location Effects Notes
Window Decoration Effects Adds borders to your windows.

Don't like the default window decorations? You can modify the window decorations to your liking by typing:

$  emerald-theme-manager

Emerald offers several different engines for theming:

  • zootreeves: Evolved from the legacy engine
  • truglass: Glassy effects for your windows
  • vrunner: Multiple gradients with somewhat glassy features too
  • legacy: Based on original gnome-window-decorator
  • line: Based on original legacy
  • pixmap: Everything done with customizable pixmaps!
  • oxygen: Designed to be vista-ish in nature

Helpful Tricks / Tips

Note Note: To do.

To Come

* Explanations of ccsm and emerald-theme-manager
* Programs to use with compiz