├── .github └── workflows │ └── main.yml ├── LICENSE ├── Makefile ├── README.md ├── com.github.jeysonflores.elementarylua ├── com.github.jeysonflores.elementarylua.yml ├── data ├── assets │ ├── icons │ │ └── com.github.jeysonflores.elementarylua.svg │ └── screenshots │ │ ├── screenshot-1.png │ │ └── screenshot-2.png ├── com.github.jeysonflores.elementarylua.appdata.xml ├── com.github.jeysonflores.elementarylua.desktop └── com.github.jeysonflores.elementarylua.gschema.xml └── src ├── Application.lua ├── MainWindow.lua └── WelcomeView.lua /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | flatpak: 7 | runs-on: ubuntu-latest 8 | 9 | container: 10 | image: ghcr.io/elementary/flatpak-platform/runtime:6 11 | options: --privileged 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v3 16 | with: 17 | bundle: ElementaryLua.flatpak 18 | manifest-path: com.github.jeysonflores.elementarylua.yml 19 | run-tests: true 20 | repository-name: appcenter 21 | repository-url: https://flatpak.elementary.io/repo.flatpakrepo 22 | cache-key: "flatpak-builder-${{ github.sha }}" 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Jeyson Flores 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all install uninstall 2 | PREFIX ?= /app 3 | 4 | install: 5 | install -D -m 0755 com.github.jeysonflores.elementarylua $(PREFIX)/bin/com.github.jeysonflores.elementarylua 6 | install -D -m 0644 src/Application.lua $(PREFIX)/bin/elementarylua/src/Application.lua 7 | install -D -m 0644 src/MainWindow.lua $(PREFIX)/bin/elementarylua/src/MainWindow.lua 8 | install -D -m 0644 src/WelcomeView.lua $(PREFIX)/bin/elementarylua/src/WelcomeView.lua 9 | install -D -m 0644 data/com.github.jeysonflores.elementarylua.gschema.xml $(PREFIX)/share/glib-2.0/schemas/com.github.jeysonflores.elementarylua.gschema.xml 10 | install -D -m 0644 data/com.github.jeysonflores.elementarylua.desktop $(PREFIX)/share/applications/com.github.jeysonflores.elementarylua.desktop 11 | install -D -m 0644 data/assets/icons/com.github.jeysonflores.elementarylua.svg $(PREFIX)/share/icons/hicolor/scalable/apps/com.github.jeysonflores.elementarylua.svg 12 | glib-compile-schemas $(PREFIX)/share/glib-2.0/schemas/ 13 | 14 | uninstall: 15 | rm -f $(PREFIX)/bin/com.github.jeysonflores.elementarylua 16 | rm -f $(PREFIX)/bin/elementarylua/src/Application.lua 17 | rm -f $(PREFIX)/bin/elementarylua/src/MainWindow.lua 18 | rm -f $(PREFIX)/bin/elementarylua/src/WelcomeView.lua 19 | rm -f $(PREFIX)/share/glib-2.0/schemas/com.github.jeysonflores.elementarylua.gschema.xml 20 | rm -f $(PREFIX)/share/icons/hicolor/scalable/apps/com.github.jeysonflores.elementarylua.svg 21 | gtk-update-icon-cache $(PREFIX)/share/icons/hicolor/share/icons/hicolor 22 | glib-compile-schemas $(PREFIX)/share/glib-2.0/schemas/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Screenshot](https://github.com/JeysonFlores/ElementaryLua/blob/master/data/assets/screenshots/screenshot-1.png) 2 | ![Screenshot](https://github.com/JeysonFlores/ElementaryLua/blob/master/data/assets/screenshots/screenshot-2.png) 3 | 4 | # Description 5 | ElementaryLua is a template for eOS applications, meaning that it's built over Gtk, Granite and Flatpak but running over LuaJIT. 6 | 7 | # Features 8 | - ElementaryOS 6 Dark Mode Support 9 | - GSchema Support 10 | # Build & Run 11 | ``` 12 | git clone https://github.com/JeysonFlores/ElementaryLua 13 | cd ElementaryLua 14 | flatpak-builder build com.github.jeysonflores.elementarylua.yml --user --install --force-clean 15 | flatpak run com.github.jeysonflores.elementarylua 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /com.github.jeysonflores.elementarylua: -------------------------------------------------------------------------------- 1 | #! /app/bin/luajit 2 | --local f, err = loadfile("src/Application.lua") 3 | package.path = package.path .. ";/app/bin/elementarylua/?.lua;/app/share/lua/5.1/?.lua" 4 | package.cpath = package.cpath .. ";/app/lib/lua/5.1/?.so" 5 | 6 | require "src.Application" 7 | 8 | app = Application.new() 9 | app:run { arg[0], ... } -------------------------------------------------------------------------------- /com.github.jeysonflores.elementarylua.yml: -------------------------------------------------------------------------------- 1 | app-id: com.github.jeysonflores.elementarylua 2 | 3 | runtime: io.elementary.Platform 4 | runtime-version: '6' 5 | sdk: io.elementary.Sdk 6 | 7 | command: com.github.jeysonflores.elementarylua 8 | 9 | finish-args: 10 | - '--share=ipc' 11 | - '--socket=fallback-x11' 12 | - '--socket=wayland' 13 | - '--system-talk-name=org.freedesktop.Accounts' 14 | 15 | modules: 16 | - name: luajit 17 | buildsystem: simple 18 | build-commands: 19 | - pwd && make && make install PREFIX=/app 20 | sources: 21 | - type: archive 22 | url: https://luajit.org/download/LuaJIT-2.0.5.tar.gz 23 | sha256: 874b1f8297c697821f561f9b73b57ffd419ed8f4278c82e05b48806d30c1e979 24 | 25 | - name: luarocks 26 | buildsystem: simple 27 | build-commands: 28 | - pwd && ./configure --prefix=/app && make && make install PREFIX=/app 29 | sources: 30 | - type: archive 31 | url: https://luarocks.org/releases/luarocks-3.7.0.tar.gz 32 | sha256: 9255d97fee95cec5b54fc6ac718b11bf5029e45bed7873e053314919cd448551 33 | 34 | - name: lgi 35 | buildsystem: simple 36 | build-options: 37 | build-args: 38 | - --share=network 39 | build-commands: 40 | - "luarocks install lgi" 41 | 42 | - name: elementarylua 43 | buildsystem: simple 44 | build-commands: 45 | - make install 46 | sources: 47 | - type: dir 48 | path: . 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /data/assets/icons/com.github.jeysonflores.elementarylua.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /data/assets/screenshots/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeysonFlores/ElementaryLua/56315e13c3b19b2c9c562f507b9417db13068046/data/assets/screenshots/screenshot-1.png -------------------------------------------------------------------------------- /data/assets/screenshots/screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeysonFlores/ElementaryLua/56315e13c3b19b2c9c562f507b9417db13068046/data/assets/screenshots/screenshot-2.png -------------------------------------------------------------------------------- /data/com.github.jeysonflores.elementarylua.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | com.github.jeysonflores.elementarylua 5 | CC0-1.0 6 | GPL-3.0+ 7 | Elementary-Lua 8 | It's just a template 9 | 10 |

