From cff1d4728593e2c6af0e174c3abac015513a647c Mon Sep 17 00:00:00 2001 From: Recolic <git@me.recolic.net> Date: Wed, 19 Mar 2025 21:19:15 -0700 Subject: [PATCH] .add-example --- examples/archlinux-gnome/conf.d/{pkgs.sh => basic.sh} | 8 +++++--- examples/archlinux-gnome/conf.d/desktop.sh | 11 +++++++++++ examples/template/masterconf.sh | 4 ++++ 3 files changed, 20 insertions(+), 3 deletions(-) rename examples/archlinux-gnome/conf.d/{pkgs.sh => basic.sh} (84%) create mode 100644 examples/archlinux-gnome/conf.d/desktop.sh diff --git a/examples/archlinux-gnome/conf.d/pkgs.sh b/examples/archlinux-gnome/conf.d/basic.sh similarity index 84% rename from examples/archlinux-gnome/conf.d/pkgs.sh rename to examples/archlinux-gnome/conf.d/basic.sh index 362c0cc..380872d 100644 --- a/examples/archlinux-gnome/conf.d/pkgs.sh +++ b/examples/archlinux-gnome/conf.d/basic.sh @@ -1,17 +1,19 @@ lc_assert_user_is root lc_init () { - # my favorite package + # my favorite pkgs pacman -Sy --noconfirm fish dhcpcd vim sudo openssh pacman -Sy --noconfirm --asdeps openssl - pacman -Sy --noconfirm gnome networkmanager power-profiles-daemon nextcloud-client firefox - # add primary user useradd --create-home --shell /usr/bin/fish rtest echo 'rtest ALL=(ALL) NOPASSWD: ALL' | EDITOR='tee -a' visudo usermod --password $(echo testpass | openssl passwd -1 -stdin) rtest + sudo -u rtest linuxconf register masterconf.sh + + # more desktop pkgs + pacman -Sy --noconfirm gnome networkmanager power-profiles-daemon nextcloud-client firefox systemctl enable gdm NetworkManager power-profiles-daemon } diff --git a/examples/archlinux-gnome/conf.d/desktop.sh b/examples/archlinux-gnome/conf.d/desktop.sh new file mode 100644 index 0000000..5351723 --- /dev/null +++ b/examples/archlinux-gnome/conf.d/desktop.sh @@ -0,0 +1,11 @@ +lc_assert_user_is_not root + +lc_init () { + [[ -d $HOME/sh ]] || git clone https://git.recolic.net/root/daily-scripts.git $HOME/sh || return 1 + +} + +lc_startup () { + +} + diff --git a/examples/template/masterconf.sh b/examples/template/masterconf.sh index da8b5aa..20fe813 100644 --- a/examples/template/masterconf.sh +++ b/examples/template/masterconf.sh @@ -46,3 +46,7 @@ function lc_cron () { # Warning: watch out for unintended user lc_fsmap files/vimrc $LC_USER_HOME/.vimrc +# TODO: what if lc_fsmap depends on lc_init() ?? This is not recommended usage. +# e.g: 'git clone xxx $HOME/sh' and lc_fsmap $HOME/sh/something /usr/bin/fancy +# lc_fsmap should success even if $HOME/sh/something doesn't exist yet. (what if dest also not exist? let it fail...) + -- GitLab