Workaround for Quadlets and Prompt

explain
65 Replies
Noel
Noelā€¢4mo ago
No description
Noel
Noelā€¢4mo ago
No description
Noel
Noelā€¢4mo ago
In Bazzite, I created this bash alias (kde-prompt is just a symlink to prompt): alias hterm='kde-prompt --tab-with-profile=Host' So I can easily create a host terminal from my container terminal if I need to.
Noel
Noelā€¢4mo ago
Or the profiles show up in the list of choices as well:
No description
j0rge
j0rgeā€¢4mo ago
show bketelsen's thing to kyle, he can smoke that one pretty easily you might need to go fetch him out of motd land tell him that side quest is over lol
j0rge
j0rgeā€¢4mo ago
he can go farm it after we get to the endgame
Noel
Noelā€¢4mo ago
I think this would be great to include bluefin-cli as an option for default when you are setting up. or have a ujust command to set it as default. maybe that might not be neccessary, I dunno.
j0rge
j0rgeā€¢4mo ago
yeah this is exactly why I want it on a fresh install you open the terminal, BLAM, it's there, all ready to go, profiles and stuff all magical. ctrl-alt-enter will always take you there ctrl-alt-t will always take you to host that's my plan.
M2
M2ā€¢4mo ago
@Noel have enough containers? Question for the profile stuff. When we on your Isengard-CLI, when selecting another container does it attempt to do a distrobox enter?
Noel
Noelā€¢4mo ago
I believe it does a distrobox enter on every run of the profile. I believe that is the case.
M2
M2ā€¢4mo ago
Okay. Will put a guard on it then. So it should be something like [ ! -f /run/.containerenv ] && [ ! -f /run/.dockerenv ] && distrobox enter container-name
j0rge
j0rgeā€¢4mo ago
we're thinking just doing it the dconf way see bketelsen's link in dev
Noel
Noelā€¢4mo ago
this one
j0rge
j0rgeā€¢4mo ago
just set them dynamically as part of the creation step?
M2
M2ā€¢4mo ago
I should be able to do ExecStartPost= So it should be able to create a profile as part of creation. Cleanup can then just be done via ExecStop. And we have a timer for triggering reconciles Yeah that makes sense. Those three bash functions turned into little bash scripts.
j0rge
j0rgeā€¢4mo ago
No description
j0rge
j0rgeā€¢4mo ago
@Kyle Gospo from voice ^ I'm thinking like this, pinned host all the way on the left, and then bluefin-cli as the tab
j0rge
j0rgeā€¢4mo ago
No description
j0rge
j0rgeā€¢4mo ago
awkward tho
1/4 Life
1/4 Lifeā€¢4mo ago
should totally be doable with dbus if this is ready/testable on bluefin rn I can look into it tonight
j0rge
j0rgeā€¢4mo ago
we don't have the dynamic container naming thing but the pinned host and just pick a tab for now should do the trick oh nice. ctrl-pageup/down is moving between tabs. so you can quickly toggle between the container and the host terminal
j0rge
j0rgeā€¢4mo ago
No description
j0rge
j0rgeā€¢4mo ago
maybe a first run banner when in a container? then when I click on it it takes me to the host which has the real banner
1/4 Life
1/4 Lifeā€¢4mo ago
the way we built it -- that has to be in your container and since we already make our own -distrobox images that'll be easy enough and each can have their own tips
j0rge
j0rgeā€¢4mo ago
yep this one will be svelte though since the motd is still there on the host too, it's working out pretty awesome as I use it hah man if we could put the fedora logo on the host terminal pin, so it "matches" the layout of the logomenu "click on the fedora logo to always go to the terminal"
1/4 Life
1/4 Lifeā€¢4mo ago
I want custom logos & color schemes for boxes so bad like I know it's rice but it's gonna look so damn nice and it avoids confusion
j0rge
j0rgeā€¢4mo ago
WSL does it so nicely there's no question that we need it imo, people expect it
M2
M2ā€¢4mo ago
So right now the profile custom command completely takes over that startup command. Trying to use a oneliner to avoid that seems to not work. But I got the quadlet to create and remove profiles. Trying to figure out how to only do distrobox enter from the host and not when selecting a container right now and have a hack for that And I have lift off. Quadlets make a profile and only enter when selected profile and selecting the my computer
M2
M2ā€¢4mo ago
No description
M2
M2ā€¢4mo ago
Additionally the profiles appear when quadlets are created meaning even if they don't show under containers you can still enter them! Next up, need someone to tell me how to open up prompt with default profile pinned and another profile selected And let's see if palette works
M2
M2ā€¢4mo ago
Only thing I don't like is the missing lego hand
j0rge
j0rgeā€¢4mo ago
oh neat! Disembodied lego hand for the win
M2
M2ā€¢4mo ago
i still haven't found in the prompt code base how those get set since they definitely can be dynamically done because of the sudo / ssh ones
Noel
Noelā€¢4mo ago
I love this Can you set that profile as default if it gets recreated each time?
M2
M2ā€¢4mo ago
probably. The default key is at a different level Need to do something closer to the reconcile that @bketelsen was doing. Right now the created profiles linger from reboots. Basically want to nuke everything not in the active profiles but it also seems like the default behaviour when you remove a profile in the menu is to not actually delete but to remove it only from the profile uuid array Can just have a user oneshot to reconcile prompt profiles based on what's in dconf list and the uuid array
bketelsen
bketelsenā€¢4mo ago
yes the default profile is set at the root of the dconf directory for prompt
Noel
Noelā€¢4mo ago
Another dumb question: This dconf method would not work on KDE due to KDE not having dconf correct?
bketelsen
bketelsenā€¢4mo ago
that's a good question. if prompt runs, it's storing stuff somewhere
Noel
Noelā€¢4mo ago
I'm so confused. where is the brew stuff actually stored? I deleted all of my podman volumes and my brew stuff is still retained. I don't see a /home/linuxbrew on the host when I do an ls which confuses me even more. is it bind-mounted and just not able to be shown on the host? OK. so it is being bind-mounted stored in ~/.local/share/bluefin-cli my question is how is that directory getting mounted? I still don't see anything obvious in the quadlet that is acheiving that.
M2
M2ā€¢4mo ago
It's inside the container /etc/profile.d/00-bluefin-cli.sh Pretty sure it's still there
Noel
Noelā€¢4mo ago
I understand now! OK cool dconf? I don't believe so https://www.reddit.com/r/kde/comments/w3oc9x/dconf_config_support/
M2
M2ā€¢4mo ago
Check if ~/.config/dconf exists And dconf exists inside of gtk flatpaks. Gnome text editor has a vim emulation that you can only set set with gsettings
Noel
Noelā€¢4mo ago
OH, I get it. You can use it to configure gnome based apps. Yeah, I see dconf command available by default. so the dconf stuff could still work for configuring prompt since it supports it awesome.
1/4 Life
1/4 Lifeā€¢4mo ago
Yep, Bazzite does that For the kde color scheme Check the user setup service
Noel
Noelā€¢4mo ago
I was wondering about that. I gotta get a better understanding of how that service works. and the bash file used by it. I definitely want to port the prompt stuff being done in here to add my quadlets as profiles by default.
M2
M2ā€¢4mo ago
I'll get the branch on GitHub. Will be under bluefin I still want to see if this can be done prompts uuids for containers Since it detects toolboxes and distroboxes automatically but not the quadlets.
Noel
Noelā€¢4mo ago
@M2 separate thing I noticed is that the name "Bluefin" is hard coded in /etc/profile.d/00-bluefin-cli.sh if you do a FROM bluefin-cli to do a custom container and you decide to use bluefin as well, there may be some weirdness with the homebrew directory? wondering if maybe we should generalize that to the container name to avoid that problem? something like replacing all the instances of Bluefin with ${HOSTNAME}? that way it should pick up the hostname of the container properly. I suppose that only works if you create the quadlet properly.
M2
M2ā€¢4mo ago
Right now it is a hard coded directory Container name might be best because podman requires unique names
Noel
Noelā€¢4mo ago
https://github.com/noelmiller/isengard-cli/blob/main/Containerfile Here is my workaround I was able to do:
mv /etc/profile.d/00-bluefin-cli-brew-firstrun.sh /etc/profile.d/00-isengard-cli-brew-firstrun.sh && \
sed -i 's/Bluefin/Isengard/g; s/bluefin/isengard/g' /etc/profile.d/00-isengard-cli-brew-firstrun.sh && \
mv /etc/profile.d/00-bluefin-cli-brew-firstrun.sh /etc/profile.d/00-isengard-cli-brew-firstrun.sh && \
sed -i 's/Bluefin/Isengard/g; s/bluefin/isengard/g' /etc/profile.d/00-isengard-cli-brew-firstrun.sh && \
that fixes the name conflict for me.
M2
M2ā€¢4mo ago
Can you check if you can get the containers name from /run/.containerenv
Noel
Noelā€¢4mo ago
Sure!
nomiller@isengard ~ took 3s
šŸ“¦ $ cat /run/.containerenv
engine="podman-4.9.0"
name="isengard-cli"
id="d4bf98b2a8ac78c692ba2310da728f609dd85bd6848f07e184818418865073cf"
image="ghcr.io/noelmiller/isengard-cli:latest"
imageid="138dc60dde8fb19bfd38fef2c800214cc69a63b35f702e2dccf15e5df1208b48"
rootless=1
graphRootMounted=1
nomiller@isengard ~ took 3s
šŸ“¦ $ cat /run/.containerenv
engine="podman-4.9.0"
name="isengard-cli"
id="d4bf98b2a8ac78c692ba2310da728f609dd85bd6848f07e184818418865073cf"
image="ghcr.io/noelmiller/isengard-cli:latest"
imageid="138dc60dde8fb19bfd38fef2c800214cc69a63b35f702e2dccf15e5df1208b48"
rootless=1
graphRootMounted=1
M2
M2ā€¢4mo ago
thanks! okay source if exist, make a directory named after container name
Noel
Noelā€¢4mo ago
better spot to pull the name from instead of $HOSTNAME? just curious why this might be better?
M2
M2ā€¢4mo ago
hostname doesn't have to be unique container name has to be unique per container manager hostname should be unique. Container name must be
M2
M2ā€¢4mo ago
it's in draft as I work on things
Noel
Noelā€¢4mo ago
Awesome! Thank you!
M2
M2ā€¢4mo ago
I think i figured out where prompt is getting the container IDs. so might be able to do this without doing a distrobox enter custom command podman inspect bluefin-cli --format {{.Id}} it seems to work but no lego hand i want the lego hand apparently no lego hand when using a profile?
Noel
Noelā€¢4mo ago
Doesn't appear so!
M2
M2ā€¢4mo ago
So Profiles are associated with Colorscheme and the follow through if you select a different container. Additionally, there is that weird cannot find container occurring when using container ID instead of distrobox enter and we don't get the lego hand when entering via Profile so I think the distrobox enter method is preferable right now Okay last bit of weirdness. Apparently during a reboot the old profiles might persist but be removed from active profiles. So need a little bit better cleanup. Additionally prompt doesn't actually cleanup in active profiles. They just kinda keep existing in the dconf database
Noel
Noelā€¢4mo ago
hmmm so there is some goofiness, but it does work for the most part?
M2
M2ā€¢4mo ago
Yeah. Some of this goofiness I think is prompt being incomplete Like go create a profile and then remove it. It's still in dconf
Noel
Noelā€¢4mo ago
mmmmm
M2
M2ā€¢4mo ago
alright going with the distrobox enter method for now. The repeats should get cleaned up. Lack of lego hand disappoints me