ibus-avro icon indicating copy to clipboard operation
ibus-avro copied to clipboard

Enhancement of appstream metadata file

Open sarim opened this issue 5 years ago • 36 comments

  • [x] Upload screenshot and add entry in xml
  • [ ] Update https://screenshots.debian.net/package/ibus-avro
  • [x] Investigate further if gnome-software shows icon

I messed around with appstream some more. But haven't found a easy way to test a metadata file in gnome-software. I'll do a bit more research.

sarim avatar Aug 21 '19 12:08 sarim

Yeah, I found no simple way to test in advance, but I simply added the metadata file and crossed my fingers. Fortunately it worked as expected. :)

If you are on GNOME, open GNOME (or Ubuntu) Software. Then Add-ons -> Input Sources. As you see they use a category icon for all the IMs. Similar if you go to Codecs or Hardware Drivers. My understanding is that an icon wouldn't be made use of.

gunnarhj avatar Aug 21 '19 13:08 gunnarhj

Yeah i noticed that, then i looked at the source code of gnome-software a bit, to figure out if that generic icon is hardcoded or its shown only if there's no icon in appstream metadata. Haven't been able to find the the relevant code yet.

sarim avatar Aug 21 '19 13:08 sarim

You don't give up easy. :) That's good. I usually don't either.

gunnarhj avatar Aug 21 '19 13:08 gunnarhj

An experiment:

$ cat /usr/share/metainfo/com.github.sarim.ibus.avro.metainfo.xml | grep icon
  <icon type="remote">https://raw.githubusercontent.com/sarim/ibus-avro/master/avro-bangla.png</icon>
$ appstreamcli validate --pedantic \
> /usr/share/metainfo/com.github.sarim.ibus.avro.metainfo.xml
Validation was successful.

But that doesn't answer the question if it would be used.

gunnarhj avatar Aug 21 '19 13:08 gunnarhj

Yeah i checked it before, validation doesn't complain. But it seems like distro's doesn't use the metadata as is, there is a conversation/edit phase. Ubuntu downloads all media to appstream.ubuntu.com and urls in metadata is edited. I directly edited ......dep11_Components-amd64.yml.gz file in /var/lib/apt/lists. Screenshots show up, but not icon. Verified that by capturing all packets to appstream.ubuntu.com in routeros and opening gnome-software. It only does web requests for screenshots. Then i found the actual code plugins/core/gs-appstream.c Here the icon for input methods is hardcoded as "system-run-symbolic". So icon won't show up for those categories :P The reason i was so hard on showing icon is that previously icon from ibus engine showed up in top bar, (as shown in screenshot in linux.omicronlab.com). But now the it only shows "bn".

I'll boot debian/ubuntu - gnome, kde, mate etc.. in VMs and upload screenshots. Hopefully within today.

sarim avatar Aug 21 '19 16:08 sarim

The reason i was so hard on showing icon is that previously icon from ibus engine showed up in top bar, (as shown in screenshot in linux.omicronlab.com).

Yeah, that's Unity. Still applies to Ubuntu 16.04. And possibly the icon is shown that way also in other non-GNOME flavors, where IBus works stand-alone (i.e. no integration with desktop specific keyboard layout settings). But I would suppose that it picks up the icon from the component xml file, and that it has nothing to do with AppStream.

But now the it only shows "bn".

That's the current GNOME way.

One observation with respect to AppStream and Ubuntu/GNOME Software (and probably other similar software managers) is that users can submit reviews.

appstream-review

Good start. :)

The screenshot is from Debian "unstable", but I have seen the very same review show up also in Ubuntu 19.04 and Ubuntu 19.10. Not sure how that 'magic' happens, but apparently those reviews are shared between releases and distros somehow.

gunnarhj avatar Aug 21 '19 21:08 gunnarhj

Uploaded the screenshots and updated appstream metadata. How can we test? pushing the update to ubuntu?

Got into some rabbit hole in kubuntu 18.04.03. Seems like im-config doesn't properly configure IBus. Also im-config should check if kimpanel-ibus-panel is available in a kde system, if yes launch with that (--panel) instead of gtk panel. Do you know where is the upstream of that project?

sarim avatar Aug 22 '19 16:08 sarim

Uploaded the screenshots and updated appstream metadata. How can we test?

Not easy. You have already tested by editing the dep11 file in /var/lib/app-info/yaml, right? If that looks good, I'm not sure that further testing is necessary.

pushing the update to ubuntu?

