Skip to content
This repository has been archived by the owner on Apr 28, 2023. It is now read-only.

realgrm/toolbox-desktop-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

toolbox-desktop-integration

Summary

Preface
Goal
Using with podman
Results
How it works
Installation
Usage
Manual Process

toolbox-desktop-integration_gif

Preface

Currently, to install something in Silverblue, the main options are (with its main drawbacks):

  • rpm-ostree
    It have to reboot to login with the image that contains the new installed packages
  • flatpak
    Many apps are not ported to this format yet
  • inside podman container trough toolbox
    Is design to install CLI programs and not GUI programs. So when a GUI app is installed, it is not fully integrated to the system. For example:
    • there's no app shortcut in the App Grip. In other words, the desktop file is not present in the correct location to be visible
    • if you use a different theme from the default, it is ignored

All the drawbacks listed are my opinion, based on my current use of Silverblue.

Goal

This project aims to integrate the toolboxes installed with the desktop, by:

  • making avaliable to the host, shortcuts of GUI applications installed inside all toolbox containers
  • making these apps run with applied theme by default

Using with podman

Although this was created with toolbox in mind, it was tested with some containers created with podman and it worked the same way. EDIT: Currently, it only works with the default toolbox

Results

Activities Overview: App is running and the system adds "(on toolbox)" in the title
image

Show Applications: App icon in Dash indicates that it is running, however in the App Grid there is no indicator below the icon
image

Menu Editor: The app shortcut is now visible to menu editors, such as Menulibre

How it works

script install.py

  • Checks if a container is created. If it is:
  • Create a desktop file to trigger the update.py script
  • run the script update.py

script update.py

  • Search for ".desktop" files inside specific folders
    • Get overlay_id of these folders
    • Create a backup folder inside the app's folder
    • Create link in ~/.local/share/applications
    • Create link in ~/.local/share/icons
    • Verify if the desktop file is already modified
      • get icon path for the unmodified ones
      • create a backup of original desktop file
      • save modified content
  • Copy themes from /usr/share/themes to ~/.themes, where is visible to all toolboxes
  • Update app grid

Installation

To install you can run these comands in terminal:

# declaring constants
app_folder="$HOME/.local/scripts/toolbox-desktop-integration/"
github_applink="https://raw.githubusercontent.com/realgrm/toolbox-desktop-integration/main/app/"

# creating folder where the app will be installed
mkdir -p $app_folder
cd $app_folder

# downloading the files
wget ${github_applink}install.py
wget ${github_applink}update.py
wget ${github_applink}toolbox-desktop-integration.png
wget ${github_applink}toolbox-desktop-integration.desktop

# making files executable
chmod +x ${app_folder}/install.py
chmod +x ${app_folder}/update.py

# runing the installation script
${app_folder}install.py

Usage

When the install.py is executed:

  • automatically the script update.py is also executed, so your GUI apps installed from toolbox should appear ins the app grid (may takes a few seconds to update the icon in the app grid)
  • it creates an shortcut in AppGrid called Update toolbox, that can run the script update.py again. image

So every time you install a GUI app inside a toolbox, you can use this shortcut.

Manual Process

The manual process below was used as the basis to the creation of these scripts. It is an example.

It is avaliable here if someone wishes to do the work manually instead of using scripts.

Make shortcut from toolbox avaliable to the host

Action: make a copy of the desktop file and icon to the home folder:

Description Copy (container) Paste (Silverblue)
Desktop File Location ~/.local/share/containers/storage/overlay/{overlay-id}/diff/usr/share/applications/blender.desktop ~/.local/share/applications/toolbox-blender.desktop
Icon File Location ~/.local/share/containers/storage/overlay/{overlay-id}/diff/usr/share/icons/hicolor/scalable/apps/blender.svg ~/.local/share/icons/hicolor/scalable/apps/toolbox/blender.svg

Replace {overlay-id} with the folder created to your container. Mine was "d0ed434fec06789afb233cd607dee2572efe8f30bf816c7edddc9372b4bd668f" folder.
I discover the correct folder by installing an app and searching for the app's desktop file inside ~/.local/share/containers/storage/overlay/

Make the shortcut point to the correct executable

Action: Edit the content of ~/.local/share/applications/toolbox-blender.desktop:

Description Before (container) After (Silverblue)
Name Line Name=Blender Name=Blender (container)
Exec Line Exec=blender% f Exec=toolbox run blender% f

Make app from toolbox to use applied theme

Action: Copy the themes from /usr/share/thems to ~/.themes s