From 2a2a77685cc5ece4af707aafaf2b64fd35d9a8ea Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 28 Jun 2025 11:46:28 -0700 Subject: [PATCH 01/27] Add migration system and fix bluetooth service + missing bat --- bin/omarchy-update | 18 ++++++++++++++++++ migrations/1751134568.sh | 8 ++++++++ migrations/1751135253.sh | 3 +++ 3 files changed, 29 insertions(+) create mode 100644 migrations/1751134568.sh create mode 100644 migrations/1751135253.sh diff --git a/bin/omarchy-update b/bin/omarchy-update index 2d6f929..da517c8 100755 --- a/bin/omarchy-update +++ b/bin/omarchy-update @@ -1,5 +1,23 @@ #!/bin/bash cd ~/.local/share/omarchy + +# Remember the version we're at before upgrading +last_updated_at=$(git log -1 --format=%cd --date=unix) + +# Get the latest git pull + +# Run any pending migrations +for file in migrations/*.sh; do + filename=$(basename "$file") + migrate_at="${filename%.sh}" + + if [ $migrate_at -gt $last_updated_at ]; then + echo "Running migration ($migrate_at)" + source $file + fi +done + +# Back to where we came from cd - diff --git a/migrations/1751134568.sh b/migrations/1751134568.sh new file mode 100644 index 0000000..f1ecd07 --- /dev/null +++ b/migrations/1751134568.sh @@ -0,0 +1,8 @@ +# Turn on bluetooth service so blueberry works out the box +if systemctl is-enabled --quiet bluetooth.service && systemctl is-active --quiet bluetooth.service; then + # Bluetooth is already enabled, nothing to change + : +else + echo "Let's turn on Bluetooth service so the controls work" + sudo systemctl enable --now bluetooth.service +fi diff --git a/migrations/1751135253.sh b/migrations/1751135253.sh new file mode 100644 index 0000000..b830627 --- /dev/null +++ b/migrations/1751135253.sh @@ -0,0 +1,3 @@ +# Add missing installation of bat +echo "Add missing installation of bat (used by the ff alias)" +yay -S --noconfirm --needed bat From 07b89e0ad88cf7d71572a7794b27829abbe04625 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 28 Jun 2025 11:48:08 -0700 Subject: [PATCH 02/27] Only run this if we are missing bat --- migrations/1751135253.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/migrations/1751135253.sh b/migrations/1751135253.sh index b830627..aa0e3ea 100644 --- a/migrations/1751135253.sh +++ b/migrations/1751135253.sh @@ -1,3 +1,5 @@ -# Add missing installation of bat -echo "Add missing installation of bat (used by the ff alias)" -yay -S --noconfirm --needed bat +if ! command -v bat &>/dev/null; then + # Add missing installation of bat + echo "Add missing installation of bat (used by the ff alias)" + yay -S --noconfirm --needed bat +fi From aa4fddf53f123dc9f7fd4c12ff9c0d244c936b0c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 28 Jun 2025 11:50:19 -0700 Subject: [PATCH 03/27] Run these again so the updated omarchy-update gets them too --- migrations/1751136488.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 migrations/1751136488.sh diff --git a/migrations/1751136488.sh b/migrations/1751136488.sh new file mode 100644 index 0000000..2300a51 --- /dev/null +++ b/migrations/1751136488.sh @@ -0,0 +1,3 @@ +# Rerun these migrations since it required an update to omarchy-update to even get migrations +source 1751134568.sh +source 1751135253.sh From 68422580319f42bbfccb4c7368f8f0b07fb03a0f Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 28 Jun 2025 11:51:11 -0700 Subject: [PATCH 04/27] Fix this --- migrations/1751136488.sh | 3 --- migrations/1751136619.sh | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 migrations/1751136488.sh create mode 100644 migrations/1751136619.sh diff --git a/migrations/1751136488.sh b/migrations/1751136488.sh deleted file mode 100644 index 2300a51..0000000 --- a/migrations/1751136488.sh +++ /dev/null @@ -1,3 +0,0 @@ -# Rerun these migrations since it required an update to omarchy-update to even get migrations -source 1751134568.sh -source 1751135253.sh diff --git a/migrations/1751136619.sh b/migrations/1751136619.sh new file mode 100644 index 0000000..eb008e8 --- /dev/null +++ b/migrations/1751136619.sh @@ -0,0 +1,3 @@ +# Rerun these migrations since it required an update to omarchy-update to even get migrations +source ~/.local/share/omarchy/migrations/1751134568.sh +source ~/.local/share/omarchy/migrations/1751135253.sh From 18931a8fd3e3606b40c67b6911e31d1d0c0fe675 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 28 Jun 2025 15:50:19 -0700 Subject: [PATCH 05/27] Need to have the service available first --- install/bluetooth.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/bluetooth.sh b/install/bluetooth.sh index caf8402..018f7ca 100644 --- a/install/bluetooth.sh +++ b/install/bluetooth.sh @@ -1,5 +1,5 @@ -# Turn on bluetooth by default -sudo systemctl enable --now bluetooth.service - # Install bluetooth controls yay -S --noconfirm --needed blueberry + +# Turn on bluetooth by default +sudo systemctl enable --now bluetooth.service From 9a8f4523e730dac5e3d1109a94e4b8c9d8b7ec31 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 28 Jun 2025 16:01:43 -0700 Subject: [PATCH 06/27] Fix that Chromium is now a capitalized class --- default/hypr/windows.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/default/hypr/windows.conf b/default/hypr/windows.conf index 3b04b4b..90133e1 100644 --- a/default/hypr/windows.conf +++ b/default/hypr/windows.conf @@ -2,11 +2,11 @@ windowrule = suppressevent maximize, class:.* # Force chromium into a tile to deal with --app bug -windowrule = tile, class:^(chromium)$ +windowrule = tile, class:^(Chromium)$ # Just dash of opacity windowrule = opacity 0.97 0.9, class:.* -windowrule = opacity 1 0.97, class:^(chromium|google-chrome|google-chrome-unstable)$ +windowrule = opacity 1 0.97, class:^(Chromium|google-chrome|google-chrome-unstable)$ windowrule = opacity 0.97 0.9, initialClass:^(chrome-.*-Default)$ # web apps windowrule = opacity 1 1, initialClass:^(chrome-youtube.*-Default)$ # Youtube windowrule = opacity 1 1, class:^(zoom|vlc|org.kde.kdenlive|com.obsproject.Studio)$ From 56f60adf6b64dac20866c4f1a0e2fea8aa237686 Mon Sep 17 00:00:00 2001 From: Kenneth Geerts Date: Sun, 29 Jun 2025 01:17:17 +0200 Subject: [PATCH 07/27] Fix for persistent workspaces shown in waybar --- config/waybar/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/waybar/config b/config/waybar/config index 8ab6f76..95eeb53 100644 --- a/config/waybar/config +++ b/config/waybar/config @@ -34,7 +34,7 @@ "9": "9", "active": "󱓻" }, - "persistent_workspaces": { + "persistent-workspaces": { "1": [], "2": [], "3": [], From 6af496f394beb56141bc3eaa1274bde1d1455c9a Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 28 Jun 2025 16:30:43 -0700 Subject: [PATCH 08/27] Fix opacity --- default/hypr/windows.conf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/default/hypr/windows.conf b/default/hypr/windows.conf index 90133e1..ecdc190 100644 --- a/default/hypr/windows.conf +++ b/default/hypr/windows.conf @@ -6,10 +6,9 @@ windowrule = tile, class:^(Chromium)$ # Just dash of opacity windowrule = opacity 0.97 0.9, class:.* -windowrule = opacity 1 0.97, class:^(Chromium|google-chrome|google-chrome-unstable)$ -windowrule = opacity 0.97 0.9, initialClass:^(chrome-.*-Default)$ # web apps -windowrule = opacity 1 1, initialClass:^(chrome-youtube.*-Default)$ # Youtube -windowrule = opacity 1 1, class:^(zoom|vlc|org.kde.kdenlive|com.obsproject.Studio)$ +windowrule = opacity 1 0.97, class:^(Chromium|chromium|google-chrome|google-chrome-unstable)$ +windowrule = opacity 1 1, initialTitle:^(youtube.com_/)$ # Youtube +windowrule = opacity 1 1, class:^(zoom|vlc|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta)$ # Fix some dragging issues with XWayland windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0 From 671f9c7882394a6582c99b42bd867762bf6a7a46 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 28 Jun 2025 16:48:16 -0700 Subject: [PATCH 09/27] Sleep on Super + Shift + Escape And move restarting Hyprland to Super + Alt + Escape --- default/hypr/bindings.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/default/hypr/bindings.conf b/default/hypr/bindings.conf index ae058d5..20a974a 100644 --- a/default/hypr/bindings.conf +++ b/default/hypr/bindings.conf @@ -19,7 +19,8 @@ bind = SUPER, W, killactive, # End active session bind = SUPER, ESCAPE, exec, hyprlock -bind = SUPER SHIFT, ESCAPE, exit, +bind = SUPER SHIFT, ESCAPE, exec, systemctl suspend +bind = SUPER ALT, ESCAPE, exit, bind = SUPER CTRL, ESCAPE, exec, reboot bind = SUPER SHIFT CTRL, ESCAPE, exec, systemctl poweroff From d227a541f002a5bd2865f84d49b5a79699c9a1fb Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 29 Jun 2025 12:39:22 -0700 Subject: [PATCH 10/27] Add migration to fix the persistent workspaces in the waybar config --- migrations/1751225707.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 migrations/1751225707.sh diff --git a/migrations/1751225707.sh b/migrations/1751225707.sh new file mode 100644 index 0000000..0a62f9d --- /dev/null +++ b/migrations/1751225707.sh @@ -0,0 +1,3 @@ +echo "Fixing persistent workspaces in waybar config" +sed -i 's/"persistent_workspaces":/"persistent-workspaces":/' ~/.config/waybar/config +pkill -SIGUSR2 waybar From dedc08a76e779caae8b251058f24a5fcbe225fe9 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 29 Jun 2025 12:49:51 -0700 Subject: [PATCH 11/27] Allow you to easily run all migrations by passing "all" Helpful for testing or if something went wrong --- bin/omarchy-update | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/omarchy-update b/bin/omarchy-update index da517c8..ed102f0 100755 --- a/bin/omarchy-update +++ b/bin/omarchy-update @@ -2,8 +2,13 @@ cd ~/.local/share/omarchy -# Remember the version we're at before upgrading -last_updated_at=$(git log -1 --format=%cd --date=unix) +if [[ $1 == "all" ]]; then + # Run all migrations + last_updated_at=1 +else + # Remember the version we're at before upgrading + last_updated_at=$(git log -1 --format=%cd --date=unix) +fi # Get the latest git pull @@ -20,4 +25,4 @@ for file in migrations/*.sh; do done # Back to where we came from -cd - +cd - >/dev/null From 3162a4cd5a5fa074f6258f1d29f5e10efc43c8a3 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 29 Jun 2025 12:50:53 -0700 Subject: [PATCH 12/27] This strategy didnt actually work, just use all --- migrations/1751136619.sh | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 migrations/1751136619.sh diff --git a/migrations/1751136619.sh b/migrations/1751136619.sh deleted file mode 100644 index eb008e8..0000000 --- a/migrations/1751136619.sh +++ /dev/null @@ -1,3 +0,0 @@ -# Rerun these migrations since it required an update to omarchy-update to even get migrations -source ~/.local/share/omarchy/migrations/1751134568.sh -source ~/.local/share/omarchy/migrations/1751135253.sh From fbd85990d07f2fe3aef7346eee77a716b2fc93e7 Mon Sep 17 00:00:00 2001 From: Kn0ax Date: Sun, 29 Jun 2025 22:19:36 +0200 Subject: [PATCH 13/27] [not tested] nvidia support this commit tries to add nvidia suppport. it's not tested yet. --- install/hyprlandia.sh | 15 ++++++ install/nvidia | 105 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 install/nvidia diff --git a/install/hyprlandia.sh b/install/hyprlandia.sh index a320d9d..8e73a88 100644 --- a/install/hyprlandia.sh +++ b/install/hyprlandia.sh @@ -3,5 +3,20 @@ yay -S --noconfirm --needed \ wofi waybar mako swaybg \ xdg-desktop-portal-hyprland xdg-desktop-portal-gtk +# Checks if nvidia gpu exist +gpu_info=$(lspci | grep -i 'nvidia') +if [ -n "$gpu_info" ]; then + # Ask user if they want to install NVIDIA drivers + if [ -t 0 ]; then + read -p "NVIDIA GPU detected. Do you want to install NVIDIA drivers? (y/N) " install_nvidia + if [[ "$install_nvidia" =~ ^[yY](es)?$ ]]; then + source ./nvidia + fi + else + # Non-interactive mode - run nvidia script + source ./nvidia + fi +fi + # Start Hyprland on first session echo "[[ -z \$DISPLAY && \$(tty) == /dev/tty1 ]] && exec Hyprland" >~/.bash_profile diff --git a/install/nvidia b/install/nvidia new file mode 100644 index 0000000..670a630 --- /dev/null +++ b/install/nvidia @@ -0,0 +1,105 @@ +#!/bin/bash + +# ============================================================================== +# Hyprland NVIDIA Setup Script for Arch Linux +# ============================================================================== +# This script automates the installation and configuration of NVIDIA drivers +# for use with Hyprland on Arch Linux, following the official Hyprland wiki. +# +# Author: https://github.com/Kn0ax +# +# ============================================================================== + +# --- Colors for better readability --- +C_RESET='\033[0m' +C_RED='\033[0;31m' +C_YELLOW='\033[0;33m' +C_BOLD='\033[1m' + +# --- GPU Detection and Driver Selection --- +# Get GPU info for driver selection +gpu_info=$(lspci | grep -i 'nvidia') + +# Turing (16xx, 20xx), Ampere (30xx), Ada (40xx), and newer recommend the open-source kernel modules +if echo "$gpu_info" | grep -q -E "RTX [2-9][0-9]|GTX 16"; then + NVIDIA_DRIVER_PACKAGE="nvidia-open-dkms" +else + NVIDIA_DRIVER_PACKAGE="nvidia-dkms" +fi + +# Check which kernel is installed and set appropriate headers package +KERNEL_HEADERS="linux-headers" # Default +if pacman -Q linux-zen &>/dev/null; then + KERNEL_HEADERS="linux-zen-headers" +elif pacman -Q linux-lts &>/dev/null; then + KERNEL_HEADERS="linux-lts-headers" +elif pacman -Q linux-hardened &>/dev/null; then + KERNEL_HEADERS="linux-hardened-headers" +fi + +# Install packages +PACKAGES_TO_INSTALL=( + "${KERNEL_HEADERS}" + "${NVIDIA_DRIVER_PACKAGE}" + "nvidia-utils" + "lib32-nvidia-utils" + "egl-wayland" + "libva-nvidia-driver" # For VA-API hardware acceleration + "qt5-wayland" + "qt6-wayland" +) + +if ! yay -Syu --needed --noconfirm "${PACKAGES_TO_INSTALL[@]}"; then + echo -e "${C_RED}${C_BOLD}[ERROR]${C_RESET} Failed to install NVIDIA packages. Please check the output for errors." >&2 + exit 1 +fi + +# Configure modprobe for early KMS +if ! echo "options nvidia_drm modeset=1" | sudo tee /etc/modprobe.d/nvidia.conf >/dev/null; then + echo -e "${C_RED}${C_BOLD}[ERROR]${C_RESET} Failed to configure modprobe. Please check your permissions." >&2 + exit 1 +fi + +# Configure mkinitcpio for early loading +MKINITCPIO_CONF="/etc/mkinitcpio.conf" + +if [ ! -f "$MKINITCPIO_CONF" ]; then + echo -e "${C_RED}${C_BOLD}[ERROR]${C_RESET} $MKINITCPIO_CONF not found. Aborting." >&2 + exit 1 +fi + +# Define modules +NVIDIA_MODULES="nvidia nvidia_modeset nvidia_uvm nvidia_drm" + +# Create backup +sudo cp "$MKINITCPIO_CONF" "${MKINITCPIO_CONF}.backup" + +# Remove any old nvidia modules to prevent duplicates +sudo sed -i -E 's/ nvidia_drm//g; s/ nvidia_uvm//g; s/ nvidia_modeset//g; s/ nvidia//g;' "$MKINITCPIO_CONF" +# Add the new modules at the start of the MODULES array +sudo sed -i -E "s/^(MODULES=\\()/\\1${NVIDIA_MODULES} /" "$MKINITCPIO_CONF" +# Clean up potential double spaces +sudo sed -i -E 's/ +/ /g' "$MKINITCPIO_CONF" + +if ! sudo mkinitcpio -P; then + echo -e "${C_RED}${C_BOLD}[ERROR]${C_RESET} Failed to rebuild initramfs with 'mkinitcpio -P'. Please check the output for errors." >&2 + exit 1 +fi + +# Add NVIDIA environment variables to hyprland.conf +HYPRLAND_CONF="$HOME/.config/hypr/hyprland.conf" +if [ -f "$HYPRLAND_CONF" ]; then + cat >> "$HYPRLAND_CONF" << 'EOF' + +# NVIDIA environment variables +env = ELECTRON_OZONE_PLATFORM_HINT,auto +env = NVD_BACKEND,direct +env = LIBVA_DRIVER_NAME,nvidia +env = __GLX_VENDOR_LIBRARY_NAME,nvidia +EOF +fi + +# Final information +echo -e "${C_YELLOW}${C_BOLD}IMPORTANT:${C_RESET} A reboot is required for all changes to take effect." + + From 86d9050420e5c032530a07392eedd0ebcac51503 Mon Sep 17 00:00:00 2001 From: 0xProt Date: Sun, 29 Jun 2025 22:38:14 +0100 Subject: [PATCH 14/27] chore: removed duplicated key in waybar battery config --- config/waybar/config | 1 - 1 file changed, 1 deletion(-) diff --git a/config/waybar/config b/config/waybar/config index 95eeb53..f0911c1 100644 --- a/config/waybar/config +++ b/config/waybar/config @@ -66,7 +66,6 @@ "on-click": "alacritty -e iwctl" }, "battery": { - "interval": 5, "format": "{capacity}% {icon}", "format-discharging": "{icon}", "format-charging": "{icon}", From 8f68793f7c4fd33a3fabfc4f1bf6f51f7bec3ab9 Mon Sep 17 00:00:00 2001 From: Kn0ax Date: Mon, 30 Jun 2025 00:38:36 +0200 Subject: [PATCH 15/27] fix script path meh, stupid me --- install/hyprlandia.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/hyprlandia.sh b/install/hyprlandia.sh index 8e73a88..6a176ce 100644 --- a/install/hyprlandia.sh +++ b/install/hyprlandia.sh @@ -10,11 +10,11 @@ if [ -n "$gpu_info" ]; then if [ -t 0 ]; then read -p "NVIDIA GPU detected. Do you want to install NVIDIA drivers? (y/N) " install_nvidia if [[ "$install_nvidia" =~ ^[yY](es)?$ ]]; then - source ./nvidia + source ~/.local/share/omarchy/install/nvidia fi else # Non-interactive mode - run nvidia script - source ./nvidia + source ~/.local/share/omarchy/install/nvidia fi fi From b5dfaef8bbb4d168969c448dc04b7877d6389d58 Mon Sep 17 00:00:00 2001 From: Kn0ax Date: Mon, 30 Jun 2025 00:47:42 +0200 Subject: [PATCH 16/27] enable multilib (if not already) --- install/nvidia | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install/nvidia b/install/nvidia index 670a630..8c0ffbb 100644 --- a/install/nvidia +++ b/install/nvidia @@ -37,6 +37,11 @@ elif pacman -Q linux-hardened &>/dev/null; then KERNEL_HEADERS="linux-hardened-headers" fi +# Enable multilib repository for 32-bit libraries +if ! grep -q "^\[multilib\]" /etc/pacman.conf; then + sudo sed -i '/^#\[multilib\]/,/^#Include/ s/^#//' /etc/pacman.conf +fi + # Install packages PACKAGES_TO_INSTALL=( "${KERNEL_HEADERS}" From 5e56279feee05451f341530cf938b81b2802a1bb Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 29 Jun 2025 19:01:25 -0700 Subject: [PATCH 17/27] Float sound and bluetooth settings --- default/hypr/windows.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/default/hypr/windows.conf b/default/hypr/windows.conf index ecdc190..9d7dd7e 100644 --- a/default/hypr/windows.conf +++ b/default/hypr/windows.conf @@ -3,6 +3,7 @@ windowrule = suppressevent maximize, class:.* # Force chromium into a tile to deal with --app bug windowrule = tile, class:^(Chromium)$ +windowrule = float, class:^(org.pulseaudio.pavucontrol|blueberry.py)$ # Just dash of opacity windowrule = opacity 0.97 0.9, class:.* From da31736b9a68a2c1d4f73420c5275e763bdc81a1 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 29 Jun 2025 19:01:48 -0700 Subject: [PATCH 18/27] Explain it --- default/hypr/windows.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/default/hypr/windows.conf b/default/hypr/windows.conf index 9d7dd7e..bbabb44 100644 --- a/default/hypr/windows.conf +++ b/default/hypr/windows.conf @@ -3,6 +3,8 @@ windowrule = suppressevent maximize, class:.* # Force chromium into a tile to deal with --app bug windowrule = tile, class:^(Chromium)$ + +# Float sound and bluetooth settings windowrule = float, class:^(org.pulseaudio.pavucontrol|blueberry.py)$ # Just dash of opacity From cfa63fdc679a6b2844837b98dd45e6ebe57f9ffa Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 29 Jun 2025 21:11:49 -0700 Subject: [PATCH 19/27] Add function to refresh xcompose after changes --- default/bash/functions | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/default/bash/functions b/default/bash/functions index 702dabe..926742f 100644 --- a/default/bash/functions +++ b/default/bash/functions @@ -66,5 +66,11 @@ web2app-remove() { rm "$ICON_PATH" } +# Ensure changes to ~/.XCompose are immediately available +refresh-xcompose() { + pkill fcitx5 + setsid fcitx5 &>/dev/null & +} + # Ensure that external keyboards that use an fn key has the F keys as the default alias fix_fkeys='echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode' From 188d1c331a2d44cf6acf3de5fb4981cb7917324b Mon Sep 17 00:00:00 2001 From: Kn0ax Date: Mon, 30 Jun 2025 20:45:17 +0200 Subject: [PATCH 20/27] requested changes --- install/hyprlandia.sh | 17 +---------------- install/{nvidia => nvidia.sh} | 30 +++++++++--------------------- 2 files changed, 10 insertions(+), 37 deletions(-) rename install/{nvidia => nvidia.sh} (82%) diff --git a/install/hyprlandia.sh b/install/hyprlandia.sh index 6a176ce..4e9b9af 100644 --- a/install/hyprlandia.sh +++ b/install/hyprlandia.sh @@ -3,20 +3,5 @@ yay -S --noconfirm --needed \ wofi waybar mako swaybg \ xdg-desktop-portal-hyprland xdg-desktop-portal-gtk -# Checks if nvidia gpu exist -gpu_info=$(lspci | grep -i 'nvidia') -if [ -n "$gpu_info" ]; then - # Ask user if they want to install NVIDIA drivers - if [ -t 0 ]; then - read -p "NVIDIA GPU detected. Do you want to install NVIDIA drivers? (y/N) " install_nvidia - if [[ "$install_nvidia" =~ ^[yY](es)?$ ]]; then - source ~/.local/share/omarchy/install/nvidia - fi - else - # Non-interactive mode - run nvidia script - source ~/.local/share/omarchy/install/nvidia - fi -fi - # Start Hyprland on first session -echo "[[ -z \$DISPLAY && \$(tty) == /dev/tty1 ]] && exec Hyprland" >~/.bash_profile +echo "[[ -z \$DISPLAY && \$(tty) == /dev/tty1 ]] && exec Hyprland" >~/.bash_profile \ No newline at end of file diff --git a/install/nvidia b/install/nvidia.sh similarity index 82% rename from install/nvidia rename to install/nvidia.sh index 8c0ffbb..88afa25 100644 --- a/install/nvidia +++ b/install/nvidia.sh @@ -1,5 +1,3 @@ -#!/bin/bash - # ============================================================================== # Hyprland NVIDIA Setup Script for Arch Linux # ============================================================================== @@ -10,16 +8,20 @@ # # ============================================================================== +# --- GPU Detection --- +# Check if nvidia gpu exists, exit silently if not found +gpu_info=$(lspci | grep -i 'nvidia') +if [ -z "$gpu_info" ]; then + exit 0 +fi + # --- Colors for better readability --- C_RESET='\033[0m' C_RED='\033[0;31m' C_YELLOW='\033[0;33m' C_BOLD='\033[1m' -# --- GPU Detection and Driver Selection --- -# Get GPU info for driver selection -gpu_info=$(lspci | grep -i 'nvidia') - +# --- Driver Selection --- # Turing (16xx, 20xx), Ampere (30xx), Ada (40xx), and newer recommend the open-source kernel modules if echo "$gpu_info" | grep -q -E "RTX [2-9][0-9]|GTX 16"; then NVIDIA_DRIVER_PACKAGE="nvidia-open-dkms" @@ -60,19 +62,11 @@ if ! yay -Syu --needed --noconfirm "${PACKAGES_TO_INSTALL[@]}"; then fi # Configure modprobe for early KMS -if ! echo "options nvidia_drm modeset=1" | sudo tee /etc/modprobe.d/nvidia.conf >/dev/null; then - echo -e "${C_RED}${C_BOLD}[ERROR]${C_RESET} Failed to configure modprobe. Please check your permissions." >&2 - exit 1 -fi +echo "options nvidia_drm modeset=1" | sudo tee /etc/modprobe.d/nvidia.conf >/dev/null # Configure mkinitcpio for early loading MKINITCPIO_CONF="/etc/mkinitcpio.conf" -if [ ! -f "$MKINITCPIO_CONF" ]; then - echo -e "${C_RED}${C_BOLD}[ERROR]${C_RESET} $MKINITCPIO_CONF not found. Aborting." >&2 - exit 1 -fi - # Define modules NVIDIA_MODULES="nvidia nvidia_modeset nvidia_uvm nvidia_drm" @@ -97,14 +91,8 @@ if [ -f "$HYPRLAND_CONF" ]; then cat >> "$HYPRLAND_CONF" << 'EOF' # NVIDIA environment variables -env = ELECTRON_OZONE_PLATFORM_HINT,auto env = NVD_BACKEND,direct env = LIBVA_DRIVER_NAME,nvidia env = __GLX_VENDOR_LIBRARY_NAME,nvidia EOF fi - -# Final information -echo -e "${C_YELLOW}${C_BOLD}IMPORTANT:${C_RESET} A reboot is required for all changes to take effect." - - From d6a44c24a72c8cfdc6e18a0715d7271a7784edda Mon Sep 17 00:00:00 2001 From: Kn0ax Date: Mon, 30 Jun 2025 20:53:36 +0200 Subject: [PATCH 21/27] remove unneeded comments --- config/hypr/hyprland.conf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index dc5bd78..316fc80 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -27,10 +27,6 @@ source = ~/.config/omarchy/current/theme/hyprland.conf # Extra env variables env = GDK_SCALE,2 # Change to 1 if on a 1x display -# Extra env variables needed if running an NVIDIA GPU -# env = NVD_BACKEND,direct -# env = LIBVA_DRIVER_NAME,nvidia -# env = __GLX_VENDOR_LIBRARY_NAME,nvidia # Extra bindings bind = SUPER, A, exec, $webapp="https://chatgpt.com" From f244be542f5e17dfd7688c392bab1c99c0f19658 Mon Sep 17 00:00:00 2001 From: Hari Chalise Date: Tue, 1 Jul 2025 00:47:40 +0545 Subject: [PATCH 22/27] add license file --- LICENSE | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..460108f --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright 2025 + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From 3c07b541bdd643f7f8a10c999db01c8fdf4bb4d9 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 30 Jun 2025 16:00:03 -0700 Subject: [PATCH 23/27] Good window defaults for gaming --- default/hypr/windows.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/default/hypr/windows.conf b/default/hypr/windows.conf index bbabb44..fb43424 100644 --- a/default/hypr/windows.conf +++ b/default/hypr/windows.conf @@ -7,11 +7,16 @@ windowrule = tile, class:^(Chromium)$ # Float sound and bluetooth settings windowrule = float, class:^(org.pulseaudio.pavucontrol|blueberry.py)$ +# Float Steam, fullscreen RetroArch +windowrule = float, class:^(steam)$ +windowrule = fullscreen, class:^(com.libretro.RetroArch)$ + # Just dash of opacity windowrule = opacity 0.97 0.9, class:.* windowrule = opacity 1 0.97, class:^(Chromium|chromium|google-chrome|google-chrome-unstable)$ windowrule = opacity 1 1, initialTitle:^(youtube.com_/)$ # Youtube windowrule = opacity 1 1, class:^(zoom|vlc|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta)$ +windowrule = opacity 1 1, class:^(com.libretro.RetroArch|steam)$ # Fix some dragging issues with XWayland windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0 From 8d15510a0cf90bdd09b831df676d8db0fb5326dc Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 30 Jun 2025 16:42:09 -0700 Subject: [PATCH 24/27] Update LICENSE --- LICENSE | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index 460108f..f12cfa7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,20 @@ -Copyright 2025 +Copyright (c) David Heinemeier Hansson -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From e8c9a5ad49d3b0b28a1268b8e54f88d5f0a533f1 Mon Sep 17 00:00:00 2001 From: Zhephod Date: Mon, 30 Jun 2025 23:56:33 -0700 Subject: [PATCH 25/27] remove defensive code --- install/nvidia.sh | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/install/nvidia.sh b/install/nvidia.sh index 88afa25..90e81d0 100644 --- a/install/nvidia.sh +++ b/install/nvidia.sh @@ -5,7 +5,7 @@ # for use with Hyprland on Arch Linux, following the official Hyprland wiki. # # Author: https://github.com/Kn0ax -# +# # ============================================================================== # --- GPU Detection --- @@ -15,12 +15,6 @@ if [ -z "$gpu_info" ]; then exit 0 fi -# --- Colors for better readability --- -C_RESET='\033[0m' -C_RED='\033[0;31m' -C_YELLOW='\033[0;33m' -C_BOLD='\033[1m' - # --- Driver Selection --- # Turing (16xx, 20xx), Ampere (30xx), Ada (40xx), and newer recommend the open-source kernel modules if echo "$gpu_info" | grep -q -E "RTX [2-9][0-9]|GTX 16"; then @@ -46,7 +40,7 @@ fi # Install packages PACKAGES_TO_INSTALL=( - "${KERNEL_HEADERS}" + "${KERNEL_HEADERS}" "${NVIDIA_DRIVER_PACKAGE}" "nvidia-utils" "lib32-nvidia-utils" @@ -56,10 +50,7 @@ PACKAGES_TO_INSTALL=( "qt6-wayland" ) -if ! yay -Syu --needed --noconfirm "${PACKAGES_TO_INSTALL[@]}"; then - echo -e "${C_RED}${C_BOLD}[ERROR]${C_RESET} Failed to install NVIDIA packages. Please check the output for errors." >&2 - exit 1 -fi +yay -Syu --needed --noconfirm "${PACKAGES_TO_INSTALL[@]}" # Configure modprobe for early KMS echo "options nvidia_drm modeset=1" | sudo tee /etc/modprobe.d/nvidia.conf >/dev/null @@ -80,10 +71,7 @@ sudo sed -i -E "s/^(MODULES=\\()/\\1${NVIDIA_MODULES} /" "$MKINITCPIO_CONF" # Clean up potential double spaces sudo sed -i -E 's/ +/ /g' "$MKINITCPIO_CONF" -if ! sudo mkinitcpio -P; then - echo -e "${C_RED}${C_BOLD}[ERROR]${C_RESET} Failed to rebuild initramfs with 'mkinitcpio -P'. Please check the output for errors." >&2 - exit 1 -fi +sudo mkinitcpio -P # Add NVIDIA environment variables to hyprland.conf HYPRLAND_CONF="$HOME/.config/hypr/hyprland.conf" From e9a399173ba6d1930da5f88cb5dcb5db2ced3493 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 2 Jul 2025 13:15:37 -0700 Subject: [PATCH 26/27] Set a default branch name --- install/4-config.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install/4-config.sh b/install/4-config.sh index c668067..bf646cd 100644 --- a/install/4-config.sh +++ b/install/4-config.sh @@ -18,6 +18,7 @@ git config --global alias.br branch git config --global alias.ci commit git config --global alias.st status git config --global pull.rebase true +git config --global init.defaultBranch master # Set identification from install inputs if [[ -n "${OMARCHY_USER_NAME//[[:space:]]/}" ]]; then From 863a1b0b3e0430c466e0e96526185b98c25c6bdb Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 2 Jul 2025 16:21:52 -0700 Subject: [PATCH 27/27] Fix nvidia check --- install/nvidia.sh | 82 ++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 43 deletions(-) diff --git a/install/nvidia.sh b/install/nvidia.sh index 90e81d0..6666562 100644 --- a/install/nvidia.sh +++ b/install/nvidia.sh @@ -9,37 +9,32 @@ # ============================================================================== # --- GPU Detection --- -# Check if nvidia gpu exists, exit silently if not found -gpu_info=$(lspci | grep -i 'nvidia') -if [ -z "$gpu_info" ]; then - exit 0 -fi - -# --- Driver Selection --- -# Turing (16xx, 20xx), Ampere (30xx), Ada (40xx), and newer recommend the open-source kernel modules -if echo "$gpu_info" | grep -q -E "RTX [2-9][0-9]|GTX 16"; then +if [ -n "$(lspci | grep -i 'nvidia')" ]; then + # --- Driver Selection --- + # Turing (16xx, 20xx), Ampere (30xx), Ada (40xx), and newer recommend the open-source kernel modules + if echo "$gpu_info" | grep -q -E "RTX [2-9][0-9]|GTX 16"; then NVIDIA_DRIVER_PACKAGE="nvidia-open-dkms" -else + else NVIDIA_DRIVER_PACKAGE="nvidia-dkms" -fi + fi -# Check which kernel is installed and set appropriate headers package -KERNEL_HEADERS="linux-headers" # Default -if pacman -Q linux-zen &>/dev/null; then + # Check which kernel is installed and set appropriate headers package + KERNEL_HEADERS="linux-headers" # Default + if pacman -Q linux-zen &>/dev/null; then KERNEL_HEADERS="linux-zen-headers" -elif pacman -Q linux-lts &>/dev/null; then + elif pacman -Q linux-lts &>/dev/null; then KERNEL_HEADERS="linux-lts-headers" -elif pacman -Q linux-hardened &>/dev/null; then + elif pacman -Q linux-hardened &>/dev/null; then KERNEL_HEADERS="linux-hardened-headers" -fi + fi -# Enable multilib repository for 32-bit libraries -if ! grep -q "^\[multilib\]" /etc/pacman.conf; then + # Enable multilib repository for 32-bit libraries + if ! grep -q "^\[multilib\]" /etc/pacman.conf; then sudo sed -i '/^#\[multilib\]/,/^#Include/ s/^#//' /etc/pacman.conf -fi + fi -# Install packages -PACKAGES_TO_INSTALL=( + # Install packages + PACKAGES_TO_INSTALL=( "${KERNEL_HEADERS}" "${NVIDIA_DRIVER_PACKAGE}" "nvidia-utils" @@ -48,39 +43,40 @@ PACKAGES_TO_INSTALL=( "libva-nvidia-driver" # For VA-API hardware acceleration "qt5-wayland" "qt6-wayland" -) + ) -yay -Syu --needed --noconfirm "${PACKAGES_TO_INSTALL[@]}" + yay -Syu --needed --noconfirm "${PACKAGES_TO_INSTALL[@]}" -# Configure modprobe for early KMS -echo "options nvidia_drm modeset=1" | sudo tee /etc/modprobe.d/nvidia.conf >/dev/null + # Configure modprobe for early KMS + echo "options nvidia_drm modeset=1" | sudo tee /etc/modprobe.d/nvidia.conf >/dev/null -# Configure mkinitcpio for early loading -MKINITCPIO_CONF="/etc/mkinitcpio.conf" + # Configure mkinitcpio for early loading + MKINITCPIO_CONF="/etc/mkinitcpio.conf" -# Define modules -NVIDIA_MODULES="nvidia nvidia_modeset nvidia_uvm nvidia_drm" + # Define modules + NVIDIA_MODULES="nvidia nvidia_modeset nvidia_uvm nvidia_drm" -# Create backup -sudo cp "$MKINITCPIO_CONF" "${MKINITCPIO_CONF}.backup" + # Create backup + sudo cp "$MKINITCPIO_CONF" "${MKINITCPIO_CONF}.backup" -# Remove any old nvidia modules to prevent duplicates -sudo sed -i -E 's/ nvidia_drm//g; s/ nvidia_uvm//g; s/ nvidia_modeset//g; s/ nvidia//g;' "$MKINITCPIO_CONF" -# Add the new modules at the start of the MODULES array -sudo sed -i -E "s/^(MODULES=\\()/\\1${NVIDIA_MODULES} /" "$MKINITCPIO_CONF" -# Clean up potential double spaces -sudo sed -i -E 's/ +/ /g' "$MKINITCPIO_CONF" + # Remove any old nvidia modules to prevent duplicates + sudo sed -i -E 's/ nvidia_drm//g; s/ nvidia_uvm//g; s/ nvidia_modeset//g; s/ nvidia//g;' "$MKINITCPIO_CONF" + # Add the new modules at the start of the MODULES array + sudo sed -i -E "s/^(MODULES=\\()/\\1${NVIDIA_MODULES} /" "$MKINITCPIO_CONF" + # Clean up potential double spaces + sudo sed -i -E 's/ +/ /g' "$MKINITCPIO_CONF" -sudo mkinitcpio -P + sudo mkinitcpio -P -# Add NVIDIA environment variables to hyprland.conf -HYPRLAND_CONF="$HOME/.config/hypr/hyprland.conf" -if [ -f "$HYPRLAND_CONF" ]; then - cat >> "$HYPRLAND_CONF" << 'EOF' + # Add NVIDIA environment variables to hyprland.conf + HYPRLAND_CONF="$HOME/.config/hypr/hyprland.conf" + if [ -f "$HYPRLAND_CONF" ]; then + cat >>"$HYPRLAND_CONF" <<'EOF' # NVIDIA environment variables env = NVD_BACKEND,direct env = LIBVA_DRIVER_NAME,nvidia env = __GLX_VENDOR_LIBRARY_NAME,nvidia EOF + fi fi