diff --git a/README.md b/README.md index 15e46a1..4802945 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,8 @@ gentoo-legion/ ├── system/ # System configuration │ ├── ccache.conf # Compiler cache config │ ├── dracut.conf.d/ # Initramfs configuration -│ └── conf.d/ # OpenRC service configs +│ ├── conf.d/ # OpenRC service configs +│ └── udev/ # udev rules (power profile switching) ├── greetd/ # Display manager configuration │ ├── config.toml # greetd main config │ ├── regreet.toml # GTK greeter theming @@ -91,6 +92,7 @@ These files can be copied directly to your system: | `system/ccache.conf` | `/etc/ccache.conf` | | `system/dracut.conf.d/*` | `/etc/dracut.conf.d/` | | `system/conf.d/{iptables,ip6tables,snapper}` | `/etc/conf.d/` | +| `system/udev/*` | `/etc/udev/rules.d/` | | `greetd/*` | `/etc/greetd/` (and `/etc/pam.d/greetd`) | | `firewall/ip6tables.rules` | `/etc/iptables/` | | `shell/starship.toml` | `~/.config/starship.toml` | diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 8bcdbc1..9e6bd9b 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -237,6 +237,32 @@ llvm-core/clang clang This is already included in the provided `package.use/steam` file. +### Hyprland GCC 15 ICE + +GCC 15 crashes with an internal compiler error when compiling Hyprland with `-march=znver3` and C++26 modules: + +``` +internal compiler error: Segmentation fault +``` + +This occurs on `SinglePixel.cpp` due to a bug in GCC's handling of C++26 module imports with aggressive optimizations. + +**Fix:** Compile Hyprland with clang instead of GCC: + +```bash +# Create clang environment +echo 'CC="clang"' > /etc/portage/env/clang.conf +echo 'CXX="clang++"' >> /etc/portage/env/clang.conf + +# Apply to Hyprland +echo "gui-wm/hyprland clang.conf" >> /etc/portage/package.env/clang + +# Rebuild +emerge -1 gui-wm/hyprland +``` + +This is already included in the provided `env/clang.conf` and `package.env/clang` files. + ### Circular Dependency (freetype/harfbuzz) During initial install, use `-harfbuzz` flag temporarily: @@ -268,6 +294,37 @@ emerge -pv Add missing flags to `/etc/portage/package.use/`. +## Hyprland Session Logging + +By default, Hyprland outputs startup logs to the terminal. To redirect to a file: + +1. Create a wrapper script `/usr/local/bin/start-hyprland-dbus`: + ```bash + #!/bin/bash + exec dbus-run-session /usr/bin/start-hyprland > ~/.local/log/hyprland.log 2>&1 + ``` + +2. Ensure log directory exists: + ```bash + mkdir -p ~/.local/log + ``` + +3. Automate the session entry update via `/etc/portage/bashrc`: + ```bash + # Portage hooks + + post_pkg_postinst() { + case "${CATEGORY}/${PN}" in + gui-wm/hyprland) + sed -i 's|Exec=.*|Exec=/usr/local/bin/start-hyprland-dbus|' /usr/share/wayland-sessions/hyprland.desktop + einfo "Updated hyprland.desktop to use start-hyprland-dbus" + ;; + esac + } + ``` + +This hook automatically patches `/usr/share/wayland-sessions/hyprland.desktop` after each Hyprland update. + ## Getting Help 1. Check Gentoo Wiki: https://wiki.gentoo.org/ diff --git a/portage/bashrc b/portage/bashrc new file mode 100644 index 0000000..268495c --- /dev/null +++ b/portage/bashrc @@ -0,0 +1,10 @@ +# Portage hooks + +post_pkg_postinst() { + case "${CATEGORY}/${PN}" in + gui-wm/hyprland) + sed -i 's|Exec=.*|Exec=/usr/local/bin/start-hyprland-dbus|' /usr/share/wayland-sessions/hyprland.desktop + einfo "Updated hyprland.desktop to use start-hyprland-dbus" + ;; + esac +} diff --git a/portage/env/clang.conf b/portage/env/clang.conf new file mode 100644 index 0000000..485cd28 --- /dev/null +++ b/portage/env/clang.conf @@ -0,0 +1,5 @@ +# Use clang/clang++ instead of GCC +# Workaround for GCC 15 ICE (internal compiler error) with -march=znver3 +# and C++26 modules on certain packages +CC="clang" +CXX="clang++" diff --git a/portage/package.env/clang b/portage/package.env/clang new file mode 100644 index 0000000..198e6a7 --- /dev/null +++ b/portage/package.env/clang @@ -0,0 +1,2 @@ +# Packages that need clang due to GCC 15 ICE with -march=znver3 + C++26 modules +gui-wm/hyprland clang.conf diff --git a/system/udev/99-power-profile.rules b/system/udev/99-power-profile.rules new file mode 100644 index 0000000..14225f4 --- /dev/null +++ b/system/udev/99-power-profile.rules @@ -0,0 +1,3 @@ +# Automatic power profile switching based on AC state +ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/usr/bin/powerprofilesctl set performance" +ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/usr/bin/powerprofilesctl set power-saver"