wf-shell icon indicating copy to clipboard operation
wf-shell copied to clipboard

Language widget for panel

Open WShad opened this issue 5 months ago • 4 comments

Adds language widget displaying current keyboard layout language. 2025-07-20_00:47:10

WShad avatar Jul 19 '25 21:07 WShad

Implemented IPC-client + language widget based on it

WShad avatar Jul 29 '25 22:07 WShad

@ammen99, better?))

WShad avatar Aug 01 '25 07:08 WShad

Hi! I haven't checked the PR carefully yet but I suppose it should use yyjson instead of nlohmann_json because wayfire uses the former. Could you please fix that?

UPD: also please fix the formatting.

NamorNiradnug avatar Aug 01 '25 12:08 NamorNiradnug

@WShad sorry for the delay, we were finishing the gtk4 port .. if you still have interest, please update this PR to gtk4 as well.

ammen99 avatar Nov 04 '25 11:11 ammen99

@WShad thanks for your updates! I looked briefly over your PR, a few things that stood out to me:

  • uncrustify.ini was copied from Wayfire's repo, but I don't think we use it here? So it shouldnt' be added
  • You have copied the yyjson wrapper from Wayfire. I find it ok to use either nlohmann/json or yyjson here, though I suppose yyjson makes us closer to Wayfire. In any case, if we are going to use wrapped yyjson like wayfire, we shouldn't duplicate the code. If you want I can make a new repo here where we can put the json wrapper and then we can share it between wayfire and wf-shell as a subproject.

ammen99 avatar Nov 14 '25 12:11 ammen99

Wow! Thanks for so fast feedback!)))

  1. Removed
  2. As you say. Lead me, plz)

WShad avatar Nov 14 '25 12:11 WShad

I will separate wayfire's json handling into a subproject and will let you know when it is ready for incorporating into your pr :)

ammen99 avatar Nov 14 '25 12:11 ammen99

@WShad It was actually easier than I expected, here is the json wrapper itself: https://github.com/WayfireWM/wf-json

Here is the Wayfire PR where it is used https://github.com/WayfireWM/wayfire/pull/2892 You can add it as a subproject to wf-shell as well and then you get the json wrapper header automatically. The rest of the IPC handling is glib-specific so maybe best to keep it here in wf-shell.

ammen99 avatar Nov 14 '25 13:11 ammen99

@WShad For the CI to work, I think you need to add cmake to the list of dependencies, or to install yyjson as a dependency so that we don't have to build it as a submodule. Also you'll need to fix the codestyle. Otherwise LGTM, good work!

ammen99 avatar Nov 29 '25 10:11 ammen99

Clean now: https://github.com/WShad/wf-shell/actions/runs/20010484337

WShad avatar Dec 07 '25 21:12 WShad

I don't understand... How? My action completed successfully, they are the same - how it even can be?

WShad avatar Dec 07 '25 21:12 WShad

@WShad I also find it hard to comprehend why it works on the one CI and not on the other, but my guess would be that you add the json submodule as a dependency only to the util static library. But it should also be a dependency of the panel itself (because it needs the json include headers). To solve such issues, we have a dependency object which includes all the necessary stuff, you can add json as a dependency to it as well: https://github.com/WayfireWM/wf-shell/blob/57a68cb42c8b1a4a5a3f5163e3ca0899804bead9/src/util/meson.build#L14

I believe this will fix the CI issue.

A note on uncrustify: we use a custom uncrustify to be consistent with Wayfire. Wayfire itself uses a custom uncrustify because uncrustify-git currently crashesh on Wayfire's codebase, plus it had some formatting bugs which I fixed in my fork ... At least however, the CI will give you a patch to apply so you don't have to set it up locally, see https://github.com/WayfireWM/wf-shell/actions/runs/20010484621/job/57379300256?pr=301#step:9:1

ammen99 avatar Dec 08 '25 09:12 ammen99

my guess would be that you add the json submodule as a dependency only to the util static library. But it should also be a dependency of the panel itself (because it needs the json include headers)

Exactly! And why i lost that dependency(?) - it compiles locally just fine, without explicitly included 'json'. Strange...

A note on uncrustify

Got it

Will compile now.

WShad avatar Dec 08 '25 10:12 WShad