Why isn’t my active workspace showing up in eww on Hyprland?

0
3
Asked By QuirkySocks72 On

I'm working on setting up a status bar in eww while using Hyprland, and I want to display the currently active workspace in a different color. I've managed to show the currently used workspaces using a `defpoll` command, but I'm having trouble with the active workspace. Even though the command `hyprctl activeworkspace -j` runs fine in the terminal, when I set up a `defpoll` for it, the `activeworkspace` variable remains empty. This ends up causing an error in my logs, where it mentions it failed to turn an empty value into a JSON value. I've even tried piping the output through `jq`, but that didn't solve the issue. Can anyone tell me what I'm doing wrong? Also, I'm using Arch Linux.

2 Answers

Answered By TechWhiz42 On

The error you're getting is likely due to the `activeworkspace` trying to pull an ID from an empty string. When you run `hyprctl activeworkspace -j`, make sure there's an active workspace available; otherwise, you'll hit that null value issue. It might help to refer to a discussion on GitHub where someone mentioned that using `hyprctl -j monitors` could provide the active workspace ID—just process that output with `jq`. Here’s a helpful script that demonstrates this process!

CodingNinja99 -

I see what you mean about the script being a bit much. But since `hyprctl activeworkspace -j` works in the terminal, have you checked if there's a specific condition in your configuration that might be causing it to return nothing in eww? Sometimes the context where the command is run affects outcomes.

Answered By ScriptKiddie13 On

You might want to double-check the state of your workspaces in Hyprland. If the active workspace isn’t set or is empty, it could explain why it’s not showing up as expected in eww. Consider looking into the GitHub discussions where people share snippets on how to ensure the ID for the active workspace is correctly fetched and utilized.

QuirkySocks72 -

Thanks for the tip! I’ll check on that, just to be sure everything's lined up properly in the config before going deeper into scripts.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.