다중 계정 설정에서 mutt 상태 표시줄 색상 조정

다중 계정 설정에서 mutt 상태 표시줄 색상 조정

질문

처리하는 계정 수에 관계없이 폴더 후크를 기반으로 계정별 색상 설정을 조정할 수 있도록 mutt를 올바르게 구성하려면 어떻게 해야 합니까?

세부 사항

안에바보내부 문서에서 계정 후크를 사용한 다중 계정 설정(아래)muttrc

# Account Hooks

# clean first
account-hook . 'unset imap_user; unset imap_pass; unset tunnel'

# account one
account-hook domain.net "set [email protected] imap_pass=${my_password}"

# account two
account-hook outlook.xyz.ch "set [email protected] imap_pass=${my_pastwo}"

# account three
account-hook mail.domain.ch "set [email protected] imap_pass=${my_passthree}"

해당 파일 후크뿐만 아니라 파일(아래)도 내부에서 제공됩니다..muttrc

# Folders and hooks

# domain.net
folder-hook 'domain.net' 'source ~/.mutt/domain.net'

# xyz
folder-hook 'outlook.xyz.ch' 'source ~/.mutt/outlook.xyz.ch'

# domain.ch
folder-hook 'mail.domain.ch' 'source ~/.mutt/domain.ch'

# source "default" on startup
source ~/.mutt/domain.net

다음 항목 세트는 각각 별도의 파일(계정당 하나씩)에 있으며 mutt 상태 표시줄 색상을 조정하기 위한 지침입니다.

파일 1

# ~/.mutt/account.one
set hostname="mail.domain.net"
color status color144 color234
..

파일 2

# ~/.mutt/account.two
set hostname = "outlook.xyz.ch"
color status brightyellow magenta
..

파일 3

# .mutt/account.three
set hostname="mail.domain.ch"
color status cyan brightblue
..
  • mutt를 시작하면 색상이 올바르게 설정됩니다(기본 계정의 경우).여기에 이미지 설명을 입력하세요.
  • 다른 계정(예: 두 번째 또는 세 번째)으로 전환해도 원하는 색상이 올바르게 설정됩니다. 아래 스크린샷에서는 계정 2가 선택되었습니다.여기에 이미지 설명을 입력하세요.
  • 그 후에는 세 번째 또는 두 번째 계정으로 전환할 수 없습니다. 다음 스크린샷은 3번 계정에 한 번 접속한 후의 2번 계정입니다.여기에 이미지 설명을 입력하세요.한편, 아래 이미지와 같이 mutt를 시작한 후 바로 계정 3에 접속하는 경우(따라서 처음으로 기본 계정에서 다른 계정으로 전환하는 경우)여기에 이미지 설명을 입력하세요.
  • 완성도를 높이기 위해 다음 스크린샷은 계정 3에 액세스한 후의 계정 2를 보여줍니다.여기에 이미지 설명을 입력하세요.

"메모리에" 저장된 색상은오직첫 번째 그룹(기본 계정), 두 번째 그룹, 즉 전환하기로 선택한 계정에 따라 두 번째 또는 세 번째 계정 중 하나입니다.

저는 Funtoo-Linux를 사용하고 있으며 기본 구성 파일 muttrc(아래 전체 파일을 복사하여 붙여넣은 내용 참조)에 다음과 같은 주석이 있습니다.

# ...For example, it is
# *impossible* currently in mutt to remove color settings from objects
# other than the index.

질문이 댓글(위)이 제가 설명하는 "문제"에 대한 답변인가요? 또는 얼마나 많은 계정 mutt 핸들이 있더라도 사전 설정된 기본 설정과 폴더 후크에 따라 색상 설정을 변경할 수 있도록 올바르게 구성할 수 있습니까?


각 계정 상태 표시줄에 색상을 지정하는 아이디어는 다음에서 나왔습니다.https://pbrisbin.com/posts/two_accounts_in_mutt/

현재의 muttrc:

# 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.


# Identity
set realname = 'Nikos Alexandris'

#set signature = ~/.mutt/signature

    # see account-hooks


# Receiving & Sending

    # see account- and/or folder-hooks

# tell the world what version of mutt I use
set user_agent


# respond using name they were sent to, if it's one of my addresses
# set reverse_name=yes

#-------------------------------------------------------------------------
# Security
#-------------------------------------------------------------------------

