diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f12cfa7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +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: + +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. 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 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" diff --git a/config/waybar/config b/config/waybar/config index 8ab6f76..f0911c1 100644 --- a/config/waybar/config +++ b/config/waybar/config @@ -34,7 +34,7 @@ "9": "9", "active": "󱓻" }, - "persistent_workspaces": { + "persistent-workspaces": { "1": [], "2": [], "3": [], @@ -66,7 +66,6 @@ "on-click": "alacritty -e iwctl" }, "battery": { - "interval": 5, "format": "{capacity}% {icon}", "format-discharging": "{icon}", "format-charging": "{icon}", 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' 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 diff --git a/default/hypr/windows.conf b/default/hypr/windows.conf index 3b04b4b..fb43424 100644 --- a/default/hypr/windows.conf +++ b/default/hypr/windows.conf @@ -2,14 +2,21 @@ windowrule = suppressevent maximize, class:.* # Force chromium into a tile to deal with --app bug -windowrule = tile, class:^(chromium)$ +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|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)$ +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 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 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 diff --git a/install/hyprlandia.sh b/install/hyprlandia.sh index a320d9d..4e9b9af 100644 --- a/install/hyprlandia.sh +++ b/install/hyprlandia.sh @@ -4,4 +4,4 @@ yay -S --noconfirm --needed \ xdg-desktop-portal-hyprland xdg-desktop-portal-gtk # 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.sh b/install/nvidia.sh new file mode 100644 index 0000000..6666562 --- /dev/null +++ b/install/nvidia.sh @@ -0,0 +1,82 @@ +# ============================================================================== +# 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 +# +# ============================================================================== + +# --- GPU Detection --- +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 + 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 + + # 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}" + "${NVIDIA_DRIVER_PACKAGE}" + "nvidia-utils" + "lib32-nvidia-utils" + "egl-wayland" + "libva-nvidia-driver" # For VA-API hardware acceleration + "qt5-wayland" + "qt6-wayland" + ) + + 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 mkinitcpio for early loading + MKINITCPIO_CONF="/etc/mkinitcpio.conf" + + # 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" + + 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' + +# NVIDIA environment variables +env = NVD_BACKEND,direct +env = LIBVA_DRIVER_NAME,nvidia +env = __GLX_VENDOR_LIBRARY_NAME,nvidia +EOF + fi +fi 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 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