This commit is contained in:
tavo 2025-09-20 20:17:31 -06:00
parent 2ff01bba16
commit 30c09bfa87
11 changed files with 135 additions and 13 deletions

View file

@ -31,7 +31,7 @@ bindsym Shift+XF86AudioLowerVolume exec micdown
bindsym Shift+XF86AudioMute exec micmute bindsym Shift+XF86AudioMute exec micmute
bindsym XF86MonBrightnessUp exec brightup bindsym XF86MonBrightnessUp exec brightup
bindsym XF86MonBrightnessDown exec brightdown bindsym XF86MonBrightnessDown exec brightdown
bindsym Print exec $prtsc bindsym Print exec prtsc
#bindsym $mod+Shift+c exec clipman pick -t wofi -T'--show dmenu -I' #bindsym $mod+Shift+c exec clipman pick -t wofi -T'--show dmenu -I'
bindsym $mod+1 workspace " 1 " bindsym $mod+1 workspace " 1 "
@ -48,7 +48,6 @@ bindsym $mod+comma workspace next_on_output
bindsym $mod+period workspace prev_on_output bindsym $mod+period workspace prev_on_output
bindsym $mod+Shift+q reload bindsym $mod+Shift+q reload
bindsym $mod+p exec menu-power
bindsym $mod+c kill bindsym $mod+c kill
bindsym $mod+$left focus left bindsym $mod+$left focus left
bindsym $mod+$down focus down bindsym $mod+$down focus down

7
scripts/gtype Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
if [ "$GDK_BACKEND" = "x11" ]; then
xdotool type --file -
elif [ "$GDK_BACKEND" = "wayland" ]; then
echo "add wtype"
fi

View file

@ -1,8 +1,92 @@
#!/bin/sh #!/bin/sh
# menu for 'pass' PASSWORD_STORE_DIR=
PASSWORD_STORE_DIR="$HOME/.local/share/password-store" PASSWORD_STORE_DIR="${PASSWORD_STORE_DIR:-"$XDG_DATA_HOME"/password-store}"
MENU="$HOME/.config/scripts/menu/menu" MENU="menu "dmenu" """
password="$(find "$PASSWORD_STORE_DIR" -type f -name '*.gpg' | sed "s@$PASSWORD_STORE_DIR/@@g ; s@.gpg@@g" | $MENU "dmenu" "Pass:")" if ! [ -d "$PASSWORD_STORE_DIR" ]; then
echo "error: could not find password-store directory"
exit 1
fi
! [ -z "$password" ] && printf '%s' "$password" || exit 1 passw="$(find "$PASSWORD_STORE_DIR" -type f -name '*.gpg' | while read s; do
name="${s#"$PASSWORD_STORE_DIR"/}"
name="${name%.gpg}"
echo "$name"
done | $MENU)"
if [ -z "$passw" ]; then
exit 0
fi
contents="$(pass "$passw")"
counter=0
field="$(echo "$contents" | while read -r line; do
counter=$((counter + 1))
if [ "$counter" -eq 1 ]; then
echo "󰌾 Password"
echo "󰦨 All"
fi
case "$line" in
user:* | User:* | USER:*)
echo " Username"
;;
email:* | Email:* | EMAIL:*)
echo "󰇮 Email"
;;
otpauth:* | Otpauth:* | OTPAUTH:*)
echo "󰦯 OTP"
;;
*) ;;
esac
done | $MENU)"
counter=0
echo "$contents" | while read -r line; do
counter=$((counter + 1))
if [ "$counter" -eq 1 ]; then
case "$field" in
*Password)
echo "$line"
exit 0
;;
*All)
echo "$contents"
exit 0
;;
esac
fi
case "$line" in
user:* | User:* | USER:*)
case "$field" in
*Username)
c="${line#*:}"
c="${c# }"
echo "$c"
exit 0
;;
esac
;;
email:* | Email:* | EMAIL:*)
case "$field" in
*Email)
c="${line#*:}"
c="${c# }"
echo "$c"
exit 0
;;
esac
;;
otpauth:* | Otpauth:* | OTPAUTH:*)
case "$field" in
*OTP)
pass otp "$passw"
exit 0
;;
esac
;;
*) ;;
esac
done

7
scripts/menu/menu-pass-copy Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
p="$(menu-pass)"
if [ -n "$p" ]; then
printf '%s' "$p" | clip
fi

7
scripts/menu/menu-pass-gtype Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
p="$(menu-pass)"
if [ -n "$p" ]; then
printf '%s' "$p" | gtype
fi

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
options="󰀻:Run 󰌾:Password 󰦯:OTP 󰕾:Output 󰍬:Input 󰱱:Emoji 󰃀:Open_Bookmark 󰆏:Copy_Bookmark 󰐥:Power" options="󰀻:Run 󰌾:Password 󰕾:Output 󰍬:Input 󰱱:Emoji 󰃀:Open_Bookmark 󰆏:Copy_Bookmark 󰐥:Power"
separator=" " separator=" "
chosen="$(for o in $options; do chosen="$(for o in $options; do
@ -11,16 +11,15 @@ chosen="${chosen#*"$separator"}"
case "$chosen" in case "$chosen" in
Run) menu "run" "" ;; Run) menu "run" "" ;;
Password) menu-pass ;; Password) menu-pass-gtype ;;
OTP) menu-otp ;;
Output) menu-output ;; Output) menu-output ;;
Input) menu-input ;; Input) menu-input ;;
Emoji) menu-copy-emoji ;; Emoji) menu-emoji-copy ;;
Open_Bookmark) menu-open-bookmark ;; Open_Bookmark) menu-bookmarks-open ;;
Copy_Bookmark) menu-copy-bookmark ;; Copy_Bookmark) menu-bookmarks-copy ;;
Power) menu-power ;; Power) menu-power ;;

View file

@ -0,0 +1,7 @@
#!/bin/sh
pinentry_script="$HOME/.config/scripts/anypinentry"
gpg_conf_file="$HOME/.local/share/gnupg/gpg-agent.conf"
printf 'pinentry-program %s\n' "$pinentry_script" >"$gpg_conf_file"
chmod 600 "$gpg_conf_file"
gpg-agent reload

View file

@ -0,0 +1,12 @@
/* Do not label equations unless they have an <identifier> */
#show: body => {
for elem in body.children {
if elem.func() == math.equation and elem.block {
let numbering = if "label" in elem.fields().keys() { "(1)" } else { none }
set math.equation(numbering: numbering)
elem
} else {
elem
}
}
}