Compare commits

..

No commits in common. "3cee46358e3417d7891c0ecfcc86af83ece70a11" and "08a46ed6916badad274373de615366381a250a44" have entirely different histories.

10 changed files with 59 additions and 96 deletions

View file

@ -22,7 +22,7 @@ alias gcn!='git commit -v --no-edit --amend'
if version_at_least 2.23 "$git_version"; then
alias gcm='git switch master 2>/dev/null || git switch main'
alias gcd='git switch develop 2>/dev/null || git switch staging'
alias gcd='git switch develop'
alias gcb='git switch -c'
else
alias gcm='git checkout master 2>/dev/null || git checkout main'

View file

@ -3,8 +3,8 @@
IMAPAccount gmail
# Address to connect to
Host imap.gmail.com
UserCmd "pass show misc/aerc-gmail-app-password | grep username | cut -d: -f2"
PassCmd "pass show misc/aerc-gmail-app-password | head -n1"
UserCmd "gpg2 --decrypt --no-tty --quiet --no-verbose --for-your-eyes-only --pinentry-mode ask ~/.local/share/pass/misc/aerc-gmail-app-password.gpg | grep username | cut -d: -f2"
PassCmd "gpg2 --decrypt --no-tty --quiet --no-verbose --for-your-eyes-only --pinentry-mode ask ~/.local/share/pass/misc/aerc-gmail-app-password.gpg | head -n1"
# To store the password in an encrypted file use PassCmd instead of Pass
# PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.mailpass.gpg"
#

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
#
# Runs mbsync, with pre-hooks and post-hooks
# by default, the pre-hook first runs imapfilter
@ -38,9 +38,7 @@
# MBSYNC_NOTIFY=1
# MBSYNC_PASSWORD_FILE="/path/to/gpg/file.gpg"
# What to run before and after decrypting the password file.
PASSWORD_CMD="pass open -t 1min"
# POST_PASSWORD_CMD=""
PASSWORD_FILE="${MBSYNC_PASSWORD_FILE:-$HOME/.local/share/pass/misc/aerc-gmail-app-password.gpg}"
prehook() {
if [ -n "$MBSYNC_PRE" ]; then
@ -85,7 +83,7 @@ checkonline() {
# warn user that he has to enter his password in a moment
# to stop catching him offguard or entering something by accident
checkwarnuser() {
enablegpgagent
agt=$(gpg2 --decrypt --no-tty --quiet --no-verbose --for-your-eyes-only --pinentry-mode cancel "$PASSWORD_FILE" 2>&1)
if echo "$agt" | grep -qE 'No secret key'; then
notify "Mail" "Password phrase needed!"
sleep 2.5
@ -93,22 +91,10 @@ checkwarnuser() {
}
enablegpgagent() {
[ -n "$agt" ] && return
if [ -n "$PASSWORD_CMD" ]; then
IFS=" " read -r -a PASSWORD_CMD <<<"$PASSWORD_CMD"
# shellcheck disable=SC2068
agt=$(${PASSWORD_CMD[@]})
fi
if [ -n "$POST_PASSWORD_CMD" ]; then
IFS=" " read -r -a POST_PASSWORD_CMD <<<"$POST_PASSWORD_CMD"
"${POST_PASSWORD_CMD[@]}"
fi
## get password from user
agt=$(gpg2 --decrypt --no-tty --quiet --no-verbose --for-your-eyes-only --pinentry-mode ask "$PASSWORD_FILE" 2>&1)
## exit program after first failed attempt
if echo "$agt" | grep -qE 'decryption failed' ||
echo "$agt" | grep -qE 'No such file'; then
if echo "$agt" | grep -qE 'decryption failed'; then
notify "Mail" "Process aborted."
exit 1
fi

View file

@ -247,9 +247,10 @@ map.v['g<c-a>'] = '<Plug>(dial-increment-additional)'
map.v['g<c-x>'] = '<Plug>(dial-decrement-additional)'
-- PLUGIN: zettelkasten.nvim
map.n.nore['<cr>'] = [[:silent lua require 'zettelkasten'.link_follow()<cr>]]
map.v.nore['<cr>'] = [[:lua require 'zettelkasten'.link_follow(true)<cr>]]
map.n.nore['<leader>ww'] = [[:lua require 'zettelkasten'.index_open()<cr> ]]
map.n.nore['<cr>'] =
[[:silent lua require 'zettelkasten'.open_or_make_link()<cr>]]
map.v.nore['<cr>'] = [[:lua require 'zettelkasten'.open_or_make_link(true)<cr>]]
map.n.nore['<leader>ww'] = [[:lua require 'zettelkasten'.open_index()<cr> ]]
-- PLUGIN: toggleterm.nvim
-- create a lazygit window, set up in toggleterm settings

View file

@ -16,7 +16,7 @@
# see the recent downloads, just press "sd".
#
# Thorsten Wißmann, 2015 (thorsten` on Libera Chat)
# Marty Oehme, 2021 (@martyo@matrix.org on Matrix), refactored to work with bemenu
# Refactored to work with bemenu by Marty Oehme, 2021 (@martyo@matrix.org on Matrix)
# Any feedback is welcome!
set -e
@ -73,7 +73,7 @@ if ! command -v "${ROFI_CMD}" >/dev/null; then
fi
crop-first-column() {
cut -d' ' -f2-
cut -d' ' -f2
}
ls-files() {
@ -91,9 +91,9 @@ if [ "${#entries[@]}" -eq 0 ]; then
die "Download directory »${DOWNLOAD_DIR}« empty"
fi
line=$(printf '%s\n' "${entries[@]}" \
| crop-first-column \
| $ROFI_CMD "${ROFI_ARGS[@]}") || true
line=$(printf '%s\n' "${entries[@]}" |
crop-first-column |
$ROFI_CMD "${ROFI_ARGS[@]}") || true
if [ -z "$line" ]; then
exit 0
fi

View file

@ -61,8 +61,6 @@ if exist fzf; then
fzf_pkg_tool=yay
elif exist paru; then
fzf_pkg_tool=paru
elif exist pacman; then
fzf_pkg_tool=pacman
fi
# shellcheck disable=2139 # we *want* this to be done at shell startup instead of dynamically
if [ -n "$fzf_pkg_tool" ]; then
@ -91,4 +89,6 @@ fi
if exist vifm; then
alias vm=vifm
alias vmm='vifm ${PWD}'
# enable picture preview script
exist vifmrun && alias vifm=vifmrun
fi

View file

@ -1,7 +1,7 @@
#!/bin/sh
# more usage instructions at https://github.com/clvv/fasd
# eval "$(fasd --init posix-hook posix_alias bash-hook zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install)"
exist fasd && eval "$(fasd --init auto)"
type fasd >/dev/null 2>&1 && eval "$(fasd --init auto)"
# any
alias a='fasd -a'

View file

@ -1,11 +0,0 @@
#!/usr/bin/env sh
## Quickly bring up a file server for
# the current directory.
if exist sfz; then
alias serve="sfz"
elif exist gossa; then
alias serve="gossa"
elif exist rossa; then
alias serve="rossa"
fi

View file

@ -6,28 +6,28 @@
# Also makes yay call paru since that is the new hotness
# (or at least I want to try it)
exist paru && {
type paru >/dev/null 2>&1 && {
# recreate the normal look of yay
alias yay="paru --bottomup"
}
syu() {
exist topgrade && {
type topgrade >/dev/null 2>&1 && {
topgrade
return
}
exist paru && {
type paru >/dev/null 2>&1 && {
paru
return
}
exist yay && {
type yay >/dev/null 2>&1 && {
yay
return
}
exist pacman && {
type pacman >/dev/null 2>&1 && {
echo "Did not find paru, or yay installed. Updates will not be applied to aur packages."
sudo pacman -Syu
return

View file

@ -1,22 +1,9 @@
#!/usr/bin/env sh
# simple check for running graphical session
if [ -n "$DISPLAY" ] || [ -z "$XDG_VTNR" ] || [ "$XDG_VTNR" -ne 1 ]; then
return
fi
# more involved check for running graphical session
# but figures it out for weird sshd sessions as well
if [ "$(loginctl show-session "$(loginctl show-user "$(whoami)" -p Display --value)" -p Type --value)" = 'wayland' ]; then
return
fi
# just in case we are running x11 and this wants
# to automatically start wayland, stop it from doing so
if [ "$(loginctl show-session "$(loginctl show-user "$(whoami)" -p Display --value)" -p Type --value)" = 'x11' ]; then
return
fi
if command -v river >/dev/null 2>&1; then
river
fi