Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to change login startup file location #110

Open
amarz45 opened this issue Dec 2, 2024 · 1 comment
Open

Option to change login startup file location #110

amarz45 opened this issue Dec 2, 2024 · 1 comment

Comments

@amarz45
Copy link

amarz45 commented Dec 2, 2024

Currently, the login startup file is located in $home/.rcrc. I would like to put it in $XDG_CONFIG_HOME/rc/init.rc, similar to how the Fish shell does it. Maybe it should check if an environment variable is set and source it, otherwise source $home/.rcrc. Or perhaps a command-line option.

@SollyMollyDolly
Copy link

SollyMollyDolly commented Feb 4, 2025

You can make it use any location you want by editing the source code of main.c and changing
rcrc = concat(varlookup("home"), word("/.rcrc", NULL))->w; to rcrc = /path/to/my/.rcrc
then changing
fd = rc_open(rcrc, rFrom); to fd = open(rcrc, O_CREAT, O_RDWR);
You may have to also add #include <fcntl.h> to access the open function

Then simply recompile and install with sudo make install, just be aware that you can't have rc running or set as login shell when you run the command else it will fail.

Also you may be able to just change
rcrc = concat(varlookup("home"), word("/.rcrc", NULL))->w; to rcrc = concat(varlookup("XDG_CONFIG_HOME"), word("/rc/init.rc", NULL))->w; but I haven't tried that, the other solution works 100% guaranteed tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants