mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 04:09:23 +00:00
Improve boot screen transition (#140)
* Working concept with SDDM * Working concept without SDDM dep * Working concept w/o SDDM and w/ UWSM * Cleanup and UWSM tweaks * Cleanup * Remove call to seamless-login.sh * Don't allow the progress to go backwards * Add refresh to migration
This commit is contained in:
@ -15,7 +15,7 @@ show_power_menu() {
|
|||||||
case "$selection" in
|
case "$selection" in
|
||||||
*Lock*) hyprlock ;;
|
*Lock*) hyprlock ;;
|
||||||
*Suspend*) systemctl suspend ;;
|
*Suspend*) systemctl suspend ;;
|
||||||
*Relaunch*) hyprctl dispatch exit ;;
|
*Relaunch*) uwsm stop ;;
|
||||||
*Restart*) systemctl reboot ;;
|
*Restart*) systemctl reboot ;;
|
||||||
*Shutdown*) systemctl poweroff ;;
|
*Shutdown*) systemctl poweroff ;;
|
||||||
esac
|
esac
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
INPUT_METHOD=fcitx
|
INPUT_METHOD=fcitx
|
||||||
GTK_IM_MODULE=fcitx
|
|
||||||
QT_IM_MODULE=fcitx
|
QT_IM_MODULE=fcitx
|
||||||
XMODIFIERS=@im=fcitx
|
XMODIFIERS=@im=fcitx
|
||||||
SDL_IM_MODULE=fcitx
|
SDL_IM_MODULE=fcitx
|
||||||
|
@ -20,6 +20,7 @@ global.fake_progress_active = 0; # 0 / 1 boolean
|
|||||||
global.animation_frame = 0;
|
global.animation_frame = 0;
|
||||||
global.fake_progress_start_time = 0; # Track when fake progress started
|
global.fake_progress_start_time = 0; # Track when fake progress started
|
||||||
global.password_shown = 0; # Track if password dialog has been shown
|
global.password_shown = 0; # Track if password dialog has been shown
|
||||||
|
global.max_progress = 0.0; # Track the maximum progress reached to prevent backwards movement
|
||||||
|
|
||||||
fun refresh_callback ()
|
fun refresh_callback ()
|
||||||
{
|
{
|
||||||
@ -55,11 +56,16 @@ Plymouth.SetRefreshFunction (refresh_callback);
|
|||||||
|
|
||||||
fun update_progress_bar(progress)
|
fun update_progress_bar(progress)
|
||||||
{
|
{
|
||||||
width = Math.Int(progress_bar.original_image.GetWidth() * progress);
|
# Only update if progress is moving forward
|
||||||
if (width < 1) width = 1; # Ensure minimum width of 1 pixel
|
if (progress > global.max_progress)
|
||||||
|
{
|
||||||
progress_bar.image = progress_bar.original_image.Scale(width, progress_bar.original_image.GetHeight());
|
global.max_progress = progress;
|
||||||
progress_bar.sprite.SetImage(progress_bar.image);
|
width = Math.Int(progress_bar.original_image.GetWidth() * progress);
|
||||||
|
if (width < 1) width = 1; # Ensure minimum width of 1 pixel
|
||||||
|
|
||||||
|
progress_bar.image = progress_bar.original_image.Scale(width, progress_bar.original_image.GetHeight());
|
||||||
|
progress_bar.sprite.SetImage(progress_bar.image);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun show_progress_bar()
|
fun show_progress_bar()
|
||||||
@ -90,11 +96,15 @@ fun hide_password_dialog()
|
|||||||
|
|
||||||
fun start_fake_progress()
|
fun start_fake_progress()
|
||||||
{
|
{
|
||||||
global.fake_progress = 0.0;
|
# Don't reset if we already have progress
|
||||||
global.real_progress = 0.0;
|
if (global.max_progress == 0.0)
|
||||||
|
{
|
||||||
|
global.fake_progress = 0.0;
|
||||||
|
global.real_progress = 0.0;
|
||||||
|
update_progress_bar(0.0);
|
||||||
|
}
|
||||||
global.fake_progress_active = 1;
|
global.fake_progress_active = 1;
|
||||||
global.animation_frame = 0;
|
global.animation_frame = 0;
|
||||||
update_progress_bar(0.0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun stop_fake_progress()
|
fun stop_fake_progress()
|
||||||
@ -149,8 +159,12 @@ fun display_password_callback (prompt, bullets)
|
|||||||
{
|
{
|
||||||
global.password_shown = 1; # Mark that password dialog has been shown
|
global.password_shown = 1; # Mark that password dialog has been shown
|
||||||
|
|
||||||
|
# Reset progress when password dialog appears
|
||||||
stop_fake_progress();
|
stop_fake_progress();
|
||||||
hide_progress_bar();
|
hide_progress_bar();
|
||||||
|
global.max_progress = 0.0;
|
||||||
|
global.fake_progress = 0.0;
|
||||||
|
global.real_progress = 0.0;
|
||||||
show_password_dialog();
|
show_password_dialog();
|
||||||
|
|
||||||
# Clear all bullets first
|
# Clear all bullets first
|
||||||
|
@ -7,14 +7,6 @@ mkdir -p ~/.local/share/applications
|
|||||||
# Use default bashrc from Omarchy
|
# Use default bashrc from Omarchy
|
||||||
echo "source ~/.local/share/omarchy/default/bash/rc" >~/.bashrc
|
echo "source ~/.local/share/omarchy/default/bash/rc" >~/.bashrc
|
||||||
|
|
||||||
# Login directly as user, rely on disk encryption + hyprlock for security
|
|
||||||
sudo mkdir -p /etc/systemd/system/getty@tty1.service.d
|
|
||||||
sudo tee /etc/systemd/system/getty@tty1.service.d/override.conf >/dev/null <<EOF
|
|
||||||
[Service]
|
|
||||||
ExecStart=
|
|
||||||
ExecStart=-/usr/bin/agetty --autologin $USER --noclear %I \$TERM
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Set common git aliases
|
# Set common git aliases
|
||||||
git config --global alias.co checkout
|
git config --global alias.co checkout
|
||||||
git config --global alias.br branch
|
git config --global alias.br branch
|
||||||
|
@ -2,6 +2,3 @@ yay -S --noconfirm --needed \
|
|||||||
hyprland hyprshot hyprpicker hyprlock hypridle polkit-gnome hyprland-qtutils \
|
hyprland hyprshot hyprpicker hyprlock hypridle polkit-gnome hyprland-qtutils \
|
||||||
wofi waybar mako swaybg \
|
wofi waybar mako swaybg \
|
||||||
xdg-desktop-portal-hyprland xdg-desktop-portal-gtk
|
xdg-desktop-portal-hyprland xdg-desktop-portal-gtk
|
||||||
|
|
||||||
# Start Hyprland on first session
|
|
||||||
echo "[[ -z \$DISPLAY && \$(tty) == /dev/tty1 ]] && exec Hyprland" >~/.bash_profile
|
|
||||||
|
115
install/login.sh
Normal file
115
install/login.sh
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Hyprland launched via UWSM and login directly as user, rely on disk encryption + hyprlock for security
|
||||||
|
yay -S --noconfirm --needed uwsm
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
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
|
||||||
|
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
|
||||||
|
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable omarchy-seamless-login.service
|
||||||
|
|
||||||
|
# Disable getty@tty1 to prevent conflicts
|
||||||
|
sudo systemctl disable getty@tty1.service
|
@ -75,12 +75,12 @@ if ! command -v plymouth &>/dev/null; then
|
|||||||
# Relying on mkinitcpio to assemble a UKI
|
# Relying on mkinitcpio to assemble a UKI
|
||||||
# https://wiki.archlinux.org/title/Unified_kernel_image
|
# https://wiki.archlinux.org/title/Unified_kernel_image
|
||||||
if ! grep -q splash /etc/cmdline.d/*.conf; then
|
if ! grep -q splash /etc/cmdline.d/*.conf; then
|
||||||
# Need splash, create the omarchy file
|
# Need splash, create the omarchy file
|
||||||
echo "splash" | sudo tee -a /etc/cmdline.d/omarchy.conf
|
echo "splash" | sudo tee -a /etc/cmdline.d/omarchy.conf
|
||||||
fi
|
fi
|
||||||
if ! grep -q quiet /etc/cmdline.d/*.conf; then
|
if ! grep -q quiet /etc/cmdline.d/*.conf; then
|
||||||
# Need quiet, create or append the omarchy file
|
# Need quiet, create or append the omarchy file
|
||||||
echo "quiet" | sudo tee -a /etc/cmdline.d/omarchy.conf
|
echo "quiet" | sudo tee -a /etc/cmdline.d/omarchy.conf
|
||||||
fi
|
fi
|
||||||
elif [ -f "/etc/kernel/cmdline" ]; then
|
elif [ -f "/etc/kernel/cmdline" ]; then
|
||||||
# Alternate UKI kernel cmdline location
|
# Alternate UKI kernel cmdline location
|
||||||
@ -95,10 +95,10 @@ if ! command -v plymouth &>/dev/null; then
|
|||||||
# Add splash and quiet if not present
|
# Add splash and quiet if not present
|
||||||
new_cmdline="$current_cmdline"
|
new_cmdline="$current_cmdline"
|
||||||
if [[ ! "$current_cmdline" =~ splash ]]; then
|
if [[ ! "$current_cmdline" =~ splash ]]; then
|
||||||
new_cmdline="$new_cmdline splash"
|
new_cmdline="$new_cmdline splash"
|
||||||
fi
|
fi
|
||||||
if [[ ! "$current_cmdline" =~ quiet ]]; then
|
if [[ ! "$current_cmdline" =~ quiet ]]; then
|
||||||
new_cmdline="$new_cmdline quiet"
|
new_cmdline="$new_cmdline quiet"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Trim any leading/trailing spaces
|
# Trim any leading/trailing spaces
|
||||||
|
18
migrations/1752292967.sh
Normal file
18
migrations/1752292967.sh
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
echo "Update to use UWSM and seamless login"
|
||||||
|
sudo rm /etc/systemd/system/getty@tty1.service.d/override.conf
|
||||||
|
sudo rmdir /etc/systemd/system/getty@tty1.service.d/ 2>/dev/null || true
|
||||||
|
|
||||||
|
if [ -f "$HOME/.bash_profile" ]; then
|
||||||
|
# Remove the specific line
|
||||||
|
sed -i '/^\[\[ -z \$DISPLAY && \$(tty) == \/dev\/tty1 \]\] && exec Hyprland$/d' "$HOME/.bash_profile"
|
||||||
|
echo "Cleaned up .bash_profile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$HOME/.config/environment.d/fcitx.conf" ]; then
|
||||||
|
echo "Removing GTK_IM_MODULE from fcitx config for Wayland..."
|
||||||
|
sed -i 's/^GTK_IM_MODULE=fcitx$//' "$HOME/.config/environment.d/fcitx.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
omarchy-refresh-plymouth
|
||||||
|
|
||||||
|
source ~/.local/share/omarchy/install/login.sh
|
Reference in New Issue
Block a user