From 03dd8b3cd8d03300ee85377ea40fa486819d2ebc Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Wed, 6 Mar 2024 14:59:00 -0500 Subject: Update shortcutgen env and misc others --- .Xresources | 2 +- .config/mutt/accounts/benjamin@chausse.xyz.muttrc | 79 +++++++++++++++++++++++ .config/mutt/my-configs | 29 --------- .local/bin/dropdowntoggle | 18 +++++- .local/bin/shortcutgen | 4 +- .local/bin/upsite | 27 ++++++-- .profile | 7 +- 7 files changed, 125 insertions(+), 41 deletions(-) create mode 100644 .config/mutt/accounts/benjamin@chausse.xyz.muttrc diff --git a/.Xresources b/.Xresources index d03696e..5068056 100644 --- a/.Xresources +++ b/.Xresources @@ -32,7 +32,7 @@ *color7: #c5c8c6 *color15: #c0c7ca !other -*background: #222d32 +*background: #111a1f *foreground: #acb3b5 *cursorColor: #ebcb88 ! See "highlightColorMode" and "hm" options in XTerm manual page. diff --git a/.config/mutt/accounts/benjamin@chausse.xyz.muttrc b/.config/mutt/accounts/benjamin@chausse.xyz.muttrc new file mode 100644 index 0000000..99ffd4a --- /dev/null +++ b/.config/mutt/accounts/benjamin@chausse.xyz.muttrc @@ -0,0 +1,79 @@ +# vim: filetype=neomuttrc +# muttrc file for account benjamin@chausse.xyz +set realname = "Benjamin Chausse" +set from = "benjamin@chausse.xyz" +set sendmail = "msmtp -a benjamin@chausse.xyz" +alias me Benjamin Chausse +set folder = "/home/master/.local/share/mail/benjamin@chausse.xyz" +set header_cache = /home/master/.cache/mutt-wizard/benjamin@chausse.xyz/headers +set message_cachedir = /home/master/.cache/mutt-wizard/benjamin@chausse.xyz/bodies +set mbox_type = Maildir +set hostname = "chausse.xyz" +source /usr/share/mutt-wizard/switch.muttrc +set spoolfile = +INBOX +set postponed = +Drafts +set trash = +Trash +set record = +Sent + +set crypt_use_gpgme = yes +set pgp_default_key = "ABC4A5A7430D6309ACBD219044F94DD6456590C3" +set pgp_sign_as = "ABC4A5A7430D6309ACBD219044F94DD6456590C3" + +macro index o "mw -y benjamin@chausse.xyz" "run mbsync to sync benjamin@chausse.xyz" +macro index \eg "unset wait_keygpg --list-secret-keys; printf 'Enter email ID of user to publish: '; read eID; printf 'Enter fingerprint of GPG key to publish: '; read eFGPT; /usr/libexec/gpg-wks-client --create \$eFGPT \$eID | msmtp --read-envelope-from --read-recipients -a benjamin@chausse.xyz" "publish GPG key to WKS provider" +macro index \eh "/usr/libexec/gpg-wks-client --receive | msmtp --read-envelope-from --read-recipients -a benjamin@chausse.xyz" "confirm GPG publication" + +mailboxes "=Trash" "=Junk" "=Archives/2030" "=Archives/2029" "=Archives/2028" "=Archives/2027" "=Archives/2026" "=Archives/2025" "=Archives/2024" "=Archives/2023" "=Archives/2022" "=Archives/2021" "=Archives/2020" "=Bills" "=Sent" "=Drafts" "=INBOX" + +macro index,pager ga " =Archives/2024" "go to current year archive" +macro index,pager Ma "; =Archives/2024" "archive message" +macro index,pager Ca " =Archives/2024" "copy message to archive" + +macro index,pager g0 " =Archives/2020" "go to 2020 archives" +macro index,pager M0 "; =Archives/2020" "move to 2020 archives" +macro index,pager g0 " =Archives/2020" "copy to 2020 archives" + +macro index,pager g1 " =Archives/2021" "go to 2021 archives" +macro index,pager M1 "; =Archives/2021" "move to 2021 archives" +macro index,pager g1 " =Archives/2021" "copy to 2021 archives" + +macro index,pager g2 " =Archives/2022" "go to 2022 archives" +macro index,pager M2 "; =Archives/2022" "move to 2022 archives" +macro index,pager g2 " =Archives/2022" "copy to 2022 archives" + + +macro index,pager g3 " =Archives/2023" "go to 2023 archives" +macro index,pager M3 "; =Archives/2023" "move to 2023 archives" +macro index,pager g3 " =Archives/2023" "copy to 2023 archives" + + +macro index,pager g4 " =Archives/2024" "go to 2024 archives" +macro index,pager M4 "; =Archives/2024" "move to 2024 archives" +macro index,pager g4 " =Archives/2024" "copy to 2024 archives" + + +macro index,pager g5 " =Archives/2025" "go to 2025 archives" +macro index,pager M5 "; =Archives/2025" "move to 2025 archives" +macro index,pager g5 " =Archives/2025" "copy to 2025 archives" + + +macro index,pager g6 " =Archives/2026" "go to 2026 archives" +macro index,pager M6 "; =Archives/2026" "move to 2026 archives" +macro index,pager g6 " =Archives/2026" "copy to 2026 archives" + + +macro index,pager g7 " =Archives/2027" "go to 2027 archives" +macro index,pager M7 "; =Archives/2027" "move to 2027 archives" +macro index,pager g7 " =Archives/2027" "copy to 2027 archives" + + +macro index,pager g8 " =Archives/2028" "go to 2028 archives" +macro index,pager M8 "; =Archives/2028" "move to 2028 archives" +macro index,pager g8 " =Archives/2028" "copy to 2028 archives" + + +macro index,pager g9 " =Archives/2029" "go to 2029 archives" +macro index,pager M9 "; =Archives/2029" "move to 2029 archives" +macro index,pager g9 " =Archives/2029" "copy to 2029 archives" + + diff --git a/.config/mutt/my-configs b/.config/mutt/my-configs index 831bc67..a84efba 100644 --- a/.config/mutt/my-configs +++ b/.config/mutt/my-configs @@ -2,33 +2,4 @@ # Add the following line to your muttrc to have them: # source $HOME/.config/mutt/my-configs -# GOOBOOK: {{{ -# goobook let's you use google contacts information. -# You install it with pip: pip install --user goobook -# Query emails -set query_command="goobook query %s" -# Add email to contacts -macro index,pager a "goobook add" "add the sender address to Google contacts" - -# Note that if you use an old version of mutt-wizard, -# you will need to disable abook in it's script: -# sed -i "s/^set\squery_command.*$//" /usr/share/mutt-wizard/mutt-wizard.muttrc -# }}} - -# PGP Encryption: {{{ -# I want pgp encryption by default when possible. -# The following line makes this possible: -set crypt_use_gpgme=yes -set crypt_autosign = yes -set pgp_self_encrypt = yes -set pgp_default_key = 'ABC4A5A7430D6309ACBD219044F94DD6456590C3' -set pgp_import_command = "gpg --no-verbose --import -v %f" -# }}} - -# Muttprint: {{{ -set print_command="muttprint" -# Dump all headers -# macro index p " " -# }}} - # vim: filetype=neomuttrc diff --git a/.local/bin/dropdowntoggle b/.local/bin/dropdowntoggle index f4a4705..91e834e 100755 --- a/.local/bin/dropdowntoggle +++ b/.local/bin/dropdowntoggle @@ -8,11 +8,23 @@ name="$1" class="dropdown" title="dropdown_$name" -active="$(xdotool search --name $title | wc -l)" +active="$(xdotool search --name "$title" | wc -l)" shift +case "$TERMINAL" in +*st) + classflag="-c" + titleflag="-t" + cmdflag="-e" + ;; +*alacritty) + classflag="--class" + titleflag="--title" + cmdflag="--command" + ;; +esac case "$active" in - 0) $TERMINAL --class "dropdown" --title "$title" --command "$@" & ;; - *) kill -9 `xdotool search --name "$class" getwindowpid` ;; +0) $TERMINAL "$classflag" "dropdown" "$titleflag" "$title" "$cmdflag" "$@" & ;; +*) kill -9 "$(xdotool search --name "$class" getwindowpid)" ;; esac diff --git a/.local/bin/shortcutgen b/.local/bin/shortcutgen index ce29ffb..2335a92 100755 --- a/.local/bin/shortcutgen +++ b/.local/bin/shortcutgen @@ -16,5 +16,7 @@ echo "$raw" | sed 's/\(.*\),\(.*\),\(.*\)/map g\2 cd \3/' >"$XDG_CONFIG_HOME/lf/ echo "$raw" | sed 's/\(.*\),\(.*\),\(.*\)/alias g\2="cd \3"/' >"$HOME/.cache/zsh-shortcuts" # Environment variables (read by .profile) -echo "$raw" | sed 's/\(.*\),\(.*\),\(.*\)/export G\U\2="\3"/' >"$HOME/.cache/env-shortcuts" +echo "$raw" | sed 's/^\(.*\),\(.*\),/export G\U\2=,/;s/,\(.*\)/\1/' >"$HOME/.cache/env-shortcuts" + + diff --git a/.local/bin/upsite b/.local/bin/upsite index c6ef404..5b15d21 100755 --- a/.local/bin/upsite +++ b/.local/bin/upsite @@ -1,11 +1,28 @@ #!/bin/sh -sitename="chausse.xyz" +username="master" +url="chausse.xyz" +siteroot="$HOME/Workspace/$url" -branch="construction" - -cd "$HOME/Workspace/$sitename$construction" && git pull origin $branch && git checkout $branch +case "$1" in + -d|--dev) + url="dev.$url" + destdir="/var/www/dev" + branch="master" + ;; + -m|--main) + destdir="/var/www/chausse" + branch="construction" + ;; + *) + echo "Usage: upsite [dev|main]" + exit 1 + ;; +esac +cd "$siteroot" || exit 1 +git checkout $branch +git pull hugo --gc=true --minify +rsync -aucz --delete --progress "$siteroot/public/" "$username@$url:$destdir" -rsync -auvz "$HOME/Workspace/$sitename$construction/public/" "master@$sitename:/var/www/chausse" diff --git a/.profile b/.profile index b34376e..0055553 100644 --- a/.profile +++ b/.profile @@ -27,8 +27,8 @@ export TEXSRC=$HOME/.local/src/sherbrooke-tex # Applications export EDITOR=$(which nvim) export READER=/usr/bin/zathura -export TERMINAL=/usr/bin/alacritty -export TERM=/usr/bin/alacritty +export TERMINAL=/usr/local/bin/st +export TERM=/usr/local/bin/st export BROWSER=/usr/bin/firefox # less/man colors @@ -45,6 +45,9 @@ export LESS_TERMCAP_ue=$'\e[0m' # end underline shortcutgen aliasgen +# Import shortcut ENV variables +source "$HOME/.cache/env-shortcuts" + # Ensure XDG_RUNTIME_DIR is set if test -z "$XDG_RUNTIME_DIR"; then export XDG_RUNTIME_DIR=$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX) -- cgit v1.2.3