11 | Lua + GTK + Granite + Flatpak 12 |

13 |

14 | Features Include: 15 |

16 | 20 |
21 | 22 | com.github.jeysonflores.elementarylua 23 | 24 | 25 | 26 | 27 |

First Release

28 |
29 |
30 |
31 | 32 | 33 | https://raw.githubusercontent.com/JeysonFlores/ElementaryLua/main/data/assets/screenshots/screenshot-1.png 34 | 35 | 36 | https://raw.githubusercontent.com/JeysonFlores/ElementaryLua/main/data/assets/screenshots/screenshot-2.png 37 | 38 | 39 | Jeyson Antonio Flores Deras 40 | com.github.jeysonflores.elementarylua.desktop 41 | https://github.com/JeysonFlores/ElementaryLua 42 | https://github.com/JeysonFlores/ElementaryLua/issues 43 | https://github.com/JeysonFlores/ElementaryLua/issues 44 | https://github.com/JeysonFlores/ElementaryLua/issues 45 | jeyson.flores@hotmail.com 46 | 47 | none 48 | none 49 | none 50 | none 51 | none 52 | none 53 | none 54 | none 55 | none 56 | none 57 | none 58 | none 59 | none 60 | none 61 | none 62 | none 63 | none 64 | none 65 | none 66 | none 67 | none 68 | none 69 | none 70 | none 71 | none 72 | none 73 | none 74 | 75 | 76 | #efefef 77 | #508ff3 78 | 0 79 | 80 | 81 | HiDpiIcon 82 | HighContrast 83 | ModernToolkit 84 | 85 |
86 | -------------------------------------------------------------------------------- /data/com.github.jeysonflores.elementarylua.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Elementary Lua 3 | GenericName=Elementary Lua 4 | Comment=It's just a template 5 | Categories=Utility; 6 | Exec=com.github.jeysonflores.elementarylua 7 | Icon=com.github.jeysonflores.elementarylua 8 | Terminal=false 9 | Type=Application 10 | X-GNOME-Gettext-Domain=com.github.jeysonflores.elementarylua 11 | Keywords=Utility; 12 | -------------------------------------------------------------------------------- /data/com.github.jeysonflores.elementarylua.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 360 6 | Horizontal position 7 | The saved horizontal position of the main window 8 | 9 | 10 | 11 | 360 12 | Vertical position 13 | The saved vertical position of the main window 14 | 15 | 16 | 17 | 600 18 | Window width 19 | The saved width of the main window 20 | 21 | 22 | 23 | 400 24 | Window height 25 | The saved height of the main window 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/Application.lua: -------------------------------------------------------------------------------- 1 | package.path = package.path .. ";/app/bin/elementarylua/?.lua;/app/share/lua/5.1/?.lua" 2 | package.cpath = package.cpath .. ";/app/lib/lua/5.1/?.so" 3 | 4 | local lgi = require 'lgi' 5 | local Gtk = lgi.require('Gtk') 6 | local Gio = lgi.require('Gio') 7 | local Granite = lgi.require('Granite') 8 | local GLib = lgi.require('GLib') 9 | 10 | require "src.MainWindow" 11 | 12 | Application = {} 13 | 14 | function Application.new() 15 | local app = Gtk.Application { 16 | application_id = "com.github.jeysonflores.elementarylua" 17 | } 18 | 19 | 20 | function app:on_activate() 21 | local main_window = MainWindow.new() 22 | main_window.application = self 23 | 24 | local settings = Gio.Settings { 25 | schema_id = "com.github.jeysonflores.elementarylua" 26 | } 27 | 28 | local granite_settings = Granite.Settings{} 29 | local gtk_settings = Gtk.Settings:get_default() 30 | 31 | 32 | if granite_settings.prefers_color_scheme == "DARK" then 33 | gtk_settings.gtk_application_prefer_dark_theme = true 34 | else 35 | gtk_settings.gtk_application_prefer_dark_theme = false 36 | end 37 | 38 | granite_settings.on_notify["prefers-color-scheme"] = function(self, pspec) 39 | if granite_settings.prefers_color_scheme == "DARK" then 40 | gtk_settings.gtk_application_prefer_dark_theme = true 41 | else 42 | gtk_settings.gtk_application_prefer_dark_theme = false 43 | end 44 | end 45 | 46 | main_window:resize(settings:get_int("window-width"), settings:get_int("window-height")) 47 | main_window:move(settings:get_int("pos-x"), settings:get_int("pos-y")) 48 | 49 | main_window:show_all() 50 | end 51 | 52 | return app 53 | end 54 | 55 | -------------------------------------------------------------------------------- /src/MainWindow.lua: -------------------------------------------------------------------------------- 1 | package.path = package.path .. ";/app/bin/elementarylua/?.lua;/app/share/lua/5.1/?.lua" 2 | package.cpath = package.cpath .. ";/app/lib/lua/5.1/?.so" 3 | 4 | local lgi = require 'lgi' 5 | local Gtk = lgi.require('Gtk') 6 | local Handy = lgi.require('Handy') 7 | local Gio = lgi.require('Gio') 8 | 9 | require "src.WelcomeView" 10 | 11 | MainWindow = {} 12 | 13 | function MainWindow.new() 14 | local title_button = Gtk.Button { 15 | label = "ElementaryLua", 16 | can_focus = false 17 | } 18 | 19 | local title_button_context = title_button:get_style_context():add_class("keycap") 20 | 21 | local titlebar = Gtk.HeaderBar { 22 | custom_title = title_button, 23 | decoration_layout = "close:", 24 | show_close_button = true 25 | } 26 | 27 | local titlebar_context = titlebar:get_style_context():add_class("flat") 28 | 29 | local main_window = Gtk.Window {} 30 | main_window:set_titlebar(titlebar) 31 | 32 | main_window:add(WelcomeView.new()) 33 | 34 | local main_window_context = main_window:get_style_context():add_class("rounded") 35 | 36 | 37 | function main_window:on_delete_event() 38 | 39 | local settings = Gio.Settings { 40 | schema_id = "com.github.jeysonflores.elementarylua" 41 | } 42 | 43 | local root_x, root_y = main_window:get_position() 44 | local width, height = main_window:get_size() 45 | 46 | settings:set_int("pos-x", root_x) 47 | settings:set_int("pos-y", root_y) 48 | 49 | settings:set_int("window-width", width) 50 | settings:set_int("window-height", height) 51 | 52 | Gtk:main_quit() 53 | end 54 | 55 | return main_window 56 | end -------------------------------------------------------------------------------- /src/WelcomeView.lua: -------------------------------------------------------------------------------- 1 | package.path = package.path .. ";/app/bin/elementarylua/?.lua;/app/share/lua/5.1/?.lua" 2 | package.cpath = package.cpath .. ";/app/lib/lua/5.1/?.so" 3 | 4 | local lgi = require 'lgi' 5 | local Gtk = lgi.require('Gtk') 6 | local Granite = lgi.require('Granite') 7 | 8 | WelcomeView = {} 9 | 10 | function WelcomeView.new() 11 | local welcome = Granite.WidgetsWelcome { 12 | title = "Welcome to ElementaryLua", 13 | subtitle = "It's just a template" 14 | } 15 | 16 | welcome:append("network-workgroup", "Lua Official Page", "The Official Website of Lua.") 17 | welcome:append ("applications-development", "LGI Bindings", "GTK Bindings for Lua.") 18 | welcome:append ("distributor-logo", "Elementary Docs", "Documentation Guide for Devs.") 19 | 20 | local welcome_context = welcome:get_style_context():remove_class("view") 21 | 22 | function welcome:on_activated(index) 23 | if index == 0 then 24 | os.execute("xdg-open https://www.lua.org/") 25 | elseif index == 1 then 26 | os.execute("xdg-open https://github.com/pavouk/lgi") 27 | elseif index == 2 then 28 | os.execute("xdg-open https://docs.elementary.io/develop/") 29 | end 30 | end 31 | 32 | return welcome 33 | end --------------------------------------------------------------------------------