source "gpg2 --decrypt ~/.mutt/passwords.gpg |" # (options: --batch --use-agent -q --no-tty)

# also, see gpg file

# -------------------------------------------------------------------------
# Paths
# -------------------------------------------------------------------------

# set folder="~/.offlineimap"           # see "folder_hooks" file
set header_cache = ~/.mutt/cache/headers
set message_cachedir = ~/.mutt/cache/bodies
set certificate_file = ~/.mutt/certificates

# set postponed = "~/.mutt/mail/postponed"# see account- & folder-hooks
# set record = "~/.mutt/mail/sent"        # see account- & folder-hooks

set mailcap_path = ~/.mutt/mailcap # entries for filetypes
set tmpdir = ~/.mutt/tmp           # where to keep temp files
    # -- conflicts, I fear, with .secret/.tmp -- see above

#-------------------------------------------------------------------------
# Further customisations
#-------------------------------------------------------------------------

# set imap_passive=no
set imap_authenticators='login'
set imap_keepalive=120
set imap_check_subscribed

ignore "Authentication-Results:"
ignore "DoaminKey-Signature:"
ignore "DKIM-Signature:"

#-------------------------------------------------------------------------
# Configuration variables
#-------------------------------------------------------------------------

set abort_nosubject = yes
set abort_unmodified = yes
set query_command = "abook --mutt-query '%s'"

set hidden_host                           # Hide host details.

set assumed_charset = "utf-8"
set attach_charset = "utf-8"
set charset = "utf-8"

# -------------------------------------------------------------------------
# Aliases
# -------------------------------------------------------------------------

set alias_file = "~/.mutt/mutt-alias"
set alias_format = "%4n %t %a %r"
set sort_alias = alias
set reverse_alias = yes
source $alias_file

# -------------------------------------------------------------------------
# Basic Options
# -------------------------------------------------------------------------

#set wait_key = no      # silence, mutt
set sleep_time = 0
set mbox_type = Maildir # mailbox type
set timeout = 3         # idle time before scanning
set mail_check = 60     # minimum time between scans

#unset move             # gmail does that
#set delete             # don't ask, just do
set delete = ask-yes        # Ask before doing a delete.
#unset confirmappend    # don't ask, just do!
set noconfirmappend     # Just append, don't hassle me.
set quit                # don't ask, just do!!
#unset mark_old         # read/new is good enough for me
set nomark_old          # Don't mark unread new msgs as old.

set beep_new            # bell on new mails
set nobeep
set pipe_decode         # strip headers and eval mimes when piping
set thorough_search     # strip headers and eval mimes before searching

# -------------------------------------------------------------------------
# Index View Options
# -------------------------------------------------------------------------

set date_format = "%Y-%m-%d %T"
set index_format = "%2C | %Z [%d] %-30.30F (%-4.4c) %s"
set uncollapse_jump                        # don't collapse on an unread message

# -------------------------------------------------------------------------
# Sorting
# -------------------------------------------------------------------------

set smart_wrap = yes
set sort = 'threads'
set duplicate_threads = yes
set sort_aux = 'reverse-last-date-received' # =date-received OR last-date-received
set sort_re                                # thread based on regex
set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*" # "^(re([\[0-9\]+])*|betr):[ \t]*"

set help = yes

set attribution = "* %n <%a> [%{%Y-%m-%d %H:%M:%S %Z}]:\n"
set editor = 'vim + -c "set textwidth=72" -c "set wrap" -c "set nocp" -c "?^$" -c "set spell spelllang=en,de,fr,el" '

set reply_to = yes
set include = yes
set forward_quote = yes

# set imap_idle=yes # seems deprecated! http://www.mutt.org/doc/manual/manual-6.html
set imap_peek = yes
set imap_servernoise = no

# -------------------------------------------------------------------------
# Menu Options
# -------------------------------------------------------------------------

set status_on_top # Status bar on top.
set menu_move_off = no
set menu_scroll = no
set mime_forward = ask-no

# -------------------------------------------------------------------------
# Pager View Options
# -------------------------------------------------------------------------

set pager_index_lines = 11  # number of index lines to show
set pager_context = 6       # Retain 6 lines of previous page when scrolling.
set pager_stop              # don't go to next message automatically
set menu_scroll             # scroll in menus
set tilde                   # show tildes like in vim

