Compare commits
No commits in common. "e9ff562c1ede56577ab1148a5d3c085847c22ebc" and "9db080dc0f1a6aa7dc6b5b14090226471a5afc19" have entirely different histories.
e9ff562c1e
...
9db080dc0f
17
alot/config
17
alot/config
|
|
@ -1,17 +0,0 @@
|
||||||
[accounts]
|
|
||||||
[[main]]
|
|
||||||
realname = amir alexander abdelbaki
|
|
||||||
address = amir@abdelbaki.eu
|
|
||||||
sendmail_command = msmtp -a main
|
|
||||||
sent_box = maildir:///home/themiro/Mail/Sent
|
|
||||||
draft_box = maildir:///home/themiro/Mail/Drafts
|
|
||||||
|
|
||||||
[bindings]
|
|
||||||
[[search]]
|
|
||||||
esc = exit
|
|
||||||
[[thread]]
|
|
||||||
esc = exit
|
|
||||||
[[taglist]]
|
|
||||||
esc = exit
|
|
||||||
[[bufferlist]]
|
|
||||||
esc = exit
|
|
||||||
|
|
@ -229,26 +229,27 @@ local function toggle_pim()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- full-screen: alot left, abook top-right, calendar bottom-right
|
local H = vim.o.lines - 2
|
||||||
local H = vim.o.lines - 2
|
local col_w = math.min(vim.o.columns, math.max(90, math.floor(vim.o.columns * 0.45)))
|
||||||
local W = vim.o.columns
|
|
||||||
local left_w = math.max(1, math.floor(W * 0.55))
|
|
||||||
local right_w = math.max(1, W - left_w)
|
|
||||||
local top_h = math.max(1, math.floor(H / 2))
|
|
||||||
local bot_h = math.max(1, H - top_h)
|
|
||||||
|
|
||||||
local w1 = _pim_float(0, 0, H, left_w)
|
-- abook gets a fixed 24-line minimum; mail/calendar split the rest 57/43
|
||||||
|
local ab_h = math.max(24, math.floor(H * 0.30))
|
||||||
|
local rest = math.max(2, H - ab_h)
|
||||||
|
local mail_h = math.max(1, math.floor(rest * 0.57))
|
||||||
|
local cal_h = math.max(1, rest - mail_h)
|
||||||
|
|
||||||
|
local w1 = _pim_float(0, 0, mail_h, col_w)
|
||||||
local ok, err = pcall(vim.cmd, "terminal alot")
|
local ok, err = pcall(vim.cmd, "terminal alot")
|
||||||
if not ok then _pim_scratch("alot", err) end
|
if not ok then _pim_scratch("alot", err) end
|
||||||
|
|
||||||
local w2 = _pim_float(0, left_w, top_h, right_w)
|
local w2 = _pim_float(mail_h, 0, cal_h, col_w)
|
||||||
ok, err = pcall(vim.cmd, "terminal abook")
|
|
||||||
if not ok then _pim_scratch("abook", err) end
|
|
||||||
|
|
||||||
local w3 = _pim_float(top_h, left_w, bot_h, right_w)
|
|
||||||
ok, err = pcall(vim.cmd, "Calendar -position=here")
|
ok, err = pcall(vim.cmd, "Calendar -position=here")
|
||||||
if not ok then _pim_scratch("calendar.vim", err) end
|
if not ok then _pim_scratch("calendar.vim", err) end
|
||||||
|
|
||||||
|
local w3 = _pim_float(mail_h + cal_h, 0, ab_h, col_w)
|
||||||
|
ok, err = pcall(vim.cmd, "terminal abook")
|
||||||
|
if not ok then _pim_scratch("abook", err) end
|
||||||
|
|
||||||
_pim_wins = { w1, w2, w3 }
|
_pim_wins = { w1, w2, w3 }
|
||||||
vim.api.nvim_set_current_win(w1)
|
vim.api.nvim_set_current_win(w1)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -87,28 +87,17 @@ EOF
|
||||||
chmod +x "$MAILDIR/.notmuch/hooks/post-new"
|
chmod +x "$MAILDIR/.notmuch/hooks/post-new"
|
||||||
|
|
||||||
# ── alot ──────────────────────────────────────────────────────────────────────
|
# ── alot ──────────────────────────────────────────────────────────────────────
|
||||||
# The bindings section lives in ~/Dotfiles/alot/config (symlinked by shell-setup.sh).
|
log "Writing ~/.config/alot/config..."
|
||||||
# Write only the account block, which contains machine-specific paths/identity.
|
mkdir -p ~/.config/alot
|
||||||
log "Writing account details into ~/Dotfiles/alot/config..."
|
cat > ~/.config/alot/config << EOF
|
||||||
ALOT_CFG="$HOME/Dotfiles/alot/config"
|
[accounts]
|
||||||
# Replace the [[main]] account block in-place (sed removes old block, cat appends new one)
|
|
||||||
python3 - "$ALOT_CFG" "$FULL_NAME" "$EMAIL" "$MAILDIR" << 'PYEOF'
|
|
||||||
import sys, re
|
|
||||||
path, name, email, maildir = sys.argv[1:]
|
|
||||||
block = f"""[accounts]
|
|
||||||
[[main]]
|
[[main]]
|
||||||
realname = {name}
|
realname = $FULL_NAME
|
||||||
address = {email}
|
address = $EMAIL
|
||||||
sendmail_command = msmtp -a main
|
sendmail_command = msmtp -a main
|
||||||
sent_box = maildir://{maildir}/Sent
|
sent_box = maildir://$MAILDIR/Sent
|
||||||
draft_box = maildir://{maildir}/Drafts
|
draft_box = maildir://$MAILDIR/Drafts
|
||||||
"""
|
EOF
|
||||||
with open(path) as f:
|
|
||||||
text = f.read()
|
|
||||||
text = re.sub(r'\[accounts\].*?(?=\n\[|\Z)', block, text, flags=re.DOTALL)
|
|
||||||
with open(path, 'w') as f:
|
|
||||||
f.write(text)
|
|
||||||
PYEOF
|
|
||||||
|
|
||||||
# ── systemd timer for periodic sync ───────────────────────────────────────────
|
# ── systemd timer for periodic sync ───────────────────────────────────────────
|
||||||
log "Installing mbsync systemd user timer (every 5 min)..."
|
log "Installing mbsync systemd user timer (every 5 min)..."
|
||||||
|
|
|
||||||
|
|
@ -75,9 +75,6 @@ ln -sf ~/Dotfiles/nvim ~/.config/nvim
|
||||||
log "Syncing neovim plugins (lazy.nvim)..."
|
log "Syncing neovim plugins (lazy.nvim)..."
|
||||||
nvim --headless "+Lazy! sync" +qa 2>/dev/null || true
|
nvim --headless "+Lazy! sync" +qa 2>/dev/null || true
|
||||||
|
|
||||||
rm -rf ~/.config/alot
|
|
||||||
ln -sf ~/Dotfiles/alot ~/.config/alot
|
|
||||||
|
|
||||||
rm -rf ~/.config/yazi
|
rm -rf ~/.config/yazi
|
||||||
ln -sf ~/Dotfiles/yazi ~/.config/yazi
|
ln -sf ~/Dotfiles/yazi ~/.config/yazi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue