You are not logged in.
How can I put the /usr/bin upper in the PATH? When I run the which command, it gives me something like this: /sbin/binary, but sbin is symlink to /usr/bin. And I don't think that symlink should be placed higher than /usr/bin. How can I put the /usr/bin/ upper in the PATH? I don't want it to be local; I want it to be global.
Offline
/sbin shouldn't be in PATH at all, and it's not by default. Check your shell configs.
Offline
/sbin shouldn't be in PATH at all, and it's not by default. Check your shell configs.
I use fish shell as my default ones. I searched for the PATH keyword in the config.fish file, and it gave this lines:
set -gx PATH "$PATH:/home/aljustiet/.local/bin"
set -gx PATH "$PATH:/home/aljustiet/Documents/platform-tools"
set -gx PATH "$PATH:/home/aljustiet/go/bin"Offline
On Arch “/sbin” is a symlink to “/usr/bin”, so there is no difference⁽¹⁾ which one you put higher. There is nothing to fix.
In case this would happen to another directory, one that would be a problem, the right question to ask is determining what modifies PATH and eliminating that factor. See what is invoked in your shell’s configuration, possibly also anything executed during DE’s start (like “~/.xinitrc” if using xorg) etc. Additional things may be present in “/etc/profile.d/”.
As a last resort you might patch PATH at some later stage (e.g. “~/.profile”). But this shouldn’t be necessary, if a cleaner solution is possible.
____
⁽¹⁾ To be technically correct: unless the program checks the name with which it was invoked. But a program generally shouldn’t change its behavior based on which binaries directory it was put in.
Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!
Offline
Ah fish. Arch isn't set up for that, it sets up shells that deal with /etc/profile correctly. You have to do it all yourself.
Offline
On Arch “/sbin” is a symlink to “/usr/bin”, so there is no difference⁽¹⁾ which one you put higher. There is nothing to fix.
In case this would happen to another directory, one that would be a problem, the right question to ask is determining what modifies PATH and eliminating that factor. See what is invoked in your shell’s configuration, possibly also anything executed during DE’s start (like “~/.xinitrc” if using xorg) etc. Additional things may be present in “/etc/profile.d/”.
As a last resort you might patch PATH at some later stage (e.g. “~/.profile”). But this shouldn’t be necessary, if a cleaner solution is possible.
____
⁽¹⁾ To be technically correct: unless the program checks the name with which it was invoked. But a program generally shouldn’t change its behavior based on which binaries directory it was put in.
I use Ly as DM, and Hyprland as WC.
Offline
Ah fish. Arch isn't set up for that, it sets up shells that deal with /etc/profile correctly. You have to do it all yourself.
I changed the default shell from fish to bash and rebooted, but when I type which ls, it still gives the binaries from the /sbin symlink.
Offline
How about with a new, clean user account? How about just logged into a TTY?
Last edited by Scimmia (2024-08-20 05:19:16)
Offline
How about with a new, clean user account? How about just logged into a TTY?
I created the user test with the bash as the default shell. I logged in using the ly DM, and there, when I run the which ls, it still gives the /sbin/ls. Should I try to do it without DM?
Last edited by aljustiet (2024-08-20 05:39:51)
Offline
The Ly DM was setting up the default PATH variable, so I changed the config to look like this
path = /usr/bin:/usr/local/sbin:/usr/local/binOffline
Stop using ly, it breaks many more things and will generally lead to weird bugs in your session.
Offline
Stop using ly, it breaks many more things and will generally lead to weird bugs in your session.
Should I use lemurs instead?
Offline
Do you actually need a DM? How many users use that system?
Online
Do you actually need a DM? How many users use that system?
Only one.
Offline
So "no".
https://wiki.archlinux.org/title/Getty# … al_console
https://wiki.archlinux.org/title/Start_X_at_login
And then just autostart some screenlocker in your xinitrc, you'll boot straight into a locked GUI session, enter your password to unlock and can use the system immediately.
(It's technically not required to auto-lock the session, but it provides a level of protection not necessarily equal to an actual login, but probably sufficient? Basically depends on whether you've an encrypted $HOME)
Online
So "no".
Does it work with Wayland compositor?
Last edited by aljustiet (2024-08-21 05:08:07)
Offline
It's even simpler under Wayland 'cos you don't have to source the /etc/X11/xinit/xinitrc.d/ files.
Just add the launch command to ~/.profile (or ~/.bash_profile if you're still using bash) to start the compositor automatically on login.
I launch different desktops depending on the TTY number:
case "$(tty)" in
/dev/tty1) exec sway > ~/.local/share/sway/sway.log 2>&1 ;;
/dev/tty2) exec startx ;;
/dev/tty3) setfont latarcyrheb-sun32 ; exec tty-clock -cs
esacAnd please don't full-quote unnecessarily, it degrades the readability of the thread.
Jin, Jîyan, Azadî
Offline