Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The fallback location of Hyprland socket is not properly configured when $TMP environment variable is set #3280

Closed
amvasilyev opened this issue May 19, 2024 · 1 comment · Fixed by #3308

Comments

@amvasilyev
Copy link

In 0.10.3 Waybar was updated to support the new location of Hyprland IPC socket. The corresponding code contains logic to find the fallback location. The code uses the std::filesystem::temp_directory_path function to get location of the temp directory.

The temp_directory_path function does not always return path to the /tmp directory and may be affected by several environment variables. My distribution provides a $TMP variable that does not point to the /tmp directory. Therefore the path is not properly computed, the module can not communicate with Hyprland.

In old version of Hyprland wiki specifies the directory of the socket to be /tmp. Taking into account that previous Waybar was working perfectly fine with the same directory I suggest to change the search path to /tmp:

     socketFolder = xdgRuntimeDir / "hypr";
   } else {
     spdlog::warn("$XDG_RUNTIME_DIR/hypr does not exist, falling back to /tmp/hypr");
-    socketFolder = std::filesystem::temp_directory_path() / "hypr";
+    socketFolder = std::filesystem::path("/tmp") / "hypr";
   }
   socketFolder = socketFolder / instanceSig;
   return socketFolder;
@Slimemaster0
Copy link

Slimemaster0 commented May 25, 2024

If you want to fix it for your self just do exec = $XDG_RUNTIME_DIR=/path/to/runtime/dir waybar in your Hyprland config.
But yes you shouldn't have to fix it your self.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants