Note: Edited for clarification
Ramiferous And would this go in ~/.profile rather than my ~/.shrc
The other way around.
~/.profile is only executed if the shell is a login shell; the other one is executed by any interactive shell. So, you want the latter (whose name depends on the shell--see specific man pages) to set
Yes, it would. Since the
pass command is running inside xterm, it (or whatever gpg program it calls) can get the pseudo-tty name it is running in by just running
tty(1) if GPG_TTY is unset.
Ramiferous however is there any other reason I should do this?
It's a default backup, but, you could use it--with major caveats--to run
pass the way you were trying to originally ie. without an
xterm. This failed because no xterm means no tty to do I/O to. But, you can, say, do I/O to some other terminal instead. Try it out yourself. Open multiple xterms; run
tty in each window; then, in a separate window type:
GPG_TTY=/dev/pts/N gpg-connect-agent "GET_PASSPHRASE X X X Password+please" /bye
Replace N with tty-number of the pseudo-ttys you noted earlier.
Ramiferous Is it possible to launch an xterm and actually specify a custom WM_CLASS(STRING) ?
If you're talking about the X property WM_CLASS, then yes. Use
xprop to set properties.
pin Yes, but it will affect all launched instances.
xterm has a
-name option to set a custom name. I don't know what it is that you guys are trying to do with X properties, but, you can use that as a basis to identify specific xterm windows.