[launcher] Add gopass launcher

This commit is contained in:
Sebastian Schulze 2021-06-10 09:40:35 +02:00
parent 081559a915
commit 1f7fb0467f
Signed by: bascht
GPG Key ID: 5BCB1D3B4D38A35A
3 changed files with 25 additions and 3 deletions

View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -x
QUERY=$1
SWAYSOCK=/run/user/$UID/sway-ipc.$UID.$(pidof sway).sock
export SWAYSOCK
if [ -z "$QUERY" ]; then
QUERY=''
fi
input=$(gopass list -f | fzf -q "$QUERY")
printf '%s' "$(gopass show -o "$input")" | wl-copy
swaymsg exec -- notify-send "gopass" "Copied ${input} to clipboard." -t 2000
sleep 5
wl-copy --clear
swaymsg exec -- notify-send "gopass" "Cleared clipboard" -t 1000

View File

@ -19,8 +19,12 @@ then
COMMAND=~/bin/launcher-bookmarks
elif [[ "$1" == "clipboard" ]]
then
FZF_DEFAULT_OPTS="--prompt='📋 ' --algo=v1 --bind 'tab:up' --cycle --read0 ${FZF_DEFAULT_OPTS}"
COMMAND=launcher-clipboard
FZF_DEFAULT_OPTS="--prompt='📋 ' --algo=v1 --bind 'tab:up' --read0 ${FZF_DEFAULT_OPTS}"
COMMAND=~/bin/launcher-clipboard
elif [[ "$1" == "gopass" ]]
then
FZF_DEFAULT_OPTS="--prompt='🔑 ' --algo=v1 --bind 'tab:up' --read0 ${FZF_DEFAULT_OPTS}"
COMMAND=~/bin/launcher-gopass
else
exec alacritty --class launcher --config-file ~/.config/alacritty/alacritty-launcher.yml --option "window.dimensions={lines: 40, columns: 80}" -e ~/bin/launcher-run
fi;

View File

@ -373,7 +373,7 @@ mode $mode_run {
bindsym $mod+shift+d exec $menu bookmarks; mode "default"
bindsym r exec rofi -show run; mode "default";
bindsym p exec rofi-pass; mode "default";
bindsym p exec $menu gopass; mode "default";
bindsym s exec swytch; mode "default"
bindsym tab exec swytch; mode "default"