You are not logged in.
I'm trying to put together some nice packages to ease the installation and updating process of my system configs and I want to have a global alacritty config since I don't believe there is a good way of installing a package on a user to user basis. Anyway, my solution is to install alacritty in a /usr/share directory and then alias alacritty to be "/usr/bin/alacritty --config-file /usr/share/my-configs/alacritty.yml". The problem comes when I need to alias that globally. I've tried installing a script into "/etc/profile.d" which aliases, but that only works for a login shell and since aliases aren't inherited like variables are, it sadly doesn't work. If there was a global directory similar to "/etc/profile.d" which is executed for non-login interactive shells that would solve my problem. As it stands I can't find a way to make an alias global without *editing* a file, which isn't practical for an installable package. Does anyone have any insight in this issue that could maybe help?
Last edited by Zaedus (2022-03-21 01:39:15)
Offline
--config-file <config-file>
Specify alternative configuration fileAlacritty looks for the configuration file at the following paths:
1. $XDG_CONFIG_HOME/alacritty/alacritty.yml
2. $XDG_CONFIG_HOME/alacritty.yml
3. $HOME/.config/alacritty/alacritty.yml
4. $HOME/.alacritty.ymlOn Windows, the configuration file is located at %APPDATA%\alacritty\alacritty.yml.
As you can see alacritty doesn't support a global config.
I doubt very much a 'global alias' will work, but there's a workaround to apply global stuff on a per-user base :
create a wrapper script for the binary.
Example :
Oolite expects to be able to use 2 user folders and crashes when they are not present..
The oolite installer does create those folders, but archlinux pacakges are not allowed to touch user folders.
In order to ensure the folders were present I created a simple wrapper script that is still used by the oolite package.
Check https://aur.archlinux.org/cgit/aur.git/ … e?h=oolite
For your custom alacritty package you should rename /usr/bin/alacritty to something else, say /usr/bin/alacritty-org .
create a script /usr/bin/alacritty that will ensure the alacritty config file you want to use is in a location alacritty can find and then runs /usr/bin/alacritty-org .
Another approach is to not change PKGBUILDs / packages but store dotfiles somewhere else .
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
alias alacritty to be "/usr/bin/alacritty --config-file /usr/share/my-configs/alacritty.yml".
You could put that in a script instead of an alias and install this wrapper script in /usr/local/bin (or another dir that you put in $PATH before /usr/bin).
Offline
Zaedus wrote:alias alacritty to be "/usr/bin/alacritty --config-file /usr/share/my-configs/alacritty.yml".
You could put that in a script instead of an alias and install this wrapper script in /usr/local/bin (or another dir that you put in $PATH before /usr/bin).
I think that the OP's point was that they wanted this all to be configured via a package.
Packages shouldn't install anything to /usr/local.....
Offline
Normal packages, sure. This "my-configs" is already a somewhat creative and more personalised usage that IMHO isn't great, but OP is free to use this over other config management systems and can then also weigh the pros and cons of putting this
in /usr/local/bin (or another dir that you put in $PATH before /usr/bin).
where PATH could be modified via an /etc/profile.d/ snippet in the same my-configs package.
Offline
I doubt very much a 'global alias' will work, but there's a workaround to apply global stuff on a per-user base :
create a wrapper script for the binary.
Ahhh this helps a lot! Thank you so much!
Offline