Code Monkey home page Code Monkey logo

cosmic-applibrary's Introduction

Cosmic Application Template

A boilerplate template to get started with GTK, Rust, Meson, Flatpak, Debian made for Cosmic.

What does it contains?

  • A simple window
  • Bunch of useful files that you SHOULD ship with your application on Linux:
    • Metainfo: describe your application for the different application stores out there;
    • Desktop: the application launcher;
    • Icons: This repo contains three icons, a normal, a nightly & monochromatic icon (symbolic) per the GNOME HIG, exported using App Icon Preview.
  • Flatpak Manifest for nightly builds
  • Dual installation support
  • Uses Meson for building the application
  • Bundles the UI files & the CSS using gresources
  • A pre-commit hook to run rustfmt on your code
  • Tests to validate your Metainfo, Schemas & Desktop files
  • Gsettings to store the window state, more settings could be added
  • Gitlab CI to produce flatpak nightlies
  • i18n support

How to init a project ?

The template ships a simple python script to init a project easily. It asks you a few questions and replaces & renames all the necessary files.

The script requires having git installed on your system.

You can run it with,

python3 create-project.py
โžœ python3 create-project.py
Welcome to Cosmic Application Template
Name: Contrast
Project Name: contrast
Application ID (e.g. org.domain.MyAwesomeApp, see: https://developer.gnome.org/ChooseApplicationID/): org.gnome.design.Contrast
Author: Bilal Elmoussaoui
Email: [email protected]

A new directory named contrast containing the generated project

Building the project

Gnome Builder works well for building the project as a flatpak during development. (It may be helpful to also install rust-analyzer and add it to PATH.)

Builing a deb

dpkg-buildpackage -b -d

Flatpak CLI

Make sure you have flatpak and flatpak-builder installed. Then run the commands below. Replace <application_id> with the value you entered during project creation. Please note that these commands are just for demonstration purposes. Normally this would be handled by your IDE, such as GNOME Builder or VS Code with the Flatpak extension.

flatpak install org.gnome.Sdk//42 org.freedesktop.Sdk.Extension.rust-stable//21.08 org.gnome.Platform//42
flatpak-builder --user flatpak_app build-aux/<application_id>.Devel.json

Once the project is build, run the command below. Replace Replace <application_id> and <project_name> with the values you entered during project creation. Please note that these commands are just for demonstration purposes. Normally this would be handled by your IDE, such as GNOME Builder or VS Code with the Flatpak extension.

flatpak-builder --run flatpak_app build-aux/<application_id>.Devel.json <project_name>

Community

Join the Pop_OS!, GNOME, and gtk-rs communities!

Credits

cosmic-applibrary's People

Contributors

wash2 avatar drakulix avatar git-f0x avatar 13r0ck avatar ids1024 avatar gildemberg-santos avatar groobledierne avatar falexei avatar 1280px avatar aanzel avatar crxruixuan avatar gustavosaquino avatar mjkim0727 avatar nimafanniasl avatar oguzkarayemis avatar pbui avatar wsx-udscbt avatar vandalhj avatar yorimirus avatar consultorseovalencia avatar menterkuo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.