You are not logged in.

#1 2022-12-14 16:51:09

calathea
Member
Registered: 2022-12-14
Posts: 7

[SOLVED] .initrc does not find command when started from .zprofile

I have installed successfully installed xmonad through cabal and set up an .xinitrc which calls `exec xmonad` (the rest is copied over from the original as describe here: https://wiki.archlinux.org/title/Xinit#xinitrc ).
I have also created a .xserverrc files as describe here: https://wiki.archlinux.org/title/Xinit#xserverrc

The xinit and startx commands both work and produce the expected result.


However i now want to autostart x at login as described here https://wiki.archlinux.org/title/Xinit# … X_at_login and have created a set my .zprofile accordingly.

When i try to log in x starts and quickly shuts down again, part of the console output tells me:

/home/username/.xinitrc: line 51: exec: xmonad: not found

Something must be different in the way startx is called but can not figure out what exactly it is or how to fix it.

I am not quite sure yet if https://wiki.archlinux.org/title/System … ay_manager is meant as additional help for a start from .zprofile or is describing different approaches. A first try with the xlogin-git package did not seem to work, however if it not necessarily part of the process i am not interested in additional packages anyway.

Thanks in advance for you help!

Last edited by calathea (2022-12-15 13:29:26)

Offline

#2 2022-12-14 16:53:25

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] .initrc does not find command when started from .zprofile

Where is xmonad installed to? I'm guessing it's a $PATH issue.

Offline

#3 2022-12-14 17:12:11

calathea
Member
Registered: 2022-12-14
Posts: 7

Re: [SOLVED] .initrc does not find command when started from .zprofile

xmonad is installed with the commands given here https://xmonad.org/INSTALL.html

cabal install --package-env=$HOME/.config/xmonad --lib xmonad xmonad-contrib
cabal install --package-env=$HOME/.config/xmonad xmonad

$PATH is as follows_

/home/user/.cabal/bin
/home/user/.ghcup/bin
/usr/local/sbin
/usr/local/bin
/usr/bin
/usr/bin/site_perl
/usr/bin/vendor_perl
/usr/bin/core_perl

Does that mean the .config/xmonad folder has to be added to $PATH?

Last edited by calathea (2022-12-14 17:13:12)

Offline

#4 2022-12-14 17:13:39

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] .initrc does not find command when started from .zprofile

that's your $PATH after you have an interactive shell. It's not your $PATH while .zprofile is running, and that's what's causing your problem. Setting it in .zshrc, I assume?

Offline

#5 2022-12-14 17:19:37

calathea
Member
Registered: 2022-12-14
Posts: 7

Re: [SOLVED] .initrc does not find command when started from .zprofile

ah, that makes sense. What are you assuming i am setting in .zshrc?

Would it be so simple then to add .cabal/bin to PATH inside of the .zprofile file?

(And how could I have found out, i.e. "compared" PATH in those situations?)

Offline

#6 2022-12-14 17:23:31

calathea
Member
Registered: 2022-12-14
Posts: 7

Re: [SOLVED] .initrc does not find command when started from .zprofile

It seems to be exactly that simple,
thank you very much!

Offline

#7 2022-12-14 18:11:28

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

Re: [SOLVED] .initrc does not find command when started from .zprofile

Note that adding to PATH is your shellrc is generally a bad idea anways as the shellrc could be sourced multiple times in nested shells.  Setting / appending-to PATH should be done in your shell profile - and your current error is just one of many reasons why this is preferred.


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

Offline

Board footer

Powered by FluxBB