Implement Gtk Network Status (#165)

Implemented
- Switch reacts to burrow socket and network changes 
- meson as build system
- Basic diagnostics to ensure burrow is installed properly
- Flatpak / Meson Building
This commit is contained in:
David Zhong 2024-01-25 22:10:24 -08:00 committed by GitHub
parent baa81eb939
commit 6990f90c2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 1571 additions and 665 deletions

View file

@ -1,7 +1,7 @@
[Desktop Entry]
Name=Burrow
Exec=burrow-gtk
Icon=com.hackclub.burrow
Name=@APP_NAME_CAPITALIZED@
Exec=@APP_NAME@
Icon=@APP_ID@
Terminal=false
Type=Application
Categories=GTK;Network

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="@APP_NAME@">
<schema id="@APP_ID" path="@APP_IDPATH@">
</schema>
</schemalist>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>@APP_ID@</id>
<metadata_license>CC0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<name translatable="no">@APP_NAME_CAPITALIZED@</name>
<launchable type="desktop-id">@APP_ID@.desktop</launchable>
<description>
<p>No description</p>
</description>
<summary>
<p>No Summary</p>
</summary>
</component>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>com.hackclub.burrow.desktop</id>
<project_license>GPL-3.0-or-later</project_license>
<description>
<p>No description</p>
</description>
</component>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="burrow-gtk">
<schema id="com.hackclub.burrow" path="/com/hackclub/burrow/">
</schema>
</schemalist>

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

View file

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><g color="#000" fill="#2e3436"><path d="M7.188 2.281c-.094.056-.192.125-.29.19L5.566 3.803a1.684 1.684 0 11-2.17 2.17L2.332 7.037c.506-.069 1.017-.136 1.2.026.242.214.139 1.031.155 1.656.213.088.427.171.657.219.04.008.085-.007.125 0 .337-.525.683-1.288 1-1.344.322-.057.905.562 1.406.937a3.67 3.67 0 00.656-.468c-.195-.595-.594-1.369-.437-1.657.158-.29 1.019-.37 1.625-.531.028-.183.062-.371.062-.562 0-.075-.027-.146-.031-.22-.587-.217-1.435-.385-1.562-.687-.128-.302.34-1.021.593-1.593a3.722 3.722 0 00-.593-.532zm3.875 3.25c-.165.475-.305 1.086-.47 1.563-.43.047-.84.14-1.218.312-.38-.322-.787-.773-1.156-1.093a5.562 5.562 0 00-.688.468c.177.46.453 1.001.625 1.469-.298.309-.531.67-.719 1.063-.494 0-1.102-.084-1.593-.094a5.68 5.68 0 00-.219.812c.435.24 1.006.468 1.438.72-.006.093-.032.185-.032.28 0 .333.049.66.125.97-.382.304-.898.63-1.28.937.015.044.04.083.058.127l.613.613c.417-.1.868-.223 1.266-.303.248.343.532.626.875.875-.027.135-.068.283-.104.428.174-.063.34-.155.482-.297l1.432-1.432a1.994 1.994 0 01.533-3.918c.919 0 1.684.623 1.918 1.467l1.338-1.338c.06-.06.11-.124.156-.191-.035-.062-.06-.13-.1-.188.096-.152.205-.31.315-.47.017-.348-.1-.7-.37-.971l-.177-.176c-.28.192-.561.387-.83.555-.345-.233-.746-.383-1.156-.5-.077-.507-.107-1.132-.187-1.625a5.44 5.44 0 00-.875-.063zm-9.247.608c-.087.068-.173.138-.254.205l.014.035z" style="marker:none" overflow="visible"/><path d="M8.707.293a1 1 0 00-1.415 0l-6.999 7a1 1 0 000 1.413l7 7.001a1 1 0 001.415 0l7-7a1 1 0 000-1.413zm-.708 2.121l5.587 5.587L8 13.586 2.414 7.999z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;shape-padding:0;isolation:auto;mix-blend-mode:normal;marker:none" font-weight="400" font-family="sans-serif" overflow="visible"/></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><g color="#000" fill="#2e3436"><path d="M7.188 2.281c-.094.056-.192.125-.29.19L5.566 3.803a1.684 1.684 0 11-2.17 2.17L2.332 7.037c.506-.069 1.017-.136 1.2.026.242.214.139 1.031.155 1.656.213.088.427.171.657.219.04.008.085-.007.125 0 .337-.525.683-1.288 1-1.344.322-.057.905.562 1.406.937a3.67 3.67 0 00.656-.468c-.195-.595-.594-1.369-.437-1.657.158-.29 1.019-.37 1.625-.531.028-.183.062-.371.062-.562 0-.075-.027-.146-.031-.22-.587-.217-1.435-.385-1.562-.687-.128-.302.34-1.021.593-1.593a3.722 3.722 0 00-.593-.532zm3.875 3.25c-.165.475-.305 1.086-.47 1.563-.43.047-.84.14-1.218.312-.38-.322-.787-.773-1.156-1.093a5.562 5.562 0 00-.688.468c.177.46.453 1.001.625 1.469-.298.309-.531.67-.719 1.063-.494 0-1.102-.084-1.593-.094a5.68 5.68 0 00-.219.812c.435.24 1.006.468 1.438.72-.006.093-.032.185-.032.28 0 .333.049.66.125.97-.382.304-.898.63-1.28.937.015.044.04.083.058.127l.613.613c.417-.1.868-.223 1.266-.303.248.343.532.626.875.875-.027.135-.068.283-.104.428.174-.063.34-.155.482-.297l1.432-1.432a1.994 1.994 0 01.533-3.918c.919 0 1.684.623 1.918 1.467l1.338-1.338c.06-.06.11-.124.156-.191-.035-.062-.06-.13-.1-.188.096-.152.205-.31.315-.47.017-.348-.1-.7-.37-.971l-.177-.176c-.28.192-.561.387-.83.555-.345-.233-.746-.383-1.156-.5-.077-.507-.107-1.132-.187-1.625a5.44 5.44 0 00-.875-.063zm-9.247.608c-.087.068-.173.138-.254.205l.014.035z" style="marker:none" overflow="visible"/><path d="M8.707.293a1 1 0 00-1.415 0l-6.999 7a1 1 0 000 1.413l7 7.001a1 1 0 001.415 0l7-7a1 1 0 000-1.413zm-.708 2.121l5.587 5.587L8 13.586 2.414 7.999z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;shape-padding:0;isolation:auto;mix-blend-mode:normal;marker:none" font-weight="400" font-family="sans-serif" overflow="visible"/></g></svg>

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Before After
Before After

View file

@ -1,13 +0,0 @@
application_id = 'com.hackclub.burrow'
scalable_dir = join_paths('hicolor', 'scalable', 'apps')
install_data(
join_paths(scalable_dir, ('@0@.svg').format(application_id)),
install_dir: join_paths(get_option('datadir'), 'icons', scalable_dir)
)
symbolic_dir = join_paths('hicolor', 'symbolic', 'apps')
install_data(
join_paths(symbolic_dir, ('@0@-symbolic.svg').format(application_id)),
install_dir: join_paths(get_option('datadir'), 'icons', symbolic_dir)
)

View file

@ -1,39 +1,90 @@
# app.desktop.in.in
desktop_conf = configuration_data()
desktop_conf.set('APP_ID', app_id)
desktop_conf.set('APP_NAME', app_name)
desktop_conf.set('APP_NAME_CAPITALIZED', app_name_capitalized)
desktop_file_in = configure_file(
input: 'app.desktop.in.in',
output: '@BASENAME@',
configuration: desktop_conf,
)
desktop_file = i18n.merge_file(
input: 'com.hackclub.burrow.desktop.in',
output: 'com.hackclub.burrow.desktop',
type: 'desktop',
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
input: desktop_file_in,
output: app_id + '.desktop',
type: 'desktop',
po_dir: '../po',
install: true,
install_dir: datadir / 'applications',
)
desktop_utils = find_program('desktop-file-validate', required: false)
if desktop_utils.found()
test('Validate desktop file', desktop_utils, args: [desktop_file])
if desktop_file_validate.found()
test(
'validate-desktop',
desktop_file_validate,
args: [desktop_file],
)
endif
appstream_file = i18n.merge_file(
input: 'com.hackclub.burrow.appdata.xml.in',
output: 'com.hackclub.burrow.appdata.xml',
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'appdata')
# app.gschema.xml.in
gschema_conf = configuration_data()
gschema_conf.set('APP_ID', app_id)
gschema_conf.set('APP_NAME', app_name)
gschema_conf.set('APP_IDPATH', app_idpath)
gschema_file = configure_file(
input: 'app.gschema.xml.in',
output: app_id + '.gschema.xml',
configuration: gschema_conf,
install: true,
install_dir: datadir / 'glib-2.0' / 'schemas',
)
if glib_compile_schemas.found()
test(
'validate-gschema',
glib_compile_schemas,
args: [
'--dry-run',
datadir / 'glib-2.0' / 'schemas',
],
)
endif
# app.metainfo.xml.in
appdata_conf = configuration_data()
appdata_conf.set('APP_ID', app_id)
appdata_conf.set('APP_NAME', app_name)
appdata_conf.set('APP_NAME_CAPITALIZED', app_name_capitalized)
appdata_file_in = configure_file(
input: 'app.metainfo.xml.in',
output: '@BASENAME@',
configuration: appdata_conf,
)
appdata_file = i18n.merge_file(
input: appdata_file_in,
output: app_id + '.metainfo.xml',
po_dir: '../po',
install: true,
install_dir: datadir / 'metainfo',
)
appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
test('Validate appstream file', appstream_util, args: ['validate', appstream_file])
test(
'validate-appdata',
appstream_util,
args: ['validate', '--nonet', appdata_file],
)
endif
install_data('com.hackclub.burrow.gschema.xml',
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
install_data(
'icons/hicolor/scalable/apps/' + app_name + '.svg',
install_dir: datadir / 'icons' / 'hicolor' / 'scalable' / 'apps',
rename: app_id + '.svg',
)
compile_schemas = find_program('glib-compile-schemas', required: false)
if compile_schemas.found()
test('Validate schema file',
compile_schemas,
args: ['--strict', '--dry-run', meson.current_source_dir()])
endif
subdir('icons')
install_data(
'icons/hicolor/symbolic/apps/' + app_name + '-symbolic.svg',
install_dir: datadir / 'icons' / 'hicolor' / 'symbolic' / 'apps',
rename: app_id + '-symbolic.svg',
)

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/com/hackclub/burrow">
</gresource>
</gresources>