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

It's me again, with another snap...this time for bpytop #101

Closed
kz6fittycent opened this issue Sep 1, 2020 · 20 comments
Closed

It's me again, with another snap...this time for bpytop #101

kz6fittycent opened this issue Sep 1, 2020 · 20 comments

Comments

@kz6fittycent
Copy link

Hello,

This is repeat of my "issue" I opened on bashtop. I've got a working snap for bpytop: https://github.com/kz6fittycent/bpytop-snap/blob/master/snapcraft.yaml

We can transfer it to you via forum.snapcraft.io but I'm happy to keep maintaining it, as I have several snaps that I'm maintaining.

Let me know!

P.S. Thanks for your hard work! These tools are freaking awesome!

@aristocratos
Copy link
Owner

aristocratos commented Sep 1, 2020

@kz6fittycent
Hi, I'm all for multiple sources of install methods and as long as it's maintained I'm glad if you do it :)

I would like to ask you though to move the additional snap connect commands to be more prominent (they are currently hidden below the "show more" button on the snapcraft.io page). Because I've gotten multiple bug reports from people missing them, resulting in a crash on start. I could add error handling for the permission errors but that wouldn't restrict it to only snap installs so it's difficult to be specific in the error messages.

Also got a report about the themes not being available for bpytop when installing through snap, I'm not sure how the environment is setup when installing, but right now the paths searched for themes are /usr/local/share/bpytop/themes, /usr/share/bpytop/themes, ~/.config/bpytop/themes and bpytop-themes in the python3 site-packages folders.
If there is a absolute path that can be used when installed through snap let me know and I'll add it.

@kz6fittycent
Copy link
Author

The config (and the themes folder) are located in ~/snap/bashtop/current/.config/bpytop

I've updated the info page - new snap is building and running snap info bpytop will print the new info.

The question I have is:

In bashtop, the themes are downloaded just by hitting "Enter" when the themes section is highlighted. Is the same function available in bpytop?

If so, then I need to figure out why it's not happening when I do that.

@aristocratos
Copy link
Owner

In bashtop, the themes are downloaded just by hitting "Enter" when the themes section is highlighted. Is the same function available in bpytop?

No, I changed to global theme folders for bpytop, so make install installs all themes to usr[/local]/share/bpytop/themes by default or if installed with pip3 to the python3 site-packages folder. So what would /usr/share/bpytop/themes correspond to when installed through snap?

@kz6fittycent
Copy link
Author

kz6fittycent commented Sep 1, 2020

/snap/bpytop/current/usr/share/bpytop/themes

Hang on before you do anything, I'm rebuilding the snap, I just saw something that might be causing an issue. Will report back.

@aristocratos
Copy link
Owner

Btw, I see 1.0.16 is marked as "stable" and 1.0.21 as "edge". Is the "stable" build always staggered from latest version or is it based on release date? Cause I think it's very likely the latest version is almost always the most "stable" version in this project since a majority of the 1.0.xx releases are bug fixes.

@kz6fittycent
Copy link
Author

It's based on the date of:

  1. You make a commit which triggers a new build
  2. When I get a chance to move the new build to stable

All that depends on if the snap builds successfully and if the snap works as intended.

Typically, I get it done within a week or so.

@aristocratos
Copy link
Owner

Ah, ok. That makes sense.

@kz6fittycent
Copy link
Author

Okay, so what I was thinking might be a problem, wasn't the problem. So, I'll need to figure out why the themes aren't showing up in the snap's "current" directory.

Basically, I'll need to copy theme files in the path you mentioned into ~/snap/bashtop/current/.config/bpytop/themes

@aristocratos
Copy link
Owner

~/snap/bashtop/current/.config/bpytop/themes should be reserved for user themes and any theme installed there will show up with a "+" prefix. But need to add search for that path too for it to be detected.

But they aren't installed in /snap/bpytop/current/usr/share/bpytop/themes by the make file currently then?

@kz6fittycent
Copy link
Author

Yeah they're installed there, but not showing up in the menu - this may be just need to be added to the paths in your code?

Anything in /snap/* is read-only so user can't "add" anything there.

@aristocratos
Copy link
Owner

this may be just need to be added to the paths in your code?

Yeah, I need to add path for both ~/snap/bashtop/current/.config/bpytop/themes and /snap/bpytop/current/usr/share/bpytop/themes in the init for them to be detected.

Anything in /snap/* is read-only so user can't "add" anything there.

~/snap/bashtop/current/.config/bpytop/themes is where user made themes should be installed.

/snap/bpytop/current/usr/share/bpytop/themes should only be touched at install so shouldn't be a problem.

@kz6fittycent
Copy link
Author

Dude, awesome! Alright, I'll look for the new build to get triggered and report back. Do you want to switch this to a "open-issue" on my repo for the snap or would you rather just keep it here?

@aristocratos
Copy link
Owner

@kz6fittycent
Or wait a minute, shouldn't ~/snap/bpytop/current/.config/bpytop/themes be seen as ~/.config/bpytop/themes inside the snap?
Otherwise the config file wouldn't be created there. And in that case the /usr/share/bpytop/themes should be the same as /snap/bpytop/current/usr/share/bpytop inside the snap environment?

@aristocratos
Copy link
Owner

Or is it only the home folder that gets translated to ~/snap/bpytop/current/ ?

@kz6fittycent
Copy link
Author

kz6fittycent commented Sep 1, 2020

ls snap/bpytop/current/.config/bpytop/
bpytop.conf error.log themes

ls snap/bpytop/current/.config/bpytop/themes/
nada

This directory represents a "working directory" that a user can interact with. It's basically /home/snap instead of /home/user

The user can make changes here.

Basically, if the software wants to install something (by default) in /home/user, then it goes to /home/snap.

I have two Minecraft snaps that do this and the configs are managed within these folders in /home/snap/blah/blah/.blah

I hope that helps.

@aristocratos
Copy link
Owner

Yeah, tested copying the themes to ~/snap/bpytop/current/.config/bpytop/themes and they did show up.

However, I'm not sure why they don't show up from /snap/bpytop/current/usr/share/bpytop/themes since that path would be /usr/share/bpytop/themes inside the snap and that's the path that is searched. I tested copying the theme folder to /usr/share/bpytop/themes in the regular filesystem and they weren't detected there either.

@aristocratos
Copy link
Owner

I will add /snap/bpytop/current/usr/share/bpytop/themes to the search, hopefully it will work.

@aristocratos
Copy link
Owner

Added in v1.0.22

@kz6fittycent
Copy link
Author

That did it! We're in business!!

@aristocratos
Copy link
Owner

Great :) Will close this for now, feel free to reopen if any issues arise related to the snap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants