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

Waybar height does not get set properly #2092

Open
heeeeeeeeeeh opened this issue Jan 4, 2025 · 2 comments
Open

Waybar height does not get set properly #2092

heeeeeeeeeeh opened this issue Jan 4, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@heeeeeeeeeeh
Copy link

heeeeeeeeeeh commented Jan 4, 2025

Bug Report

Description

When there is no number in config.ctl to the right of the second pipe like this 1||top|( hyprland/workspaces )... the variable w_height does not get set properly. This happens because in the if statement in wbarconfgen.sh:69:

export w_height=$(grep '^1|' $conf_ctl | cut -d '|' -f 2)
if [ -z $w_height ]; then
y_monres=$(cat /sys/class/drm/*/modes | head -1 | cut -d 'x' -f 2)
export w_height=$((y_monres * 2 / 100))
fi

gets interpreted as:
+Configs/.local/share/bin/wbarconfgen.sh:69> [ -z ']'

using [[ ]] instead nets:
+Configs/.local/share/bin/wbarconfgen.sh:69> [[ -z '' ]]

Steps to Reproduce

  1. zsh -x wbarconfgen.sh

Expected Behavior

-z ''

Actual Behavior

-z ']'

Environment

using zsh 5.9 as shell

  • Linux Distro: Arch Linux
  • Linux Version, output of Linux Desktop-Silve 6.12.7-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Fri, 27 Dec 2024 14:24:32 +0000 x86_64 GNU/Linux:
@heeeeeeeeeeh heeeeeeeeeeh added the bug Something isn't working label Jan 4, 2025
@kRHYME7
Copy link
Collaborator

kRHYME7 commented Jan 4, 2025

Not about the error but when debugging be sure to use the correct interpreter.

I think this wbarconfgen is either bash or sh.

About that bug, I think removing the scaling size falls back to fit @prasanthrangan's monitor.

Feel free to open a PR so I can merge it.

@heeeeeeeeeeh
Copy link
Author

Oops my bad, I thought if you had zsh installed, sh would link to zsh not bash. Turns out the script is run by bash and it works. Don't know if it still should be changed if for some reason the user does not have bash installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants