Re: a 'who called me?' variable?
On Thursday 19 July 2001 04:26 pm, Craig Dickson wrote:
> Dan Berdine wrote:
> > Is there an environment variable in bash that can be used to tell
> > where bash is running from? For example, is there a variable I can
> > test in my .bashrc to tell whether I am running remotly, from a
> > tty, from konsole, an xterm, etc.? I'v looked at the Advanced
> > Scripting HOWTO, but the only thing that looked promising was
> > "$BASH_ENV" which seems to be empty.
>
> I use the following script, which determines the appropriate value
> for the DISPLAY variable (for the benefit of X apps) appropriately
> according to how I'm accessing the system. It probably isn't perfect
> (I'm sure if you have two monitors, it may screw up, or if you're on
> a graphics terminal connected by a serial line, or some other unusual
> connection), but it works for me.
>
This seems to work, but it doesn't really help me any.
Maybe I should give a little more background, tho some of the solutions
given so far are basicly sufficient.
There is a bug with AntiAliased fonts under KDE which causes things to
look pretty nasty in Konsole sometimes. A workaround is to set
QT_XFT=0 before launching Konsole so it doesn't use AA. However, then
everything launched with Konsole will be without AA, so I want to add
something in .bashrc that checks to see if I'm using Konsole (knowing
I'm in X (:0.0) isn't enough, nor is knowing I'm in X on my local
machine (I sometimes use Konsole remotely)) and if I am, sets QT_XFT=1,
so AA gets turned back on and I can launch apps again. Its not that
big of a deal, I jsut get a little error when I log on a tty or
remotely without the check, but I'd rather get rid of it.
I think I'v got it good enough now, tho. This is a hack, afterall, it
doesn't have to be all that elegant...
-Dan
Reply to: