You are not logged in.

#1 2017-06-24 14:44:54

lkblkb
Member
Registered: 2017-06-24
Posts: 4

[SOLVED] LXDE - Running bash script from Alt+F2 run box (new user)

I asked on SE but so far haven't gotten a solution so I thought I'd ask here.

https://unix.stackexchange.com/question … box/370944

How can I get a script to run from the lxpanelctl run box in LXDE? I have a script which can be run directly from a terminal using just the script name, and I added it successfully to the lxpanel main menu. Entering the full path in the run box works but I wonder if there isn't a way to let me simply type what I'd type in a terminal--the script name--and run the script.

Many thanks!

Lee

Last edited by lkblkb (2017-06-25 08:29:53)

Offline

#2 2017-06-24 14:47:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,545
Website

Re: [SOLVED] LXDE - Running bash script from Alt+F2 run box (new user)

What is the full path to the script?  It sounds like it is in a nonstandard PATH, but you add that location to your PATH variable in interactive shells.

However, that revision to the PATH is not made before you log in to X so the run box doesn't inherit it.  The solution is to set the PATH in the parent process to whatever starts X.

How do you start X?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2017-06-24 14:53:41

lkblkb
Member
Registered: 2017-06-24
Posts: 4

Re: [SOLVED] LXDE - Running bash script from Alt+F2 run box (new user)

Wow, fast reply. Thanks!

I'm afraid I don't know. My guess that the answer might be ... with LXDM? Sorry, I'm quite new to Linux.

Offline

#4 2017-06-24 15:50:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,545
Website

Re: [SOLVED] LXDE - Running bash script from Alt+F2 run box (new user)

lkblkb wrote:

I'm afraid I don't know.

So ... you're not using archlinux?

How did you install your system?

Mod note: moved to N.C. for now.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2017-06-25 07:42:57

lkblkb
Member
Registered: 2017-06-24
Posts: 4

Re: [SOLVED] LXDE - Running bash script from Alt+F2 run box (new user)

Yes, running Arch with the last pacman -Syu last week so it's fairly current.

I am running a live USB installed according to valleycat.org/foo/arch-usb.html. However this does not include any instructions for installing a DM or DE. I just used pacman to install the lxde group, as far as I recall. So x windows is being started however LXDE starts it by default. I never had to configure that myself.

Offline

#6 2017-06-25 08:23:31

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,475

Re: [SOLVED] LXDE - Running bash script from Alt+F2 run box (new user)

You are using LXDM which reads environmental variables from /home/<user>/.xprofile. So first add the location of your script to the path like this in .xprofile

export PATH="${PATH}:/home/<user>/bin"

Now any script you put in /home/<user>/bin will be available with just script name, from next login.

READ: Environmental variables & xprofile page on archwiki

Offline

#7 2017-06-25 08:37:52

lkblkb
Member
Registered: 2017-06-24
Posts: 4

Re: [SOLVED] LXDE - Running bash script from Alt+F2 run box (new user)

Somehow my installation does not have ~/.xprofile.

The script I'm trying to run was originally in ~/bin. I just copied it to /usr/local/bin and now it will run from the lxpanel run box. So it seems ~/bin is indeed missing from $PATH as sourced by LXDM--probably /etc/profile. That's just a guess though, based on the contents of /etc/lxdm/Xsession, which has /etc/profile as the first thing under Load profile. None of the other locations listed actually contain anything.

Marking as solved but anyone is free to comment further big_smile

Thanks Trilby and Docbroke!

Offline

#8 2017-06-25 09:26:55

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,475

Re: [SOLVED] LXDE - Running bash script from Alt+F2 run box (new user)

You can just create .xprofile file in your home folder and add bin folder to that. That will avoid using superuser previlages every time you need to edit or add new custom scripts.

Offline

Board footer

Powered by FluxBB