Unfortunately I haven't upload rights for ibus-avro yet. So for testing via uploads I'd need a sponsor, which would be a cumbersome way. (PPA uploads wouldn't help to test this.)

If you you like, I can play with dep11 using the updated metadata and provide feedback.

Got into some rabbit hole in kubuntu 18.04.03. Seems like im-config doesn't properly configure IBus.

Sounds worrying. Please elaborate. Are you talking about something else but the need to enable IBus:

im-config -n ibus

(or use the Input Method GUI to do it that way)?

Also im-config should check if kimpanel-ibus-panel is available in a kde system, if yes launch with that (--panel) instead of gtk panel. Do you know where is the upstream of that project?

Yes, Debian is upstream.

Please note that im-config in Ubuntu has a patch as regards the default configuration. I'm highly involved in it (and unlike ibus-avro I can upload im-config in Ubuntu).

gunnarhj avatar Aug 22 '19 17:08 gunnarhj

Sounds worrying. Please elaborate. Are you talking about something else but the need to enable IBus:

im-config -n ibus

I'm not 100% sure, might be my fault too. As i'm testing only in virtualbox-live-cd-iso. What is happening is after doing im-config -n ibus log out - log in, ibus is starting, but for some reason its not working. IBus icon not showing up in systray, text inputs not going to IBus either. If i start the ibus-daemon manually, it works, IBus icon in systray also shows up. I guess im-config is starting ibus-daemon in a wrong stage where kde session is not fully started up yet? I'll investigate further, I have to also check kubuntu 19.04 and debian 10 kde to see if those are affected too.

Yes, Debian is upstream.

Yeah I found that, but i also noticed this https://salsa.debian.org/input-method-team/im-config/commits/upstream. Seems like there is another upstream repo or some other source, from there he is importing it to salsa.debian.org repo?

sarim avatar Aug 22 '19 19:08 sarim

Due to some systemd issue, im-config in Ubuntu (including Kubuntu) 18.04 and 19.04 uses a temporary way to launch IBus and set the variables: It's done via /etc/profile.d/input-method-config.sh. That file will be dropped in Ubuntu 19.10.

It should work after a reboot, at least. (Otherwise you have found a serious bug.)

Seems like there is another upstream repo or some other source, from there he is importing it to salsa.debian.org repo?

Osamu's hard disk? :) I'm pretty sure that there is no other upstream. Fedora uses something called im-chooser, I think.

gunnarhj avatar Aug 22 '19 20:08 gunnarhj

It should work after a reboot, at least. (Otherwise you have found a serious bug.)

IBus icon still doesn't show up in systray after reboot. Though now it can write texts after hitting the switch input method hotkey. So It is kind of working. So im-config trying to launch im from profile.d, xinit, systemd? That is a complex tool.

sarim avatar Aug 22 '19 22:08 sarim

VirtualBox_Kubuntu_23_08_2019_04_44_23

The pid of ibus-daemon is lower, Is it starting too early?

sarim avatar Aug 22 '19 22:08 sarim

So im-config trying to launch im from profile.d, xinit, systemd?

Yeah, but profile.d is/was a workaround.

The pid of ibus-daemon is lower, Is it starting too early?

Possibly. This is a bit over my head. But any chance you can test also with the latest Kubuntu daily build? It has the latest im-config, with another (systemd) way to start it.

gunnarhj avatar Aug 22 '19 23:08 gunnarhj

Possibly. This is a bit over my head. But any chance you can test also with the latest Kubuntu daily build? It has the latest im-config, with another (systemd) way to start it.

Yeah, I'll test all kde ones tomorrow, debian buster, kubuntu 19.04, 19.10.

sarim avatar Aug 22 '19 23:08 sarim

As regards the screenshots, I haven't figured out a way to test locally. Two observations:

  1. When validating, it suggests to use https instead of http URLs.

  2. When looking at other apps with screenshots, the captions are not shown in GNOME Software. Maybe doesn't matter much, but thought you'd better be aware of it. I don't know if it is a bug which will be fixed or a conscious design decision.

Anyway, I tend to think that a new release and upload to Debian is the best way to accomplish a full test. We won't break anything by doing so.

gunnarhj avatar Aug 23 '19 00:08 gunnarhj

Installed Kubuntu 19.10. IBus icon is shown for me in the panel, even if it's hard to see when an XKB layout is active (dark blue letters on a dark gray background).

Also played with kimpanel-ibus-panel. Edited /usr/share/im-config/data/21_ibus.rc and appended --panel=/usr/lib/x86_64-linux-gnu/libexec/kimpanel-ibus-panel to the command. The result was that no IBus icon was shown, and no suggestion window was shown when inputting Bangla.

P.S. Noticed that Avro Phonetic is easily found also via KDE's Discover Software Center.

gunnarhj avatar Aug 23 '19 15:08 gunnarhj

Debian Buster KDE already comes with ibus running. Shows up in systray, can write texts without any problem. Both Kubuntu 19.04 and 19.10 daily-live (2019-08-23) works without any problem. im-config -n ibus and Logout - Login works, ibus shows up in systray, can write text too.

sarim avatar Aug 23 '19 15:08 sarim

Lol we both commented at the same time.

Also played with kimpanel-ibus-panel. Edited /usr/share/im-config/data/21_ibus.rc and appended --panel=/usr/lib/x86_64-linux-gnu/libexec/kimpanel-ibus-panel to the command. The result was that no IBus icon was shown, and no suggestion window was shown when inputting Bangla.

I also played with it yesterday. You have to add kimpanel to bottom panel first. Then editing 21_ibus.rc works.

sarim avatar Aug 23 '19 15:08 sarim

You have to add kimpanel to bottom panel first. Then editing 21_ibus.rc works.

But if that additional change is required, making im-config do it by default is not a good idea, right?

gunnarhj avatar Aug 23 '19 15:08 gunnarhj

But if that additional change is required, making im-config do it by default is not a good idea, right?

Not default, no. Perhaps via flag in /etc/default/im-config? I guess its not really that important feature anyway :P I was messing with kimpanel when ibus wasn't properly working in kubuntu 18.04.3.

P.S. Noticed that Avro Phonetic is easily found also via KDE's Discover Software Center.

Yeah I noticed it too. Seems like gnome-software is not the only user of appstream metadata. Actually about the caption (and icon), in the appstream documentation icon is not explicitly forbidden for input methods, and caption in screenshot is optional. So i added both, It is a valid appstream metadata file, so even if gnome-software doesn't show it now, let it be. Maybe in future some other package manager will use it.

  1. When validating, it suggests to use https instead of http URLs.

After getting into ubuntu repositary, all media gets downloaded to http://appstream.ubuntu.com/media/.................. and this domain doesn't support https :P So I just used http. I don't think it'll be an issue, But the url can be edited to https without any problem, linux.omicronlab.com is available in https.

sarim avatar Aug 23 '19 16:08 sarim

But if that additional change is required, making im-config do it by default is not a good idea, right?

Not default, no. Perhaps via flag in /etc/default/im-config?

By default I meant without checking somehow whether kimpanel has been added. The latter seems necessary to consider it.

I guess its not really that important feature anyway :P

I'd say a wishlist thing which may be considered in consultation with the Kubuntu/KDE folks.

icon is not explicitly forbidden for input methods, and caption in screenshot is optional. So i added both, It is a valid appstream metadata file, so even if gnome-software doesn't show it now, let it be. Maybe in future some other package manager will use it.

Sounds reasonable to me.

So I just used http. I don't think it'll be an issue,

Neither do I. It's just an informational note when validating.

gunnarhj avatar Aug 23 '19 16:08 gunnarhj

Btw, you didn't add an icon in yesterday's commit (even if the title says so).

gunnarhj avatar Aug 23 '19 17:08 gunnarhj

Btw, you didn't add an icon in yesterday's commit (even if the title says so).

:( I added icon in the file, but mistakenly didn't commit that line. Fixed now.

By default I meant without checking somehow whether kimpanel has been added. The latter seems necessary to consider it.

kimpanel-ibus-panel-launcher process seems to be started when kimpanel widget is added. Perhaps that could be checked by running ps? Or checking dconf (or whatever config storage kde uses)?

sarim avatar Aug 23 '19 19:08 sarim

kimpanel-ibus-panel-launcher process seems to be started when kimpanel widget is added. Perhaps that could be checked by running ps?

Possibly. Works only if that process is started before im-config is run, though.

Or checking dconf (or whatever config storage kde uses)?

Sounds safer.

I would suggest that you file an im-config bug to Debian. Let's consider it something separate from our efforts to make ibus-avro more visible and easier to install.

gunnarhj avatar Aug 23 '19 20:08 gunnarhj

I would suggest that you file an im-config bug to Debian.

Or not...

On Kubuntu 19.10 I simply added the "Input Method Panel" widget (which started a kimpanel-ibus-panel process). Then logged out, logged in, and only KDE's panel is shown. (It indeed looks better.)

AFAICT this is a pure user customization thing; no need to modify im-config. Maybe it works differently today with Plasma 5 compared to Kubuntu a few cycles ago.

gunnarhj avatar Aug 24 '19 00:08 gunnarhj

Hi @sarim, you got quiet suddenly. This is my understanding of what's pending ATM:

  1. You will update README.md and linux.omicronlab.com

  2. New release

  3. Upload to Debian, so we can see what the AppStream screenshots look like

So currently I simply wait for next release. There is no urgency; I just wanted to make sure that you are not expecting anything from me before the release.

gunnarhj avatar Aug 28 '19 17:08 gunnarhj

Yeah I'm working on it. I'll tag you here after I'm finished with these.

sarim avatar Aug 29 '19 12:08 sarim

Hi @sarim!

The screenshots don't look good, at least not in GNOME Software. They are being mangled somehow and look blurry.

I saw it on Ubuntu 20.10, but it looks like also unstable has been updated at appstream.debian.org with the latest version.

gunnarhj avatar Apr 30 '20 11:04 gunnarhj

That sounds bad, how can I get a installation of ubuntu 20.10? Or do i just start a vm of 20.04 and change the repo source? I'll figure it out and check if the images needs to be in a different resolution or something.

Another thing i noticed, few people left bad reviews saying there isn't a "launch" button for ibus-avro in software center, huh. I have to check if its even a possible to have a launch button for input method :|

sarim avatar Apr 30 '20 12:04 sarim

how can I get a installation of ubuntu 20.10

http://cdimage.ubuntu.com/daily-live/current/

Another thing i noticed, few people left bad reviews saying there isn't a "launch" button for ibus-avro in software center, huh. I have to check if its even a possible to have a launch button for input method :|

I've seen that. It's not possible, of course. You don't "launch" IBus plugins. It's one of all those misconceptions when it comes to using IBus IMs.

gunnarhj avatar Apr 30 '20 12:04 gunnarhj