Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/fischerling/dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
fischerling committed Aug 4, 2017
2 parents 9a051e9 + a994b1c commit 23ea135
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 11 deletions.
3 changes: 3 additions & 0 deletions config/fish/functions/c2p.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function c2p --description 'Copy clipboard to primary selection'
xclip -o -selection clipboard | xclip -i -selection primary
end
3 changes: 3 additions & 0 deletions config/fish/functions/p2c.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function p2c --description 'Copy primary selection to clipboard'
xclip -o -selection primary | xclip -i -selection clipboard
end
207 changes: 207 additions & 0 deletions config/lumail/lumail.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
--
-- This is the per-user configuration file for lumail.
--

keymap['global']['gg'] = 'first()'
keymap['global']['G'] = 'last()'

-----------------------------------------------------------------------------

--
-- The following line enables *experimental* conversion of message-bodies
-- to UTF-8.
--
-- You might require this to be enabled if you receive mail in foreign
-- character-sets. It should be harmless when enabled, but character-sets,
-- encoding, and similar, are scary and hard. If you see garbled text,
-- unreadable emails, or similar problems with displaying message-bodies
-- comment it out as a first step in isolating the problem.
--
Config:set( "global.iconv", 1 )

--
-- Get our base-directories
--
local HOME = os.getenv("HOME")
local DATA_HOME = os.getenv("XDG_DATA_HOME") or HOME .. "/.local/share"
local CACHE_HOME = os.getenv("XDG_CONFIG_HOME") or HOME .. "/.cache"

--
-- The default Maildir location is ~/Maildir
--
local MAILPREFIX = HOME .. "/.local/share/maildir"
Config:set("maildir.prefix", MAILPREFIX);

--
-- Handle both of my email accounts.
-- Determine the current account on basis of the folder path.
--

-- This is the account used by msmtp
local account = "fau"
-- Default name to use
Config:set("global.name", "Florian Fischer")
-- Default address.
Config:set("global.address", "[email protected]")
-- Default From: address.
Config:set("global.sender", "Florian Fischer <[email protected]>")
-- Default sent-folder.
Config:set("global.sent-mail", MAILPREFIX .. "/FAU/Sent")
-- Default trash-folder.
Config:set("global.trash-mail", MAILPREFIX.."/FAU/Trash")
-- Default GPG mode
Config:set("gpg.mode", "auto")

function on_folder_changed(folder)
local path = folder:path()
if path:find("FAU") then
account = "fau"
Config:set("global.address", "[email protected]")
Config:set("global.sent-mail", MAILPREFIX .. "/FAU/Sent")
Config:set("global.trash-mail", MAILPREFIX.."/FAU/Trash")
Config:set("gpg.mode", "auto")
elseif path:find("MUHQ") then
account = "muhq"
Config:set("global.address", "[email protected]")
Config:set("global.sent-mail", MAILPREFIX .. "/MUHQ/Sent")
Config:set("global.trash-mail", MAILPREFIX.."/MUHQ/Trash")
Config:set("gpg.mode", "")
end
-- update sender
Config:set("global.sender", Config:get("global.name").." <"..Config:get("global.address")..">")
-- update MTA.
Config:set( "global.mailer", "/usr/bin/sendmail -t -a " .. account .. " -f " .. Config:get("global.address") )
end

--
-- Setup our MTA, the command which actually sends the mail.
--
Config:set( "global.mailer", "/usr/bin/sendmail -t -a " .. account .. " -f " .. Config:get("global.address") )

--
-- Setup our default editor, for compose/reply/forward operations.
--
local editor = os.getenv("VISUAL") or os.getenv("EDITOR") or "vi"
Config:set( "global.editor", editor .. " +/^$ ++8" )

--
-- Save persistant history of our input in the named file.
--
Config:set( "global.history", DATA_HOME .. "/lumail/history" )

--
-- Configure a cache-prefix, and populate it
--
Config:set( "cache.prefix", CACHE_HOME .. "/lumail" )

-- Configure logging
Config:set( "log.path" , DATA_HOME .. "/lumail/log" )
Config:set ( "log.level", "")

