You are not logged in.
Manjaro has a package named maia-console that uses a shell script to echo escape codes to the TTY with a systemd service so the colourscheme is updated before login. I've modified it to be configured to output a base16 theme of choice set through a config file instead of the original hardcoded colours. This is the first time I'm writing a package so I'd really appreciate a review of the PKGBUILD and thoughts on whether its suitable for upload to the AUR.
Source: https://github.com/masala-man/base16-console
PKGBUILD:
# Maintainer: Ayush Shenoy <masala_man@protonmail.com>
pkgname=base16-console
pkgver=1.0
pkgrel=6
pkgdesc="Base16 themes for the console and shell dialog"
arch=('any')
license=('GPL')
depends=('systemd')
backup=('etc/systemd/system/getty@.service.d/base16-console.conf')
install="$pkgname.install"
source=("$pkgname"
"$pkgname.conf"
"$pkgname@.service"
'dialogrc'
'base16_themes.tar.gz'
'base16consolerc')
md5sums=('0a9d9c3e9177625b9b1d4af865679a0e'
'f66e62b940fc92250ee12e36725ffa01'
'2e05f72efe00e004874ffbba19bb10cb'
'0116a239d6c4be36c9782217d4008a3f'
'0bc0676f0b8b3640f866d4e4728c3575'
'c64f0e353de41e24d968ad0e96974ba6')
package() {
install -Dm755 $pkgname $pkgdir/usr/bin/$pkgname
install -Dm644 $pkgname@.service $pkgdir/etc/systemd/system/$pkgname@.service
install -Dm644 $pkgname.conf $pkgdir/etc/systemd/system/getty@.service.d/$pkgname.conf
install -Dm644 base16consolerc $pkgdir/etc/base16consolerc
install -Dm644 themes/* -t $pkgdir/usr/share/$pkgname/themes
# install -Dm644 dialogrc $pkgdir/etc/skel/.dialogrc
}
Offline
You should quote "$pkgdir" as the build would fail/not work as expected if someone has a space/other special character in their $pkgdir path. Also for general security/verifiability it would probably be preferable to use sha256sums or so instead of md5sums. Other than that I'm not seeing anything blatantly off. You probably also want to change source to actually grab something off of the github link, e.g. a commit/tag (... or opting for a VCS package) instead of including files directly.
Last edited by V1del (2022-11-30 10:23:09)
Offline
Package supplied systemd units should be placed in /usr/lib/systemd this also allows the .install file to be removed as the hook /usr/share/libalpm/hooks/30-systemd-daemon-reload.hook will then be triggered.
Offline
Is there a reason you are not just using setvtrgb? My script uses just one command rather than 16 seperate echos. And with this approach you'd not need variables for the user preferences, their file would just be a list of hex codes, and they'd be fed directly to setvtrgb. Then at this point you'd realize you'd not need your script at all, and the systemd service could just run setvtrb directly with the config file as a parameter.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
The source gives a 404 ...
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline