summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlake Romero <blake@blkrom.com>2024-09-21 01:55:52 +0100
committerBlake Romero <blake@blkrom.com>2024-09-21 01:55:52 +0100
commitb370dde629290c654aaff75c010b9aadb6ddd0d5 (patch)
tree001080e8a932bda52dea65fecda740154e0e020f
parent77e890fb6ea763c9d8be303277c84c6b06229d7f (diff)
Add greeter option
-rw-r--r--README.org35
-rw-r--r--config1
-rw-r--r--install.sh46
3 files changed, 43 insertions, 39 deletions
diff --git a/README.org b/README.org
index 904acdf..b5ba13c 100644
--- a/README.org
+++ b/README.org
@@ -39,23 +39,24 @@ Follow the setup process bellow to install it onto a system.
* Configuration Options
Configuration options are available in the =config= file.
-| Option | Example | Notes |
-|--------------+----------------+--------------------------------------------------|
-| =drive= | /dev/sda | main device for installation |
-| =boot= | /dev/sda1 | can be already in use if =duel_boot= is enabled |
-| =root= | /dev/sda2 | will use BTRFS with dedicated subvolumes |
-| =swap_size= | auto | can be set explicitly, e.g. =8G= or =16G= |
-| =boot_size= | 512M | set a large value if duel booting, e.g. =1G= |
-| =duel_boot= | true | =boot= must be already setup & separate from =drive= |
-| =timezone= | Europe/London | timezones are defined in =/usr/share/zoneinfo/= |
-| =locale= | en_GB | locales are defined in =/etc/locale.gen= |
-| =user= | blake | the main user of the system |
-| =user_groups= | wheel,log,seat | groups for =user=, see [[https://wiki.archlinux.org/title/Users_and_groups#Group_list][ArchWiki]] for more info |
-| =hostname= | ArtixPC | the system name |
-| =arch_support= | false | enables extra & multilib repositories |
-| =enable_aur= | false | installs the =trizen= AUR helper |
-| =autologin= | false | automatically login system |
-| =elogind= | true | if false, =seatd= and =turnstile= is used |
+| Option | Example | Notes |
+|--------------+----------------+---------------------------------------------------------|
+| =drive= | /dev/sda | main device for installation |
+| =boot= | /dev/sda1 | can be already in use if =duel_boot= is enabled |
+| =root= | /dev/sda2 | will use BTRFS with dedicated subvolumes |
+| =swap_size= | auto | can be set explicitly, e.g. =8G= or =16G= |
+| =boot_size= | 512M | set a large value if duel booting, e.g. =1G= |
+| =duel_boot= | true | =boot= must be already setup & separate from =drive= |
+| =timezone= | Europe/London | timezones are defined in =/usr/share/zoneinfo/= |
+| =locale= | en_GB | locales are defined in =/etc/locale.gen= |
+| =user= | blake | the main user of the system |
+| =user_groups= | wheel,log,seat | groups for =user=, see [[https://wiki.archlinux.org/title/Users_and_groups#Group_list][ArchWiki]] for more info |
+| =hostname= | ArtixPC | the system name |
+| =arch_support= | false | enables extra & multilib repositories |
+| =enable_aur= | false | installs the =trizen= AUR helper |
+| =autologin= | false | automatically login system |
+| =elogind= | true | if false, =seatd= and =turnstile= is used |
+| =greeter= | greetd | enables =greetd= with =tuigreet= or the =agetty= login prompt |
* Notes
Last tested using =artix-base-dinit-20240823-x86_64.iso= on a UEFI system.
diff --git a/config b/config
index 0b83351..2a55ce5 100644
--- a/config
+++ b/config
@@ -43,6 +43,7 @@ locale=en_GB
# Login
autologin=false
+greeter=greetd
# Use elogind, if false setup uses seatd & turnstile instead
elogind=true
diff --git a/install.sh b/install.sh
index 08356c3..f8c11f5 100644
--- a/install.sh
+++ b/install.sh
@@ -282,13 +282,15 @@ Defaults pwfeedback
${user} ALL=(ALL) NOPASSWD: PACMAN,POWER,STAT
" >> /mnt/etc/sudoers
-# Setup greetd login manager
-basestrap /mnt --needed {greetd,tuigreet}-dinit
-services+=" greetd"
-# disable tty1 console for greetd login
-sed 's/\[.*\]/\[2-6\]/' -i /mnt/etc/dinit.d/config/console.conf
-# set tuigreet as greetd command
-tuigreet_args="\
+# Login
+# when using greetd
+if [[ "${greeter}" == greetd ]]; then
+ basestrap /mnt --needed {greetd,tuigreet}-dinit
+ services+=" greetd"
+ # disable tty1 console for greetd login
+ sed 's/\[.*\]/\[2-6\]/' -i /mnt/etc/dinit.d/config/console.conf
+ # set tuigreet as greetd command
+ tuigreet_args="\
--cmd /bin/bash \
--power-shutdown 'sudo halt' \
--power-reboot 'sudo reboot' \
@@ -296,28 +298,28 @@ tuigreet_args="\
--asterisks \
--remember \
--time"
-sed "s,^command =.*,command = \"tuigreet ${tuigreet_args}\"," \
- -i /mnt/etc/greetd/config.toml
-# Allow greeter to run power commands
-printf "greeter ALL=(ALL) NOPASSWD: POWER\n" >> /mnt/etc/sudoers
+ sed "s,^command =.*,command = \"tuigreet ${tuigreet_args}\"," \
+ -i /mnt/etc/greetd/config.toml
+ # Allow greeter to run power commands
+ printf "greeter ALL=(ALL) NOPASSWD: POWER\n" >> /mnt/etc/sudoers
-# Autologin
-if [[ "${autologin}" == true ]]; then
- echo "
+ if [[ "${autologin}" == true ]]; then
+ echo "
[initial_session]
command = \"bash\"
user = \"${user}\"
" >> /mnt/etc/greetd/config.toml
+ fi
+else
+ # when using agetty
+ if [[ "${autologin}" == true ]]; then
+ cp /mnt/etc/dinit.d/config/agetty-default.conf \
+ /mnt/etc/dinit.d/config/agetty-tty1.conf
+ sed "s/GETTY_ARGS=.*/GETTY_ARGS=\"--noclear --autologin ${user}\"/" \
+ -i /mnt/etc/dinit.d/config/agetty-tty1.conf
+ fi
fi
-# # Autologin (when not using greetd login manager)
-# if [[ "${autologin}" == true ]]; then
-# cp /mnt/etc/dinit.d/config/agetty-default.conf \
-# /mnt/etc/dinit.d/config/agetty-tty1.conf
-# sed "s/GETTY_ARGS=.*/GETTY_ARGS=\"--noclear --autologin ${user}\"/" \
-# -i /mnt/etc/dinit.d/config/agetty-tty1.conf
-# fi
-
# Setup user dinit log directory
mkdir /mnt/var/log/dinit/user
chgrp log /mnt/var/log/dinit/user