prasanthrangan / hyprdots

// Aesthetic, dynamic and minimal dots for Arch hyprland

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Waybar config generator parsing error

Olaipai opened this issue · comments

Bug Report

Description

The script wbarconfgen.sh is causing a JSON parsing error. Not correctly making a config.

Steps to Reproduce

  1. Delete config.json in ~/.config/waybar/config.json
  2. Run script ~/.local/share/bin/wbarconfgen.sh
  3. Launch waybar

Expected Behavior

For waybar to show up and work.

Actual Behavior

No worky. Throws this error in the terminal if ran from there.

[2024-05-16 17:47:26.892] [info] Using configuration file /home/olaipai/.config/waybar/config.jsonc
[2024-05-16 17:47:26.893] [error] Error parsing JSON: * Line 66, Column 17
  Syntax error: value, object or array expected.

Screenshots

image

Environment

Distro: EndeavourOS.
Uname: Linux OLAIPAI-DESKTOP 6.8.9-lqx2-4-lqx
Hyprland version: v0.40.0-90-g3381e2b5

Additional Information

Ran hyde update and hyde upgrade.

Config.ctl I am using
0|28|top|( cpu memory custom/cpuinfo custom/gpuinfo ) ( idle_inhibitor clock )|( hyprland/workspaces hyprland/window )|( backlight network pulseaudio>
0|28|bottom|( cpu memory custom/cpuinfo custom/gpuinfo ) ( idle_inhibitor clock ) ( hyprland/workspaces )|( hyprland/window )|( backlight network pul>
0|28|top|( cpu memory custom/cpuinfo ) ( idle_inhibitor clock ) ( hyprland/workspaces )|( hyprland/window )|( backlight network pulseaudio pulseaudio>
1||bottom|( hyprland/workspaces hyprland/window )|( idle_inhibitor clock )|( cpu memory custom/cpuinfo custom/gpuinfo ) ( backlight network pulseaudi>
0||top|( hyprland/workspaces hyprland/window )|( idle_inhibitor clock )|( cpu memory custom/cpuinfo custom/gpuinfo ) ( backlight network pulseaudio p>
0|31|bottom|( custom/power custom/cliphist custom/wbar custom/theme custom/wallchange ) ( wlr/taskbar custom/spotify ) |( idle_inhibitor clock )|( tr>
0|31|left|( custom/power custom/cliphist custom/wbar custom/theme custom/wallchange ) ( wlr/taskbar custom/spotify ) |( idle_inhibitor clock )|( tray>
0|31|top|( custom/power custom/cliphist custom/wbar custom/theme custom/wallchange ) ( wlr/taskbar custom/spotify ) |( idle_inhibitor clock )|( tray >
0|31|right|( custom/power custom/cliphist custom/wbar custom/theme custom/wallchange ) ( wlr/taskbar custom/spotify ) |( idle_inhibitor clock )|( tra>
0|32|bottom||( custom/power ) ( tray battery ) ( wlr/taskbar idle_inhibitor clock ) ( custom/cliphist ) ( custom/wbar ) ( custom/wallchange ) ( custo>
0|32|left||( custom/power ) ( tray battery ) ( wlr/taskbar idle_inhibitor clock ) ( custom/cliphist ) ( custom/wbar ) ( custom/wallchange ) ( custom/>
0|32|top||( custom/power ) ( tray battery ) ( wlr/taskbar idle_inhibitor clock ) ( custom/cliphist ) ( custom/wbar ) ( custom/wallchange ) ( custom/t>
0|32|right||( custom/power ) ( tray battery ) ( wlr/taskbar idle_inhibitor clock ) ( custom/cliphist ) ( custom/wbar ) ( custom/wallchange ) ( custom>
0|31|bottom|( cpu memory custom/cpuinfo custom/gpuinfo ) ( idle_inhibitor clock ) ( hyprland/workspaces )|( wlr/taskbar )|( backlight network pulseau>
0|31|top|( cpu memory custom/cpuinfo custom/gpuinfo ) ( idle_inhibitor clock ) ( hyprland/workspaces )|( wlr/taskbar )|( backlight network pulseaudio>
0|29|bottom|( wlr/taskbar mpris )|( idle_inhibitor clock )|( backlight network pulseaudio pulseaudio#microphone custom/updates ) ( tray battery ) ( c>
0|29|left|( wlr/taskbar mpris )|( idle_inhibitor clock )|( backlight network pulseaudio pulseaudio#microphone custom/updates ) ( tray battery ) ( cus>
0|29|top|( wlr/taskbar mpris )|( idle_inhibitor clock )|( backlight network pulseaudio pulseaudio#microphone custom/updates ) ( tray battery ) ( cust>
0|29|right|( wlr/taskbar mpris )|( idle_inhibitor clock )|( backlight network pulseaudio pulseaudio#microphone custom/updates ) ( tray battery ) ( cu>
0|28|bottom|( custom/power custom/cliphist custom/wbar custom/theme custom/wallchange ) ( idle_inhibitor clock custom/spotify )|( wlr/taskbar )|( tra>
0|28|left|( custom/power custom/cliphist custom/wbar custom/theme custom/wallchange ) ( idle_inhibitor clock custom/spotify )|( wlr/taskbar )|( tray >
0|28|top|( custom/power custom/cliphist custom/wbar custom/theme custom/wallchange ) ( idle_inhibitor clock custom/spotify )|( wlr/taskbar )|( tray )>
0|28|right|( custom/power custom/cliphist custom/wbar custom/theme custom/wallchange ) ( idle_inhibitor clock custom/spotify )|( wlr/taskbar )|( tray>
Code in question from the config
"clock": {
      "format": "{:%H:%M}",
      "rotate": ${r_deg
      },
      "format-alt": "{:%R 󰃭 %d·%m·%y}",
      "tooltip-format": "<tt>{calendar}</tt>",
      "calendar": {
        "mode": "month",
        "mode-mon-col": 3,
        "on-scroll": 1,
        "on-click-right": "mode",
        "format": {
          "months": "<span color='#ffead3'><b>{}</b></span>",
          "weekdays": "<span color='#ffcc66'><b>{}</b></span>",
          "today": "<span color='#ff6699'><b>{}</b></span>"
        }
      },
      "actions": {
        "on-click-right": "mode",
        "on-click-forward": "tz_up",
        "on-click-backward": "tz_down",
        "on-scroll-up": "shift_up",
        "on-scroll-down": "shift_down"
      }
    },
Clock Module
    "clock": {
        "format": "{:%H:%M}",
        "rotate": ${r_deg},
        "format-alt": "{:%R 󰃭 %d·%m·%y}",
        "tooltip-format": "<tt>{calendar}</tt>",
        "calendar": {
            "mode": "month",
            "mode-mon-col": 3,
            "on-scroll": 1,
            "on-click-right": "mode",
            "format": {
                "months": "<span color='#ffead3'><b>{}</b></span>",
                "weekdays": "<span color='#ffcc66'><b>{}</b></span>",
                "today": "<span color='#ff6699'><b>{}</b></span>"
            }
        },
        "actions": {
            "on-click-right": "mode",
            "on-click-forward": "tz_up",
            "on-click-backward": "tz_down",
            "on-scroll-up": "shift_up",
            "on-scroll-down": "shift_down"
        }
    },

Hi @Olaipai

We got a tool to check the diff of the files

Example

image

So you can invoke :
Hyde check Config --mismatch --less
--mismatch flag will diff the files from the Clone directory and from your Configs.
--less will output it in less so you can scroll freely

Before doing the above command, it is recommended to run Hyde update it works like git pull

And if the commands give errors like this
image

This means the CLI is not yet setup for your clone directory.

Hyde-install --link --dir ~/HyDE where ~/HyDE is the Clone diretory

Here is the corrected config

"clock": {
    "format": "{:%H:%M}",
    "rotate": ${r_deg},
    "format-alt": "{:%R 󰃭 %d·%m·%y}",
    "tooltip-format": "<tt>{calendar}</tt>",
    "calendar": {
      "mode": "month",
      "mode-mon-col": 3,
      "on-scroll": 1,
      "on-click-right": "mode",
      "format": {
        "months": "<span color='#ffead3'><b>{}</b></span>",
        "weekdays": "<span color='#ffcc66'><b>{}</b></span>",
        "today": "<span color='#ff6699'><b>{}</b></span>"
      }
    },
    "actions": {
      "on-click-right": "mode",
      "on-click-forward": "tz_up",
      "on-click-backward": "tz_down",
      "on-scroll-up": "shift_up",
      "on-scroll-down": "shift_down"
    }
  },

image

Will close this as it seems like a simple fix. Please reopen in the discussions panel for queries like this.

IMO a misconfiguration in the Users end shouldn't be a bug related to the repo. However feel free to post questions and Ideas in the discussions panel.

Will close this as it seems like a simple fix. Please reopen in the discussions panel for queries like this.

IMO a misconfiguration in the Users end shouldn't be a bug related to the repo. However feel free to post questions and Ideas in the discussions panel.

Hey,
Thank you for getting back to me.

I am aware that there is an error in the config.
The whole point here was to point out that this config was made by the wbarconfgen.sh script and not by me. Hench why I reported it here as a bug and not as help wanted.

I wanted to report it so the script could be checked and won't happen to others.

I have checked my cloned repo and I also ran the suggestion you have with hyde-ctl check config. There is a missmatch between my cloned repo and the applied config - Which was caused by the script in question "wbarconfgen.sh". Applying a correct config manually from either the repo or by hand, fixes the config. But when / if the "wbarconfgen.sh" scripts runs again, it causes the exact same issue that I reported.
The script matches my cloned repo as well as the upstream main branch.

Please correct me if there is something I am missing here or misunderstanding the script.
From my point of view and from looking at the script it creates a layout in json from the "config.ctl".

Edit
Looked into it further. Neovim had a plugin who messed up the config at save. This explains it as I am mainly using Doom Emacs. Sorry for the wasting your time.
Thank you anyway! :)

Great! Thanks for clarifying everything!