From 88b2cf0e21794207d68386ae5c2504abad6b0a67 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 23 May 2017 12:39:46 +0200 Subject: [PATCH 01/18] update guixsd setup guixsd specific environment variables are set with bash. After setting up the environment fish is executed. --- config/fish/config.fish | 13 ++----------- guix/bashrc | 26 ++++++++++++++++++++++++++ guix/system.scm | 14 ++++++-------- setup.py | 5 +++-- 4 files changed, 37 insertions(+), 21 deletions(-) create mode 100644 guix/bashrc diff --git a/config/fish/config.fish b/config/fish/config.fish index d89c8b5..41c71fa 100644 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -1,10 +1,7 @@ # PATH Stuff -# include guix paths -for p in /home/fischerling/.guix-profile/bin /run/setuid-programs /run/current-system/profile/bin /run/current-system/profile/sbin - if test -d $p; and not contains $p $PATH - set PATH $PATH $p - end +if not contains ~/.local/bin $PATH + set PATH ~/.local/bin $PATH end # export the path to our dotfiles @@ -42,12 +39,6 @@ else end end -if not contains ~/.local/bin $PATH - set PATH ~/.local/bin $PATH -end - - - # autoload functions and completions in .dotfiles set fish_function_path $DOTFILES_LOCATION/config/fish/functions $fish_function_path set fish_complete_path $DOTFILES_LOCATION/config/fish/completions $fish_complete_path diff --git a/guix/bashrc b/guix/bashrc new file mode 100644 index 0000000..44af031 --- /dev/null +++ b/guix/bashrc @@ -0,0 +1,26 @@ +# Bash initialization for interactive non-login shells and +# for remote shells (info "(bash) Bash Startup Files"). + +# Export 'SHELL' to child processes. Programs such as 'screen' +# honor it and otherwise use /bin/sh. +export SHELL + +if [ -n "$SSH_CLIENT" -a -z "`type -P cat`" ] +then + # We are being invoked from a non-interactive SSH session + # (as in "ssh host command") but 'cat' cannot be found + # in $PATH. Source /etc/profile so we get $PATH and other + # essential variables. + source /etc/profile +fi + +# Adjust the prompt depending on whether we're in 'guix environment'. +if [ -n "$GUIX_ENVIRONMENT" ] +then + PS1='\u@\h \w [env]\$ ' +else + PS1='\u@\h \w\$ ' +fi + +# exec fish +exec fish diff --git a/guix/system.scm b/guix/system.scm index 26a0270..2c6eaaf 100644 --- a/guix/system.scm +++ b/guix/system.scm @@ -57,19 +57,17 @@ (group "users") (supplementary-groups '("wheel" "netdev" "audio" "video")) - (home-directory "/home/fischerling") - (shell #~(string-append #$fish "/bin/fish"))) + (home-directory "/home/fischerling")) %base-user-accounts)) (packages (cons* - i3-wm i3status dmenu conky ;; Desktop + i3-wm i3status dmenu ;; Desktop - gcc python-wrapper git make ;; Devel - fish - file + gcc python-wrapper git ;; Devel + fish fish-guix vis - htop - gnupg + htop file + gnupg pinentry openssh alsa-utils nss-certs ;for HTTPS access diff --git a/setup.py b/setup.py index 2153685..f0c8564 100755 --- a/setup.py +++ b/setup.py @@ -87,7 +87,8 @@ def offlineimap_warn(quiet): targets = { "guixsd": - [("guix/system.scm", "/etc/guix/system.scm")], + [("guix/system.scm", "/etc/guix/system.scm"), + ("guix/bashrc", home_dir + "/.bashrc")], "vimrc": [("vimrc", home_dir + "/.vimrc")], "vim.d": @@ -131,7 +132,7 @@ def offlineimap_warn(quiet): [("msmtprc", home_dir + "/.msmtprc")], "FAU": [("FAU/wl-FAU-STUD.gpg", "/etc/netctl/wl-FAU-STUD"), - ("FAU/fau_stud.conf.gpg", "/etc/wpa_supplicant/fau_stud.conf"), + ("FAU/fau_stud.conf.gpg", ""), ("FAU/start_fau_wlan.sh", home_dir + "/.local/bin/start_fau_wlan")] } From e56a88107e5961cb457e02f70962cfed41234617 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 23 May 2017 18:58:46 +0200 Subject: [PATCH 02/18] remove comments --- guix/packages/own/conky-wl.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guix/packages/own/conky-wl.scm b/guix/packages/own/conky-wl.scm index d9b4a6b..7fc8d90 100644 --- a/guix/packages/own/conky-wl.scm +++ b/guix/packages/own/conky-wl.scm @@ -1,7 +1,7 @@ (define-module (own conky-wl) - #:use-module (gnu packages conky) ; emacs - #:use-module (guix build-system cmake) ; gnu-build - #:use-module (guix packages)) ; package + #:use-module (gnu packages conky) + #:use-module (guix build-system cmake) + #:use-module (guix packages)) (define-public conky-wl (package From f1b85b9997a2235e5e3070268da887e70df7b2ff Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 24 May 2017 11:48:47 +0200 Subject: [PATCH 03/18] export GUIX_PACKAGE_PATH and add current-system to the paths --- config/fish/config.fish | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/fish/config.fish b/config/fish/config.fish index 41c71fa..10ab766 100644 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -28,7 +28,10 @@ end # guixsd has nether /bin nor /usr # TODO find a better way to check if we are on guixsd if type -q guix - set GUIX_PACKAGE_PATH $DOTFILES_LOCATION/guix/packages + set -x GUIX_PACKAGE_PATH $DOTFILES_LOCATION/guix/packages + # source the system paths + set fish_function_path $fish_function_path /run/current-system/profile/share/fish/functions + set fish_complete_path $fish_complete_path /run/current-system/profile/share/fish/completions else if not contains /bin/core_perl $PATH set PATH /bin/core_perl $PATH From b03002c04c44a390f59ad1e0d71a1174d5d0d3ca Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 24 May 2017 12:35:27 +0200 Subject: [PATCH 04/18] make conky do what I want, finally :) --- guix/packages/own/conky-wl.scm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/guix/packages/own/conky-wl.scm b/guix/packages/own/conky-wl.scm index 7fc8d90..51d5c64 100644 --- a/guix/packages/own/conky-wl.scm +++ b/guix/packages/own/conky-wl.scm @@ -1,14 +1,17 @@ (define-module (own conky-wl) #:use-module (gnu packages conky) - #:use-module (guix build-system cmake) - #:use-module (guix packages)) + #:use-module (gnu packages linux) ;wireless-tools + #:use-module (guix packages) + #:use-module (guix utils)) (define-public conky-wl (package (inherit conky) (name "conky-wl") (synopsis "conky with wireless support" ) - (build-system cmake-build-system) - (arguments `( - #:configure-flags '("-DBUILD_WLAN=true") - ,@(package-arguments conky))))) + (inputs `( + ("wireless-tools" ,wireless-tools) + ,@(package-inputs conky))) + (arguments + (substitute-keyword-arguments (package-arguments conky) + ((#:configure-flags cf) `(cons "-DBUILD_WLAN=true" ,cf)))))) From c2bcf5dcde28c5be579e50fff839882939473372 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 24 May 2017 14:53:12 +0200 Subject: [PATCH 05/18] only exec fish if bash is not a login shell --- guix/bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/bashrc b/guix/bashrc index 44af031..986cd82 100644 --- a/guix/bashrc +++ b/guix/bashrc @@ -23,4 +23,4 @@ else fi # exec fish -exec fish +! shopt -q login_shell && exec fish From d235c9a62afbfcf004f7cbca09096aaac8263a64 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 5 Jun 2017 19:11:42 +0200 Subject: [PATCH 06/18] add lumail2 config --- lumail2/lumail2.lua | 201 ++++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 + 2 files changed, 203 insertions(+) create mode 100644 lumail2/lumail2.lua diff --git a/lumail2/lumail2.lua b/lumail2/lumail2.lua new file mode 100644 index 0000000..a301a92 --- /dev/null +++ b/lumail2/lumail2.lua @@ -0,0 +1,201 @@ +-- +-- 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 home-directory, as this is often used. +-- +local HOME = os.getenv("HOME") + +-- +-- The default Maildir location is ~/Maildir +-- +Config:set( "maildir.prefix", HOME .. "/Mail" ); + +-- +-- 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", "florian.fl.fischer@fau.de") +-- Default From: address. +Config:set( "global.sender", "Florian Fischer " ) +-- Default sent-folder. +Config:set( "global.sent-mail", HOME.."/Mail/FAU/Sent") +-- Default trash-folder. +Config:set( "global.trash-mail", HOME.."/Mail/FAU/Trash") + +function on_folder_changed(folder) + local path = folder:path() + if path:find("FAU") then + account = "fau" + Config:set("global.address", "florian.fl.fischer@fau.de") + Config:set("global.sent-mail", HOME.."/Mail/FAU/Sent") + Config:set( "global.trash-mail", HOME.."/Mail/FAU/Trash") + elseif path:find("MUHQ") then + account = "muhq" + Config:set("global.address", "florian.fischer@muhq.space") + Config:set("global.sent-mail", HOME.."/Mail/MUHQ/Sent") + Config:set( "global.trash-mail", HOME.."/Mail/MUHQ/Trash") + 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", HOME .. "/.lumail2/history" ) + +-- +-- Configure a cache-prefix, and populate it +-- +Config:set( "cache.prefix", HOME .. "/.lumail2/cache" ) + +-- 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 -> bob@example.com +-- 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', +} + +-- set logfile +Config:set( "log.path" , HOME .. "/.lumail2/log" ) +Config:set ( "log.level", "debug") + +-- +-- 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 + diff --git a/setup.py b/setup.py index f0c8564..7230e80 100755 --- a/setup.py +++ b/setup.py @@ -86,6 +86,8 @@ def offlineimap_warn(quiet): # targets are a list of tuples and/or functions targets = { + "lumail": + [("lumail2/lumail2.lua", home_dir + "/lumail2/lumail2.lua")], "guixsd": [("guix/system.scm", "/etc/guix/system.scm"), ("guix/bashrc", home_dir + "/.bashrc")], From dcea5ffd358d3b5f5cff654f4befd03b9729e719 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 6 Jun 2017 12:48:18 +0200 Subject: [PATCH 07/18] fix lumail2 folder --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7230e80..8f80aa1 100755 --- a/setup.py +++ b/setup.py @@ -87,7 +87,7 @@ def offlineimap_warn(quiet): targets = { "lumail": - [("lumail2/lumail2.lua", home_dir + "/lumail2/lumail2.lua")], + [("lumail2/lumail2.lua", home_dir + "/.lumail2/lumail2.lua")], "guixsd": [("guix/system.scm", "/etc/guix/system.scm"), ("guix/bashrc", home_dir + "/.bashrc")], From 5985125e2e62bc4cf7bf85b104c85620daed25a4 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 6 Jun 2017 14:07:46 +0200 Subject: [PATCH 08/18] make lumail2 config XDG_BASE_DIR ready --- {lumail2 => config/lumail2}/lumail2.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) rename {lumail2 => config/lumail2}/lumail2.lua (93%) diff --git a/lumail2/lumail2.lua b/config/lumail2/lumail2.lua similarity index 93% rename from lumail2/lumail2.lua rename to config/lumail2/lumail2.lua index a301a92..8e66daf 100644 --- a/lumail2/lumail2.lua +++ b/config/lumail2/lumail2.lua @@ -20,9 +20,11 @@ keymap['global']['G'] = 'last()' Config:set( "global.iconv", 1 ) -- --- Get our home-directory, as this is often used. +-- 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 @@ -80,12 +82,16 @@ Config:set( "global.editor", editor .. " +/^$ ++8" ) -- -- Save persistant history of our input in the named file. -- -Config:set( "global.history", HOME .. "/.lumail2/history" ) +Config:set( "global.history", DATA_HOME .. "/lumail2/history" ) -- -- Configure a cache-prefix, and populate it -- -Config:set( "cache.prefix", HOME .. "/.lumail2/cache" ) +Config:set( "cache.prefix", CACHE_HOME .. "/lumail2/" ) + +-- Configure logging +Config:set( "log.path" , DATA_HOME .. "/.lumail2/log" ) +Config:set ( "log.level", "") -- Index mode - which shows the list of messages: -- @@ -136,7 +142,6 @@ for i,o in ipairs(Global:modes()) do colour_table[o] = {} end - -- -- Setup our colours - for Maildir-mode -- @@ -167,10 +172,6 @@ colour_table['message'] = { ['^>%s$'] = 'blue', } --- set logfile -Config:set( "log.path" , HOME .. "/.lumail2/log" ) -Config:set ( "log.level", "debug") - -- -- Include address book completion in on_complete -- From 9a0ea281fb40292636146031a560065e9fa7622b Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 6 Jun 2017 14:31:03 +0200 Subject: [PATCH 09/18] make lumail config xdg ready #2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8f80aa1..6662334 100755 --- a/setup.py +++ b/setup.py @@ -87,7 +87,7 @@ def offlineimap_warn(quiet): targets = { "lumail": - [("lumail2/lumail2.lua", home_dir + "/.lumail2/lumail2.lua")], + [("config/lumail2/lumail2.lua", home_dir + "/.config/lumail2/lumail2.lua")], "guixsd": [("guix/system.scm", "/etc/guix/system.scm"), ("guix/bashrc", home_dir + "/.bashrc")], From 621642a33b947cc29fa1aa48e5268385a9d582b3 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 6 Jun 2017 18:19:18 +0200 Subject: [PATCH 10/18] lumail2 add Content-Type to the headers --- config/lumail2/lumail2.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/config/lumail2/lumail2.lua b/config/lumail2/lumail2.lua index 8e66daf..8466863 100644 --- a/config/lumail2/lumail2.lua +++ b/config/lumail2/lumail2.lua @@ -200,3 +200,29 @@ do end end +-- +-- Add Content-Type to the headers before sending +-- +function on_message_send(path) + local content = {} + local added = false + local is_header = "^%a+: .*" + for l in io.lines(path) do + -- Find the last header. + if not added + and content[#content] and string.match(content[#content], is_header) + and not string.match(l, is_header) + then + -- Append Content-Type to the headers. + table.insert(content, "Content-Type: text/plain; charset=UTF-8\n") + added = true + end + table.insert(content, l.."\n") + end + + -- write the new content + local m = io.open(path, "w") + m:write(unpack(content)) + m:close() +end + From 295354be091b78979e3c842e9d683655c889c43f Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 6 Jun 2017 21:01:26 +0200 Subject: [PATCH 11/18] don't mess with mimegpg --- config/lumail2/lumail2.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/lumail2/lumail2.lua b/config/lumail2/lumail2.lua index 8466863..8c60232 100644 --- a/config/lumail2/lumail2.lua +++ b/config/lumail2/lumail2.lua @@ -208,6 +208,11 @@ function on_message_send(path) local added = false local is_header = "^%a+: .*" for l in io.lines(path) do + -- If this message was replaced by mimegpg don't mess with it + if (l == "-----BEGIN PGP SIGNATURE-----") or (l == "-----BEGIN PGP MESSAGE-----") then + return + end + -- Find the last header. if not added and content[#content] and string.match(content[#content], is_header) From f0f7e0b833792fad507fbe93990df1eebc30801a Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 16 Jun 2017 16:17:37 +0200 Subject: [PATCH 12/18] add new gpg defaults. And lumail2 is now just lumail. --- config/{lumail2/lumail2.lua => lumail/lumail.lua} | 10 +++++++--- setup.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) rename config/{lumail2/lumail2.lua => lumail/lumail.lua} (95%) diff --git a/config/lumail2/lumail2.lua b/config/lumail/lumail.lua similarity index 95% rename from config/lumail2/lumail2.lua rename to config/lumail/lumail.lua index 8c60232..ab8dbba 100644 --- a/config/lumail2/lumail2.lua +++ b/config/lumail/lumail.lua @@ -43,11 +43,13 @@ Config:set("global.name", "Florian Fischer") -- Default address. Config:set("global.address", "florian.fl.fischer@fau.de") -- Default From: address. -Config:set( "global.sender", "Florian Fischer " ) +Config:set("global.sender", "Florian Fischer ") -- Default sent-folder. -Config:set( "global.sent-mail", HOME.."/Mail/FAU/Sent") +Config:set("global.sent-mail", HOME.."/Mail/FAU/Sent") -- Default trash-folder. -Config:set( "global.trash-mail", HOME.."/Mail/FAU/Trash") +Config:set("global.trash-mail", HOME.."/Mail/FAU/Trash") +-- Default GPG mode +Config:set("gpg.mode", "auto") function on_folder_changed(folder) local path = folder:path() @@ -56,11 +58,13 @@ function on_folder_changed(folder) Config:set("global.address", "florian.fl.fischer@fau.de") Config:set("global.sent-mail", HOME.."/Mail/FAU/Sent") Config:set( "global.trash-mail", HOME.."/Mail/FAU/Trash") + Config:set("gpg.mode", "auto") elseif path:find("MUHQ") then account = "muhq" Config:set("global.address", "florian.fischer@muhq.space") Config:set("global.sent-mail", HOME.."/Mail/MUHQ/Sent") Config:set( "global.trash-mail", HOME.."/Mail/MUHQ/Trash") + Config:set("gpg.mode", "") end -- update sender Config:set("global.sender", Config:get("global.name").." <"..Config:get("global.address")..">") diff --git a/setup.py b/setup.py index 6662334..33159f9 100755 --- a/setup.py +++ b/setup.py @@ -87,7 +87,7 @@ def offlineimap_warn(quiet): targets = { "lumail": - [("config/lumail2/lumail2.lua", home_dir + "/.config/lumail2/lumail2.lua")], + [("config/lumail/lumail.lua", home_dir + "/.config/lumail/lumail.lua")], "guixsd": [("guix/system.scm", "/etc/guix/system.scm"), ("guix/bashrc", home_dir + "/.bashrc")], From a304b9c4ff564368aa2b1ed30f064f8cff3fc4af Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 16 Jun 2017 16:24:25 +0200 Subject: [PATCH 13/18] additional lumail2 -> lumail changes --- config/lumail/lumail.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/lumail/lumail.lua b/config/lumail/lumail.lua index ab8dbba..7baa19c 100644 --- a/config/lumail/lumail.lua +++ b/config/lumail/lumail.lua @@ -86,15 +86,15 @@ Config:set( "global.editor", editor .. " +/^$ ++8" ) -- -- Save persistant history of our input in the named file. -- -Config:set( "global.history", DATA_HOME .. "/lumail2/history" ) +Config:set( "global.history", DATA_HOME .. "/lumail/history" ) -- -- Configure a cache-prefix, and populate it -- -Config:set( "cache.prefix", CACHE_HOME .. "/lumail2/" ) +Config:set( "cache.prefix", CACHE_HOME .. "/lumail/" ) -- Configure logging -Config:set( "log.path" , DATA_HOME .. "/.lumail2/log" ) +Config:set( "log.path" , DATA_HOME .. "/.lumail/log" ) Config:set ( "log.level", "") -- Index mode - which shows the list of messages: From 5ec70a115e95818a24ff682753b11cef072a4ebd Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 16 Jun 2017 17:22:29 +0200 Subject: [PATCH 14/18] move maildir from ~/Mail to ~/.local/share/maildir --- config/lumail/lumail.lua | 15 ++++++++------- offlineimap/offlineimaprc | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/config/lumail/lumail.lua b/config/lumail/lumail.lua index 7baa19c..ddc0be4 100644 --- a/config/lumail/lumail.lua +++ b/config/lumail/lumail.lua @@ -29,7 +29,8 @@ local CACHE_HOME = os.getenv("XDG_CONFIG_HOME") or HOME .. "/.cache" -- -- The default Maildir location is ~/Maildir -- -Config:set( "maildir.prefix", HOME .. "/Mail" ); +local MAILPREFIX = HOME .. "/.local/share/maildir" +Config:set("maildir.prefix", MAILPREFIX); -- -- Handle both of my email accounts. @@ -45,9 +46,9 @@ Config:set("global.address", "florian.fl.fischer@fau.de") -- Default From: address. Config:set("global.sender", "Florian Fischer ") -- Default sent-folder. -Config:set("global.sent-mail", HOME.."/Mail/FAU/Sent") +Config:set("global.sent-mail", MAILPREFIX .. "/FAU/Sent") -- Default trash-folder. -Config:set("global.trash-mail", HOME.."/Mail/FAU/Trash") +Config:set("global.trash-mail", MAILPREFIX.."/FAU/Trash") -- Default GPG mode Config:set("gpg.mode", "auto") @@ -56,14 +57,14 @@ function on_folder_changed(folder) if path:find("FAU") then account = "fau" Config:set("global.address", "florian.fl.fischer@fau.de") - Config:set("global.sent-mail", HOME.."/Mail/FAU/Sent") - Config:set( "global.trash-mail", HOME.."/Mail/FAU/Trash") + 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", "florian.fischer@muhq.space") - Config:set("global.sent-mail", HOME.."/Mail/MUHQ/Sent") - Config:set( "global.trash-mail", HOME.."/Mail/MUHQ/Trash") + Config:set("global.sent-mail", MAILPREFIX .. "/MUHQ/Sent") + Config:set("global.trash-mail", MAILPREFIX.."/MUHQ/Trash") Config:set("gpg.mode", "") end -- update sender diff --git a/offlineimap/offlineimaprc b/offlineimap/offlineimaprc index 3a46bd4..f514afd 100644 --- a/offlineimap/offlineimaprc +++ b/offlineimap/offlineimaprc @@ -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 @@ -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 @@ -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/ From 5004951e471fae7576243c85de6523bd5ac61ad0 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 12 Jul 2017 12:47:24 +0200 Subject: [PATCH 15/18] lumail: fix lumail locations --- config/lumail/lumail.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/lumail/lumail.lua b/config/lumail/lumail.lua index ddc0be4..cd8f381 100644 --- a/config/lumail/lumail.lua +++ b/config/lumail/lumail.lua @@ -92,10 +92,10 @@ Config:set( "global.history", DATA_HOME .. "/lumail/history" ) -- -- Configure a cache-prefix, and populate it -- -Config:set( "cache.prefix", CACHE_HOME .. "/lumail/" ) +Config:set( "cache.prefix", CACHE_HOME .. "/lumail" ) -- Configure logging -Config:set( "log.path" , DATA_HOME .. "/.lumail/log" ) +Config:set( "log.path" , DATA_HOME .. "/lumail/log" ) Config:set ( "log.level", "") -- Index mode - which shows the list of messages: From ffcc69d8ba57497efa4461dfccde8e35af4aa3d3 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 15 Jul 2017 17:00:38 +0200 Subject: [PATCH 16/18] add functions to copy primary to clipboard and vice versa --- config/fish/functions/c2p.fish | 3 +++ config/fish/functions/p2c.fish | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 config/fish/functions/c2p.fish create mode 100644 config/fish/functions/p2c.fish diff --git a/config/fish/functions/c2p.fish b/config/fish/functions/c2p.fish new file mode 100644 index 0000000..e84b5e4 --- /dev/null +++ b/config/fish/functions/c2p.fish @@ -0,0 +1,3 @@ +function c2p --description 'Copy clipboard to primary selection' + xclip -o -selection clipboard | xclip -i -selection primary +end diff --git a/config/fish/functions/p2c.fish b/config/fish/functions/p2c.fish new file mode 100644 index 0000000..02072da --- /dev/null +++ b/config/fish/functions/p2c.fish @@ -0,0 +1,3 @@ +function p2c --description 'Copy primary selection to clipboard' + xclip -o -selection primary | xclip -i -selection clipboard +end From 8d277a7d9e029a36736c0e505c6a9458f402cee1 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 18 Jul 2017 19:26:20 +0200 Subject: [PATCH 17/18] lumail: remove on_message because it breakes attachments --- config/lumail/lumail.lua | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/config/lumail/lumail.lua b/config/lumail/lumail.lua index cd8f381..42e0337 100644 --- a/config/lumail/lumail.lua +++ b/config/lumail/lumail.lua @@ -205,34 +205,3 @@ do end end --- --- Add Content-Type to the headers before sending --- -function on_message_send(path) - local content = {} - local added = false - local is_header = "^%a+: .*" - for l in io.lines(path) do - -- If this message was replaced by mimegpg don't mess with it - if (l == "-----BEGIN PGP SIGNATURE-----") or (l == "-----BEGIN PGP MESSAGE-----") then - return - end - - -- Find the last header. - if not added - and content[#content] and string.match(content[#content], is_header) - and not string.match(l, is_header) - then - -- Append Content-Type to the headers. - table.insert(content, "Content-Type: text/plain; charset=UTF-8\n") - added = true - end - table.insert(content, l.."\n") - end - - -- write the new content - local m = io.open(path, "w") - m:write(unpack(content)) - m:close() -end - From a994b1c03298326f6003458e1a2026ee00ef51a9 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 31 Jul 2017 17:03:37 +0200 Subject: [PATCH 18/18] update vis-cursors --- config/vis/plugins/vis-cursors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/vis/plugins/vis-cursors b/config/vis/plugins/vis-cursors index 084d8dd..bfc07ce 160000 --- a/config/vis/plugins/vis-cursors +++ b/config/vis/plugins/vis-cursors @@ -1 +1 @@ -Subproject commit 084d8dd146ca26ce0d634a38895c0e58c705b453 +Subproject commit bfc07ce7934f0fb49b7941118619f5fdf4522175