# Using Yad for ssh-askpass


<img src="/images/openssh.png" alt="OpenSSH" width="100px" style="float: left; margin-right: 10px; margin-bottom: 10px;" />

ssh-askpass is an X11 application for passing a user's SSH Key passphrase
to ssh-add [ssh-add(1)](https://man.openbsd.org/ssh-add). But it only works
with X11. And I'm on Wayland now.

## Solution

Yad.  [Yad](https://github.com/v1cont/yad) is Yet Another Dialog ala Zenity
or Dialog.  It allows for taking in input and passing it to something else
in a similar way to the way ssh-askpass worked with X11.

## A screenshot
This is how my yad-askpass window looks:

![yad-askpass](/images/yad-askpass.png)

## The code

I run [yad_askpass](https://git.erdelynet.com/mike/dotfiles/src/branch/main/.local/bin/yad-askpass)
out of my $HOME/.local/bin directory.

The script looks like this:

```bash
#!/bin/sh

ontop='--on-top'
unset css
width=350

/usr/bin/yad --title 'Enter SSH Key Passphrase' $ontop --css "$css" --width $width --center \
  --fixed --entry --hide-text --entry-label='Enter SSH Key passphrase'
```

Since I have my screenlocker forget my SSH Passphrases and lock my ssh keys
whenever my screen locks, I end up typing this password 20 times a day (at
least).


