You are not logged in.

#1 2022-03-20 00:50:54

Zaedus
Member
Registered: 2021-07-14
Posts: 9

[SOLVED] PKGBUILD: Install global alacritty config

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

#2 2022-03-20 11:23:34

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] PKGBUILD: Install global alacritty config

man alacritty wrote:

       --config-file <config-file>
              Specify alternative configuration file

              Alacritty 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.yml

              On 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 .

See https://wiki.archlinux.org/title/Dotfiles


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2022-03-20 12:15:23

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] PKGBUILD: Install global alacritty config

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).

Offline

#4 2022-03-20 12:52:03

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] PKGBUILD: Install global alacritty config

Raynman wrote:
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.....


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2022-03-20 14:06:27

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] PKGBUILD: Install global alacritty config

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

Raynman wrote:

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

#6 2022-03-20 19:11:36

Zaedus
Member
Registered: 2021-07-14
Posts: 9

Re: [SOLVED] PKGBUILD: Install global alacritty config

Lone_Wolf wrote:

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

Board footer

Powered by FluxBB