add anki and expand some tools

This commit is contained in:
stupidcomputer 2025-01-02 13:36:21 -06:00
parent 18b78f55c0
commit 8f00ba299d
4 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,55 @@
# when there's an open anki window, and we're entering conjugations for verbs
# or whatever, it's nice to automatically advance the conjugation form.
# for instance, if your card key is:
# What is the yo form conjugation for ir in the imperfect?
# Your next one will naturally be
# What is the tú form conjugation for ir in the imperfect?
sleep 0.25
# firstly, get the card key text
xdotool sleep 0.2 key ctrl+a ctrl+c
sleep 0.25
# now the key is in our clipboard
text=$(xclip -out -selection clipboard)
form=$(echo "$text" | sed '
s/.*\( yo \).*/\1/;
s/.*\( tú \).*/\1/;
s/.*\( él\/ella\/usted \).*/\1/;
s/.*\( nosotros \).*/\1/;
s/.*\( vosotros \).*/\1/;
s/.*\( ustedes \).*/\1/
')
case "$form" in
" yo ")
next="tú"
;;
" tú ")
next="él/ella/usted"
;;
" él/ella/usted ")
next="nosotros"
;;
" nosotros ")
next="vosotros"
;;
" vosotros ")
next="ustedes"
;;
" ustedes ")
next="yo"
;;
esac
printf "text: %s\n" "$text"
printf "form: %s\n" "$form"
printf "next: %s\n" "$next"
new_text=$(echo "$text" | sed "s|$form| $next |g")
echo -n "$new_text" | xclip -in -selection clipboard
xdotool key ctrl+a ctrl+v

View File

@ -10,6 +10,10 @@ dmenu <<DONE
Á a-acute
é e-acute
É e-acute
ú u-acute
Ú U-acute
ñ n-tilde
Ñ N-tilde
DONE
) | awk -F' ' '{print $1}' \
| tr -d '\n' \

View File

@ -43,6 +43,7 @@
vdirsyncer
xscreensaver
zathura
anki
# misc x11 progs
xclip

View File

@ -89,6 +89,10 @@ super + ctrl + 0
super + ctrl + shift + 0
bspc node -d aristrcon
# advance anki conjugation
super + bracketright
anki-advance-conjugation
# change a node to tiling, floating, or fullscreen
super + {t,f,s}
bspc node -t {tiled,floating,fullscreen}