Skip to content

Initialization

Directory Structure

About this..

  • The default structure is intended (& recomended) to provide a clean structure & followed by documentation.
  • Except modules dir, config file, you are free to organize your project however you like.
Project Root
├── main.sh
├── config.yml 
├── src/
│   └── packages.sh
└── modules/
    ├── Module1.sh
    └── Module2.sh

1. main.sh

  • Location: Project Root
  • Desc:
    • This is entry point of the project.
    • This file holds all steps. initializing kit, importing modules, using methods, is done in this method.
Example main.sh
#!/bin/bash

# Init Kit
eval "$(kireisakura -i)"

# Import modules
kimport utils.os utils.font

# list all installed fonts & find one
font.list | grep "jetbrains"

# Rest of the script

3. config.yml dir

  • Location: Project Root
  • Desc: This directory holds local modules. This directory is interpreted as local package within the kit.

3. modules dir

  • Location: Project Root
  • Desc: This directory holds local modules. This directory is interpreted as local package within the kit.

4. src dir

  • Location: Project Root
  • Desc: This directory is intended to hold resource files that are part of your project.
Example src/packages.sh
cli_pacakges=(
    "yazi"
    "eza"
    "htop"
)

gui_packages=(
    "zen-browser"
    "code-oss"
    "mpv"
    "redshift"
)
#!/bin/env bash
source src/packages.sh

install-package cli_packages gui_packages


Install & source Kit

Before everything

  • Make sure you have curl, grep installed.
  • Optionally figlet too for the header.

ℹ️ There are two ways to Install & source the kit : -

  • This one is recommended.
  • Just execute your entry script, initialization will be done automatically.
  • Suitable for portable scripts. (ex. in a dotfiles install script)
Add these lines at top of your script
if command -v kireisakura &> /dev/null; then
  eval "$(kireisakura --init)"
else
  clear -x
  printf "\n> Downloading KireiSakura-Kit\n"
  curl -sSL https://kireisakura.soymadip.me/install.sh | bash -s -ds
fi
  • Installs the kit in your system but Doesn't source kit even if executed inside a script.
  • Suitable if only needed to install.
Run this in terminal
curl -L https://kireisakura.soymadip.me/install.sh | bash -s


Create config file

Create a file called config.yml in your project root.

Add below lines with proper values : -

Project:
    name: "Your project name"
    owner: "your name"