zakk4223 / hyprland-workspace-rules

0 stars 1 forks source link

Failing to build with latest (0.35.0) Hyprland version #2

Open mihneaCR opened 7 months ago

mihneaCR commented 7 months ago

Hi, thanks for your plugin, this is exactly what I'm looking for to replace my hacky bash script. When trying to add this plugin via hyprpm though, it fails to build:


hyprpm add -v https://github.com/zakk4223/hyprland-workspace-rules
[v] version returned: Hyprland, built from branch HEAD at commit 84ab8d11e8951a6551d1e1bf87796a8589da6d47  (props: bump ver to 0.35.0).
Date: Mon Feb 5 01:59:02 2024
Tag: v0.35.0

flags: (if any)

[v] parsed commit 84ab8d11e8951a6551d1e1bf87796a8589da6d47 at branch HEAD ✔ adding a new plugin repository from https://github.com/zakk4223/hyprland-workspace-rules MAKE SURE that you trust the authors. DO NOT install random plugins without verifying the code and author. Are you sure? [Y/n]

╍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0 / 5 Cloning the plugin repositor! old plugin repo build files found in temp directory, removing.
╍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0 / 5 Cloning the plugin repositor → Cloning https://github.com/zakk4223/hyprland-workspace-rules
╍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0 / 5 Cloning the plugin repositor✔ cloned
━━━━━━━━━━╍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1 / 5 Cloning the plugin repositor✔ found hyprpm manifest
✔ parsed manifest, found 1 plugins:
→ monitor-workspace-rules by Zakk version
→ Manifest has 2 pins, checking
✔ commit pin 4525c3466cbf5edea95c497515b7e250a1d1af13 matched hl, resetting
✔ Hyprland headers OK
→ Building monitor-workspace-rules
✖ Plugin monitor-workspace-rules failed to build.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╍━━━━━━━━━━━━━━━━━━━ 3 / 5 Building plugin(s)[v] shell returned: -> cd /tmp/hyprpm/new && PKG_CONFIG_PATH="/home/mihnea/.local/share/hyprpm/headersRoot/share/pkgconfig" make all g++ -shared -Wall -fPIC --no-gnu-unique ./main.cpp -g -fcf-protection -DWLR_USE_UNSTABLE pkg-config --cflags pixman-1 libdrm hyprland -std=c++23 -o monitor-workspace-rules.so ./main.cpp:33:61: error: ‘HyprCtl’ has not been declared 33 | std::string hkgetWorkspaceRuleData(const SWorkspaceRule& r, HyprCtl::eHyprCtlOutputFormat format) { | ^~~ ./main.cpp:33:91: error: expected ‘,’ or ‘...’ before ‘format’ 33 | std::string hkgetWorkspaceRuleData(const SWorkspaceRule& r, HyprCtl::eHyprCtlOutputFormat format) { | ^~ ./main.cpp: In function ‘std::string {anonymous}::hkgetWorkspaceRuleData(const SWorkspaceRule&, int)’: ./main.cpp:35:9: error: ‘format’ was not declared in this scope; did you mean ‘std::format’? 35 | if (format == HyprCtl::FORMAT_JSON) { | ^~ | std::format In file included from /home/mihnea/.local/share/hyprpm/headersRoot/include/hyprland/src/helpers/Vector2D.hpp:4, from /home/mihnea/.local/share/hyprpm/headersRoot/include/hyprland/src/includes.hpp:150, from ./main.cpp:1: /usr/include/c++/13.2.1/format:3765:5: note: ‘std::format’ declared here 3765 | format(const locale& loc, wformat_string<_Args...> fmt, | ^~ ./main.cpp:35:19: error: ‘HyprCtl’ has not been declared 35 | if (format == HyprCtl::FORMAT_JSON) { | ^~~ ./main.cpp: At global scope: ./main.cpp:88:45: error: ‘HyprCtl’ has not been declared 88 | std::string hkworkspaceRulesRequest(HyprCtl::eHyprCtlOutputFormat format) { | ^~~ ./main.cpp:88:83: error: expected ‘,’ or ‘;’ before ‘{’ token 88 | std::string hkworkspaceRulesRequest(HyprCtl::eHyprCtlOutputFormat format) { | ^ ./main.cpp: In function ‘std::string {anonymous}::hkgetWorkspaceRuleData(const SWorkspaceRule&, int)’: ./main.cpp:86:9: warning: control reaches end of non-void function [-Wreturn-type] 86 | } | ^ ./main.cpp: At global scope: ./main.cpp:33:13: warning: ‘std::string {anonymous}::hkgetWorkspaceRuleData(const SWorkspaceRule&, int)’ defined but not used [-Wunused-function] 33 | std::string hkgetWorkspaceRuleData(const SWorkspaceRule& r, HyprCtl::eHyprCtlOutputFormat format) { | ^~~~~~ ./main.cpp:28:21: warning: ‘void {anonymous}::trimTrailingComma(std::string&)’ defined but not used [-Wunused-function] 28 | static void trimTrailingComma(std::string& str) { | ^~~~~ make: *** [Makefile:7: monitor-workspace-rules.so] Error 1

✔ all plugins built
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╍━━━━━━━━━ 4 / 5 Installing repositoryterminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error' what(): filesystem error: cannot copy file: No such file or directory [/tmp/hyprpm/new/monitor-workspace-rules.so] [/home/mihnea/.local/share/hyprpm/monitor-workspace-rules/monitor-workspace-rules.so] zsh: IOT instruction (core dumped) hyprpm add -v https://github.com/zakk4223/hyprland-workspace-rules

Trying to build from the cloned repo directly works. Moving the compiled .so file and creating an adequate state.toml file allows for the plugin to be loaded successfully though.
However, I have noticed that the set options don't seem to have any effect (orientation is not changing based on the monitor the workspace is displaying on).

I am running the latest Hyprland from the arch repos:
```shell
❯ hyprctl version
Hyprland, built from branch HEAD at commit 84ab8d11e8951a6551d1e1bf87796a8589da6d47  (props: bump ver to 0.35.0).
Date: Mon Feb 5 01:59:02 2024
Tag: v0.35.0

flags: (if any)

Do you know how to proceed with debugging? Thanks in advance!

zakk4223 commented 7 months ago

I had the wrong pin set in hyprpm for 0.35. Should be fixed now.

Are you also running split-monitor-workspaces?

mihneaCR commented 7 months ago

Thanks for helping! It does not compile yet, due to a syntax error (deleted one line too many) It works (as intended I think) when correcting that error, although it's not quite usable for me yet. When creating a new workspace it does apply the correct orientation, when moving one workspace to the other monitor though, the orientation doesn't change dynamically, which would be nice. My use case is having both a landscape and a portrait monitor, and I'm using focusworkspaceoncurrentmonitor to switch between workspaces (I'm looking for XMonad style workspaces, where all 10 workspaces are shared between both monitors).

I'm not using split-monitor-workspaces, the only other plugin I'm using is hycov, but I'd be willing to disable that, if it were necessary.