# Package Structure

Phion will be using a custom extension called .phkg which stores all the files necessary for your rice. Phion package will contain wallpapers, dot configuration folders and other notes for the user to use or scripts as well. To see how PHION handles these packages see Parsers

You can create packages either through the CLI interface or by using the GUI currently. Easiest way is to simply create a rice through PHIOS and then export it as a .phkg file.

A Phion rice package structure will look more or less like this-

 ┣ 📂configs
 ┃ ┣ 📂Kitty
 ┃ ┃ ┗ 📜kitty.conf
 ┃ ┣ 📂Polybar
 ┃ ┃ ┗ 📜polybar.conf
 ┃ ┗ 📂Rofi
 ┃ ┃ ┗ 📜rofi.conf
 ┣ 📂wallpapers
 ┃ ┣ 📜dark.png
 ┃ ┣ 📜extra.png
 ┃ ┗ 📜light.png
 ┣ 📂wm
 ┃ ┣ 📂awesome
 ┃ ┃ ┗ 📜config
 ┃ ┗ 📂i3
 ┃ ┃ ┗ 📜i3.conf
 ┣ 📜config.phn
 ┗ 📜install.sh

You don't necessarily need PHION to use a .phkg file as its just a zip file, but it makes it easier to install, save and share your rices.

Below, I have explained the functionality and purpose each folder and file in detail.

# wallpapers

The wallpaper folder is one the most simple to begin with. It contains the images required for the rice. A rice can have multiple wallpapers, and then it would be up to the user to decide what wallpaper they want to use.

When creating the package, it is advised to keep all your wallpapers at a single place. I prefer storing my rice wallpapers at $HOME/Pictures folder. But you can store it almost anywhere you want.

This may seem unnecessary, but each wallpaper has its own class. Each wallpaper class contains

wallpaper_name <string>
wallpaper_location <string> # Which is set by the phkg creator.

When the user installs a .phkg the wallpaper files are copied over to the wallpaper_location. In case this location is not accessible due to permissions, the location then falls back to $HOME/Pictures where you would then need to move it to the specified location. It would be better to keep the wallpapers in a generalized location.

# Application Configurations

The configs folder in the package is the most important folder. Without this, you cannot call it a rice. The application configs contain folders for application dot files such as terminal configs (kitty, Alacrity, etc), Polybar, Rofi, Dunst, Picom, etc. Note that you are not supposed to store the WM configs inside this folder.

Each application folder can have multiple files and when installing the package, the entire application folder is moved to the specified location. It is required that the configs should be at their default locations which is generally at $HOME/.config.

Each application is also an object with the following structure-

application_name <string>
config_folder_path <string>
files_included <list>

# WMs

The reason for why window manager configs are not in the application configs is simply because I prefer this type of organization. It is possible for a rice to have multiple WMs configs. Honestly, why limit your setup to just a single window manager? While it is True that one is only going to use a single WM at a time, it still adds a lot of customization and flexibility. You wouldn't need to create multiple packages for the same color scheme rices just for different WMs... All of that now comes under the same package.

WM class structure (Similar to the previous class)

WM_name <string>
config_folder_path <string>
files_included <list>

TIP: It is advisable to split your WM configs into 2 parts (I'll be giving an example for i3):- styling.conf i3.conf While i3.conf contains all of your keybinds and applications that autostart, styling.conf will contain all the colors, gaps configurations, etc for the rice. (This is still optional, but it would save you a lot of time if you don't like changing your keybinds that were created by someone else)

# Variants

This is quite a hard and confusing feature to explain and then implement, so I'll keep this here for later.

# install.sh (Optional)

This may not be required by most people, but if your rice requires some other configurations than simply copy-pasting the dot files then use this inside the package. Users are required to view what the shell file does before running it for security reasons.

# Phion Config / .phn

Phion config is auto generated by PHION when packing a rice into a package. This contains instructions and metadata for the package. Basically a pickle dump. When loading a package, it is a must for it to have this file else the rice wouldn't load. More information at [[config]]