Compare commits

...

2 Commits

2 changed files with 147 additions and 8 deletions

124
.config/mbsync/config Normal file
View File

@ -0,0 +1,124 @@
IMAPStore alexander@bocken.org-remote
Host mail.bocken.org
Port 993
User alexander
PassCmd "pass alexander@bocken.org"
AuthMechs LOGIN
TLSType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
MaildirStore alexander@bocken.org-local
Subfolders Verbatim
Path /home/alex/.local/share/mail/alexander@bocken.org/
Inbox /home/alex/.local/share/mail/alexander@bocken.org/INBOX
Channel alexander@bocken.org
Expunge Both
Far :alexander@bocken.org-remote:
Near :alexander@bocken.org-local:
Patterns * !"[Gmail]/All Mail"
Create Both
SyncState *
MaxMessages 0
ExpireUnread no
# End profile
IMAPStore abocken@ethz.ch-remote
Host outlook.office365.com
Port 993
User abocken@ethz.ch
PassCmd "mutt_oauth2.py ~/.local/share/mail/eth.token"
AuthMechs XOAUTH2
TLSType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
MaildirStore abocken@ethz.ch-local
Subfolders Verbatim
Path /home/alex/.local/share/mail/abocken@ethz.ch/
Inbox /home/alex/.local/share/mail/abocken@ethz.ch/INBOX
Channel abocken@ethz.ch
Expunge Both
Far :abocken@ethz.ch-remote:
Near :abocken@ethz.ch-local:
Patterns * !"[Gmail]/All Mail"
Create Both
SyncState *
MaxMessages 0
ExpireUnread no
# End profile
#IMAPStore abocken@ethz.ch-remote
#Host mail.ethz.ch
#Port 993
#User abocken
#PassCmd "pass 'ETH/nETHz - abocken@ethz.ch'"
#AuthMechs LOGIN
#TLSType IMAPS
#CertificateFile /etc/ssl/certs/ca-certificates.crt
#
#MaildirStore abocken@ethz.ch-local
#Subfolders Verbatim
#Path /home/alex/.local/share/mail/abocken@ethz.ch/
#Inbox /home/alex/.local/share/mail/abocken@ethz.ch/INBOX
#
#Channel abocken@ethz.ch
#Expunge Both
#Far :abocken@ethz.ch-remote:
#Near :abocken@ethz.ch-local:
#Patterns * !"[Gmail]/All Mail"
#Create Both
#SyncState *
#MaxMessages 0
#ExpireUnread no
IMAPStore alexander@aaathats3as.com-remote
Host mail.cock.li
Port 993
User alexander@aaathats3as.com
PassCmd "pass eMail/aaathats3as.com"
AuthMechs LOGIN
TLSType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
MaildirStore alexander@aaathats3as.com-local
Subfolders Verbatim
Path /home/alex/.local/share/mail/alexander@aaathats3as.com/
Inbox /home/alex/.local/share/mail/alexander@aaathats3as.com/INBOX
Channel alexander@aaathats3as.com
Expunge Both
Far :alexander@aaathats3as.com-remote:
Near :alexander@aaathats3as.com-local:
Patterns * !"[Gmail]/All Mail"
Create Both
SyncState *
MaxMessages 0
ExpireUnread no
# End profile
IMAPStore account@bocken.org-remote
Host mail.bocken.org
Port 993
User account
PassCmd "pass account@bocken.org"
AuthMechs LOGIN
TLSType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
MaildirStore account@bocken.org-local
Subfolders Verbatim
Path /home/alex/.local/share/mail/account@bocken.org/
Inbox /home/alex/.local/share/mail/account@bocken.org/INBOX
Channel account@bocken.org
Expunge Both
Far :account@bocken.org-remote:
Near :account@bocken.org-local:
Patterns * !"[Gmail]/All Mail" !"*fts-flatcurve*" !"*virtual*"
Create Both
SyncState *
MaxMessages 0
ExpireUnread no
# End profile

View File

@ -15,7 +15,7 @@ local function reset_y()
end end
-- Function to handle 'y' keypress -- Function to handle 'y' keypress
local function handle_y() local function handle_yanker()
reset_y() reset_y()
y_pressed = true y_pressed = true
-- Start a timer to reset the state after 2 seconds -- Start a timer to reset the state after 2 seconds
@ -24,7 +24,7 @@ end
-- Function to handle 'n' keypress -- Function to handle 'n' keypress
-- Copy the filename to clipboard -- Copy the filename to clipboard
local function handle_n() local function handle_filename()
if y_pressed then if y_pressed then
local filename = mp.get_property("filename") local filename = mp.get_property("filename")
-- Use a method to copy 'filename' to clipboard (platform-specific) -- Use a method to copy 'filename' to clipboard (platform-specific)
@ -39,7 +39,7 @@ end
-- Function to handle 'd' keypress -- Function to handle 'd' keypress
-- Copy the directory to clipboard -- Copy the directory to clipboard
local function handle_d() local function handle_dir()
if y_pressed then if y_pressed then
local filepath = mp.get_property("path") local filepath = mp.get_property("path")
local directory = string.match(filepath, "(.*/)") local directory = string.match(filepath, "(.*/)")
@ -50,7 +50,7 @@ local function handle_d()
end end
-- Function to handle 'p' keypress -- Function to handle 'p' keypress
local function handle_p() local function handle_path()
if y_pressed then if y_pressed then
local full_path = mp.get_property("path") local full_path = mp.get_property("path")
os.execute("printf %s " .. full_path .. " | xclip -selection clipboard") os.execute("printf %s " .. full_path .. " | xclip -selection clipboard")
@ -59,7 +59,22 @@ local function handle_p()
end end
end end
mp.add_key_binding("y", "check_y", handle_y) -- Function to copy the title to clipboard
mp.add_key_binding("n", "check_n", handle_n) local function handle_title()
mp.add_key_binding("p", "check_p", handle_p) if y_pressed then
mp.add_key_binding("d", "check_d", handle_d) local title = mp.get_property("media-title")
if title and title ~= mp.get_property("filename") then
os.execute("printf %s" .. title .. " | xclip -selection clipboard")
mp.osd_message("Copied title " .. title .. " to clipboard", 3)
else
handle_filename() -- Call the function to copy the filename
end
reset_y()
end
end
mp.add_key_binding("y", "check_y", handle_yanker)
mp.add_key_binding("n", "check_n", handle_filename)
mp.add_key_binding("p", "check_p", handle_path)
mp.add_key_binding("d", "check_d", handle_dir)
mp.add_key_binding("t", "check_t", handle_title)