-- Index mode - which shows the list of messages:
--
Config:set( "index.format",
"[${4|flags}] ${2|message_flags} | ${10|date} | ${20|sender} | ${indent}${subject}" )
--
-- Options include:
--
-- date -> The message date.
-- flags -> The local flags.
-- id -> Message-ID.
-- indent -> Nesting character(s) for the display of threads.
-- message_flags -> The message-content flags (has attachment? is signed?).
-- number -> The message number.
-- sender -> The sender of the message: "Bob Smith <[email protected]>"
-- email -> [email protected]
-- name -> Bob Smith
-- subject -> The message subject.

--
-- Set the default sorting method. Valid choices are:
--
-- `file` - Use the mtime of the files in the maildir.
-- `date` - Read the `Date` header of the message(s) - slower than the
-- above method, but works on IMAP too.
-- `subject` - Sort by subject.
-- `from` - Sort by sender.
--
sorting_method( "threads" )

Config:set("threads.sort", "date")

--
-- Unread messages/maildirs are drawn in red.
--
Config:set( "colour.unread", "red" )

--
-- This table contains colouring information, it is designed to allow
-- the user to override the colours used in the display easily.
--
colour_table = {}

--
-- Create a per-mode map for each known mode.
--
for i,o in ipairs(Global:modes()) do
colour_table[o] = {}
end

--
-- Setup our colours - for Maildir-mode
--
colour_table['maildir'] = {
['Automated'] = 'yellow|underline',
['lists'] = 'green|bold',
}

-- Setup our colours - for index-mode
colour_table['index'] = {
['Florian Fischer'] = 'blue',
['Fischer'] = 'blue',
}

-- Setup our colours - for a message
colour_table['message'] = {
-- headers
['^Subject:'] = 'yellow',
['^Date:'] = 'yellow',
['^From:'] = 'yellow',
['^To:'] = 'yellow',
['^Cc:'] = 'yellow',
['^Sent:'] = 'yellow',

-- quoting, and nested quoting.
['^>%s*>%s*'] = 'green',
['^>%s*[^>%s]'] = 'blue',
['^>%s$'] = 'blue',
}

--
-- Include address book completion in on_complete
--
do
local _on_complete = on_complete
function on_complete(token)
local res = _on_complete(token)

local handle = io.popen("khard email --parsable " .. token)
local stdout = handle:read("*a")
handle:close()

local lines = {}

local function insert_mailaddr(line)
-- include @ to make sure match is email
local mailaddr = line:match("([^%s]*@[^%s]*)%s")
if mailaddr then
table.insert(res, mailaddr)
end
end

stdout:gsub("(.-)\r?\n", insert_mailaddr)

return res
end
end

2 changes: 1 addition & 1 deletion config/vis/plugins/vis-cursors
Submodule vis-cursors updated 2 files
+4 −5 README.md
+5 −5 cursors.lua
20 changes: 10 additions & 10 deletions offlineimap/offlineimaprc
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ remoterepository = FAU
autorefresh=1
quick=10

[Account MUHQ]
localrepository=LocalMUHQ
remoterepository=MUHQ

autorefresh=1
quick=10

[Repository FAU]
type = IMAP
remotehost = faumail.uni-erlangen.de
Expand All @@ -29,10 +22,17 @@ ssl=yes
cert_fingerprint = BB9EE687E92693794C752F57C53483076DEF2755
newmail_hook = lambda: __import__("os").system("i3-nagbar -m \"new mail in FAU\" > /dev/null 2>&1 &")


[Repository LocalFAU]
type = Maildir
localfolders = ~/Mail/FAU/
localfolders = ~/.local/share/maildir/FAU/


[Account MUHQ]
localrepository=LocalMUHQ
remoterepository=MUHQ

autorefresh=1
quick=10

[Repository MUHQ]
type = IMAP
Expand All @@ -46,4 +46,4 @@ newmail_hook = lambda: __import__("os").system("i3-nagbar -m \"new mail in MUHQ\

[Repository LocalMUHQ]
type = Maildir
localfolders = ~/Mail/MUHQ/
localfolders = ~/.local/share/maildir/MUHQ/
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def offlineimap_warn(quiet):
# targets are a list of tuples<file name, link destination> and/or functions

targets = {
"lumail":
[("config/lumail/lumail.lua", home_dir + "/.config/lumail/lumail.lua")],
"guixsd":
[("guix/system.scm", "/etc/guix/system.scm"),
("guix/bashrc", home_dir + "/.bashrc")],
Expand Down

0 comments on commit 23ea135

Please sign in to comment.