set read_inc = 100            # Read counter ticks every 100 msgs.
set write_inc = 100           # Write counter ticks every 100 msgs.

# set markers # mark wrapped lines of text in the pager with a +
unset markers               # no ugly plus signs

set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
alternative_order text/plain text/enriched text/html

# -------------------------------------------------------------------------
# Header Options
# -------------------------------------------------------------------------

set edit_headers = yes
ignore *                                # ignore all headers
unignore subject: from: to: cc: date:   # show only these
unhdr_order *                           # some distros order things by default
hdr_order subject: from: to: cc: date:  # and in this order

#--------------------------------------------------------------------------
# muttprint for printing
#--------------------------------------------------------------------------

set print = ask-yes     # Ask before printing.
set print_command = "muttprint"

#--------------------------------------------------------------------------
# Automatically process html mails
#--------------------------------------------------------------------------

auto_view text/html

#--------------------------------------------------------------------------
# Greek support -- Should read Hellenic!
#--------------------------------------------------------------------------

# set charset="greek"
# set locale="el_GR"
# set send_charset="US-ASCII:ISO-8859-1:ISO-8859-7:UTF-8"

#--------------------------------------------------------------------------
# Other configuration files
#--------------------------------------------------------------------------

source ~/.mutt/account_hooks
source ~/.mutt/folder_hooks
source ~/.mutt/colors
source ~/.mutt/sidebar
source ~/.mutt/statusbar
source ~/.mutt/gpg
source ~/.mutt/macros
source ~/.mutt/lists

# Last, but not least, get mutt to display its version on startup.
push <show-version>

현재 소스 색 구성표:

# Screenshot http://trovao.droplinegnome.org/stuff/mutt-zenburnt.png
#
# This is a zenburn-based mutt color scheme that is not (even by far)
# complete. There's no copyright involved. Do whatever you want with it.
# Just be aware that I won't be held responsible if the current color-scheme
# explodes your mail client. ;)
#
# Do notice that this color scheme requires a terminal emulator that supports
# 256 color. Any modern X terminal emulator should have support for that and
# you can enable it by calling mutt as "TERM=xterm-256color mutt" or, if you
# use screen, by adding "term screen-256color" to your .screenrc.
#
# This file is in the public domain.
#

# general-doesn't-fit stuff
color normal color188 color237
#color error color115 color236
color error color236 color210
color markers color142 color238
color tilde color108 color237
# color status color144 color234 # check in folder-hooks!

# index stuff
#color indicator color229 color238
color indicator color236 color188
color tree color109 color237
color index color188 color237 ~A
color index color228 color237 ~N # New
color index color174 color237 ~F # Flagged
color index color223 color237 ~O # Old
color index color108 color237 ~P # From me
color index color210 color237 ~D # Deleted

# header stuff
color hdrdefault color223 color237
color header color223 color237 "^Subject"

# gpg stuff
color body color188 color237 "^gpg: Good signature.*"
color body color115 color236 "^gpg: BAD signature.*"
color body color174 color237 "^gpg: Can't check signature.*"
color body color174 color237 "^-----BEGIN PGP SIGNED MESSAGE-----"
color body color174 color237 "^-----BEGIN PGP SIGNATURE-----"
color body color174 color237 "^-----END PGP SIGNED MESSAGE-----"
color body color174 color237 "^-----END PGP SIGNATURE-----"
color body color174 color237 "^Version: GnuPG.*"
color body color174 color237 "^Comment: .*"

# url, email and web stuff
color body color174 color237 "(finger|ftp|http|https|news|telnet)://[^ >]*"
color body color174 color237 "<URL:[^ ]*>"
color body color174 color237 "www\\.[-.a-z0-9]+\\.[a-z][a-z][a-z]?([-_./~a-z0-9]+)?"
color body color174 color237 "mailto: *[^ ]+\(\\i?subject=[^ ]+\)?"
color body color174 color237 "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"

# misc body stuff
color attachment color174 color237 #Add-ons to the message
color signature color223 color237

# quote levels
color quoted color108 color237
color quoted1 color116 color237
color quoted2 color247 color237
color quoted3 color108 color237
color quoted4 color116 color237
color quoted5 color247 color237
color quoted6 color108 color237
color quoted7 color116 color237
color quoted8 color247 color237
color quoted9 color108 color237

# vim: set ft=muttrc

관련 정보