diff --git a/config.yaml b/config.yaml index 6215cdb..fef2fb1 100644 --- a/config.yaml +++ b/config.yaml @@ -22,7 +22,7 @@ dotfiles: d_neomutt: dst: ~/.config/neomutt src: .config/neomutt - d_goimapnotify: + d_imapnotify: dst: ~/.config/imapnotify src: .config/imapnotify f_init.vim: @@ -33,12 +33,12 @@ dotfiles: - vim-plug dst: ~/.config/nvim/conf.d src: .config/nvim/conf.d + f_user-dirs.dirs: + dst: ~/.config/user-dirs.dirs + src: .config/user-dirs.dirs f_coc-settings.json: dst: ~/.config/nvim/coc-settings.json src: .config/nvim/coc-settings.json - d_scripts: - dst: ~/.scripts - src: .scripts d_sway: dst: ~/.config/sway src: .config/sway @@ -178,7 +178,6 @@ profiles: - f_ranger.conf - f_ssh.conf - f_authorized_keys - - d_scripts - d_nvim_config - f_init.vim - f_coc-settings.json @@ -187,7 +186,7 @@ profiles: email: dotfiles: - d_neomutt - - d_goimapnotify + - d_imapnotify - f_mbsyncrc - f_msmtp_config media: @@ -229,6 +228,7 @@ profiles: - Pacman dotfiles: - f_paru.conf + - f_user-dirs.dirs Moria: include: - terminal diff --git a/dotdrop b/dotdrop index d42d810..fe2681e 160000 --- a/dotdrop +++ b/dotdrop @@ -1 +1 @@ -Subproject commit d42d810ab1842c9568f655127491eeedf1d376fc +Subproject commit fe2681e32ca6d387cd9693bb704b2273b440e664 diff --git a/home/.config/imapnotify/admin@korhonen.cc.conf b/home/.config/imapnotify/admin@korhonen.cc.conf deleted file mode 100644 index cecd8ba..0000000 --- a/home/.config/imapnotify/admin@korhonen.cc.conf +++ /dev/null @@ -1,13 +0,0 @@ -{ - "host": "imap.migadu.com", - "port": 993, - "tls": true, - "tlsOptions": { - "rejectUnauthorized": true - }, - "username": "admin@korhonen.cc", - "password": "{{@@ env['PASS_EMAIL_ADMIN'] @@}}", - "onNewMail": "mbsync admin@korhonen.cc", - "onNewMailPost": "", - "boxes": [ "INBOX" ] -} diff --git a/home/.config/imapnotify/admin@korhonen.cc.js b/home/.config/imapnotify/admin@korhonen.cc.js new file mode 100644 index 0000000..de3e0a5 --- /dev/null +++ b/home/.config/imapnotify/admin@korhonen.cc.js @@ -0,0 +1,19 @@ +var child_process = require("child_process"); + +function getStdout(cmd) { + var stdout = child_process.execSync(cmd); + return stdout.toString().trim(); +} + +exports.host = "imap.migadu.com"; +exports.port = 993; +exports.tls = true; +exports.tlsOptions = { + rejectUnauthorized: true, +}; +exports.username = "admin@korhonen.cc"; +exports.password = "{{@@ env['PASS_EMAIL_ADMIN'] @@}}"; +exports.onNewMail = "mbsync admin@korhonen.cc"; +exports.onNewMailPost = + "~/git/dotfiles/scripts/mail/notify-new-mail.sh admin@korhonen.cc"; +exports.boxes = ["INBOX"]; diff --git a/home/.config/imapnotify/functionalhacker@korhonen.cc.js b/home/.config/imapnotify/functionalhacker@korhonen.cc.js new file mode 100644 index 0000000..1ca0937 --- /dev/null +++ b/home/.config/imapnotify/functionalhacker@korhonen.cc.js @@ -0,0 +1,19 @@ +var child_process = require("child_process"); + +function getStdout(cmd) { + var stdout = child_process.execSync(cmd); + return stdout.toString().trim(); +} + +exports.host = "imap.migadu.com"; +exports.port = 993; +exports.tls = true; +exports.tlsOptions = { + rejectUnauthorized: true, +}; +exports.username = "functionalhacker@korhonen.cc"; +exports.password = "{{@@ env['PASS_EMAIL_HACKER'] @@}}"; +exports.onNewMail = "mbsync functionalhacker@korhonen.cc"; +exports.onNewMailPost = + "~/git/dotfiles/scripts/mail/notify-new-mail.sh functionalhacker@korhonen.cc"; +exports.boxes = ["INBOX"]; diff --git a/home/.config/imapnotify/marko@korhonen.cc.conf b/home/.config/imapnotify/marko@korhonen.cc.conf deleted file mode 100644 index 4572d3d..0000000 --- a/home/.config/imapnotify/marko@korhonen.cc.conf +++ /dev/null @@ -1,13 +0,0 @@ -{ - "host": "imap.migadu.com", - "port": 993, - "tls": true, - "tlsOptions": { - "rejectUnauthorized": true - }, - "username": "marko@korhonen.cc", - "password": "{{@@ env['PASS_EMAIL_MARKO'] @@}}", - "onNewMail": "mbsync marko@korhonen.cc", - "onNewMailPost": "", - "boxes": [ "INBOX" ] -} diff --git a/home/.config/imapnotify/marko@korhonen.cc.js b/home/.config/imapnotify/marko@korhonen.cc.js new file mode 100644 index 0000000..f86cca9 --- /dev/null +++ b/home/.config/imapnotify/marko@korhonen.cc.js @@ -0,0 +1,19 @@ +var child_process = require("child_process"); + +function getStdout(cmd) { + var stdout = child_process.execSync(cmd); + return stdout.toString().trim(); +} + +exports.host = "imap.migadu.com"; +exports.port = 993; +exports.tls = true; +exports.tlsOptions = { + rejectUnauthorized: true, +}; +exports.username = "marko@korhonen.cc"; +exports.password = "{{@@ env['PASS_EMAIL_MARKO'] @@}}"; +exports.onNewMail = "mbsync marko@korhonen.cc"; +exports.onNewMailPost = + "~/git/dotfiles/scripts/mail/notify-new-mail.sh marko@korhonen.cc"; +exports.boxes = ["INBOX"]; diff --git a/home/.config/mimeo/associations.txt b/home/.config/mimeo/associations.txt index 27e0d1a..9d7fd9a 100644 --- a/home/.config/mimeo/associations.txt +++ b/home/.config/mimeo/associations.txt @@ -1,31 +1,31 @@ -umpv %U +mpvqueue %U ^https?://invidio.us/.* -umpv %U +mpvqueue %U ^https?://(m.)?(www.)?youtube.com/watch\?.*v= -umpv %U +mpvqueue %U ^https?://(www.)?youtube.com/playlist\?.*list= -umpv %U +mpvqueue %U ^https?://(www.)?youtu.be/ -umpv %U +mpvqueue %U ^https?://(www.)?(m.)?twitch.tv/ -umpv %U +mpvqueue %U ^https?://(?:[a-z0-9\-]+\.)+[a-z]{2,6}(?:/[^/#?]+)+\.(?:mp4|mkv|webm|avi|3gp|gif|gifv) -umpv %U +mpvqueue %U ^https?://www.facebook.com/.*/videos/ -umpv %U +mpvqueue %U ^https?://gfycat.com/.* -umpv %U +mpvqueue %U ^https?://vimeo.com/.* -umpv %U +mpvqueue %U ^https?://v.redd.it/.* imgurviewer %U diff --git a/home/.config/mpd/mpd.conf b/home/.config/mpd/mpd.conf index 0150443..0e05ab8 100644 --- a/home/.config/mpd/mpd.conf +++ b/home/.config/mpd/mpd.conf @@ -1,5 +1,5 @@ -music_directory "~/Music" -playlist_directory "~/Music/Playlists" +music_directory "~/music" +playlist_directory "~/music/Playlists" db_file "~/.mpd/database" log_file "~/.mpd/log" pid_file "~/.mpd/pid" diff --git a/home/.config/msmtp/config b/home/.config/msmtp/config index 81ca24c..1179ee8 100644 --- a/home/.config/msmtp/config +++ b/home/.config/msmtp/config @@ -1,25 +1,26 @@ +defaults +auth on +tls on +tls_starttls off +tls_trust_file /etc/ssl/certs/ca-certificates.crt +logfile ~/.log/msmtp.log +host smtp.migadu.com +port 465 + +# functionalhacker@korhonen.cc +account functionalhacker@korhonen.cc +from functionalhacker@korhonen.cc +user functionalhacker@korhonen.cc +password "{{@@ env['PASS_EMAIL_HACKER'] @@}}" + # marko@korhonen.cc account marko@korhonen.cc from marko@korhonen.cc user marko@korhonen.cc password "{{@@ env['PASS_EMAIL_MARKO'] @@}}" -auth on -tls on -tls_starttls off -tls_trust_file /etc/ssl/certs/ca-certificates.crt -logfile ~/.log/msmtp/marko@korhonen.cc.log -host smtp.migadu.com -port 465 # admin@korhonen.cc account admin@korhonen.cc from admin@korhonen.cc user admin@korhonen.cc password "{{@@ env['PASS_EMAIL_ADMIN'] @@}}" -auth on -tls on -tls_starttls off -tls_trust_file /etc/ssl/certs/ca-certificates.crt -logfile ~/.log/msmtp/admin@korhonen.cc.log -host smtp.migadu.com -port 465 diff --git a/home/.config/neomutt/accounts/admin@korhonen.cc b/home/.config/neomutt/accounts/admin@korhonen.cc deleted file mode 100644 index 4bea53a..0000000 --- a/home/.config/neomutt/accounts/admin@korhonen.cc +++ /dev/null @@ -1,14 +0,0 @@ -# vim: filetype=neomuttrc - -set my_email = "admin@korhonen.cc" -set from = $my_email -set sendmail = "/usr/bin/msmtp -a $my_email" -set realname = "Marko Korhonen" -set status_format = "-%r-Mutt: $my_email %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---" -set mbox_type = Maildir -set folder = "~/.mail/$my_email" -set mbox = "+INBOX" -set record = "+INBOX" -set postponed = "+Drafts" -set spoolfile = "+INBOX" -mailboxes = +INBOX diff --git a/home/.config/neomutt/accounts/marko@korhonen.cc b/home/.config/neomutt/accounts/marko@korhonen.cc deleted file mode 100644 index 514d359..0000000 --- a/home/.config/neomutt/accounts/marko@korhonen.cc +++ /dev/null @@ -1,14 +0,0 @@ -# vim: filetype=neomuttrc - -set my_email = "marko@korhonen.cc" -set from = $my_email -set sendmail = "/usr/bin/msmtp -a $my_email" -set realname = "Marko Korhonen" -set status_format = "-%r-Mutt: $my_email %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---" -set mbox_type = Maildir -set folder = "~/.mail/$my_email" -set mbox = "+INBOX" -set record = "+INBOX" -set postponed = "+Drafts" -set spoolfile = "+INBOX" -mailboxes = +INBOX diff --git a/home/.config/neomutt/appearance b/home/.config/neomutt/appearance deleted file mode 100644 index 49493cd..0000000 --- a/home/.config/neomutt/appearance +++ /dev/null @@ -1 +0,0 @@ -color normal default default diff --git a/home/.config/neomutt/neomuttrc b/home/.config/neomutt/neomuttrc deleted file mode 100644 index 7402072..0000000 --- a/home/.config/neomutt/neomuttrc +++ /dev/null @@ -1,13 +0,0 @@ -# vim: filetype=neomuttrc - -set sendmail = "/usr/bin/msmtp" -set mbox_type = Maildir -set folder = ~/.mail -set spoolfile = +Personal/INBOX - -source ~/.config/neomutt/appearance -source ~/.config/neomutt/sidebar -source ~/.config/neomutt/accounts/marko@korhonen.cc - -macro index 'source ~/.config/neomutt/accounts/marko@korhonen.cc!' -macro index 'source ~/.config/neomutt/accounts/admin@korhonen.cc!' diff --git a/home/.config/neomutt/sidebar b/home/.config/neomutt/sidebar deleted file mode 100644 index 48b1252..0000000 --- a/home/.config/neomutt/sidebar +++ /dev/null @@ -1,5 +0,0 @@ -# vim: filetype=neomuttrc - -set sidebar_visible = yes -set sidebar_indent_string = ' ' -sidebar_whitelist '~/.mail/<>/INBOX' diff --git a/home/.config/sway/conf.d/01-vars.conf b/home/.config/sway/conf.d/01-vars.conf index 5ca6f7e..2736d7e 100644 --- a/home/.config/sway/conf.d/01-vars.conf +++ b/home/.config/sway/conf.d/01-vars.conf @@ -3,5 +3,5 @@ set $mod Mod4 set $term alacritty set $gnome-schema org.gnome.desktop.interface -set $wallpaper ~/Pictures/Wallpapers/random/$(ls ~/Pictures/Wallpapers/random | sort -R | tail -n 1) +set $wallpaper ~/pictures/Wallpapers/random/$(ls ~/Pictures/Wallpapers/random | sort -R | tail -n 1) set $scripts ~/.config/sway/scripts diff --git a/home/.config/user-dirs.dirs b/home/.config/user-dirs.dirs index 4356ac1..99266f4 100644 --- a/home/.config/user-dirs.dirs +++ b/home/.config/user-dirs.dirs @@ -1,8 +1,8 @@ -XDG_DESKTOP_DIR="$HOME/Desktop" -XDG_DOWNLOAD_DIR="$HOME/Downloads" -XDG_TEMPLATES_DIR="$HOME/Templates" -XDG_PUBLICSHARE_DIR="$HOME/Public" -XDG_DOCUMENTS_DIR="$HOME/Documents" -XDG_MUSIC_DIR="$HOME/Music" -XDG_PICTURES_DIR="$HOME/Pictures" -XDG_VIDEOS_DIR="$HOME/Videos" +XDG_DESKTOP_DIR="$HOME/desktop" +XDG_DOWNLOAD_DIR="$HOME/downloads" +XDG_TEMPLATES_DIR="$HOME/templates" +XDG_PUBLICSHARE_DIR="$HOME/public" +XDG_DOCUMENTS_DIR="$HOME/documents" +XDG_MUSIC_DIR="$HOME/music" +XDG_PICTURES_DIR="$HOME/pictures" +XDG_VIDEOS_DIR="$HOME/videos" diff --git a/home/.config/zsh/03-aliases.zsh b/home/.config/zsh/03-aliases.zsh index 85a9456..7f0afa2 100644 --- a/home/.config/zsh/03-aliases.zsh +++ b/home/.config/zsh/03-aliases.zsh @@ -4,8 +4,7 @@ alias gac='ga && gc' alias gpull='git pull' alias gpush='git push' -# Access server mariadb -alias moria-mariadb='ssh -tt moria docker exec -it mariadb mysql -p' +alias mutt='neomutt' # Syntax highlighting cat if output is a terminal cat() { diff --git a/home/.mbsyncrc b/home/.mbsyncrc index b9e97e8..d16d2f4 100644 --- a/home/.mbsyncrc +++ b/home/.mbsyncrc @@ -1,3 +1,28 @@ +### functionalhacker@korhonen.cc ##################################### +IMAPAccount functionalhacker@korhonen.cc +Host imap.migadu.com +User functionalhacker@korhonen.cc +Pass "{{@@ env['PASS_EMAIL_HACKER'] @@}}" +SSLType IMAPS +Port 993 +CertificateFile /etc/ssl/certs/ca-certificates.crt + +IMAPStore functionalhacker@korhonen.cc-remote +Account functionalhacker@korhonen.cc + +MaildirStore functionalhacker@korhonen.cc-local +Subfolders Verbatim +Path ~/.mail/functionalhacker@korhonen.cc/ +Inbox ~/.mail/functionalhacker@korhonen.cc/INBOX + +Channel functionalhacker@korhonen.cc +Master :functionalhacker@korhonen.cc-remote: +Slave :functionalhacker@korhonen.cc-local: +Create Both +Patterns * +SyncState * +################################################################# + ### marko@korhonen.cc ##################################### IMAPAccount marko@korhonen.cc Host imap.migadu.com diff --git a/home/.msmtprc b/home/.msmtprc deleted file mode 100644 index 79c5ce7..0000000 --- a/home/.msmtprc +++ /dev/null @@ -1,38 +0,0 @@ -defaults -auth on -logfile ~/.msmtp.log -tls on -tls_trust_file /etc/ssl/certs/ca-certificates.crt - -# reekymarko@reekynet.com -account reekymarko@reekynet.com -host smtp.migadu.com -port 587 -from reekymarko@reekynet.com -user reekymarko@reekynet.com -passwordeval "pass email/reekymarko@reekynet.com | head -n 1" - -# marko.korhonen@reekynet.com -account marko.korhonen@reekynet.com -host smtp.migadu.com -port 587 -from marko.korhonen@reekynet.com -user marko.korhonen@reekynet.com -passwordeval "pass email/marko.korhonen@reekynet.com | head -n 1" - - -# admin@reekynet.com -account admin@reekynet.com -host smtp.migadu.com -port 587 -from admin@reekynet.com -user admin@reekynet.com -passwordeval "pass email/admin@reekynet.com | head -n 1" - -# marko.korhonen@metropolia.fi -account marko.korhonen@metropolia.fi -host smtp.metropolia.fi -port 587 -from marko.korhonen@metropolia.fi -user markoak -passwordeval "pass email/marko.korhonen@metropolia.fi | head -n 1" diff --git a/home/.scripts/autorotate.sh b/scripts/autorotate.sh similarity index 100% rename from home/.scripts/autorotate.sh rename to scripts/autorotate.sh diff --git a/home/.scripts/confgen/termite.conf.gen.sh b/scripts/confgen/termite.conf.gen.sh similarity index 100% rename from home/.scripts/confgen/termite.conf.gen.sh rename to scripts/confgen/termite.conf.gen.sh diff --git a/home/.scripts/confgen/zathura.conf.gen.sh b/scripts/confgen/zathura.conf.gen.sh similarity index 100% rename from home/.scripts/confgen/zathura.conf.gen.sh rename to scripts/confgen/zathura.conf.gen.sh diff --git a/home/.scripts/hibernate-lowbattery.sh b/scripts/hibernate-lowbattery.sh similarity index 100% rename from home/.scripts/hibernate-lowbattery.sh rename to scripts/hibernate-lowbattery.sh diff --git a/home/.scripts/ipmi/auto.sh b/scripts/ipmi/auto.sh similarity index 100% rename from home/.scripts/ipmi/auto.sh rename to scripts/ipmi/auto.sh diff --git a/home/.scripts/ipmi/fans.sh b/scripts/ipmi/fans.sh similarity index 100% rename from home/.scripts/ipmi/fans.sh rename to scripts/ipmi/fans.sh diff --git a/home/.scripts/ipmi/full.sh b/scripts/ipmi/full.sh similarity index 100% rename from home/.scripts/ipmi/full.sh rename to scripts/ipmi/full.sh diff --git a/home/.scripts/ipmi/static.sh b/scripts/ipmi/static.sh similarity index 100% rename from home/.scripts/ipmi/static.sh rename to scripts/ipmi/static.sh diff --git a/home/.scripts/ipmi/temp.sh b/scripts/ipmi/temp.sh similarity index 100% rename from home/.scripts/ipmi/temp.sh rename to scripts/ipmi/temp.sh diff --git a/scripts/mail/notify-new-mail.sh b/scripts/mail/notify-new-mail.sh new file mode 100755 index 0000000..298d6b3 --- /dev/null +++ b/scripts/mail/notify-new-mail.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +NEWMAILDIR=~/.mail/$1/INBOX/new +COUNT=$(ls $NEWMAILDIR | wc -l) +ICON=/usr/share/icons/Papirus-Dark/64x64/apps/email.svg +SOUND=/usr/share/sounds/Oxygen-Im-Message-In.ogg + + +if [ $COUNT -ne 0 ]; then + mpv $SOUND & +fi + +if [ $COUNT -gt 1 ]; then + fromaddress=$(cat $NEWMAILDIR/$(ls $NEWMAILDIR | sort -R | tail -1) | formail -x From | tail -1) + notify-send.sh -i $ICON "$COUNT new messages in $1" "From $fromaddress and others" + +elif [ $COUNT -eq 1 ]; then + mailsubject=$(cat $NEWMAILDIR/* | formail -x Subject) + fromaddress=$(cat $NEWMAILDIR/* | formail -x From | tail -1) + + notify-send.sh -i $ICON "New message in $1" "$fromaddress $mailsubject" +else + echo "No new mail" +fi diff --git a/home/.scripts/media/imageviewer b/scripts/media/imageviewer similarity index 100% rename from home/.scripts/media/imageviewer rename to scripts/media/imageviewer diff --git a/home/.scripts/media/imgurviewer b/scripts/media/imgurviewer similarity index 100% rename from home/.scripts/media/imgurviewer rename to scripts/media/imgurviewer diff --git a/home/.scripts/media/mpvqueue b/scripts/media/mpvqueue similarity index 100% rename from home/.scripts/media/mpvqueue rename to scripts/media/mpvqueue diff --git a/home/.scripts/open_with_linux.py b/scripts/open_with_linux.py similarity index 100% rename from home/.scripts/open_with_linux.py rename to scripts/open_with_linux.py diff --git a/secrets/env b/secrets/env index 9d4d342..7b41c97 100755 --- a/secrets/env +++ b/secrets/env @@ -9,6 +9,7 @@ export PASS_MPD_ADMIN="$(pass linux/mpd-admin | head -1)" export PASS_IPMI="$(pass selfhosted/idrac | head -1)" export PASS_MQTT="$(pass selfhosted/mqtt.reekynet.com | head -1)" +export PASS_EMAIL_HACKER="$(pass email/functionalhacker@korhonen.cc | head -1)" export PASS_EMAIL_MARKO="$(pass email/marko@korhonen.cc | head -1)" export PASS_EMAIL_ADMIN="$(pass email/admin@korhonen.cc | head -1)" diff --git a/secrets/secrets.sh b/secrets/secrets.sh index a33dac0..349c03a 100755 --- a/secrets/secrets.sh +++ b/secrets/secrets.sh @@ -13,6 +13,7 @@ export PASS_MPD_ADMIN="$PASS_MPD_ADMIN" export PASS_IPMI="$PASS_IPMI" export PASS_MQTT="$PASS_MQTT" +export PASS_EMAIL_HACKER="$PASS_EMAIL_HACKER" export PASS_EMAIL_MARKO="$PASS_EMAIL_MARKO" export PASS_EMAIL_ADMIN="$PASS_EMAIL_ADMIN"