[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Looking for alias-like behavior that works with Alt-F2



Aubrey Raech wrote:
> do it, and is amost certainly the least elegant or correct way to

I think shell scripts would be more elegant than symlinks.

  #!/bin/sh
  exec gnome-terminal "$@"

> solve this problem. I shouldn't need root privileges to make shortcut
> names like this!

You don't need to be root.  You need to be in group 'staff'.  (And
group 'adm' too, to read /var/log* files.)

  # adduser YOU staff
  # adduser YOU adm

Then log out and then log back in again.  Groups are assigned when you
log into your machine.  So you need to log in again in order to have
access to those groups.

Now that you are in group staff you can write to /usr/local and create
local scripts in /usr/local/bin/ easily.  And you do not need to be
root to do it.  Just be yourself.

> The reason this is a problem at all is because the Alt-F2 run dialog
> does not respect bash settings.

Since it isn't bash there isn't any reason for it to.

> Usually I would put "alias gt=gnome-terminal" in my .bashrc, but
> that isn't read by whatever mechanism Alt-F2 uses to execute
> things.

GNOME reads Alt-F2.  GNOME is not bash.

> I have a few ideas:
> 
> 1. Change my $PATH to include something like ~/bin and put all of my
>    symlinks there instead.
> 
> I was told that my .profile does this automatically, which it should,
> but does that affect the X session or only shells?

It should.  It could.  But it doesn't.  Put it in your .xsessionrc
file which is read by /etc/X11/Xsession when X starts.  This is a
/bin/sh shell and not a /bin/bash shell so no bash syntax.  Use only
portable shell syntax.

In file $HOME/.xsessionrc put:

  PATH=$HOME/bin:$PATH

> 2. It seems weird to have to use symlinks to do this, but I don't know
>    where Alt-F2 gets its information.

It just executes commands.  So anything you invoke must be a program
found on PATH.

>    Is there some place I can put aliases that will be recognized by
>    the Run dialog?

Just create a shell script to do what you want.  That is trouble free.

> 3. What about ~/.xsession and the like? Are those even read by gdm3? I
>    think that's more for startx and xdm than it is for gdm as far as I
>    can tell from the man pages.

I use ~/.xsession to have it source my .profile.  I do this.  But it
is too much to explain simply.

File ~/.xsession has:

  #!/bin/bash --login
  exec x-session-manager

And it must be executable.  If it is executable then it is a script
and is executed.  If not executable then it is run with an explicit
'/bin/sh' upon it (in /etc/X11/Xsession) which won't have the right
effect.  And then you must start the "default" session.  If you pick a
window manager then it will avoid this file.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: