diff --git a/.gitignore b/.gitignore index d4de618b..0025a451 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .gitsecret/keys/random_seed !*.secret zsh/secret +mail/mbsyncrc +mail/msmtp/config diff --git a/.gitsecret/paths/mapping.cfg b/.gitsecret/paths/mapping.cfg index 70315088..c921caa7 100644 --- a/.gitsecret/paths/mapping.cfg +++ b/.gitsecret/paths/mapping.cfg @@ -1 +1,3 @@ zsh/secret:63d3fba77f570fbb9e9f999303a2828c4a2d88990836e80ea08a48c48619da22 +mail/mbsyncrc +mail/msmtp/config diff --git a/applications/neomutt.desktop b/applications/neomutt.desktop new file mode 100644 index 00000000..4748d3fb --- /dev/null +++ b/applications/neomutt.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=NeoMutt E-Mail Client +Name[en_US]=NeoMutt E-Mail Client +Comment=Terminal Based E-Mail Client +Exec=st -c 'neomutt-send' -e neomutt %u +Terminal=false +Categories=Utility +Type=Application +Icon=email +StartupWMClass=neomutt diff --git a/applications/ranger.desktop b/applications/ranger.desktop new file mode 100644 index 00000000..07e9fd6c --- /dev/null +++ b/applications/ranger.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=ranger +Comment=Launches the ranger file manager +Icon=utilities-terminal +Terminal=false +Exec=st -c ranger -e ranger +Categories=ConsoleOnly;System;FileTools;FileManager +MimeType=inode/directory;inode/mount-point;x-scheme-handler/ssh;x-scheme-handler/smb;x-scheme-handler/nfs;x-scheme-handler/ftp;application/x-directory; diff --git a/applications/st.desktop b/applications/st.desktop new file mode 100644 index 00000000..44a503a4 --- /dev/null +++ b/applications/st.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=Simple Terminal +Comment=simple-terminal emulator for X +Icon=utilities-terminal +Exec=st +Categories=System;TerminalEmulator diff --git a/applications/vim.desktop b/applications/vim.desktop new file mode 100644 index 00000000..41359214 --- /dev/null +++ b/applications/vim.desktop @@ -0,0 +1,114 @@ +# The vim.desktop file is generated by src/po/Makefile, do NOT edit. +# Edit the src/po/vim.desktop.in file instead. +[Desktop Entry] +# Translators: This is the Application Name used in the Vim desktop file +Name[de]=Vim +Name[eo]=Vim +Name[fr]=Vim +Name[ru]=Vim +Name[sr]=Vim +Name[tr]=Vim +Name=Vim +# Translators: This is the Generic Application Name used in the Vim desktop file +GenericName[de]=Texteditor +GenericName[eo]=Tekstoredaktilo +GenericName[fr]=Éditeur de texte +GenericName[ja]=テキストエディタ +GenericName[ru]=Текстовый редактор +GenericName[sr]=Едитор текст +GenericName[tr]=Metin Düzenleyici +GenericName=Text Editor +# Translators: This is the comment used in the Vim desktop file +Comment[de]=Textdateien bearbeiten +Comment[eo]=Redakti tekstajn dosierojn +Comment[fr]=Éditer des fichiers texte +Comment[ja]=テキストファイルを編集します +Comment[ru]=Редактирование текстовых файлов +Comment[sr]=Уређујте текст фајлове +Comment[tr]=Metin dosyaları düzenleyin +Comment=Edit text files +# The translations should come from the po file. Leave them here for now, they will +# be overwritten by the po file when generating the desktop.file. +GenericName[da]=Teksteditor +GenericName[pl]=Edytor tekstu +GenericName[is]=Ritvinnsluforrit +Comment[af]=Redigeer tekslêers +Comment[am]=የጽሑፍ ፋይሎች ያስተካክሉ +Comment[ar]=حرّر ملفات نصية +Comment[az]=Mətn fayllarını redaktə edin +Comment[be]=Рэдагаваньне тэкставых файлаў +Comment[bg]=Редактиране на текстови файлове +Comment[bn]=টেক্স্ট ফাইল এডিট করুন +Comment[bs]=Izmijeni tekstualne datoteke +Comment[ca]=Edita fitxers de text +Comment[cs]=Úprava textových souborů +Comment[cy]=Golygu ffeiliau testun +Comment[da]=Rediger tekstfiler +Comment[el]=Επεξεργασία αρχείων κειμένου +Comment[en_CA]=Edit text files +Comment[en_GB]=Edit text files +Comment[es]=Edita archivos de texto +Comment[et]=Redigeeri tekstifaile +Comment[eu]=Editatu testu-fitxategiak +Comment[fa]=ویرایش پرونده‌های متنی +Comment[fi]=Muokkaa tekstitiedostoja +Comment[ga]=Eagar comhad Téacs +Comment[gu]=લખાણ ફાઇલોમાં ફેરફાર કરો +Comment[he]=ערוך קבצי טקסט +Comment[hi]=पाठ फ़ाइलें संपादित करें +Comment[hr]=Uređivanje tekstualne datoteke +Comment[hu]=Szövegfájlok szerkesztése +Comment[id]=Edit file teks +Comment[is]=Vinna með textaskrár +Comment[it]=Modifica file di testo +Comment[kn]=ಪಠ್ಯ ಕಡತಗಳನ್ನು ಸಂಪಾದಿಸು +Comment[ko]=텍스트 파일을 편집합니다 +Comment[lt]=Redaguoti tekstines bylas +Comment[lv]=Rediģēt teksta failus +Comment[mk]=Уреди текстуални фајлови +Comment[ml]=വാചക രചനകള് തിരുത്തുക +Comment[mn]=Текст файл боловсруулах +Comment[mr]=गद्य फाइल संपादित करा +Comment[ms]=Edit fail teks +Comment[nb]=Rediger tekstfiler +Comment[ne]=पाठ फाइललाई संशोधन गर्नुहोस् +Comment[nl]=Tekstbestanden bewerken +Comment[nn]=Rediger tekstfiler +Comment[no]=Rediger tekstfiler +Comment[or]=ପାଠ୍ଯ ଫାଇଲଗୁଡ଼ିକୁ ସମ୍ପାଦନ କରନ୍ତୁ +Comment[pa]=ਪਾਠ ਫਾਇਲਾਂ ਸੰਪਾਦਨ +Comment[pl]=Edytuj pliki tekstowe +Comment[pt]=Editar ficheiros de texto +Comment[pt_BR]=Edite arquivos de texto +Comment[ro]=Editare fişiere text +Comment[sk]=Úprava textových súborov +Comment[sl]=Urejanje datotek z besedili +Comment[sq]=Përpuno files teksti +Comment[sr@Latn]=Izmeni tekstualne datoteke +Comment[sv]=Redigera textfiler +Comment[ta]=உரை கோப்புகளை தொகுக்கவும் +Comment[th]=แก้ไขแฟ้มข้อความ +Comment[tk]=Metin faýllary editle +Comment[uk]=Редактор текстових файлів +Comment[vi]=Soạn thảo tập tin văn bản +Comment[wa]=Asspougnî des fitchîs tecses +Comment[zh_CN]=编辑文本文件 +Comment[zh_TW]=編輯文字檔 +TryExec=vim +Exec=st -c vim -e vim %F +Terminal=false +Type=Application +# Translators: Search terms to find this application. Do NOT change the semicolons! The list MUST also end with a semicolon! +Keywords[de]=Text;Editor; +Keywords[eo]=Teksto;redaktilo; +Keywords[fr]=Texte;éditeur; +Keywords[ja]=テキスト;エディタ; +Keywords[ru]=текст;текстовый редактор; +Keywords[sr]=Текст;едитор; +Keywords[tr]=Metin;düzenleyici; +Keywords=Text;editor; +# Translators: This is the Icon file name. Do NOT translate +Icon=gvim +Categories=Utility;TextEditor; +StartupNotify=false +MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; diff --git a/chroot/AUR.txt b/arch-setup/AUR.txt similarity index 100% rename from chroot/AUR.txt rename to arch-setup/AUR.txt diff --git a/arch-setup.sh b/arch-setup/arch-setup.sh similarity index 100% rename from arch-setup.sh rename to arch-setup/arch-setup.sh diff --git a/chroot/chroot.sh b/arch-setup/chroot.sh similarity index 100% rename from chroot/chroot.sh rename to arch-setup/chroot.sh diff --git a/chroot/nonAUR.txt b/arch-setup/nonAUR.txt similarity index 100% rename from chroot/nonAUR.txt rename to arch-setup/nonAUR.txt diff --git a/chroot/plist.sh b/arch-setup/plist.sh similarity index 100% rename from chroot/plist.sh rename to arch-setup/plist.sh diff --git a/install.sh b/install.sh index ce15e25c..2f2e1c01 100755 --- a/install.sh +++ b/install.sh @@ -12,7 +12,7 @@ mkdir -p ~/.dotfiles_backup mkdir -p ~/.config mkdir -p ~/.dotfiles_backup/.config -rsync -avzh --ignore-errors \ +rsync --remove-source-files -avzh --ignore-errors \ ~/.completions \ ~/.aliases \ ~/.cmds \ @@ -30,7 +30,7 @@ rsync -avzh --ignore-errors \ ~/.vimrc \ ~/.dotfiles_backup -rsync -avzh --ignore-errors \ +rsync --remove-source-files -avzh --ignore-errors \ ~/.config/htop \ ~/.config/.profile \ ~/.config/systemd \ @@ -64,10 +64,14 @@ ln -s ~/.dotfiles/misc/profile ~/.config/.profile ln -s ~/.dotfiles/misc/htop ~/.config/htop ln -s ~/.dotfiles/misc/.fzf.zsh ~/.fzf.zsh ln -s ~/.dotfiles/misc/keyboard ~/.keyboard +ln -s ~/.dotfiles/misc/mimeapps.list ~/.config/mimeapps.list ln -s ~/.dotfiles/fonts ~/.fonts fc-cache - +# Applications +for d in ~/.dotfiles/applications/* ; do + ln -s $d ~/.local/share/applications/ +done # Scripts ln -s ~/.dotfiles/scripts ~/.scripts @@ -76,7 +80,6 @@ ln -s ~/.dotfiles/suckless ~/.config/suckless ln -s ~/.dotfiles/suckless/dot_surf ~/.surf ~/.dotfiles/suckless/build.sh - # Tmux ln -s ~/.dotfiles/tmux/tmux.conf ~/.tmux.conf @@ -93,6 +96,12 @@ ln -s ~/.dotfiles/zsh/cmds ~/.cmds ln -s ~/.dotfiles/zsh/aliases ~/.aliases ln -s ~/.dotfiles/zsh/completions ~/.completions +# Mail +ln -s ~/.dotfiles/mail/mutt ~/.config/mutt +ln -s ~/.dotfiles/mail/msmtp ~/.config/msmtp +ln -s ~/.dotfiles/mail/mbsyncrc ~/.mbsyncrc +echo "*/30 * * * * /home/yigit/.scripts/mailsync" >> /var/spool/cron/yigit + # Install vim and tmux plugins mkdir -p ~/.tmux/plugins vim -c ':PlugInstall' diff --git a/mail/msmtp/.gitignore b/mail/msmtp/.gitignore new file mode 100644 index 00000000..f65f5bac --- /dev/null +++ b/mail/msmtp/.gitignore @@ -0,0 +1 @@ +msmtp.log diff --git a/mail/mutt/.mailsynclastrun b/mail/mutt/.mailsynclastrun new file mode 100644 index 00000000..e69de29b diff --git a/mail/mutt/accounts/1-yigitcolakoglu@hotmail.com.muttrc b/mail/mutt/accounts/1-yigitcolakoglu@hotmail.com.muttrc new file mode 100644 index 00000000..1060385c --- /dev/null +++ b/mail/mutt/accounts/1-yigitcolakoglu@hotmail.com.muttrc @@ -0,0 +1,46 @@ +# vim: filetype=neomuttrc +# muttrc file for account yigitcolakoglu@hotmail.com +set realname = "Yigit Colakoglu" +set from = "yigitcolakoglu@hotmail.com" +set sendmail = "msmtp -a yigitcolakoglu@hotmail.com" +alias me Yigit Colakoglu +set folder = "/home/yigit/.local/share/mail/yigitcolakoglu@hotmail.com" +set header_cache = /home/yigit/.cache/mutt-wizard/yigitcolakoglu@hotmail.com/headers +set message_cachedir = /home/yigit/.cache/mutt-wizard/yigitcolakoglu@hotmail.com/bodies +set mbox_type = Maildir +set signature = "/home/yigit/.config/mutt/accounts/1-yigitcolakoglu@hotmail.com.sig" + + +bind index,pager gg noop +bind index,pager g noop +bind index,pager M noop +bind index,pager C noop +bind index gg first-entry +unmailboxes * +unalternates * +unset signature +unmacro index o +macro index o "mw -y yigitcolakoglu@hotmail.com" "run mbsync to sync yigitcolakoglu@hotmail.com" + +mailboxes "=Archive" "=Archived Mail" "=Deleted" "=Drafts" "=INBOX" "=Junk" "=Mailspring/Snoozed" "=Notes" "=Outbox" "=Sent" "=Sync Issues/Conflicts" "=Sync Issues/Local Failures" "=Sync Issues/Server Failures" +macro index,pager ga "=Archive" "go to archive" +macro index,pager Ma ";=Archive" "move mail to archive" +macro index,pager Ca ";=Archive" "copy mail to archive" +macro index,pager ga "=Archived" "go to archive" +macro index,pager Ma ";=Archived" "move mail to archive" +macro index,pager Ca ";=Archived" "copy mail to archive" +set postponed = "+Drafts" +macro index,pager gd "=Drafts" "go to drafts" +macro index,pager Md ";=Drafts" "move mail to drafts" +macro index,pager Cd ";=Drafts" "copy mail to drafts" +macro index,pager gi "=INBOX" "go to inbox" +macro index,pager Mi ";=INBOX" "move mail to inbox" +macro index,pager Ci ";=INBOX" "copy mail to inbox" +set spoolfile = "+INBOX" +macro index,pager gj "=Junk" "go to junk" +macro index,pager Mj ";=Junk" "move mail to junk" +macro index,pager Cj ";=Junk" "copy mail to junk" +set record = "+Sent" +macro index,pager gs "=Sent" "go to sent" +macro index,pager Ms ";=Sent" "move mail to sent" +macro index,pager Cs ";=Sent" "copy mail to sent" diff --git a/mail/mutt/accounts/1-yigitcolakoglu@hotmail.com.sig b/mail/mutt/accounts/1-yigitcolakoglu@hotmail.com.sig new file mode 100644 index 00000000..068c43c8 --- /dev/null +++ b/mail/mutt/accounts/1-yigitcolakoglu@hotmail.com.sig @@ -0,0 +1,5 @@ +-- +Yiğit Çolakoğlu +=================== +Senior Student at Ted Ankara College Foundation High School + diff --git a/mail/mutt/colors.muttrc b/mail/mutt/colors.muttrc new file mode 100644 index 00000000..b915db9e --- /dev/null +++ b/mail/mutt/colors.muttrc @@ -0,0 +1,73 @@ +# vim: filetype=neomuttrc + +# Default index colors: +color index yellow default '.*' +color index_author red default '.*' +color index_number blue default +color index_subject cyan default '.*' + +# New mail is boldened: +color index brightyellow black "~N" +color index_author brightred black "~N" +color index_subject brightcyan black "~N" + +# Tagged mail is highlighted: +color index brightyellow blue "~T" +color index_author brightred blue "~T" +color index_subject brightcyan blue "~T" + +# Other colors and aesthetic settings: +mono bold bold +mono underline underline +mono indicator reverse +mono error bold +color normal default default +color indicator brightblack white +color sidebar_highlight red default +color sidebar_divider brightblack black +color sidebar_flagged red black +color sidebar_new green black +color normal brightyellow default +color error red default +color tilde black default +color message cyan default +color markers red white +color attachment white default +color search brightmagenta default +color status brightyellow black +color hdrdefault brightgreen default +color quoted green default +color quoted1 blue default +color quoted2 cyan default +color quoted3 yellow default +color quoted4 red default +color quoted5 brightred default +color signature brightgreen default +color bold black default +color underline black default +color normal default default + +# Regex highlighting: +color header blue default ".*" +color header brightmagenta default "^(From)" +color header brightcyan default "^(Subject)" +color header brightwhite default "^(CC|BCC)" +color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses +color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL +color body green default "\`[^\`]*\`" # Green text between ` and ` +color body brightblue default "^# \.*" # Headings as bold blue +color body brightcyan default "^## \.*" # Subheadings as bold cyan +color body brightgreen default "^### \.*" # Subsubheadings as bold green +color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow +color body brightcyan default "[;:][-o][)/(|]" # emoticons +color body brightcyan default "[;:][)(|]" # emoticons +color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon? +color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon? +color body red default "(BAD signature)" +color body cyan default "(Good signature)" +color body brightblack default "^gpg: Good signature .*" +color body brightyellow default "^gpg: " +color body brightyellow red "^gpg: BAD signature from.*" +mono body bold "^gpg: Good signature" +mono body bold "^gpg: BAD signature from.*" +color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" diff --git a/mail/mutt/keys.muttrc b/mail/mutt/keys.muttrc new file mode 100644 index 00000000..b9dbd170 --- /dev/null +++ b/mail/mutt/keys.muttrc @@ -0,0 +1,67 @@ +# vim: filetype=neomuttrc +auto_view text/html # automatically show html (mailcap uses lynx) +auto_view application/pgp-encrypted +#set display_filter = "tac | sed '/\\\[-- Autoview/,+1d' | tac" # Suppress autoview messages. +alternative_order text/plain text/enriched text/html +bind index,pager i noop +bind index,pager g noop +bind index \Cf noop + +# General rebindings +bind index j next-entry +bind index k previous-entry +bind attach view-mailcap +bind attach l view-mailcap +bind editor noop +bind index G last-entry +bind index gg first-entry +bind pager,attach h exit +bind pager j next-line +bind pager k previous-line +bind pager l view-attachments +bind index D delete-message +bind index U undelete-message +bind index L limit +bind index h noop +bind index l display-message +bind index,query tag-entry +#bind browser h goto-parent +macro browser h '..' "Go to parent folder" +bind index,pager H view-raw-message +bind browser l select-entry +bind pager,browser gg top-page +bind pager,browser G bottom-page +bind index,pager,browser d half-down +bind index,pager,browser u half-up +bind index,pager S sync-mailbox +bind index,pager R group-reply +bind index \031 previous-undeleted # Mouse wheel +bind index \005 next-undeleted # Mouse wheel +bind pager \031 previous-line # Mouse wheel +bind pager \005 next-line # Mouse wheel +bind editor complete-query + +#set crypt_autosign = yes +#set crypt_opportunistic_encrypt = yes +#set pgp_self_encrypt = yes +#set pgp_default_key = 'your@gpgemailaddre.ss' + +macro index,pager a "set my_pipe_decode=\$pipe_decode pipe_decodeabook --add-emailset pipe_decode=\$my_pipe_decode; unset my_pipe_decode" "add the sender address to abook" +macro index \Cr "T~UN." "mark all messages as read" +macro index O "mw -Y" "run mw -Y to sync all mail" +macro index \Cf "unset wait_keyprintf 'Enter a search term to find with notmuch: '; read x; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" +macro index A "all\n" "show all messages (undo limit)" + +# Sidebar mappings +set sidebar_visible = yes +set sidebar_width = 20 +set sidebar_short_path = yes +set sidebar_next_new_wrap = yes +set mail_check_stats +set sidebar_format = '%D%?F? [%F]?%* %?N?%N/? %?S?%S?' +bind index,pager \Ck sidebar-prev +bind index,pager \Cj sidebar-next +bind index,pager \Co sidebar-open +bind index,pager \Cp sidebar-prev-new +bind index,pager \Cn sidebar-next-new +bind index,pager B sidebar-toggle-visible diff --git a/mail/mutt/mailcap b/mail/mutt/mailcap new file mode 100644 index 00000000..b355f328 --- /dev/null +++ b/mail/mutt/mailcap @@ -0,0 +1,9 @@ +text/plain; $EDITOR %s ; +text/html; openfile %s ; nametemplate=%s.html +text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput; +image/*; openfile %s ; +video/*; setsid mpv --quiet %s &; copiousoutput +audio/*; mpv %s ; +application/pdf; openfile %s ; +application/pgp-encrypted; gpg -d '%s'; copiousoutput; +application/pgp-keys; gpg --import '%s'; copiousoutput; diff --git a/mail/mutt/muttrc b/mail/mutt/muttrc new file mode 100644 index 00000000..bee463ea --- /dev/null +++ b/mail/mutt/muttrc @@ -0,0 +1,32 @@ +# vim: filetype=neomuttrc +source /home/yigit/.config/mutt/accounts/1-yigitcolakoglu@hotmail.com.muttrc +source /home/yigit/.config/mutt/colors.muttrc +source /home/yigit/.config/mutt/keys.muttrc +set mailcap_path = /home/yigit/.config/mutt/mailcap:$mailcap_path +set mime_type_query_command = "file --mime-type -b %s" +set date_format="%y/%m/%d %I:%M%p" +set index_format="%2C %Z %?X?A& ? %D %-15.15F %s (%-4.4c)" +set sort = 'reverse-date' +set smtp_authenticators = 'gssapi:login' +set query_command = "abook --mutt-query '%s'" +set rfc2047_parameters = yes +set sleep_time = 0 # Pause 0 seconds for informational messages +set markers = no # Disables the `+` displayed at line wraps +set mark_old = no # Unread mail stay unread until read +set mime_forward = yes # attachments are forwarded with mail +set wait_key = no # mutt won't ask "press key to continue" +set fast_reply # skip to compose when replying +set fcc_attach # save attachments with the body +set forward_format = "Fwd: %s" # format of subject when forwarding +set forward_quote # include message in forwards +set reverse_name # reply as whomever it was to +set include # include message in replies +set mail_check=60 # to avoid lags using IMAP with some email providers (yahoo for example) + +set pager_index_lines = 10 # number of index lines to show +set pager_context = 3 # number of context lines to show + +# Encryted Mails and Signing +set crypt_use_gpgme +set pgp_default_key = "yigitcolakoglu@hotmail.com" +macro index,pager i1 'source /home/yigit/.config/mutt/accounts/1-yigitcolakoglu@hotmail.com.muttrc!;' "switch to yigitcolakoglu@hotmail.com" diff --git a/misc/keyboard b/misc/keyboard index 3a9d7920..ef08bdbd 100755 --- a/misc/keyboard +++ b/misc/keyboard @@ -1,3 +1,4 @@ #!/bin/bash -setxkbmap us -variant altgr-intl -options caps:escape +setxkbmap us -variant altgr-intl -option caps:escape # Set keyboard layout. map CapsLock to Esc +xmodmap -e "clear control" -e "add control = Control_L" -e "clear mod3" -e "add mod3 = Control_R" # Map right Ctrl to Mod3Mask diff --git a/misc/mimeapps.list b/misc/mimeapps.list new file mode 100644 index 00000000..81369aeb --- /dev/null +++ b/misc/mimeapps.list @@ -0,0 +1,52 @@ +[Default Applications] +x-scheme-handler/jetbrains=jetbrains-toolbox.desktop +x-scheme-handler/mailspring=mailspring.desktop +x-scheme-handler/http=firefox-developer-edition.desktop +x-scheme-handler/https=firefox-developer-edition.desktop +image/png=sxiv.desktop +image/jpeg=sxiv.desktop +text/plain=vim.desktop +x-scheme-handler/postman=Postman.desktop +x-scheme-handler/gitkraken=GitKraken.desktop +x-scheme-handler/ssh=ktelnetservice5.desktop +video/mp4=mpv.desktop +video/x-matroska=mpv.desktop +text/html=firefox-developer-edition.desktop +application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice-writer.desktop +application/x-shellscript=vim.desktop +inode/directory=ranger.desktop +application/x-gnome-saved-search=ranger.desktop +application/pdf=userapp-zathura-N034Y0.desktop +video/webm=mpv.desktop +application/zip=engrampa.desktop +x-scheme-handler/tg=userapp-Telegram Desktop-RUP9V0.desktop +x-scheme-handler/mailto=neomutt.desktop +message/rfc822=userapp-neomutt.desktop +application/x-directory=ranger.desktop + +[Added Associations] +image/png=deepin-image-viewer.desktop;feh.desktop;eom.desktop; +image/jpeg=deepin-image-viewer.desktop;eom.desktop;sxiv.desktop; +text/plain=gvim.desktop;vim.desktop;visual-studio-code.desktop;sublime_text.desktop; +application/octet-stream=sublime_text.desktop;org.gnome.GHex.desktop;vim.desktop; +video/x-ms-wmv=vlc.desktop; +audio/wav=sonic-visualiser.desktop; +text/x-python=vim.desktop;visual-studio-code.desktop; +text/x-tex=gvim.desktop;vim.desktop; +video/mp4=vlc.desktop; +video/x-matroska=vlc.desktop; +application/x-ole-storage=userapp-ghex-QDFPP0.desktop; +text/html=firefox-developer-edition.desktop; +video/quicktime=vlc.desktop; +application/pdf=org.pwmt.zathura-pdf-mupdf.desktop;atril.desktop;mupdf.desktop;userapp-zathura-N034Y0.desktop; +application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice-writer.desktop; +application/x-shellscript=sublime_text.desktop; +application/x-bittorrent=transmission-gtk.desktop; +application/zip=org.kde.ark.desktop;org.gnome.Nautilus.desktop;engrampa.desktop; +image/gif=eom.desktop; +video/webm=vlc.desktop; +x-scheme-handler/tg=userapp-Telegram Desktop-RUP9V0.desktop; +binary/octet-stream=sublime_text.desktop; +x-scheme-handler/mailto=userapp-Thunderbird-RAKCZ0.desktop;userapp-Thunderbird-38XBZ0.desktop;userapp-Thunderbird-A0ECZ0.desktop; +message/rfc822=userapp-Thunderbird-RAKCZ0.desktop;userapp-Thunderbird-38XBZ0.desktop;userapp-Thunderbird-A0ECZ0.desktop; +application/x-tex=vim.desktop; diff --git a/scripts/dmenu_surf b/scripts/dmenu_surf index 1cf9aaa6..080bd182 100755 --- a/scripts/dmenu_surf +++ b/scripts/dmenu_surf @@ -3,10 +3,11 @@ lines=12 blacklist='google' -cat ~/.surf/history.txt | sed -E 's/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} *([^ ]*) *(.*)/\2 : \1/g' | sort | uniq -selection=$(cat ~/.surf/history.txt | grep -Eiv $blacklist| sed -E 's/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} *([^ ]*) *(.*)/\2 : \1/g' | sort | uniq | dmenu -l $lines -i -p "Enter URL") +# cat ~/.surf/history.txt | sed -E 's/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} *([^ ]*) *(.*)/\2 : \1/g' | sort | uniq +# selection=$(cat ~/.surf/history.txt | grep -Eiv $blacklist| sed -E 's/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} *([^ ]*) *(.*)/\2 : \1/g' | sort | uniq | dmenu -l $lines -i -p "Enter URL") +selection=$(echo "" | dmenu -p "Enter URL") if [ ! -z "$selection" ] then - ~/.scripts/tabbed_surf $(echo $selection | sed -E 's/.* : ([^ ]*)$/\1/g') + firefox-developer-edition $selection fi diff --git a/scripts/mailsync b/scripts/mailsync new file mode 100755 index 00000000..67418044 --- /dev/null +++ b/scripts/mailsync @@ -0,0 +1,91 @@ +#!/bin/sh + +# - Syncs mail for all accounts, or a single account given as an argument. +# - Displays a notification showing the number of new mails. +# - Displays a notification for each new mail with its subject displayed. +# - Runs notmuch to index new mail. +# - This script can be set up as a cron job for automated mail syncing. + +# There are many arbitrary and ugly features in this script because it is +# inherently difficult to pass environmental variables to cronjobs and other +# issues. It also should at least be compatible with Linux (and maybe BSD) with +# Xorg and MacOS as well. + +# Run only if user logged in (prevent cron errors) +pgrep -u "${USER:=$LOGNAME}" >/dev/null || { echo "$USER not logged in; sync will not run."; exit ;} +# Run only if not already running in other instance +pgrep -x mbsync >/dev/null && { echo "mbsync is already running." ; exit ;} + +# First, we have to get the right variables for the mbsync file, the pass +# archive, notmuch and the GPG home. This is done by searching common profile +# files for variable assignments. This is ugly, but there are few options that +# will work on the maximum number of machines. +eval "$(grep -h -- \ + "^\s*\(export \)\?\(MBSYNCRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\)=" \ + "$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" \ + "$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" "$HOME/.pam_environment" 2>/dev/null)" + +case "$(readlink -f /sbin/init)" in + *systemd*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;; +esac +export GPG_TTY=$TTY + +[ -n "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" || MBSYNCRC="$HOME/.mbsyncrc" + +# Settings are different for MacOS (Darwin) systems. +case "$(uname)" in + Darwin) + notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2 ;} + messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\"" ;} + ;; + *) + displays="$(pgrep -a X\(org\|wayland\) | grep -wo "[0-9]*:[0-9]\+" | sort -u)" + notify() { for x in $displays; do + export DISPLAY=$x + notify-send --app-name="mutt-wizard" "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." + done ;} + messageinfo() { for x in $displays; do + export DISPLAY=$x + notify-send --app-name="mutt-wizard" "📧$from:" "$subject" + done ;} + ;; +esac + +# Check account for new mail. Notify if there is new content. +syncandnotify() { + acc="$(echo "$account" | sed "s/.*\///")" + if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi + new=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" 2> /dev/null) + newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) + if [ "$newcount" -gt "0" ]; then + notify "$acc" "$newcount" & + for file in $new; do + # Extract subject and sender from mail. + from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//') + subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n 1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n') + messageinfo & + done + fi +} + +# Sync accounts passed as argument or all. +if [ "$#" -eq "0" ]; then + accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")" +else + for arg in "$@"; do + [ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1 + done + accounts=$* +fi + +# Parallelize multiple accounts +for account in $accounts; do + syncandnotify & +done + +wait + +notmuch new 2>/dev/null + +#Create a touch file that indicates the time of the last run of mailsync +touch "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" diff --git a/scripts/password_manager b/scripts/password_manager index e27e6af8..23eb282f 100755 --- a/scripts/password_manager +++ b/scripts/password_manager @@ -1,3 +1,3 @@ #!/bin/bash -bitwarden-dmenu --dmenu-args='-i' --clear-clipboard 30 --session-timeout 100 --sync-vault-after 3600 --on-error 'xargs notify-send --urgency=low' +bitwarden-dmenu --dmenu-args='-i -l 10' --clear-clipboard 30 --session-timeout 96600 --sync-vault-after 48300 --on-error 'xargs notify-send --urgency=low' diff --git a/scripts/ytfzf_dmenu b/scripts/ytfzf_dmenu index 18708af5..504a1b67 100755 --- a/scripts/ytfzf_dmenu +++ b/scripts/ytfzf_dmenu @@ -1,5 +1,6 @@ #!/bin/bash +export YTFZF_EXTMENU=' dmenu -i -l 12' action=$(echo "" | dmenu -p "Search YouTube") ytfzf -D "$action" diff --git a/suckless/dwm/config.h b/suckless/dwm/config.h index ccbf5ac5..90b3a242 100644 --- a/suckless/dwm/config.h +++ b/suckless/dwm/config.h @@ -14,6 +14,9 @@ static const char autostartsh[] = "autostart.sh"; static const char dwmdir[] = "dwm"; static const char localshare[] = ".config/suckless"; +static int floatposgrid_x = 5; /* float grid columns */ +static int floatposgrid_y = 5; /* float grid rows */ + /* systray */ static int tagindicatortype = INDICATOR_TOP_LEFT_SQUARE; static int tiledindicatortype = INDICATOR_NONE; @@ -51,9 +54,12 @@ static const Layout layouts[] = { const char *spcmd1[] = {"st", "-c", "scratchpad", "-n", "spterm", "-g", "120x34", NULL }; const char *spcmd2[] = {"sxiv", "-N", "spsxiv", "-b", "-g","900x300+500+350", "/home/yigit/Pictures/us_keyboard.png", NULL}; +const char *spcmd3[] = {"st", "-c", "scratchpad", "-n", "spmutt", "-g", "180x51", "-e", "neomutt", NULL }; + static Sp scratchpads[] = { {"spterm", spcmd1}, {"spsxiv", spcmd2}, + {"spmutt", spcmd3}, }; static const BarRule barrules[] = { @@ -64,3 +70,4 @@ static const BarRule barrules[] = { { 'A', 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_statuscmd, "status2d" }, }; + diff --git a/suckless/dwm/keybind.h b/suckless/dwm/keybind.h index 0e435591..9e571abc 100644 --- a/suckless/dwm/keybind.h +++ b/suckless/dwm/keybind.h @@ -48,7 +48,7 @@ static const char *windowshot[] = { "scrot", "-u", "-d","3", "%Y-%m-%d-%s_$wx$h. static const char *url[] = {"/home/yigit/.scripts/dmenu_surf", NULL}; static const char *surf[] = {"/home/yigit/.scripts/tabbed_surf", NULL}; static const char *google[] = {"/home/yigit/.scripts/menu-surfraw", "google", NULL}; -static const char *youtube[] = {"/home/yigit/.scripts/menu-surfraw", "youtube", NULL}; +static const char *youtube[] = {"/home/yigit/.scripts/ytfzf_dmenu", NULL}; /* commands */ static Key keys[] = { @@ -120,7 +120,26 @@ static Key keys[] = { { MODKEY, XK_y, spawn, {.v = youtube} }, { MODKEY, XK_s, togglescratch, {.ui = 0 } }, { MODKEY|ShiftMask, XK_s, togglescratch, {.ui = 1 } }, - + { MODKEY, XK_m, togglescratch, {.ui = 2 } }, + /* FloatPos Patch Keybinds */ + { Mod3Mask, XK_u, floatpos, {.v = "-26x -26y" } }, // ↖ + { Mod3Mask, XK_i, floatpos, {.v = " 0x -26y" } }, // ↑ + { Mod3Mask, XK_o, floatpos, {.v = " 26x -26y" } }, // ↗ + { Mod3Mask, XK_j, floatpos, {.v = "-26x 0y" } }, // ← + { Mod3Mask, XK_l, floatpos, {.v = " 26x 0y" } }, // → + { Mod3Mask, XK_m, floatpos, {.v = "-26x 26y" } }, // ↙ + { Mod3Mask, XK_comma, floatpos, {.v = " 0x 26y" } }, // ↓ + { Mod3Mask, XK_period, floatpos, {.v = " 26x 26y" } }, // ↘ + /* Resize client, client center position is fixed which means that client expands in all directions */ + { Mod3Mask|ShiftMask, XK_u, floatpos, {.v = "-26w -26h" } }, // ↖ + { Mod3Mask|ShiftMask, XK_i, floatpos, {.v = " 0w -26h" } }, // ↑ + { Mod3Mask|ShiftMask, XK_o, floatpos, {.v = " 26w -26h" } }, // ↗ + { Mod3Mask|ShiftMask, XK_j, floatpos, {.v = "-26w 0h" } }, // ← + { Mod3Mask|ShiftMask, XK_k, floatpos, {.v = "800W 800H" } }, // · + { Mod3Mask|ShiftMask, XK_l, floatpos, {.v = " 26w 0h" } }, // → + { Mod3Mask|ShiftMask, XK_m, floatpos, {.v = "-26w 26h" } }, // ↙ + { Mod3Mask|ShiftMask, XK_comma, floatpos, {.v = " 0w 26h" } }, // ↓ + { Mod3Mask|ShiftMask, XK_period, floatpos, {.v = " 26w 26h" } }, // ↘ }; /* button definitions */ diff --git a/suckless/dwm/patches.h b/suckless/dwm/patches.h index d6a8ab6c..ca329bb5 100644 --- a/suckless/dwm/patches.h +++ b/suckless/dwm/patches.h @@ -508,10 +508,10 @@ * The size and position can be specified using absolute, relative or fixed co-ordinates and * https://github.com/bakkeby/patches/wiki/floatpos/ */ -#define FLOATPOS_PATCH 0 +#define FLOATPOS_PATCH 1 /* Add-on functionality for the above: make the float positions respect outer (vanity)gaps. */ -#define FLOATPOS_RESPECT_GAPS_PATCH 0 +#define FLOATPOS_RESPECT_GAPS_PATCH 1 /* This patch provides the ability to focus the tag on the immediate left or right of the * currently focused tag. It also allows to send the focused window either on the left or diff --git a/suckless/dwm/rules.h b/suckless/dwm/rules.h index 6a1f2a2b..d3e8f311 100644 --- a/suckless/dwm/rules.h +++ b/suckless/dwm/rules.h @@ -25,7 +25,10 @@ static const Rule rules[] = { RULE(.class = "Spotify", .tags = 1 << 9) RULE(.instance = "spterm", .tags = SPTAG(0), .isfloating = 1) RULE(.instance = "spsxiv", .tags = SPTAG(1), .isfloating = 1) + RULE(.instance = "spmutt", .tags = SPTAG(2), .isfloating = 1) RULE(.class = "ranger", 0, .isfloating = 1) RULE(.class = "vim", 0, .isfloating = 1) - RULE(.class = "mpv", 0, .isfloating = 1) + RULE(.class = "mpv", 0, .isfloating = 1, .floatpos="100% 1% 600W 350H") + RULE(.class = "Sxiv", 0, .isfloating = 1, .floatpos="100% 1% 600W 350H") + RULE(.class = "neomutt-send", 0, .isfloating = 1, .floatpos="50% 50% 1000W 700H") }; diff --git a/vim/vim/plugin/plugins.vim b/vim/vim/plugin/plugins.vim index 70cb0a06..d8e1863b 100644 --- a/vim/vim/plugin/plugins.vim +++ b/vim/vim/plugin/plugins.vim @@ -43,6 +43,7 @@ Plug 'gu-fan/riv.vim' Plug 'gu-fan/InstantRst' Plug 'prettier/vim-prettier', { 'do': 'yarn install' } Plug 'isene/hyperlist.vim' +Plug 'neomutt/neomutt.vim' " Plug 'neoclide/coc.nvim', {'branch': 'release'} diff --git a/xorg/xinitrc b/xorg/xinitrc index 179ade97..d27b9fe6 100755 --- a/xorg/xinitrc +++ b/xorg/xinitrc @@ -49,7 +49,8 @@ dbus-update-activation-environment --systemd DISPLAY picom --no-fading-openclose & firefox-developer-edition app.daily.dev& bitwarden-desktop & -thunderbird & +~/.keyboard +#thunderbird & dunst & exec dwm > /tmp/dwm.log 2> /tmp/dwm.err