tldr; install vscode or vscodium directly inside of your Silverblue toolbox

This time it’s just Silverblue and VSCodium. I’ve learned more and found (what I think) is the perfect solution. The idea is to run VSCodium inside of your toolbox container, which is actually quite easy.

Inside the toolbox container you still have access to your host file system. You also can install whatever you want inside this container as though it was a writable file system, which is ideal for a lot of development style’s people are used to.

The Road that Lead Here

After I had published the last post I tried to use VSCodium with plugins, like the RLS (rust language server) and Python plugins. Both were a pain and my methods were getting more and more hacky to try and get them to work.

I then hatched on the idea “what if I run VSCodium directly inside the toolbox container?” and so I started working on it. I downloaded the app image and then tried to run it. I spent a long time resolving various ‘library not found’ type errors, but eventually I did get it working. However, along the way, I had found that some at least one other person had the same idea as me, and did the same thing too, but a bit better. The person in mind was puzzledprimary over on the Fedora project’s forums. Their solution (and I’m guessing others as well) was to just install vs-code directly in the container using dnf. So that’s what I did.

How to do it

  1. Create a toolbox (if not yet created).
  2. Enter the toolbox
  3. Follow the install directions for Fedora on either VSCode or VSCodiums websites.
  4. As stated on the above fedora forum post, run dnf install libX11-xcb to install the straggling dependency.
  5. Launch via the CLI. code for VSCode, and codium for VSCodium.
  6. Set up the launcher.

Setting up the Launcher

This is the part that I had the biggest pain doing. Essentially what I did was copy the desktop launcher file from inside the container, into my ~/.local/share/applications directory, and then changing the exec command to toolbox run codium.

I think the desktop launcher file was at /usr/share/applications/codium.desktop, inside the container of course.

That was enough to get it working. However app icon in the “start menu” looked bad. This was because the icon it was searching for was inside the container, and gnome couldn’t find it.

What I ended up doing to get the icon working, is I downloaded the icon from VSCodiums GitHub repo (code.xpm) and copied it to my ~/.local/share/icons. I then created a ~/.profile file and added the following line to it.

XDG_DATA_DIRS=$HOME/.local/share:$XDG_DATA_DIRS

What that does is adds your ~.local/share to the list of path’s that are searched for icons and things. In order for this to take effect you probably want to reboot, unless you’re a pro and no how to get your gnome-shell to reload the variable without rebooting (which I don’t and was happy enough to reboot).

I then changed the ‘Icon’ property to ‘code’ to match the name of the icon I had just downloaded, minus the extension.

The resulting .desktop file looked like:

[Desktop Entry]
Name=VSCodium
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=toolbox run /usr/share/codium/codium --no-sandbox --unity-launch %F
Icon=code
Type=Application
StartupNotify=false
StartupWMClass=VSCodium
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;
Actions=new-empty-window;
Keywords=vscode;

[Desktop Action new-empty-window]
Name=New Empty Window
Exec=toolbox run /usr/share/codium/codium --no-sandbox --new-window %F
Icon=code

Setting up the Editor

From there the default font kinda sucks in the container. I like the ‘Fira Code’ font, which I installed via dnf install fira-code-fonts and then followed the instructions at this GitHub wiki to set it up. Things looked very weird immediately after setting the font, but after closing codium and re-opening it, it righted itself.

The integrated terminal is also in the toolbox container, which means if you need packages for other plugins, you can just use that to get situated.

Troubleshooting

I found myself on the Arch Linux wiki learning about .desktop files. I think that the Arch linux wiki is one of, if not the, best Linux wiki out there.

Conclusion

This is the way to go. It’s not very intrusive and it’s done in a useful way.

Also, So far, I’m really loving Fedora Silverblue. It hasn’t been too difficult. It’s been a little quirky, and a few UI things could be polished better, but I like what it’s trying to accomplish. Being able to put my editor directly in my toolbox container (which I think is actually just a podman container) was the biggest deal to make the OS useable for me. I’m glad I tried it.