update configuration

* copy URLs in foot to primary selection
* remove rarely used/invalid choices from delegator
* manually exit in mailsync because ! disabled set -e
* emit OSC 7 cwd so foot can open new windows in current directory
This commit is contained in:
Felix Van der Jeugt 2024-12-19 08:09:48 +01:00
parent 601dea0836
commit 432966a418
No known key found for this signature in database
GPG Key ID: 58B209295023754D
5 changed files with 22 additions and 33 deletions

View File

@ -1,4 +1,4 @@
font=M+ 2m:size=12
[url]
launch=rifle ${url}
launch=wl-copy --primary ${url}

View File

@ -1 +1 @@
/home/ninewise/.local/pipx/venvs/clirail/bin/clirail
/home/ninewise/.local/share/pipx/venvs/clirail/bin/clirail

View File

@ -82,10 +82,6 @@ case "$choice" in
choice="$(cd ~/.password-store/otp; find * -name '*.gpg' | sed 's/\.gpg$//' | sort -d | pick)"
inject "$(pass otp code otp/"$choice" | head -1)"
;;
'student')
choice="$(pick < ~/.local/share/students.list)"
inject "$choice"
;;
'curl')
d="$(mktemp -d)"
trap "rm -r '$d'" EXIT KILL
@ -93,9 +89,6 @@ case "$choice" in
curl -LOJ "$(primary)"
rifle -fF *
;;
'clipmenu')
exec clipmenu
;;
'yubikey')
choice="$(ykman oath accounts list | pick)"
inject "$(ykman oath accounts code -s "$choice")"
@ -107,22 +100,4 @@ case "$choice" in
'spotify-title')
inject "$(curl -L "$(clip)" | sed -n 's@.*<title>\(.*\) - song \(and lyrics \)\?by \(.*\) | Spotify</title>.*@\1 _van_ \3@p')"
;;
'youtube-dl')
d="$(mktemp -d)"
trap "rm -r '$d'" EXIT KILL
cd "$d"
yt-dlp "$(primary)"
if mplayer -v >/dev/null; then
exec st mplayer *
else
exec st mpv *
fi
;;
'audio-dl')
d="$(mktemp -d)"
trap "rm -r '$d'" EXIT KILL
cd "$d"
yt-dlp -x "$(primary)"
exec st mpv --no-video *
;;
esac

View File

@ -6,10 +6,10 @@ export DISPLAY=":0"
set -e
# Don't sync mails while composing
! pgrep -f mcom > /dev/null
! pgrep -f mfwd > /dev/null
! pgrep -f mbnc > /dev/null
! pgrep -f mrep > /dev/null
if pgrep -f mcom > /dev/null; then exit; fi
if pgrep -f mfwd > /dev/null; then exit; fi
if pgrep -f mbnc > /dev/null; then exit; fi
if pgrep -f mrep > /dev/null; then exit; fi
# Split outbox emails
mlist -d /data/mail/outbox | mpick -t 'from =~~ "posteo"' | mflag -F | mrefile /data/mail/posteo/Sent
@ -31,7 +31,7 @@ fi
# Incorporate new mails and store them in the temp sequence
s="$(mktemp)"
trap "rm '$s'" EXIT KILL
minc $(mdirs /data/mail) > "$s"
mdirs /data/mail | minc > "$s"
{
# Ignores

16
zshrc
View File

@ -80,7 +80,7 @@ agenda() {
}
magnet() {
ssh Tumbrel "transmission-remote --add '$(xclip -sel c -o)'"
ssh Tumbrel "transmission-remote --add '$(wl-paste)'"
}
# Ledger
@ -103,3 +103,17 @@ go() {
terminfo() {
infocmp -x | ssh $@ 'cat > $TERM.info && tic -x $TERM.info && rm $TERM.info'
}
# Emit OSC 7 cwd so foot can open new windows in current directory
osc7-pwd() {
emulate -L zsh # also sets localoptions for us
setopt extendedglob
local LC_ALL=C
printf '\e]7;file://%s%s\e\' $HOST ${PWD//(#m)([^@-Za-z&-;_~])/%${(l:2::0:)$(([##16]#MATCH))}}
}
chpwd-osc7-pwd() {
(( ZSH_SUBSHELL )) || osc7-pwd
}
autoload -Uz add-zsh-hook
add-zsh-hook -Uz chpwd chpwd-osc7-pwd