You are not logged in.

#1 2010-11-03 22:04:44

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

[SOLVED] Xmonad and XMonad.Prompt.Shell - /home/user/bin scripts

Hello

I've exported my ~/bin directory to $PATH's, but commands I execute in Xmonad's shell prompt is not working. For example, I have "winxp.sh" in ~/bin/winxp.sh, but typing "winxp.sh" in the prompt window results in /bin/sh: winxp: command not found.

Is it possible to run these scripts, using the Xmonad shell prompt? They work fine in my terminal obviously.

Thanks

Last edited by valvet (2010-11-04 10:19:45)

Offline

#2 2010-11-03 22:10:05

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: [SOLVED] Xmonad and XMonad.Prompt.Shell - /home/user/bin scripts

Where did you do the export? The PATH needs to be exported in a process from which x/xmonad gets started, e.g. your login shell. Try adding it to ~./profile or ~/.bash_profile (whichever you're using). Then relogin and and the PATH should be set for xmonad, too.

Offline

#3 2010-11-03 22:13:26

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Xmonad and XMonad.Prompt.Shell - /home/user/bin scripts

hbekel wrote:

Where did you do the export? The PATH needs to be exported in a process from which x/xmonad gets started, e.g. your login shell. Try adding it to ~./profile or ~/.bash_profile (whichever you're using). Then relogin and and the PATH should be set for xmonad, too.

Hi hbekel

I export it in .bashrc, likea so

export PATH=$PATH:/home/michael/bin

Relogging does not change anything, xmonad wise.. I can run any script in ~/bin from my terminal fine, but not in the Xmonad prompt.

Offline

#4 2010-11-04 00:36:43

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [SOLVED] Xmonad and XMonad.Prompt.Shell - /home/user/bin scripts

how are you starting x?

Offline

#5 2010-11-04 00:41:51

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Xmonad and XMonad.Prompt.Shell - /home/user/bin scripts

brisbin33 wrote:

how are you starting x?

Currently from inittab, as it did not make a difference starting it either manual, or when logging in:

x:5:once:/bin/su michael -l -c '/usr/bin/startx -- -nolisten tcp -br -deferglyphs 16 >/dev/null 2>&1'

Before I did it from .bashrc (when logging into tty1).

.xinitrc

# start terminal emulation daemon
urxvtd -q -o -f &

# http://wiki.archlinux.org/index.php/Per_Application_Transparency
#xcompmgr &
#devilspie -a &

# set keyboard language, and enable restart X
setxkbmap dk -option terminate:ctrl_alt_bksp &

# set the cursor
xsetroot -cursor_name left_ptr

# disable anoying pc speaker.. it beeps after resume (s2ram -f)
xset -b

# set wallpaper
#sh /home/michael/.fehbg &
nitrogen --restore &

# hide mouse when not needed
unclutter -idle 5 &

# start dzen2 scripts
./dev/dzen2/scripts/rtop.sh &
./dev/dzen2/scripts/rbottom.sh &
./dev/dzen2/scripts/lbottom.sh &

# terminal
sleep 1
{
    urxvtc &
#    urxvtc -e "newsbeuter" &
}

# start xmonad
exec ck-launch-session dbus-launch --exit-with-session xmonad

Offline

#6 2010-11-04 05:13:44

kilgoretrout
Member
Registered: 2010-06-28
Posts: 25

Re: [SOLVED] Xmonad and XMonad.Prompt.Shell - /home/user/bin scripts

Create a text configuration file in your home directory called ".profile":

$ touch .profile

Open .profile in your favorite text editor and edit it by adding the following:

export PATH=$PATH:/home/michael/bin

Save the changes to .profile then open your .bashrc file and add the following line at the end:

source /home/michael/.profile

Save the changes then log out and log back in. Your ~/bin file should now be in PATH.

Offline

#7 2010-11-04 09:51:05

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Xmonad and XMonad.Prompt.Shell - /home/user/bin scripts

The problem is not that my bin folder is not being sourced.. as I wrote, I can run things fine from my terminal - but not from Xmonad's shell prompt.

Offline

#8 2010-11-04 10:19:26

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Xmonad and XMonad.Prompt.Shell - /home/user/bin scripts

Ok the great users of #xmonad fixed it.. all you had to do, is export the path BEFORE launching xmonad.. eg., not from the bashrc, but from .xinitrc or whatever.

Offline

#9 2010-11-04 11:05:41

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: [SOLVED] Xmonad and XMonad.Prompt.Shell - /home/user/bin scripts

Told you so in my first post... using .xinitrc works, but it's not really the proper place for this. Note that .bashrc is not equivalent to .profile, which is the main cause for your problem. See man bash, section INVOCATION for details.

Offline

#10 2010-11-04 11:26:01

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Xmonad and XMonad.Prompt.Shell - /home/user/bin scripts

hbekel wrote:

Told you so in my first post... using .xinitrc works, but it's not really the proper place for this. Note that .bashrc is not equivalent to .profile, which is the main cause for your problem. See man bash, section INVOCATION for details.

Yeah I just read it again, I thought that the .profile etc. were equivalent to .bashrc - that's why I diden't try it out. Thanks :-)

Offline

#11 2010-11-05 13:40:18

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [SOLVED] Xmonad and XMonad.Prompt.Shell - /home/user/bin scripts

Just for anyone else coming by this thread:

valvet wrote:
brisbin33 wrote:

how are you starting x?

Currently from inittab, as it did not make a difference starting it either manual, or when logging in:

x:5:once:/bin/su michael -l -c '/usr/bin/startx -- -nolisten tcp -br -deferglyphs 16 >/dev/null 2>&1'

#xmonad is correct that you must export PATH before starting xmonad (logically). 

on my main box, i startx at the end of my .bashrc; PATH is exported ahead of it so everything works.  on my htpc however, i use the inittab method but slightly different:

x:5:respawn:/bin/su xbmc -l -c "/bin/bash --login -c startx >/dev/null 2>&1"

using `bash --login` means .bashrc would be sourced and set PATH correctly too.  i agree with hbekel that .xinitrc is not the place to export a custom PATH.

Offline

Board footer

Powered by FluxBB