hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.05k stars 881 forks source link

`$PATH` gets mangled/reset/? in Hyprland session #6501

Closed Atemu closed 4 months ago

Atemu commented 4 months ago

Bug or Regression?

Bug

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit dirty (). Date: Tag: , commits: flags: (if any) System Information: System name: Linux Node name: LYKOURGOS Release: 6.8.11-xanmod1 Version: #1-NixOS SMP PREEMPT_DYNAMIC Tue Jan 1 00:00:00 UTC 1980 GPU information: c1:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 [1002:15bf] (rev c2) (prog-if 00 [VGA controller]) os-release: ANSI_COLOR="1;34" BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" BUILD_ID="24.11.git.b9122fde00c3M" DOCUMENTATION_URL="https://nixos.org/learn.html" HOME_URL="https://nixos.org/" ID=nixos IMAGE_ID="" IMAGE_VERSION="" LOGO="nix-snowflake" NAME=NixOS PRETTY_NAME="NixOS 24.11 (Vicuña)" SUPPORT_URL="https://nixos.org/community.html" VERSION="24.11 (Vicuña)" VERSION_CODENAME="vicuña" VERSION_ID="24.11" plugins: ``` (NixOS breaks the version output but it's f15513309b24790099d42974274eb23f66f7c985) Config: ``` # ####################################################################################### # AUTOGENERATED HYPR CONFIG. # PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT, # OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS. # ####################################################################################### # autogenerated = 1 # remove this line to remove the warning # This is an example Hyprland config file. # Refer to the wiki for more information. # https://wiki.hyprland.org/Configuring/Configuring-Hyprland/ # Please note not all available settings / options are set here. # For a full list, see the wiki # You can split this configuration into multiple files # Create your files separately and then link them to this file like this: # source = ~/.config/hypr/myColors.conf ################ ### MONITORS ### ################ # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=,preferred,auto,auto ################### ### MY PROGRAMS ### ################### # See https://wiki.hyprland.org/Configuring/Keywords/ # Set programs that you use $terminal = mlterm $fileManager = dolphin $menu = wofi --show drun # $menu = bemenu ################# ### AUTOSTART ### ################# # Autostart necessary processes (like notifications daemons, status bars, etc.) # Or execute your favorite apps at launch like this: # exec-once = $terminal # exec-once = nm-applet & # exec-once = waybar & hyprpaper & firefox exec-once = hypridle ############################# ### ENVIRONMENT VARIABLES ### ############################# # See https://wiki.hyprland.org/Configuring/Environment-variables/ env = XCURSOR_SIZE,24 env = HYPRCURSOR_SIZE,24 ##################### ### LOOK AND FEEL ### ##################### # Refer to https://wiki.hyprland.org/Configuring/Variables/ # https://wiki.hyprland.org/Configuring/Variables/#general general { gaps_in = 2 gaps_out = 0 border_size = 1 # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors col.active_border = rgba(33ccffee)# rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) # Set to true enable resizing windows by clicking and dragging on borders and gaps resize_on_border = true # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = false # layout = dwindle } # https://wiki.hyprland.org/Configuring/Variables/#decoration decoration { # rounding = 10 # Change transparency of focused and unfocused windows active_opacity = 1.0 inactive_opacity = 1.0 drop_shadow = false shadow_range = 4 shadow_render_power = 3 col.shadow = rgba(1a1a1aee) # https://wiki.hyprland.org/Configuring/Variables/#blur blur { enabled = false size = 3 passes = 1 vibrancy = 0.1696 } } # https://wiki.hyprland.org/Configuring/Variables/#animations animations { enabled = true # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = myBezier, 0.05, 0.9, 0.1, 1.05 animation = global, 0, 7, myBezier animation = workspaces, 1, 1.5, default } # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more dwindle { pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true # You probably want this no_gaps_when_only = true } # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more master { new_is_master = true } group { groupbar { render_titles = false height = 1 } } # https://wiki.hyprland.org/Configuring/Variables/#misc misc { force_default_wallpaper = 1 # Set to 0 or 1 to disable the anime mascot wallpapers disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :( hide_cursor_on_key_press = true # I'd like my screen to turn on when I press a button please mouse_move_enables_dpms = true key_press_enables_dpms = true # Variable frame rate? # TODO need to test whether this affects input delay vrr = 1 vfr = true # supposedly "lowers the amount of frames sent to the display" no_direct_scanout = false } xwayland { force_zero_scaling = true } ############# ### INPUT ### ############# # https://wiki.hyprland.org/Configuring/Variables/#input input { kb_layout = us kb_variant = altgr-intl kb_model = kb_options = caps:escape kb_rules = repeat_rate = 30 repeat_delay = 200 accel_profile = flat follow_mouse = 1 sensitivity = 0 # -1.0 - 1.0, 0 means no modification. touchpad { natural_scroll = false scroll_factor = 0.5 # disable_while_typing = true # TODO try whether this actually changes the parameter } } # https://wiki.hyprland.org/Configuring/Variables/#gestures gestures { workspace_swipe = true # workspace_swipe_distance = 200 workspace_swipe_min_speed_to_force = 10 workspace_swipe_invert = false } # Example per-device config # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more device { name = pixa3854:00-093a:0274-touchpad sensitivity = -0.125 accel_profile = flat } #################### ### KEYBINDINGSS ### #################### # See https://wiki.hyprland.org/Configuring/Keywords/ $mainMod = SUPER # Sets "Windows" key as main modifier # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, RETURN, exec, $terminal bind = $mainMod, w, killactive, unbind = $mainMod, e # Needs to be done for some reason? # TODO still necessary now that I do shift properly? bind = $mainMod, e, exec, emacsclient -c bind = $mainMod SHIFT, E, exit, bind = $mainMod, ESCAPE, exec, loginctl lock-session bind = $mainMod SHIFT, s, exec, systemctl suspend bind = $mainMod, SPACE, togglefloating, bind = $mainMod, x, exec, $menu # bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, s, togglesplit, # dwindle unbind = $mainMod, f bind = $mainMod, f, fullscreen, 2 bind = $mainMod SHIFT, f, fullscreen, 1 bind = $mainMod, t, togglegroup, # Move focus with mainMod + vi keys bind = $mainMod, h, movefocus, l bind = $mainMod, l, movefocus, r bind = $mainMod, k, movefocus, u bind = $mainMod, j, movefocus, d # Move window with mainMod + vi keys bind = $mainMod SHIFT, h, movewindoworgroup, l bind = $mainMod SHIFT, l, movewindoworgroup, r bind = $mainMod SHIFT, k, movewindoworgroup, u bind = $mainMod SHIFT, j, movewindoworgroup, d bind = $mainMod, u, lockactivegroup, lock bind = $mainMod, d, lockactivegroup, unlock bind = $mainMod, grave, changegroupactive, f bind = $mainMod SHIFT, grave, changegroupactive, b # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 bind = $mainMod, 3, workspace, 3 bind = $mainMod, 4, workspace, 4 bind = $mainMod, 5, workspace, 5 bind = $mainMod, 6, workspace, 6 bind = $mainMod, 7, workspace, 7 bind = $mainMod, 8, workspace, 8 bind = $mainMod, 9, workspace, 9 bind = $mainMod, 0, workspace, 10 # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1 bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2 bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3 bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4 bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5 bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6 bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7 bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8 bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9 bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10 # Example special workspace (scratchpad) bind = $mainMod, p, togglespecialworkspace, magic bind = $mainMod SHIFT, p, movetoworkspacesilent, special:magic # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_up, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow binde = , XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 2%+ binde = , XF86AudioLowerVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 2%- binde = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle binde = , XF86MonBrightnessUp, exec, brightnessctl set +3% binde = , XF86MonBrightnessDown, exec, brightnessctl set 3%- ############################## ### WINDOWS AND WORKSPACES ### ############################## # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules # Example windowrule v1 # windowrule = float, ^(kitty)$ # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. ```

