Package: yafti
Yet Another First Time InstallerThis application is responsible for installing Flatpaks on first boot after a user finishes installation.
It is intended as a replacement for custom zenity dialogs.Project goalsConfig file driven via JSON/YAMLSupport for arbitrary pre and post-install commandsConfiguration driven screensScreen independent state management with ability to set defaultsExtensible with drop-in Python classes / plugins to extend functionalityCore featuresThese are goals for each feature of the first time installer:Title ScreenThe Title screen will be comprised of three primary elements. An image/icon, a header/primary text, and a paragraph description text.ICON
      TITLE TEXT

  this is a description
  to accompany the title
  screen.Packages screenDisplay several groups of packages to install, allow for expansion of each group to individually select discrete packages or toggle the entire group on/off.eg:Core                [/] >
Gaming              [/] >
Office              [/] >Expanding Core would revealCore                [/] v
  firefox           [x]
  calculator        [x]
  text editor       [x]
  clocks            [x]
  fonts             [x]
Gaming              [/] >
Office              [/] >The application then installs the Flatpaks. Plugins for other packages systems may/can be developed.Configurationtitle:uBlue First Bootproperties:mode:"run-on-change"path:"~/.config/yafti/last-run"actions:pre:-run:/full/path/to/bin --with --params-run:/another/command run-yafti.plugin.flatpak:install:org.gnome.Calculatorpost:-run:/run/these/commands --after --all --screensscreens:first-screen:source:yafti.screen.titlevalues:title:"Thatwasprettycool"icon:"/path/to/icon"description:|Time to play overwatchapplications:source:yafti.screen.packagevalues:title:Package Installationshow_terminal:truepackage_manager:yafti.plugin.flatpakgroups:Core:description:All the good stuffpackages:-Calculator:org.gnome.Calculator-Firefox:org.mozilla.firefoxGaming:description:GAMES GAMES GAMESpackages:-Steam:com.valvesoftware.Steam-Games:org.gnome.GamesOffice:description:All the work stuffpackages:-LibreOffice:org.libreoffice.LibreOffice-Calendar:org.gnome.Calendarfinal-screen:source:yafti.screen.titlevalues:title:"Alldone"icon:"/path/to/icon"description:|Thanks for installing, join the community, next stepsDevelopmentThis project uses Poetry and Python 3.11. Make sure you have Python 3.11 andPoetry installed. Checkout the repository and navigate to root project directory.PrerequisitesIf you're on a Ublue / immutable OS, you'll need to run these and the poetry install in a toolbox.sudo dnf install python3-devel cairo-devel gobject-introspection-devel cairo-gobject-devel
poetry installRunningpoetry run python -m yafti tests/example.ymlThis will launch the Yafti window.Running from a ContainerfileOne of yafti's main use cases is to be used in Containerfiles to handle installation of Flatpaks on first boot.
Add this to your Containerfile to add yafti to your image:RUN pip install --prefix=/usr yaftiAdditionally, you need a script to copy over the .desktop file to the user's home directory:Example firstboot scriptExample firstboot .desktop fileThen add a file in/etc/yafti.ymlwith your customizations. Check theexample filefor ideas.TestingThis project uses pytest, black, isort, and ruff for testing and linting.poetry run pytest --cov=yafti --cov-report=term-missing
poetry run black yafti
poetry run isort yafti
poetry run ruff yaftiContributingThis project follows a fork and pull request syle of contribution.Creating a ForkJust head over to the GitHub page andclick the "Fork" button. Once you've done that, you can use your favorite git client to clone your repo or just head straight to the command line:# Clone your fork to your local machinegitclonegit@github.com:USERNAME/FORKED-PROJECT.gitKeeping Your Fork Up to DateWhile this isn't an absolutely necessary step, if you plan on doing anything more than just a tiny quick fix, you'll want to make sure you keep your fork up to date by tracking the original "upstream" repo that you forked. You can do this by usingthe Github UIor locally by adding this repo as an upstream.# Add 'upstream' repo to list of remotesgitremoteaddupstreamhttps://github.com/ublue-os/yafti.git# Verify the new remote named 'upstream'gitremote-vWhenever you want to update your fork with the latest upstream changes, you'll need to first fetch the upstream repo's branches and latest commits to bring them into your repository:# Fetch from upstream remotegitfetchupstream# View all branches, including those from upstreamgitbranch-vaNow, checkout your own main branch and merge the upstream repo's main branch:# Checkout your main branch and merge upstreamgitcheckoutmain
gitmerge--ff-onlyupstream/mainIf there are no unique commits on the local main branch, git will simply perform a fast-forward. However, if you have been making changes on main (in the vast majority of cases you probably shouldn't be -see the next section, you may have to deal with conflicts. When doing so, be careful to respect the changes made upstream.Now, your local main branch is up-to-date with everything modified upstream.Doing Your WorkCreate a BranchWhenever you begin work on a new feature or bugfix, it's important that you create a new branch. Not only is it proper git workflow, but it also keeps your changes organized and separated from the main branch so that you can easily submit and manage multiple pull requests for every task you complete.To create a new branch and start working on it:# Checkout the main branch - you want your new branch to come from maingitcheckoutmain# Create a new branch named newfeature (give your branch its own simple informative name)gitcheckbout-bnewfeatureNow, go to town hacking away and making whatever changes you want to.Commit MessagesWe useConventional Commitsand enforce them with a bot to keep the changelogs tidy:chore: add Oyster build script
docs: explain hat wobble
feat: add beta sequence
fix: remove broken confirmation message
refactor: share logic between 4d3d3d3 and flarhgunnstow
style: convert tabs to spaces
test: ensure Tayne retains clothingIf you have multiple commits, whensubmitting your chages, make sure to use a conventional commit style PR title as this project does squash merges and that will be used as your contribution.Submitting a Pull RequestCleaning Up Your WorkPrior to submitting your pull request, you might want to do a few things to clean up your branch and make it as simple as possible for the original repo's maintainer to test, accept, and merge your work.If any commits have been made to the upstream main branch, you should rebase your feature branch so that merging it will be a simple fast-forward that won't require any conflict resolution work.# Fetch upstream main and merge with your repo's main branchgitfetchupstream
gitcheckoutmain
gitmergeupstream/main# If there were any new commits, rebase your feature branchgitcheckoutnewfeature
gitrebasemainSubmittingOnce you've committed and pushed all of your changes to GitHub, go to the page for your fork on GitHub, select your feature branch, and click the pull request button. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes on your feature branch and update.Accepting and Merging a Pull RequestTake note that unlike the previous sections which were written from the perspective of someone that created a fork and generated a pull request, this section is written from the perspective of the original repository owner who is handling an incoming pull request. Thus, where the "forker" was referring to the original repository asupstream, we're now looking at it as the owner of that original repository and the standardoriginremote.Checking Out and Testing Pull RequestsThere are multiple ways tocheck out a pull request locally. This way uses standard git operations to complete. Open up the.git/configfile and add a new line under[remote "origin"]:fetch = +refs/pull/*/head:refs/pull/origin/*Now you can fetch and checkout any pull request so that you can test them:# Fetch all pull request branchesgitfetchorigin# Checkout out a given pull request branch based on its numbergitcheckout-b9001pull/origin/9001Keep in mind that these branches will be read only and you won't be able to push any changes.Automatically Merging a Pull RequestIn cases where the merge would be a simple fast-forward, you can automatically do the merge by  clicking the button on the pull request page on GitHub.