mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Change DM to SDDM
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
run_logged $OMARCHY_INSTALL/login/plymouth.sh
|
run_logged $OMARCHY_INSTALL/login/plymouth.sh
|
||||||
|
run_logged $OMARCHY_INSTALL/login/default-keyring.sh
|
||||||
|
run_logged $OMARCHY_INSTALL/login/sddm.sh
|
||||||
run_logged $OMARCHY_INSTALL/login/limine-snapper.sh
|
run_logged $OMARCHY_INSTALL/login/limine-snapper.sh
|
||||||
run_logged $OMARCHY_INSTALL/login/enable-mkinitcpio.sh
|
run_logged $OMARCHY_INSTALL/login/enable-mkinitcpio.sh
|
||||||
run_logged $OMARCHY_INSTALL/login/alt-bootloaders.sh
|
run_logged $OMARCHY_INSTALL/login/alt-bootloaders.sh
|
||||||
|
|||||||
20
install/login/default-keyring.sh
Normal file
20
install/login/default-keyring.sh
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
KEYRING_DIR="$HOME/.local/share/keyrings"
|
||||||
|
KEYRING_FILE="Default_keyring.keyring"
|
||||||
|
DEFAULT_FILE="default"
|
||||||
|
|
||||||
|
cat << EOF | tee "$KEYRING_FILE"
|
||||||
|
[keyring]
|
||||||
|
display-name=Default keyring
|
||||||
|
ctime=$(date +%s)
|
||||||
|
mtime=0
|
||||||
|
lock-on-idle=false
|
||||||
|
lock-after=false
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat << EOF | tee "$DEFAULT_FILE"
|
||||||
|
Default_keyring
|
||||||
|
EOF
|
||||||
|
|
||||||
|
chmod 700 "$KEYRING_DIR"
|
||||||
|
chmod 600 "$KEYRING_FILE"
|
||||||
|
chmod 644 "$DEFAULT_FILE"
|
||||||
@@ -1,151 +1,4 @@
|
|||||||
# Hyprland launched via UWSM and login directly as user, rely on disk encryption + hyprlock for security
|
|
||||||
|
|
||||||
# ==============================================================================
|
|
||||||
# PLYMOUTH SETUP
|
|
||||||
# ==============================================================================
|
|
||||||
|
|
||||||
if [ "$(plymouth-set-default-theme)" != "omarchy" ]; then
|
if [ "$(plymouth-set-default-theme)" != "omarchy" ]; then
|
||||||
sudo cp -r "$HOME/.local/share/omarchy/default/plymouth" /usr/share/plymouth/themes/omarchy/
|
sudo cp -r "$HOME/.local/share/omarchy/default/plymouth" /usr/share/plymouth/themes/omarchy/
|
||||||
sudo plymouth-set-default-theme omarchy
|
sudo plymouth-set-default-theme omarchy
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ==============================================================================
|
|
||||||
# SEAMLESS LOGIN
|
|
||||||
# ==============================================================================
|
|
||||||
|
|
||||||
if [ ! -x /usr/local/bin/seamless-login ]; then
|
|
||||||
# Compile the seamless login helper -- needed to prevent seeing terminal between loader and desktop
|
|
||||||
cat <<'CCODE' >/tmp/seamless-login.c
|
|
||||||
/*
|
|
||||||
* Seamless Login - Minimal SDDM-style Plymouth transition
|
|
||||||
* Replicates SDDM's VT management for seamless auto-login
|
|
||||||
*/
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <linux/kd.h>
|
|
||||||
#include <linux/vt.h>
|
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
|
||||||
int vt_fd;
|
|
||||||
int vt_num = 1; // TTY1
|
|
||||||
char vt_path[32];
|
|
||||||
|
|
||||||
if (argc < 2) {
|
|
||||||
fprintf(stderr, "Usage: %s <session_command>\n", argv[0]);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Open the VT (simple approach like SDDM)
|
|
||||||
snprintf(vt_path, sizeof(vt_path), "/dev/tty%d", vt_num);
|
|
||||||
vt_fd = open(vt_path, O_RDWR);
|
|
||||||
if (vt_fd < 0) {
|
|
||||||
perror("Failed to open VT");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Activate the VT
|
|
||||||
if (ioctl(vt_fd, VT_ACTIVATE, vt_num) < 0) {
|
|
||||||
perror("VT_ACTIVATE failed");
|
|
||||||
close(vt_fd);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wait for VT to be active
|
|
||||||
if (ioctl(vt_fd, VT_WAITACTIVE, vt_num) < 0) {
|
|
||||||
perror("VT_WAITACTIVE failed");
|
|
||||||
close(vt_fd);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Critical: Set graphics mode to prevent console text
|
|
||||||
if (ioctl(vt_fd, KDSETMODE, KD_GRAPHICS) < 0) {
|
|
||||||
perror("KDSETMODE KD_GRAPHICS failed");
|
|
||||||
close(vt_fd);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear VT and close (like SDDM does)
|
|
||||||
const char *clear_seq = "\33[H\33[2J";
|
|
||||||
if (write(vt_fd, clear_seq, strlen(clear_seq)) < 0) {
|
|
||||||
perror("Failed to clear VT");
|
|
||||||
}
|
|
||||||
|
|
||||||
close(vt_fd);
|
|
||||||
|
|
||||||
// Set working directory to user's home
|
|
||||||
const char *home = getenv("HOME");
|
|
||||||
if (home) chdir(home);
|
|
||||||
|
|
||||||
// Now execute the session command
|
|
||||||
execvp(argv[1], &argv[1]);
|
|
||||||
perror("Failed to exec session");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
CCODE
|
|
||||||
|
|
||||||
gcc -o /tmp/seamless-login /tmp/seamless-login.c
|
|
||||||
sudo mv /tmp/seamless-login /usr/local/bin/seamless-login
|
|
||||||
sudo chmod +x /usr/local/bin/seamless-login
|
|
||||||
rm /tmp/seamless-login.c
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f /etc/systemd/system/omarchy-seamless-login.service ]; then
|
|
||||||
cat <<EOF | sudo tee /etc/systemd/system/omarchy-seamless-login.service
|
|
||||||
[Unit]
|
|
||||||
Description=Omarchy Seamless Auto-Login
|
|
||||||
Documentation=https://github.com/basecamp/omarchy
|
|
||||||
Conflicts=getty@tty1.service
|
|
||||||
After=systemd-user-sessions.service getty@tty1.service plymouth-quit.service systemd-logind.service
|
|
||||||
PartOf=graphical.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
ExecStart=/usr/local/bin/seamless-login uwsm start -- hyprland.desktop
|
|
||||||
Restart=always
|
|
||||||
RestartSec=2
|
|
||||||
StartLimitIntervalSec=30
|
|
||||||
StartLimitBurst=2
|
|
||||||
User=$USER
|
|
||||||
TTYPath=/dev/tty1
|
|
||||||
TTYReset=yes
|
|
||||||
TTYVHangup=yes
|
|
||||||
TTYVTDisallocate=yes
|
|
||||||
StandardInput=tty
|
|
||||||
StandardOutput=journal
|
|
||||||
StandardError=journal+console
|
|
||||||
PAMName=login
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=graphical.target
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f /etc/systemd/system/plymouth-quit.service.d/wait-for-graphical.conf ]; then
|
|
||||||
# Make plymouth remain until graphical.target
|
|
||||||
sudo mkdir -p /etc/systemd/system/plymouth-quit.service.d
|
|
||||||
sudo tee /etc/systemd/system/plymouth-quit.service.d/wait-for-graphical.conf <<'EOF'
|
|
||||||
[Unit]
|
|
||||||
After=multi-user.target
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Mask plymouth-quit-wait.service only if not already masked
|
|
||||||
if ! systemctl is-enabled plymouth-quit-wait.service | grep -q masked; then
|
|
||||||
sudo systemctl mask plymouth-quit-wait.service
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Enable omarchy-seamless-login.service only if not already enabled
|
|
||||||
if ! systemctl is-enabled omarchy-seamless-login.service | grep -q enabled; then
|
|
||||||
sudo systemctl enable omarchy-seamless-login.service
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Disable getty@tty1.service only if not already disabled
|
|
||||||
if ! systemctl is-enabled getty@tty1.service | grep -q disabled; then
|
|
||||||
sudo systemctl disable getty@tty1.service
|
|
||||||
fi
|
|
||||||
|
|||||||
14
install/login/sddm.sh
Normal file
14
install/login/sddm.sh
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
sudo mkdir -p /etc/sddm.conf.d
|
||||||
|
|
||||||
|
if [ ! -f /etc/sddm.conf.d/autologin.conf ]; then
|
||||||
|
cat <<EOF | sudo tee /etc/sddm.conf.d/autologin.conf
|
||||||
|
[Autologin]
|
||||||
|
User=$USER
|
||||||
|
Session=hyprland-uwsm
|
||||||
|
|
||||||
|
[Theme]
|
||||||
|
Current=breeze
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
chrootable_systemctl_enable sddm.service
|
||||||
@@ -56,6 +56,7 @@ kvantum-qt5
|
|||||||
lazydocker
|
lazydocker
|
||||||
lazygit
|
lazygit
|
||||||
less
|
less
|
||||||
|
libsecret
|
||||||
libyaml
|
libyaml
|
||||||
libqalculate
|
libqalculate
|
||||||
libreoffice
|
libreoffice
|
||||||
@@ -92,6 +93,7 @@ python-terminaltexteffects
|
|||||||
qt5-wayland
|
qt5-wayland
|
||||||
ripgrep
|
ripgrep
|
||||||
satty
|
satty
|
||||||
|
sddm
|
||||||
signal-desktop
|
signal-desktop
|
||||||
slurp
|
slurp
|
||||||
spotify
|
spotify
|
||||||
|
|||||||
24
migrations/1758487660_change_dm_to_sddm.sh
Executable file
24
migrations/1758487660_change_dm_to_sddm.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
echo "Change display manager to SDDM"
|
||||||
|
|
||||||
|
sudo pacman -S --needed --noconfirm sddm libsecret gnome-keyring
|
||||||
|
|
||||||
|
sudo mkdir -p /etc/sddm.conf.d
|
||||||
|
|
||||||
|
cat <<EOF | sudo tee /etc/sddm.conf.d/autologin.conf
|
||||||
|
[Autologin]
|
||||||
|
User=$USER
|
||||||
|
Session=hyprland-uwsm
|
||||||
|
|
||||||
|
[Theme]
|
||||||
|
Current=breeze
|
||||||
|
EOF
|
||||||
|
|
||||||
|
sudo systemctl disable omarchy-seamless-login.service
|
||||||
|
sudo systemctl unmask plymouth-quit-wait.service
|
||||||
|
sudo systemctl enable getty@tty1.service
|
||||||
|
sudo systemctl enable sddm.service
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
|
||||||
|
sudo rm -f /usr/local/bin/seamless-login
|
||||||
|
sudo rm -f /etc/systemd/system/plymouth-quit.service.d/wait-for-graphical.conf
|
||||||
|
sudo rm -f /etc/systemd/system/omarchy-seamless-login.service
|
||||||
Reference in New Issue
Block a user