This repository has been archived by the owner on Feb 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87137bf
commit 209208d
Showing
20 changed files
with
175 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
data/com.github.casasfernando.wingpanel-indicator-airpods.gresource.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<gresources> | ||
<gresource prefix="/com/github/casasfernando/wingpanel-indicator-airpods"> | ||
<file alias="Application.css">Application.css</file> | ||
<file compressed="true" preprocess="xml-stripblanks">icons/airpods-symbolic.svg</file> | ||
<file compressed="true" preprocess="xml-stripblanks">icons/airpods-left-symbolic.svg</file> | ||
<file compressed="true" preprocess="xml-stripblanks">icons/airpods-right-symbolic.svg</file> | ||
<file compressed="true" preprocess="xml-stripblanks">icons/airpods-case-symbolic.svg</file> | ||
<file compressed="true" preprocess="xml-stripblanks">icons/airpods-connected-symbolic.svg</file> | ||
<file compressed="true" preprocess="xml-stripblanks">icons/airpods-disconnected-symbolic.svg</file> | ||
</gresource> | ||
</gresources> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,37 @@ | ||
# Install icons | ||
icon_sizes = ['16', '24', '32', '48', '64', '128'] | ||
|
||
foreach i : icon_sizes | ||
install_data( | ||
join_paths('icons', i, meson.project_name() + '.svg'), | ||
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps') | ||
) | ||
install_data( | ||
join_paths('icons', i, meson.project_name() + '.svg'), | ||
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i + '@2', 'apps') | ||
) | ||
install_data ( | ||
join_paths ('icons', i, meson.project_name () + '.svg'), | ||
install_dir: join_paths (get_option ('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps') | ||
) | ||
install_data ( | ||
join_paths ('icons', i, meson.project_name() + '.svg'), | ||
install_dir: join_paths (get_option ('datadir'), 'icons', 'hicolor', i + 'x' + i + '@2', 'apps') | ||
) | ||
endforeach | ||
|
||
i18n.merge_file( | ||
input: meson.project_name() + '.desktop.in', | ||
output: meson.project_name() + '.desktop', | ||
po_dir: join_paths(meson.source_root(), 'po', 'extra'), | ||
type: 'desktop', | ||
install: true, | ||
install_dir: join_paths(get_option('datadir'), 'applications') | ||
# Translate and install our .desktop file so the Applications Menu will see it | ||
i18n.merge_file ( | ||
input: meson.project_name () + '.desktop.in', | ||
output: meson.project_name () + '.desktop', | ||
po_dir: join_paths (meson.source_root (), 'po', 'extra'), | ||
type: 'desktop', | ||
install: true, | ||
install_dir: join_paths (get_option ('datadir'), 'applications') | ||
) | ||
|
||
i18n.merge_file( | ||
input: meson.project_name() + '.appdata.xml.in', | ||
output: meson.project_name() + '.appdata.xml', | ||
po_dir: join_paths(meson.source_root(), 'po', 'extra'), | ||
install: true, | ||
install_dir: join_paths(get_option('datadir'), 'metainfo') | ||
# Translate and install our .appdata.xml file so AppCenter will see it | ||
i18n.merge_file ( | ||
input: meson.project_name () + '.appdata.xml.in', | ||
output: meson.project_name () + '.appdata.xml', | ||
po_dir: join_paths (meson.source_root (), 'po', 'extra'), | ||
install: true, | ||
install_dir: join_paths (get_option ('datadir'), 'metainfo') | ||
) | ||
|
||
|
||
desktop_file_validate = find_program('desktop-file-validate', required:false) | ||
|
||
if desktop_file_validate.found() | ||
test ( | ||
'Validate desktop file', | ||
desktop_file_validate, | ||
args: join_paths(meson.current_build_dir (), meson.project_name() + '.desktop') | ||
) | ||
endif | ||
|
||
appstreamcli = find_program(['appstreamcli', 'appstream-util'], required:false) | ||
|
||
if appstreamcli.found() | ||
test ( | ||
'Validate appdata file', | ||
appstreamcli, | ||
args: ['validate', join_paths(meson.current_build_dir (), meson.project_name() + '.appdata.xml')] | ||
) | ||
endif | ||
|
||
install_data( | ||
meson.project_name() + '.gschema.xml', | ||
install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'glib-2.0', 'schemas') | ||
install_data ( | ||
meson.project_name () + '.gschema.xml', | ||
install_dir: join_paths (get_option ('datadir'), 'glib-2.0', 'schemas') | ||
) | ||
|
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,95 @@ | ||
project('com.github.casasfernando.wingpanel-indicator-airpods', 'vala', 'c') | ||
# Project name, programming language and version | ||
project ( | ||
'com.github.casasfernando.wingpanel-indicator-airpods', | ||
'c', 'vala', | ||
version: '0.4.7' | ||
) | ||
|
||
# GNOME module | ||
gnome = import ('gnome') | ||
|
||
gnome = import('gnome') | ||
i18n = import('i18n') | ||
# Translation module | ||
i18n = import ('i18n') | ||
|
||
add_project_arguments(['--vapidir', join_paths(meson.current_source_dir(), 'vapi')], language: 'vala') | ||
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), language:'c') | ||
# Project arguments | ||
add_project_arguments ( | ||
'-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name ()), | ||
language: 'c' | ||
) | ||
|
||
# common dirs | ||
prefix = get_option('prefix') | ||
datadir = join_paths(prefix, get_option('datadir')) | ||
libdir = join_paths(prefix, get_option('libdir')) | ||
icondir = join_paths(datadir, 'icons', 'hicolor') | ||
add_project_arguments ( | ||
['--vapidir', join_paths (meson.current_source_dir (), 'vapi')], | ||
language: 'vala' | ||
) | ||
|
||
# deps | ||
wingpanel = dependency('wingpanel') | ||
# Listing dependencies | ||
wingpanel = dependency ('wingpanel') | ||
|
||
icons_gresource = gnome.compile_resources( | ||
'gresource_icons', | ||
'data/icons/icons.indicator.gresource.xml', | ||
source_dir: 'data/icons', | ||
common_dependencies = [ | ||
dependency ('granite'), | ||
dependency ('gtk+-3.0'), | ||
dependency ('gee-0.8'), | ||
dependency ('glib-2.0'), | ||
dependency ('gobject-2.0'), | ||
wingpanel | ||
] | ||
|
||
executable_dependencies = [ | ||
common_dependencies, | ||
dependency ('libhandy-1'), | ||
meson.get_compiler ('c').find_library ('m', required : false), | ||
meson.get_compiler ('vala').find_library ('posix') | ||
] | ||
|
||
indicator_dependencies = [ | ||
common_dependencies, | ||
dependency ('libnotify') | ||
] | ||
|
||
# Compiling resources | ||
asresources = gnome.compile_resources ( | ||
'as-resources', | ||
join_paths ('data', meson.project_name ()) + '.gresource.xml', | ||
source_dir: 'data', | ||
c_name: 'as' | ||
) | ||
|
||
config_data = configuration_data() | ||
config_data.set_quoted('GETTEXT_PACKAGE', meson.project_name()) | ||
# Config | ||
config_data = configuration_data () | ||
config_data.set_quoted ('GETTEXT_PACKAGE', meson.project_name ()) | ||
|
||
configure_file(output: 'config.h', configuration: config_data) | ||
config_h_dir = include_directories('.') | ||
configure_file (output: 'config.h', configuration: config_data) | ||
|
||
c_args = [ | ||
'-include', 'config.h', | ||
'-w', | ||
] | ||
|
||
executable( | ||
meson.project_name(), | ||
icons_gresource, | ||
'src/Application.vala', | ||
'src/MainWindow.vala', | ||
'src/Widgets/ComboRow.vala', | ||
'src/Widgets/SpinRow.vala', | ||
'src/Widgets/Toggles.vala', | ||
subdir ('src') | ||
|
||
# Define executable | ||
executable ( | ||
meson.project_name (), | ||
executable_sources, | ||
asresources, | ||
c_args: c_args, | ||
dependencies: [ | ||
dependency('gee-0.8'), | ||
dependency('glib-2.0'), | ||
dependency('gobject-2.0'), | ||
dependency('granite'), | ||
dependency('gtk+-3.0'), | ||
dependency('libhandy-1'), | ||
wingpanel, | ||
meson.get_compiler('c').find_library('m', required : false), | ||
meson.get_compiler('vala').find_library('posix') | ||
], | ||
dependencies: executable_dependencies, | ||
install: true | ||
) | ||
|
||
shared_module( | ||
# Define indicator | ||
shared_module ( | ||
'wingpanel-indicator-airpods', | ||
'src/Indicator.vala', | ||
'src/Services/Airpods.vala', | ||
'src/Services/Bluez.vala', | ||
'src/Services/Dbus.vala', | ||
'src/Services/Mpris.vala', | ||
'src/Services/Upower.vala', | ||
'src/Widgets/DisplayWidget.vala', | ||
'src/Widgets/IndicatorWidget.vala', | ||
'src/Widgets/PopoverWidget.vala', | ||
'src/Widgets/PopoverWidgetRowIconic.vala', | ||
icons_gresource, | ||
indicator_sources, | ||
asresources, | ||
c_args: c_args, | ||
dependencies: [ | ||
dependency('gee-0.8'), | ||
dependency('glib-2.0'), | ||
dependency('gobject-2.0'), | ||
dependency('libnotify'), | ||
dependency('granite'), | ||
dependency('gtk+-3.0'), | ||
wingpanel, | ||
], | ||
dependencies: indicator_dependencies, | ||
install: true, | ||
install_dir : wingpanel.get_pkgconfig_variable('indicatorsdir', define_variable: ['libdir', libdir]), | ||
install_dir : wingpanel.get_pkgconfig_variable('indicatorsdir', define_variable: ['libdir', join_paths (get_option ('prefix'), get_option ('libdir'))]), | ||
) | ||
|
||
subdir('data') | ||
subdir('po') | ||
meson.add_install_script('meson/post_install.py') | ||
|
||
subdir ('data') | ||
subdir ('po') | ||
|
||
meson.add_install_script ('meson/post_install.py') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,17 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
from os import path, environ | ||
import subprocess | ||
|
||
prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local') | ||
datadir = os.path.join(prefix, 'share') | ||
schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas') | ||
prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local') | ||
schemadir = path.join(environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas') | ||
datadir = path.join(prefix, 'share') | ||
desktop_database_dir = path.join(datadir, 'applications') | ||
|
||
# Packaging tools define DESTDIR and this isn't needed for them | ||
if 'DESTDIR' not in os.environ: | ||
print('Updating icon cache...') | ||
icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor') | ||
if not os.path.exists(icon_cache_dir): | ||
os.makedirs(icon_cache_dir) | ||
subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir]) | ||
|
||
print('Updating desktop database...') | ||
desktop_database_dir = os.path.join(datadir, 'applications') | ||
if not os.path.exists(desktop_database_dir): | ||
os.makedirs(desktop_database_dir) | ||
if not environ.get('DESTDIR'): | ||
print('Compiling gsettings schemas…') | ||
subprocess.call(['glib-compile-schemas', schemadir]) | ||
print('Updating desktop database…') | ||
subprocess.call(['update-desktop-database', '-q', desktop_database_dir]) | ||
|
||
print('Compiling gsettings schemas...') | ||
subprocess.call(['glib-compile-schemas', schemadir]) | ||
print('Updating icon cache…') | ||
subprocess.call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
i18n.gettext('extra', | ||
args: '--directory=' + meson.source_root(), | ||
preset: 'glib', | ||
install: false | ||
# Install metadata translations | ||
i18n.gettext ('extra', | ||
args: [ | ||
'--directory=' + meson.source_root (), | ||
'--from-code=UTF-8' | ||
], | ||
install: false | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
i18n.gettext(meson.project_name(), | ||
args: '--directory=' + meson.source_root(), | ||
preset: 'glib' | ||
# Install main translations | ||
i18n.gettext (meson.project_name (), | ||
args: [ | ||
'--directory=' + meson.source_root (), | ||
'--from-code=UTF-8', | ||
'-cTRANSLATORS' | ||
] | ||
) | ||
|
||
subdir ('extra') |
Oops, something went wrong.