Description

I have a .profile which sets some env vars, including $PATH which I prepend to:

PATH=$HOME/.local/bin/:$PATH

All of these env vars appear to be set in the session except for $PATH which is missing this modification for some reason.

Additionally, I set an env var that makes my .profile idempotent, so these vars are not set upon opening a shell.

This works in every desktop environment I have encountered but Hyprland.

How to reproduce

  1. Set $PATH in your .profile
  2. Have a profile idempotence setup
  3. Start Hyprland via GDM

Crash reports, logs, images, videos

No response

Atemu commented 4 months ago

Duplicating that part of the config (env = PATH,$HOME/.local/bin/:$PATH) works around the issue but that approach has obvious issues.

vaxerski commented 4 months ago

hyprland doesn't mangle your env, it's GDM that doesn't source your .profile when launching hyprland. Most login managers don't.

Atemu commented 4 months ago

GDM (or whatever other part in this chain) is sourcing my .profile. The env var that is used for idempotence is set in the session (confirmed by echoing it via a bind) and .profile is not being sourced again when I open a shell.

It's really only $PATH that is wrong, all the other env vars are fine. It's really confusing; something must be specifically altering $PATH.

Though it might indeed be GDM doing the env var fuckery, I'll investigate that.

vaxerski commented 4 months ago

hyprland doesnt do anything to your path

Atemu commented 4 months ago

Thanks for the confirmation.

In the mean time, I have found two GDM issues that might be interesting for anyone else running into this issue:

https://gitlab.gnome.org/GNOME/gdm/-/issues/692 https://gitlab.gnome.org/GNOME/gdm/-/issues/846

It's still weird that this only happens in Hyprland though. All other desktop sessions I have tried did not have this issue.
Is there anything Hyprland does perhaps even a little differently in the startup process that could be triggering this GDM bug?

vaxerski commented 4 months ago

not that I am aware of