mirror of
https://github.com/javalsai/lidm.git
synced 2025-08-31 18:38:00 +02:00
Compare commits
3 Commits
947c92ce3f
...
master
Author | SHA1 | Date | |
---|---|---|---|
ddc38ef27f
|
|||
|
b3c8d3cbea | ||
5761838112 |
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@@ -132,6 +132,7 @@ jobs:
|
|||||||
path: lidm-riscv64
|
path: lidm-riscv64
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
# This build job is only symbolic, the behavior of the packaged Void Linux version may differ.
|
||||||
build-linux-amd64-musl:
|
build-linux-amd64-musl:
|
||||||
name: amd64-musl
|
name: amd64-musl
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@@ -147,7 +148,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd /workspace
|
cd /workspace
|
||||||
|
|
||||||
xbps-install -Sy
|
xbps-install -Syu xbps && xbps-install -yu
|
||||||
xbps-install -y git pam-devel make gcc bash git
|
xbps-install -y git pam-devel make gcc bash git
|
||||||
|
|
||||||
ARCH=amd64-musl GITHUB_STEP_SUMMARY=gss.out GITHUB_OUTPUT=go.out assets/github_scripts/build.sh
|
ARCH=amd64-musl GITHUB_STEP_SUMMARY=gss.out GITHUB_OUTPUT=go.out assets/github_scripts/build.sh
|
||||||
|
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
packages: "shellcheck"
|
packages: "shellcheck"
|
||||||
version: 1.0
|
version: 1.0
|
||||||
- run: find . -type f -name '*.sh' -not -path './assets/pkg/aur/*/src/*' | xargs shellcheck
|
- run: git ls-files "*.sh" "*/PKGBUILD" | xargs shellcheck --shell=bash
|
||||||
|
|
||||||
clangcheck:
|
clangcheck:
|
||||||
name: Clang
|
name: Clang
|
||||||
|
21
Makefile
21
Makefile
@@ -16,20 +16,21 @@ ALLFLAGS=$(CFLAGS) $(CPPFLAGS) -I$(IDIR)
|
|||||||
|
|
||||||
LIBS=-lpam
|
LIBS=-lpam
|
||||||
|
|
||||||
_DEPS = version.h log.h util.h ui.h ui_state.h config.h desktop.h auth.h ofield.h efield.h keys.h users.h sessions.h chvt.h macros.h launch_state.h
|
_DEPS = version.h log.h util.h ui.h ui_state.h config.h desktop.h desktop_exec.h auth.h ofield.h efield.h keys.h users.h sessions.h chvt.h macros.h launch_state.h
|
||||||
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
|
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
|
||||||
|
|
||||||
_OBJ = main.o log.o util.o ui.o ui_state.o config.o desktop.o auth.o ofield.o efield.o users.o sessions.o chvt.o launch_state.o
|
_OBJ = main.o log.o util.o ui.o ui_state.o config.o desktop.o desktop_exec.o auth.o ofield.o efield.o users.o sessions.o chvt.o launch_state.o
|
||||||
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
|
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
|
||||||
|
|
||||||
.git/HEAD:
|
INFO_GIT_REV?=$$(git describe --long --tags --always || echo '?')
|
||||||
|
INFO_BUILD_TS?=$$(date +%s)
|
||||||
|
|
||||||
$(IDIR)/version.h: Makefile .git/HEAD
|
$(IDIR)/version.h: Makefile
|
||||||
@tmp=$$(mktemp); \
|
@tmp=$$(mktemp); \
|
||||||
printf '' > $$tmp; \
|
printf '' > $$tmp; \
|
||||||
echo '#define LIDM_VERSION "'$(VERSION)'"' >> $$tmp; \
|
echo '#define LIDM_VERSION "'$(VERSION)'"' >> $$tmp; \
|
||||||
echo '#define LIDM_GIT_REV "'$$(git describe --long --tags --always || echo '?')'"' >> $$tmp; \
|
echo '#define LIDM_GIT_REV "'$(INFO_GIT_REV)'"' >> $$tmp; \
|
||||||
echo '#define LIDM_BUILD_TS '$$(date +%s) >> $$tmp; \
|
echo '#define LIDM_BUILD_TS '$(INFO_BUILD_TS) >> $$tmp; \
|
||||||
if ! cmp -s $$tmp $@; then \
|
if ! cmp -s $$tmp $@; then \
|
||||||
mv $$tmp $@; \
|
mv $$tmp $@; \
|
||||||
fi; \
|
fi; \
|
||||||
@@ -133,10 +134,12 @@ install-service-s6-etc:
|
|||||||
|
|
||||||
pre-commit:
|
pre-commit:
|
||||||
codespell
|
codespell
|
||||||
prettier --write "**/*.md"
|
prettier -c "**/*.md"
|
||||||
find . -type f -name '*.sh' -not -path './assets/pkg/aur/*/src/*' | xargs shellcheck
|
git ls-files "*.sh" "*/PKGBUILD" | xargs shellcheck --shell=bash
|
||||||
clang-format -i $$(git ls-files "*.c" "*.h")
|
clang-format -i $$(git ls-files "*.c" "*.h")
|
||||||
clang-tidy -p . $$(git ls-files "*.c" "*.h")
|
git ls-files -z "*.h" | \
|
||||||
|
parallel -j$$(nproc) -q0 --no-notice --will-cite --tty clang-tidy --quiet |& \
|
||||||
|
grep -v "warnings generated." || true
|
||||||
|
|
||||||
print-version:
|
print-version:
|
||||||
@echo $(VERSION)
|
@echo $(VERSION)
|
||||||
|
@@ -1,20 +1,32 @@
|
|||||||
pkgbase = lidm-bin
|
pkgbase = lidm-bin
|
||||||
pkgdesc = A fully colorful customizable TUI display manager made in C. (release binary)
|
pkgdesc = A fully colorful customizable TUI display manager made in C. (release binary)
|
||||||
pkgver = 1.2.3
|
pkgver = 1.2.3
|
||||||
pkgrel = 1
|
pkgrel = 3
|
||||||
url = https://github.com/javalsai/lidm
|
url = https://github.com/javalsai/lidm
|
||||||
arch = x86_64
|
arch = x86_64
|
||||||
|
arch = i686
|
||||||
|
arch = aarch64
|
||||||
|
arch = armv7h
|
||||||
|
arch = riscv64
|
||||||
license = GPL
|
license = GPL
|
||||||
depends = pam
|
depends = libpam.so
|
||||||
provides = lidm
|
provides = lidm
|
||||||
conflicts = lidm
|
conflicts = lidm
|
||||||
source = lidm::https://github.com/javalsai/lidm/releases/download/v1.2.3/lidm-amd64
|
source = lidm-default-theme-1.2.3.ini::https://raw.githubusercontent.com/javalsai/lidm/v1.2.3/themes/default.ini
|
||||||
source = default-theme.ini::https://raw.githubusercontent.com/javalsai/lidm/v1.2.3/themes/default.ini
|
source = lidm-1.2.3.1::https://raw.githubusercontent.com/javalsai/lidm/v1.2.3/assets/man/lidm.1
|
||||||
source = lidm.1::https://raw.githubusercontent.com/javalsai/lidm/v1.2.3/assets/man/lidm.1
|
source = lidm-config-1.2.3.5::https://raw.githubusercontent.com/javalsai/lidm/v1.2.3/assets/man/lidm-config.5
|
||||||
source = lidm-config.5::https://raw.githubusercontent.com/javalsai/lidm/v1.2.3/assets/man/lidm-config.5
|
|
||||||
sha256sums = a533b5aee3ffe04268f8d3ff8d7eb87f09d31fbe25e1b8b1ed29c42ef465bd4b
|
|
||||||
sha256sums = ffaa5fe2cf5011bf53c90f81bfec8585158d35f72c0666db0bd4d3866ae041ca
|
sha256sums = ffaa5fe2cf5011bf53c90f81bfec8585158d35f72c0666db0bd4d3866ae041ca
|
||||||
sha256sums = 7f2fb91f55088be1a9b1c93ecf5d6c1e437f369b56df2eacc9d10b00c93c39f8
|
sha256sums = 7f2fb91f55088be1a9b1c93ecf5d6c1e437f369b56df2eacc9d10b00c93c39f8
|
||||||
sha256sums = 0aa5755bdcc60ea80cd9ee0f89233ffaf22c6cee9db9da277274a62c6ed477d9
|
sha256sums = 0aa5755bdcc60ea80cd9ee0f89233ffaf22c6cee9db9da277274a62c6ed477d9
|
||||||
|
source_x86_64 = lidm-1.2.3-x86_64::https://github.com/javalsai/lidm/releases/download/v1.2.3/lidm-amd64
|
||||||
|
sha256sums_x86_64 = a533b5aee3ffe04268f8d3ff8d7eb87f09d31fbe25e1b8b1ed29c42ef465bd4b
|
||||||
|
source_i686 = lidm-1.2.3-i686::https://github.com/javalsai/lidm/releases/download/v1.2.3/lidm-i386
|
||||||
|
sha256sums_i686 = 75018578e68bffda9807de8a65e16eaed8a16c6cf2417a0b58c5d5bcfa603e45
|
||||||
|
source_aarch64 = lidm-1.2.3-aarch64::https://github.com/javalsai/lidm/releases/download/v1.2.3/lidm-aarch64
|
||||||
|
sha256sums_aarch64 = 1b81a1537a1e31ca1902cbc3b60add4ac712aa64fd4d266685f53372cc365882
|
||||||
|
source_armv7h = lidm-1.2.3-armv7h::https://github.com/javalsai/lidm/releases/download/v1.2.3/lidm-armv7
|
||||||
|
sha256sums_armv7h = e86f59509fe2366d6312b9bc9e8d89c14e9c049fd713a04c41dab49a848b1ada
|
||||||
|
source_riscv64 = lidm-1.2.3-riscv64::https://github.com/javalsai/lidm/releases/download/v1.2.3/lidm-riscv64
|
||||||
|
sha256sums_riscv64 = 3f0eb0315c523d367bac332641e5cd3c86cfd9aa4e7c14b2efc036937b97a598
|
||||||
|
|
||||||
pkgname = lidm-bin
|
pkgname = lidm-bin
|
||||||
|
@@ -1,29 +1,39 @@
|
|||||||
# shellcheck disable=SC2034,SC2148,SC2128,SC2154,SC2164
|
# shellcheck disable=SC2034,SC2154,SC2164
|
||||||
# Maintainer: javalsai <javalsai@proton.me>
|
# Maintainer: javalsai <javalsai@proton.me>
|
||||||
pkgname=lidm-bin
|
pkgname=lidm-bin
|
||||||
pkgver=1.2.3
|
pkgver=1.2.3
|
||||||
pkgrel=1
|
pkgrel=3
|
||||||
depends=('pam')
|
depends=('libpam.so')
|
||||||
pkgdesc="A fully colorful customizable TUI display manager made in C. (release binary)"
|
pkgdesc="A fully colorful customizable TUI display manager made in C. (release binary)"
|
||||||
arch=('x86_64')
|
arch=('x86_64' 'i686' 'aarch64' 'armv7h' 'riscv64')
|
||||||
url="https://github.com/javalsai/lidm"
|
url="https://github.com/javalsai/lidm"
|
||||||
license=('GPL')
|
license=('GPL')
|
||||||
provides=('lidm')
|
provides=('lidm')
|
||||||
conflicts=('lidm')
|
conflicts=('lidm')
|
||||||
source=(
|
source=(
|
||||||
"lidm::$url/releases/download/v$pkgver/lidm-amd64"
|
"lidm-default-theme-${pkgver}.ini::https://raw.githubusercontent.com/javalsai/lidm/v$pkgver/themes/default.ini"
|
||||||
"default-theme.ini::https://raw.githubusercontent.com/javalsai/lidm/v$pkgver/themes/default.ini"
|
"lidm-${pkgver}.1::https://raw.githubusercontent.com/javalsai/lidm/v$pkgver/assets/man/lidm.1"
|
||||||
"lidm.1::https://raw.githubusercontent.com/javalsai/lidm/v$pkgver/assets/man/lidm.1"
|
"lidm-config-${pkgver}.5::https://raw.githubusercontent.com/javalsai/lidm/v$pkgver/assets/man/lidm-config.5"
|
||||||
"lidm-config.5::https://raw.githubusercontent.com/javalsai/lidm/v$pkgver/assets/man/lidm-config.5"
|
|
||||||
)
|
)
|
||||||
sha256sums=('a533b5aee3ffe04268f8d3ff8d7eb87f09d31fbe25e1b8b1ed29c42ef465bd4b'
|
source_x86_64=("lidm-${pkgver}-x86_64::$url/releases/download/v$pkgver/lidm-amd64")
|
||||||
'ffaa5fe2cf5011bf53c90f81bfec8585158d35f72c0666db0bd4d3866ae041ca'
|
source_i686=("lidm-${pkgver}-i686::$url/releases/download/v$pkgver/lidm-i386")
|
||||||
|
source_aarch64=("lidm-${pkgver}-aarch64::$url/releases/download/v$pkgver/lidm-aarch64")
|
||||||
|
source_armv7h=("lidm-${pkgver}-armv7h::$url/releases/download/v$pkgver/lidm-armv7")
|
||||||
|
source_riscv64=("lidm-${pkgver}-riscv64::$url/releases/download/v$pkgver/lidm-riscv64")
|
||||||
|
sha256sums=('ffaa5fe2cf5011bf53c90f81bfec8585158d35f72c0666db0bd4d3866ae041ca'
|
||||||
'7f2fb91f55088be1a9b1c93ecf5d6c1e437f369b56df2eacc9d10b00c93c39f8'
|
'7f2fb91f55088be1a9b1c93ecf5d6c1e437f369b56df2eacc9d10b00c93c39f8'
|
||||||
'0aa5755bdcc60ea80cd9ee0f89233ffaf22c6cee9db9da277274a62c6ed477d9')
|
'0aa5755bdcc60ea80cd9ee0f89233ffaf22c6cee9db9da277274a62c6ed477d9')
|
||||||
|
sha256sums_x86_64=('a533b5aee3ffe04268f8d3ff8d7eb87f09d31fbe25e1b8b1ed29c42ef465bd4b')
|
||||||
|
sha256sums_i686=('75018578e68bffda9807de8a65e16eaed8a16c6cf2417a0b58c5d5bcfa603e45')
|
||||||
|
sha256sums_aarch64=('1b81a1537a1e31ca1902cbc3b60add4ac712aa64fd4d266685f53372cc365882')
|
||||||
|
sha256sums_armv7h=('e86f59509fe2366d6312b9bc9e8d89c14e9c049fd713a04c41dab49a848b1ada')
|
||||||
|
sha256sums_riscv64=('3f0eb0315c523d367bac332641e5cd3c86cfd9aa4e7c14b2efc036937b97a598')
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
install -Dm755 lidm "${pkgdir}/usr/bin/lidm"
|
cd "$srcdir"
|
||||||
install -Dm644 default-theme.ini "${pkgdir}/etc/lidm.ini"
|
|
||||||
install -Dm644 lidm.1 "${pkgdir}/usr/share/man/man1/lidm.1"
|
install -Dm755 "lidm-${pkgver}-$CARCH" "${pkgdir}/usr/bin/lidm"
|
||||||
install -Dm644 lidm-config.5 "${pkgdir}/usr/share/man/man5/lidm-config.5"
|
install -Dm644 "lidm-default-theme-${pkgver}.ini" "${pkgdir}/etc/lidm.ini"
|
||||||
|
install -Dm644 "lidm-${pkgver}.1" "${pkgdir}/usr/share/man/man1/lidm.1"
|
||||||
|
install -Dm644 "lidm-config-${pkgver}.5" "${pkgdir}/usr/share/man/man5/lidm-config.5"
|
||||||
}
|
}
|
||||||
|
@@ -1,13 +1,11 @@
|
|||||||
pkgbase = lidm-git
|
pkgbase = lidm-git
|
||||||
pkgdesc = A fully colorful customizable TUI display manager made in C. (last git commit)
|
pkgdesc = A fully colorful customizable TUI display manager made in C. (last git commit)
|
||||||
pkgver = 0.1.0.r0.g8071694
|
pkgver = 1.2.3.r3.g363deea
|
||||||
pkgrel = 1
|
pkgrel = 3
|
||||||
url = https://github.com/javalsai/lidm
|
url = https://github.com/javalsai/lidm
|
||||||
arch = any
|
arch = any
|
||||||
license = GPL
|
license = GPL
|
||||||
makedepends = git
|
makedepends = git
|
||||||
makedepends = make
|
|
||||||
makedepends = gcc
|
|
||||||
depends = pam
|
depends = pam
|
||||||
provides = lidm
|
provides = lidm
|
||||||
conflicts = lidm
|
conflicts = lidm
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
# shellcheck disable=SC2034,SC2148,SC2128,SC2154,SC2164
|
# shellcheck disable=SC2034,SC2154,SC2164
|
||||||
# Maintainer: javalsai <javalsai@proton.me>
|
# Maintainer: javalsai <javalsai@proton.me>
|
||||||
pkgname=lidm-git
|
pkgname=lidm-git
|
||||||
pkgver=1.2.3.r0.g7e1ec83
|
pkgver=1.2.3.r3.g363deea
|
||||||
pkgrel=1
|
pkgrel=3
|
||||||
depends=('pam')
|
depends=('pam')
|
||||||
makedepends=('git' 'make' 'gcc')
|
makedepends=('git')
|
||||||
pkgdesc="A fully colorful customizable TUI display manager made in C. (last git commit)"
|
pkgdesc="A fully colorful customizable TUI display manager made in C. (last git commit)"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
url="https://github.com/javalsai/lidm"
|
url="https://github.com/javalsai/lidm"
|
||||||
@@ -15,17 +15,17 @@ source=("lidm::git+https://github.com/javalsai/lidm")
|
|||||||
sha256sums=('SKIP')
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
pkgver() {
|
pkgver() {
|
||||||
cd "lidm"
|
cd "$srcdir/lidm"
|
||||||
git describe --long --abbrev=7 --tags | \
|
git describe --long --abbrev=7 --tags | \
|
||||||
sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
|
sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "lidm"
|
cd "$srcdir/lidm"
|
||||||
make CFLAGS="-O3"
|
make
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "lidm"
|
cd "$srcdir/lidm"
|
||||||
make install DESTDIR="${pkgdir}"
|
make DESTDIR="${pkgdir}" install
|
||||||
}
|
}
|
||||||
|
@@ -1,14 +1,12 @@
|
|||||||
pkgbase = lidm
|
pkgbase = lidm
|
||||||
pkgdesc = A fully colorful customizable TUI display manager made in C. (build latest tag)
|
pkgdesc = A fully colorful customizable TUI display manager made in C. (build latest tag)
|
||||||
pkgver = 1.2.3
|
pkgver = 1.2.3
|
||||||
pkgrel = 1
|
pkgrel = 3
|
||||||
url = https://github.com/javalsai/lidm
|
url = https://github.com/javalsai/lidm
|
||||||
arch = any
|
arch = any
|
||||||
license = GPL
|
license = GPL
|
||||||
makedepends = git
|
|
||||||
makedepends = gcc
|
|
||||||
depends = pam
|
depends = pam
|
||||||
source = tarball.tar.gz::https://github.com/javalsai/lidm/archive/refs/tags/v1.2.3.tar.gz
|
source = lidm-1.2.3.tar.gz::https://github.com/javalsai/lidm/archive/refs/tags/v1.2.3.tar.gz
|
||||||
sha256sums = 1ce414b510c5bbc3e32ea882f915b4d3958cb82eb1fbb5cf33e62f69c844bf93
|
sha256sums = 1ce414b510c5bbc3e32ea882f915b4d3958cb82eb1fbb5cf33e62f69c844bf93
|
||||||
|
|
||||||
pkgname = lidm
|
pkgname = lidm
|
||||||
|
@@ -1,25 +1,21 @@
|
|||||||
# shellcheck disable=SC2034,SC2148,SC2128,SC2154,SC2164
|
# shellcheck disable=SC2034,SC2154,SC2164
|
||||||
# Maintainer: javalsai <javalsai@proton.me>
|
# Maintainer: javalsai <javalsai@proton.me>
|
||||||
pkgname=lidm
|
pkgname=lidm
|
||||||
pkgver=1.2.3
|
pkgver=1.2.3
|
||||||
pkgrel=1
|
pkgrel=3
|
||||||
depends=('pam')
|
depends=('pam')
|
||||||
makedepends=('git' 'gcc')
|
makedepends=()
|
||||||
pkgdesc="A fully colorful customizable TUI display manager made in C. (build latest tag)"
|
pkgdesc="A fully colorful customizable TUI display manager made in C. (build latest tag)"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
url="https://github.com/javalsai/lidm"
|
url="https://github.com/javalsai/lidm"
|
||||||
license=('GPL')
|
license=('GPL')
|
||||||
source=("tarball.tar.gz::https://github.com/javalsai/lidm/archive/refs/tags/v$pkgver.tar.gz")
|
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/javalsai/lidm/archive/refs/tags/v$pkgver.tar.gz")
|
||||||
sha256sums=('1ce414b510c5bbc3e32ea882f915b4d3958cb82eb1fbb5cf33e62f69c844bf93')
|
sha256sums=('1ce414b510c5bbc3e32ea882f915b4d3958cb82eb1fbb5cf33e62f69c844bf93')
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
tar -xzf "tarball.tar.gz"
|
make -C "$srcdir/lidm-$pkgver"
|
||||||
cd "lidm-$pkgver"
|
|
||||||
|
|
||||||
make CFLAGS="-O3"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "lidm-$pkgver"
|
make -C "$srcdir/lidm-$pkgver" DESTDIR="$pkgdir" install
|
||||||
make install DESTDIR="${pkgdir}"
|
|
||||||
}
|
}
|
||||||
|
22
assets/pkg/aur/makepkg-clean.sh
Executable file
22
assets/pkg/aur/makepkg-clean.sh
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
MYSELF=$(realpath "$0")
|
||||||
|
MYDIR=$(dirname "$MYSELF")
|
||||||
|
|
||||||
|
cd "$MYDIR"
|
||||||
|
typeset -a pkgs=(lidm{,-git,-bin})
|
||||||
|
|
||||||
|
for pkg in "${pkgs[@]}"; do
|
||||||
|
printf "\x1b[mEntering '%s'\x1b[0m\n" "$pkg"
|
||||||
|
cd "$pkg"
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
source PKGBUILD
|
||||||
|
# shellcheck disable=SC2154
|
||||||
|
for f in "${source[@]}"; do
|
||||||
|
echo "$f"
|
||||||
|
awk -F:: '{print $1}' <<<"$f" | xargs rm -rf
|
||||||
|
done
|
||||||
|
cd ..
|
||||||
|
echo
|
||||||
|
done
|
@@ -4,18 +4,19 @@ set -e
|
|||||||
MYSELF=$(realpath "$0")
|
MYSELF=$(realpath "$0")
|
||||||
MYDIR=$(dirname "$MYSELF")
|
MYDIR=$(dirname "$MYSELF")
|
||||||
|
|
||||||
for pkg in "$MYDIR"/*/; do
|
cd "$MYDIR"
|
||||||
printf "\x1b[1mEntering '%s'\x1b[0m\n" "$pkg"
|
typeset -a pkgs=(lidm{,-git,-bin})
|
||||||
|
|
||||||
|
for pkg in "${pkgs[@]}"; do
|
||||||
|
printf "\x1b[mEntering '%s'\x1b[0m\n" "$pkg"
|
||||||
cd "$pkg"
|
cd "$pkg"
|
||||||
|
makepkg -Cf
|
||||||
# shellcheck disable=SC1091
|
cd ..
|
||||||
source "PKGBUILD"
|
|
||||||
for source in "${source[@]}"; do
|
|
||||||
awk -F'::' '{print $1}' <<<"$source" | xargs rm -rf
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -rf ./*.{gz,zst} src pkg
|
|
||||||
makepkg -f .
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ -n "${PRINT_TREE:-}" ]]; then
|
||||||
|
for pkg in "${pkgs[@]}"; do
|
||||||
|
eza --tree "$pkg/pkg/"*
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
@@ -17,12 +17,6 @@ for pkg in "$MYDIR"/lidm{,-bin}/; do
|
|||||||
sed -i "s/pkgver=.*/pkgver=$1/" PKGBUILD
|
sed -i "s/pkgver=.*/pkgver=$1/" PKGBUILD
|
||||||
sed -i "s/pkgrel=.*/pkgrel=1/" PKGBUILD
|
sed -i "s/pkgrel=.*/pkgrel=1/" PKGBUILD
|
||||||
|
|
||||||
grep 'source = ' <.SRCINFO | awk -F'= |::' '{print $2}' | \
|
|
||||||
while read -r srcfile; do
|
|
||||||
printf "\x1b[31mDeleting '%s'\x1b[0m\n" "$srcfile"
|
|
||||||
rm -f "$srcfile"
|
|
||||||
done
|
|
||||||
|
|
||||||
updpkgsums
|
updpkgsums
|
||||||
makepkg --printsrcinfo | tee .SRCINFO
|
makepkg --printsrcinfo | tee .SRCINFO
|
||||||
echo
|
echo
|
||||||
|
@@ -38,6 +38,17 @@ Lidm attempts to support being built by `gcc` and `clang` with preference over t
|
|||||||
|
|
||||||
Compiler flags should be passed with `CFLAGS`, its `-O3 -Wall` by default so adding anything will overwrite this.
|
Compiler flags should be passed with `CFLAGS`, its `-O3 -Wall` by default so adding anything will overwrite this.
|
||||||
|
|
||||||
|
## Build Metadata
|
||||||
|
|
||||||
|
`lidm -v` outputs some information about the build version, this can be weaked with `INFO_GIT_REV` and `INFO_BUILD_TS`, by default they are:
|
||||||
|
|
||||||
|
```make
|
||||||
|
INFO_GIT_REV?=$$(git describe --long --tags --always || echo '?')
|
||||||
|
INFO_BUILD_TS?=$$(date +%s)
|
||||||
|
```
|
||||||
|
|
||||||
|
But this can be changed by just passing those env variables, for example, in the case git is not applicable in the build environment of the package.
|
||||||
|
|
||||||
## Target Directory
|
## Target Directory
|
||||||
|
|
||||||
`DESTDIR` can be used to for installation recipes to install on alternative root directories. Along with `PREFIX` (defaults to `/usr`) for systems which don't use the common `/usr` structure. e.g. `make install DESTDIR=$out PREFIX=`
|
`DESTDIR` can be used to for installation recipes to install on alternative root directories. Along with `PREFIX` (defaults to `/usr`) for systems which don't use the common `/usr` structure. e.g. `make install DESTDIR=$out PREFIX=`
|
||||||
|
7
include/desktop_exec.h
Normal file
7
include/desktop_exec.h
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#ifndef DESKTOP_EXEC_H_
|
||||||
|
#define DESKTOP_EXEC_H_
|
||||||
|
|
||||||
|
int parse_exec_string(const char* exec_s, int* arg_count, char*** args);
|
||||||
|
void free_parsed_args(int arg_count, char** args);
|
||||||
|
|
||||||
|
#endif
|
28
src/auth.c
28
src/auth.c
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
#include "auth.h"
|
#include "auth.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "desktop_exec.h"
|
||||||
|
#include "log.h"
|
||||||
#include "sessions.h"
|
#include "sessions.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "unistd.h"
|
#include "unistd.h"
|
||||||
@@ -166,6 +168,22 @@ void moarEnv(char* user, struct session session, struct passwd* pw,
|
|||||||
// NOLINTBEGIN(readability-function-cognitive-complexity)
|
// NOLINTBEGIN(readability-function-cognitive-complexity)
|
||||||
bool launch(char* user, char* passwd, struct session session, void (*cb)(void),
|
bool launch(char* user, char* passwd, struct session session, void (*cb)(void),
|
||||||
struct config* config) {
|
struct config* config) {
|
||||||
|
char** desktop_exec;
|
||||||
|
int desktop_count;
|
||||||
|
|
||||||
|
if (session.type != SHELL) {
|
||||||
|
desktop_exec = NULL;
|
||||||
|
int parse_status =
|
||||||
|
parse_exec_string(session.exec, &desktop_count, &desktop_exec);
|
||||||
|
if (parse_status != 0 || desktop_count == 0 || !desktop_exec[0]) {
|
||||||
|
print_err("failure parsing exec string");
|
||||||
|
log_printf("failure parsing exec string '%s': %d\n",
|
||||||
|
session.exec ? session.exec : "NULL", parse_status);
|
||||||
|
free_parsed_args(desktop_count, desktop_exec);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct passwd* pw = getpwnam(user);
|
struct passwd* pw = getpwnam(user);
|
||||||
if (pw == NULL) {
|
if (pw == NULL) {
|
||||||
print_err("could not get user info");
|
print_err("could not get user info");
|
||||||
@@ -237,8 +255,7 @@ bool launch(char* user, char* passwd, struct session session, void (*cb)(void),
|
|||||||
|
|
||||||
*reach_session = true;
|
*reach_session = true;
|
||||||
|
|
||||||
// TODO: these will be different due to TryExec
|
// TODO: test existence of executable with TryExec
|
||||||
// and, Exec/TryExec might contain spaces as args
|
|
||||||
printf("\x1b[0m");
|
printf("\x1b[0m");
|
||||||
// NOLINTNEXTLINE(bugprone-branch-clone)
|
// NOLINTNEXTLINE(bugprone-branch-clone)
|
||||||
if (session.type == SHELL) {
|
if (session.type == SHELL) {
|
||||||
@@ -248,9 +265,12 @@ bool launch(char* user, char* passwd, struct session session, void (*cb)(void),
|
|||||||
} else if (session.type == XORG || session.type == WAYLAND) {
|
} else if (session.type == XORG || session.type == WAYLAND) {
|
||||||
clear_screen();
|
clear_screen();
|
||||||
(void)fflush(stdout);
|
(void)fflush(stdout);
|
||||||
execlp(session.exec, session.exec, NULL);
|
// NOLINTNEXTLINE
|
||||||
|
execvp(desktop_exec[0], desktop_exec);
|
||||||
|
// NOLINTNEXTLINE
|
||||||
|
free_parsed_args(desktop_count, desktop_exec);
|
||||||
}
|
}
|
||||||
perror("execl error");
|
perror("exec error");
|
||||||
(void)fputs("failure calling session\n", stderr);
|
(void)fputs("failure calling session\n", stderr);
|
||||||
} else {
|
} else {
|
||||||
pid_t child_pid = (pid_t)pid;
|
pid_t child_pid = (pid_t)pid;
|
||||||
|
183
src/desktop_exec.c
Normal file
183
src/desktop_exec.c
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
#include <stddef.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "desktop_exec.h"
|
||||||
|
|
||||||
|
// constants for exec string parsing
|
||||||
|
#define MAX_ARGS 100
|
||||||
|
// ARG_LENGTH is the initial length of a parsed argument
|
||||||
|
#define ARG_LENGTH 64
|
||||||
|
|
||||||
|
// parse Exec=/bin/prog arg1 arg2\ with\ spaces
|
||||||
|
void free_parsed_args(int arg_count, char** args) {
|
||||||
|
if (!args) return;
|
||||||
|
for (int i = 0; i < arg_count; i++) {
|
||||||
|
free(args[i]);
|
||||||
|
}
|
||||||
|
free((void*)args);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* small closure-like struct to pass state to helper functions */
|
||||||
|
struct ctx {
|
||||||
|
char** pcur;
|
||||||
|
size_t* pcur_len;
|
||||||
|
size_t* pcur_cap;
|
||||||
|
char*** pargv;
|
||||||
|
int* pargc;
|
||||||
|
};
|
||||||
|
/* append_char(state, ch) -> 0 on error, 1 on success */
|
||||||
|
int append_char(struct ctx* st, char ch) {
|
||||||
|
char** pcur = st->pcur;
|
||||||
|
size_t* plen = st->pcur_len;
|
||||||
|
size_t* pcap = st->pcur_cap;
|
||||||
|
if (*plen + 1 >= *pcap) {
|
||||||
|
size_t newcap = *pcap ? (*pcap) * 2 : ARG_LENGTH;
|
||||||
|
char* cur = (char*)realloc(*pcur, newcap);
|
||||||
|
if (!cur) return 0;
|
||||||
|
*pcur = cur;
|
||||||
|
*pcap = newcap;
|
||||||
|
}
|
||||||
|
(*pcur)[(*plen)++] = ch;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* push_arg(state) -> 0 on error, 1 on success */
|
||||||
|
int push_arg(struct ctx* st) {
|
||||||
|
char** pcur = st->pcur;
|
||||||
|
size_t* plen = st->pcur_len;
|
||||||
|
size_t* pcap = st->pcur_cap;
|
||||||
|
char*** pargv = st->pargv;
|
||||||
|
int* pargc = st->pargc;
|
||||||
|
|
||||||
|
if (*pargc > MAX_ARGS) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (!*pcur) {
|
||||||
|
char* empty = strdup("");
|
||||||
|
if (!empty) return 0;
|
||||||
|
char** na = (char**)realloc((void*)*pargv, sizeof(char*) * ((*pargc) + 1));
|
||||||
|
if (!na) {
|
||||||
|
free(empty);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
*pargv = na;
|
||||||
|
(*pargv)[(*pargc)++] = empty;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (!append_char(st, '\0')) return 0;
|
||||||
|
char* final = (char*)realloc(*pcur, *plen);
|
||||||
|
if (!final) final = *pcur;
|
||||||
|
*pcur = NULL;
|
||||||
|
*plen = 0;
|
||||||
|
*pcap = 0;
|
||||||
|
char** na = (char**)realloc((void*)*pargv, sizeof(char*) * ((*pargc) + 1));
|
||||||
|
if (!na) {
|
||||||
|
free(final);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
*pargv = na;
|
||||||
|
(*pargv)[(*pargc)++] = final;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return codes:
|
||||||
|
0 = success
|
||||||
|
1 = bad args
|
||||||
|
2 = memory
|
||||||
|
3 = syntax
|
||||||
|
Important: call free_parsed_args afterwards to free the passed ***args
|
||||||
|
*/
|
||||||
|
// NOLINTBEGIN(readability-function-cognitive-complexity)
|
||||||
|
int parse_exec_string(const char* exec_s, int* arg_count, char*** args) {
|
||||||
|
if (!exec_s || !args || !arg_count) return 1;
|
||||||
|
*args = NULL;
|
||||||
|
*arg_count = 0;
|
||||||
|
|
||||||
|
size_t len = strlen(exec_s);
|
||||||
|
size_t idx = 0;
|
||||||
|
char* cur = NULL;
|
||||||
|
size_t cur_len = 0;
|
||||||
|
size_t cur_cap = 0;
|
||||||
|
char** argv = NULL;
|
||||||
|
int argc = 0;
|
||||||
|
int in_quote = 0;
|
||||||
|
|
||||||
|
struct ctx ctx;
|
||||||
|
ctx.pcur = &cur;
|
||||||
|
ctx.pcur_len = &cur_len;
|
||||||
|
ctx.pcur_cap = &cur_cap;
|
||||||
|
ctx.pargv = &argv;
|
||||||
|
ctx.pargc = &argc;
|
||||||
|
|
||||||
|
while (idx < len) {
|
||||||
|
char cur_c = exec_s[idx];
|
||||||
|
if (!in_quote && (cur_c == ' ' || cur_c == '\t' || cur_c == '\n')) {
|
||||||
|
if (cur_cap) {
|
||||||
|
if (!push_arg(&ctx)) goto nomem;
|
||||||
|
}
|
||||||
|
idx++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!in_quote && cur_c == '"') {
|
||||||
|
in_quote = 1;
|
||||||
|
idx++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (in_quote && cur_c == '"') {
|
||||||
|
in_quote = 0;
|
||||||
|
idx++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cur_c == '\\') {
|
||||||
|
if (idx + 1 >= len) goto syntax_err;
|
||||||
|
if (!append_char(&ctx, exec_s[idx + 1])) goto nomem;
|
||||||
|
idx += 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cur_c == '%') {
|
||||||
|
if (idx + 1 >= len) goto syntax_err;
|
||||||
|
if (exec_s[idx + 1] == '%') {
|
||||||
|
if (!append_char(&ctx, '%')) goto nomem;
|
||||||
|
idx += 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/* drop any %X */
|
||||||
|
idx += 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!append_char(&ctx, cur_c)) goto nomem;
|
||||||
|
idx++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_quote) goto syntax_err;
|
||||||
|
if (cur_cap) {
|
||||||
|
if (!push_arg(&ctx)) goto nomem;
|
||||||
|
}
|
||||||
|
char** na = (char**)realloc((void*)argv, sizeof(char*) * (argc + 1));
|
||||||
|
if (!na) goto nomem;
|
||||||
|
argv = na;
|
||||||
|
argv[argc] = NULL;
|
||||||
|
|
||||||
|
*args = argv;
|
||||||
|
*arg_count = argc;
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
nomem:
|
||||||
|
if (cur) free(cur);
|
||||||
|
free_parsed_args(argc, argv);
|
||||||
|
*args = NULL;
|
||||||
|
*arg_count = 0;
|
||||||
|
return 2;
|
||||||
|
|
||||||
|
syntax_err:
|
||||||
|
if (cur) free(cur);
|
||||||
|
free_parsed_args(argc, argv);
|
||||||
|
*args = NULL;
|
||||||
|
*arg_count = 0;
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
// NOLINTEND(readability-function-cognitive-complexity)
|
Reference in New Issue
Block a user