Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikReider committed Jul 27, 2021
1 parent 62c2140 commit 7506f2a
Show file tree
Hide file tree
Showing 28 changed files with 3,299 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
*.ui~
*.ui#
1,648 changes: 1,648 additions & 0 deletions .uncrustify.cfg

Large diffs are not rendered by default.

675 changes: 675 additions & 0 deletions COPYING

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions build-aux/meson/postinstall.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python3

from os import environ, path
from subprocess import call

prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
datadir = path.join(prefix, 'share')
destdir = environ.get('DESTDIR', '')

# Package managers set this so we don't need to run
if not destdir:
print('Updating icon cache...')
call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])

print('Updating desktop database...')
call(['update-desktop-database', '-q', path.join(datadir, 'applications')])

print('Compiling GSettings schemas...')
call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')])


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions data/icons/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
application_id = 'org.erikreider.sway-notification-center'

scalable_dir = join_paths('hicolor', 'scalable', 'apps')
install_data(
join_paths(scalable_dir, ('@[email protected]').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, ('@[email protected]').format(application_id)),
install_dir: join_paths(get_option('datadir'), 'icons', symbolic_dir)
)
43 changes: 43 additions & 0 deletions data/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
desktop_file = i18n.merge_file(
input: 'org.erikreider.sway-notification-center.desktop.in',
output: 'org.erikreider.sway-notification-center.desktop',
type: 'desktop',
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)

desktop_utils = find_program('desktop-file-validate', required: false)
if desktop_utils.found()
test('Validate desktop file', desktop_utils,
args: [desktop_file]
)
endif

appstream_file = i18n.merge_file(
input: 'org.erikreider.sway-notification-center.appdata.xml.in',
output: 'org.erikreider.sway-notification-center.appdata.xml',
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'appdata')
)

appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
test('Validate appstream file', appstream_util,
args: ['validate', appstream_file]
)
endif

install_data('org.erikreider.sway-notification-center.gschema.xml',
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
)

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')
8 changes: 8 additions & 0 deletions data/org.erikreider.sway-notification-center.appdata.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>org.erikreider.sway-notification-center.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<description>
</description>
</component>
8 changes: 8 additions & 0 deletions data/org.erikreider.sway-notification-center.desktop.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Name=sway-notificaton-center
Exec=sway-notificaton-center
Icon=org.erikreider.sway-notification-center
Terminal=false
Type=Application
Categories=GTK;
StartupNotify=true
5 changes: 5 additions & 0 deletions data/org.erikreider.sway-notification-center.gschema.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="sway-notificaton-center">
<schema id="org.erikreider.sway-notification-center" path="/org/erikreider/sway-notification-center/">
</schema>
</schemalist>
16 changes: 16 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
project('sway-notificaton-center', ['c', 'vala'],
version: '0.1.0',
meson_version: '>= 0.50.0',
default_options: [ 'warning_level=2',
],
)

i18n = import('i18n')



subdir('data')
subdir('src')
subdir('po')

meson.add_install_script('build-aux/meson/postinstall.py')
38 changes: 38 additions & 0 deletions org.erikreider.sway-notification-center.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"app-id" : "org.erikreider.sway-notification-center",
"runtime" : "org.gnome.Platform",
"runtime-version" : "40",
"sdk" : "org.gnome.Sdk",
"command" : "sway-notificaton-center",
"finish-args" : [
"--share=network",
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland"
],
"cleanup" : [
"/include",
"/lib/pkgconfig",
"/man",
"/share/doc",
"/share/gtk-doc",
"/share/man",
"/share/pkgconfig",
"/share/vala",
"*.la",
"*.a"
],
"modules" : [
{
"name" : "sway-notificaton-center",
"builddir" : true,
"buildsystem" : "meson",
"sources" : [
{
"type" : "git",
"url" : "file:///home/erikreider/GitHub/Sway-Notificaton-Center"
}
]
}
]
}
Empty file added po/LINGUAS
Empty file.
7 changes: 7 additions & 0 deletions po/POTFILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data/org.erikreider.sway-notification-center.desktop.in
data/org.erikreider.sway-notification-center.appdata.xml.in
data/org.erikreider.sway-notification-center.gschema.xml
src/window.ui
src/main.vala
src/window.vala

1 change: 1 addition & 0 deletions po/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
i18n.gettext('sway-notificaton-center', preset: 'glib')
16 changes: 16 additions & 0 deletions src/client.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[DBus (name = "org.erikreider.swaync.cc")]
interface CcDaemon : GLib.Object {
public abstract void toggle () throws DBusError, IOError;
}

public void main (string[] args) {
try {
CcDaemon controlCenter = Bus.get_proxy_sync (BusType.SESSION, "org.erikreider.swaync.cc",
"/org/erikreider/swaync/cc");
controlCenter.toggle ();
} catch (IOError e) {
stderr.printf ("Could not connect to CC service\n");
} catch (DBusError e) {
stderr.printf ("Could not connect to CC service\n");
}
}
4 changes: 4 additions & 0 deletions src/constants.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace SwayNotificatonCenter {
public class Constants {
}
}
Loading

0 comments on commit 7506f2a

Please sign in to comment.