Compare commits

..

No commits in common. "da57f64816927a947bbc274c6193ca452e3d1c50" and "0013e75b59d625aed57760291de8b4a5168cccb9" have entirely different histories.

18 changed files with 69 additions and 75 deletions

View File

@ -31,9 +31,9 @@ All kaomojis are stored in a simple, accessible format:
To add your own category/emoticon, simply create a folder and a corresponding .txt file in either `$XDG_DATA_HOME/moemoji/kaomoji/` or `/usr/local/share/moemoji`. To add your own category/emoticon, simply create a folder and a corresponding .txt file in either `$XDG_DATA_HOME/moemoji/kaomoji/` or `/usr/local/share/moemoji`.
If you use flatpak, the correct data path is `~/.var/app/jp.angeltech.MoeMoji/data/`. If you use flatpak, the correct data path is `~/.var/app/net.angeltech.MoeMoji/data/`.
So adding your own emoticons would look like this: So adding your own emoticons would look like this:
1. `cd ~/.var/app/jp.angeltech.MoeMoji/data/` 1. `cd ~/.var/app/net.angeltech.MoeMoji/data/`
2. `mkdir -p moemoji/kaomoji` 2. `mkdir -p moemoji/kaomoji`
3. `cd moemoji/kaomoji` 3. `cd moemoji/kaomoji`
4. `mkdir your-category` 4. `mkdir your-category`
@ -51,5 +51,5 @@ Run dev build: `GSETTINGS_SCHEMA_DIR=./builddir/data ./builddir/src/moemoji`
# Flatpak packaging # Flatpak packaging
`flatpak-builder --force-clean --user --install .flatpak-build jp.angeltech.MoeMoji.json` `flatpak-builder --force-clean --user --install .flatpak-build net.angeltech.MoeMoji.json`
`flatpak run jp.angeltech.MoeMoji` `flatpak run net.angeltech.MoeMoji`

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -1,4 +1,4 @@
application_id = 'jp.angeltech.MoeMoji' application_id = 'net.angeltech.MoeMoji'
scalable_dir = join_paths('hicolor', 'scalable', 'apps') scalable_dir = join_paths('hicolor', 'scalable', 'apps')
install_data( install_data(

View File

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>jp.angeltech.MoeMoji</id>
<name>MoeMoji</name>
<summary>Moe picker!</summary>
<developer id="jp.angeltech">
<name>angeltech.jp</name>
</developer>
<description>
<p>Kaomoji picker. Browse a library of Japanese emoticons, click to copy, add your own!</p>
</description>
<metadata_license>CC0-1.0</metadata_license>
<url type="homepage">https://gitea.angeltech.jp/Angel-Technologies/MoeMoji</url>
<url type="vcs-browser">https://gitea.angeltech.jp/Angel-Technologies/MoeMoji</url>
<launchable type="desktop-id">jp.angeltech.MoeMoji.desktop</launchable>
<project_license>WTFPL</project_license>
<content_rating type="oars-1.1" />
<screenshots>
<screenshot type="default">
<image>https://gitea.angeltech.jp/Angel-Technologies/MoeMoji/media/branch/main/preview.png</image>
<caption>Kaomoji picker</caption>
</screenshot>
</screenshots>
<releases>
<release version="0.1.0" date="2026-02-28">
<description>
<p>Initial release.</p>
</description>
</release>
</releases>
</component>

View File

@ -1,6 +1,6 @@
desktop_file = i18n.merge_file( desktop_file = i18n.merge_file(
input: 'jp.angeltech.MoeMoji.desktop.in', input: 'net.angeltech.MoeMoji.desktop.in',
output: 'jp.angeltech.MoeMoji.desktop', output: 'net.angeltech.MoeMoji.desktop',
type: 'desktop', type: 'desktop',
po_dir: '../po', po_dir: '../po',
install: true, install: true,
@ -15,11 +15,11 @@ if desktop_utils.found()
endif endif
appstream_file = i18n.merge_file( appstream_file = i18n.merge_file(
input: 'jp.angeltech.MoeMoji.metainfo.xml.in', input: 'net.angeltech.MoeMoji.appdata.xml.in',
output: 'jp.angeltech.MoeMoji.metainfo.xml', output: 'net.angeltech.MoeMoji.appdata.xml',
po_dir: '../po', po_dir: '../po',
install: true, install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo') install_dir: join_paths(get_option('datadir'), 'appdata')
) )
appstream_util = find_program('appstream-util', required: false) appstream_util = find_program('appstream-util', required: false)
@ -29,12 +29,12 @@ if appstream_util.found()
) )
endif endif
gnome.compile_schemas(build_by_default: true, depend_files: 'jp.angeltech.MoeMoji.gschema.xml') gnome.compile_schemas(build_by_default: true, depend_files: 'net.angeltech.MoeMoji.gschema.xml')
devenv = environment() devenv = environment()
devenv.set('GSETTINGS_SCHEMA_DIR', meson.current_build_dir() / 'data') devenv.set('GSETTINGS_SCHEMA_DIR', meson.current_build_dir() / 'data')
meson.add_devenv(devenv) meson.add_devenv(devenv)
install_data('jp.angeltech.MoeMoji.gschema.xml', install_data('net.angeltech.MoeMoji.gschema.xml',
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
) )

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>net.angeltech.MoeMoji</id>
<name>MoeMoji</name>
<summary>Moe picker!</summary>
<description>
<p>Kaomoji picker. Browse a library of Japanese emoticons, click to copy, add your own!</p>
</description>
<metadata_license>CC0-1.0</metadata_license>
<launchable type="desktop-id">net.angeltech.MoeMoji.desktop</launchable>
<project_license>WTFPL</project_license>
<content_rating type="oars-1.1" />
</component>

View File

@ -2,7 +2,7 @@
Type=Application Type=Application
Name=MoeMoji Name=MoeMoji
Comment=Japanese emoticon picker! Comment=Japanese emoticon picker!
Icon=jp.angeltech.MoeMoji Icon=net.angeltech.MoeMoji
Exec=moemoji Exec=moemoji
Terminal=false Terminal=false
Categories=Accessibility;GTK;Utility; Categories=Accessibility;GTK;Utility;

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="moemoji"> <schemalist gettext-domain="moemoji">
<schema id='jp.angeltech.MoeMoji' path='/jp/angeltech/MoeMoji/'> <schema id='net.angeltech.MoeMoji' path='/net/angeltech/MoeMoji/'>
</schema> </schema>
</schemalist> </schemalist>

View File

@ -1,5 +1,5 @@
{ {
"app-id": "jp.angeltech.MoeMoji", "app-id": "net.angeltech.MoeMoji",
"runtime": "org.gnome.Platform", "runtime": "org.gnome.Platform",
"runtime-version": "49", "runtime-version": "49",
"sdk": "org.gnome.Sdk", "sdk": "org.gnome.Sdk",
@ -8,7 +8,9 @@
"--share=ipc", "--share=ipc",
"--socket=fallback-x11", "--socket=fallback-x11",
"--socket=wayland", "--socket=wayland",
"--talk-name=org.kde.StatusNotifierWatcher" "--talk-name=org.kde.StatusNotifierWatcher",
"--talk-name=org.freedesktop.portal.Desktop",
"--own-name=org.kde.*"
], ],
"modules": [ "modules": [
{ {

View File

@ -21,7 +21,7 @@ static void register_with_portal (void) {
"org.freedesktop.host.portal.Registry", "org.freedesktop.host.portal.Registry",
"Register", "Register",
g_variant_new ("(s@a{sv})", g_variant_new ("(s@a{sv})",
"jp.angeltech.MoeMoji", "net.angeltech.MoeMoji",
g_variant_builder_end (&options)), g_variant_builder_end (&options)),
NULL, NULL,
G_DBUS_CALL_FLAGS_NONE, G_DBUS_CALL_FLAGS_NONE,
@ -41,6 +41,6 @@ int main (int argc, char *argv[]) {
textdomain(GETTEXT_PACKAGE); textdomain(GETTEXT_PACKAGE);
register_with_portal (); register_with_portal ();
g_autoptr(MoeMojiApplication) app = g_autoptr(MoeMojiApplication) app =
moemoji_application_new("jp.angeltech.MoeMoji", G_APPLICATION_DEFAULT_FLAGS); moemoji_application_new("net.angeltech.MoeMoji", G_APPLICATION_DEFAULT_FLAGS);
return g_application_run(G_APPLICATION(app), argc, argv); return g_application_run(G_APPLICATION(app), argc, argv);
} }

View File

@ -246,7 +246,7 @@ GVariant *sni_get_property(G_GNUC_UNUSED GDBusConnection *connection,
MoeMojiApplication *self = MOEMOJI_APPLICATION(user_data); MoeMojiApplication *self = MOEMOJI_APPLICATION(user_data);
return g_variant_new_string(self->tray_icon_name return g_variant_new_string(self->tray_icon_name
? self->tray_icon_name ? self->tray_icon_name
: "jp.angeltech.MoeMoji-tray-dark"); : "net.angeltech.MoeMoji-tray-dark");
} }
if (g_strcmp0(property_name, "ItemIsMenu") == 0) if (g_strcmp0(property_name, "ItemIsMenu") == 0)
return g_variant_new_boolean(FALSE); return g_variant_new_boolean(FALSE);
@ -266,11 +266,21 @@ static const GDBusInterfaceVTable sni_vtable = {
.set_property = NULL, .set_property = NULL,
}; };
static void on_sni_bus_name_acquired(GDBusConnection *connection,
const gchar *name,
G_GNUC_UNUSED gpointer user_data) {
g_dbus_connection_call(
connection, "org.kde.StatusNotifierWatcher", "/StatusNotifierWatcher",
"org.kde.StatusNotifierWatcher", "RegisterStatusNotifierItem",
g_variant_new("(s)", name), NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL,
NULL);
}
static void update_tray_icon(MoeMojiApplication *self) { static void update_tray_icon(MoeMojiApplication *self) {
AdwStyleManager *sm = adw_style_manager_get_default(); AdwStyleManager *sm = adw_style_manager_get_default();
gboolean dark = adw_style_manager_get_dark(sm); gboolean dark = adw_style_manager_get_dark(sm);
self->tray_icon_name = dark ? "jp.angeltech.MoeMoji-tray-dark" self->tray_icon_name = dark ? "net.angeltech.MoeMoji-tray-dark"
: "jp.angeltech.MoeMoji-tray-light"; : "net.angeltech.MoeMoji-tray-light";
if (self->dbus_conn && self->sni_registration_id > 0) { if (self->dbus_conn && self->sni_registration_id > 0) {
g_dbus_connection_emit_signal(self->dbus_conn, NULL, "/StatusNotifierItem", g_dbus_connection_emit_signal(self->dbus_conn, NULL, "/StatusNotifierItem",
@ -324,12 +334,11 @@ static void setup_sni(MoeMojiApplication *self) {
g_warning("dbusmenu register: %s", error->message); g_warning("dbusmenu register: %s", error->message);
g_error_free(error); g_error_free(error);
} }
const gchar *unique_name = g_dbus_connection_get_unique_name(self->dbus_conn); g_autofree gchar *bus_name =
g_dbus_connection_call( g_strdup_printf("org.kde.StatusNotifierItem-%d-1", getpid());
self->dbus_conn, "org.kde.StatusNotifierWatcher", "/StatusNotifierWatcher", self->sni_bus_name_id = g_bus_own_name_on_connection(
"org.kde.StatusNotifierWatcher", "RegisterStatusNotifierItem", self->dbus_conn, bus_name, G_BUS_NAME_OWNER_FLAGS_NONE,
g_variant_new("(s)", unique_name), NULL, G_DBUS_CALL_FLAGS_NONE, -1, on_sni_bus_name_acquired, NULL, NULL, NULL);
NULL, NULL, NULL);
} }
static void on_shortcuts_activated(GDBusProxy *proxy, const gchar *sender_name, static void on_shortcuts_activated(GDBusProxy *proxy, const gchar *sender_name,
@ -498,8 +507,8 @@ static void moemoji_application_startup(GApplication *app) {
MoeMojiApplication *self = MOEMOJI_APPLICATION(app); MoeMojiApplication *self = MOEMOJI_APPLICATION(app);
gtk_icon_theme_add_resource_path( gtk_icon_theme_add_resource_path(
gtk_icon_theme_get_for_display(gdk_display_get_default()), gtk_icon_theme_get_for_display(gdk_display_get_default()),
"/jp/angeltech/MoeMoji/icons"); "/net/angeltech/MoeMoji/icons");
gtk_window_set_default_icon_name("jp.angeltech.MoeMoji-symbolic"); gtk_window_set_default_icon_name("net.angeltech.MoeMoji-symbolic");
gboolean in_flatpak = g_file_test("/.flatpak-info", G_FILE_TEST_EXISTS); gboolean in_flatpak = g_file_test("/.flatpak-info", G_FILE_TEST_EXISTS);
if (in_flatpak) { if (in_flatpak) {
self->icon_theme_path = NULL; self->icon_theme_path = NULL;
@ -552,6 +561,10 @@ static void moemoji_application_dispose(GObject *object) {
self->menu_registration_id); self->menu_registration_id);
self->menu_registration_id = 0; self->menu_registration_id = 0;
} }
if (self->sni_bus_name_id > 0) {
g_bus_unown_name(self->sni_bus_name_id);
self->sni_bus_name_id = 0;
}
g_clear_object(&self->shortcuts_proxy); g_clear_object(&self->shortcuts_proxy);
g_clear_pointer(&self->shortcuts_session_path, g_free); g_clear_pointer(&self->shortcuts_session_path, g_free);
g_clear_pointer(&self->icon_theme_path, g_free); g_clear_pointer(&self->icon_theme_path, g_free);
@ -579,7 +592,7 @@ static void moemoji_application_class_init(MoeMojiApplicationClass *klass) {
} }
static void moemoji_application_init(MoeMojiApplication *self) { static void moemoji_application_init(MoeMojiApplication *self) {
self->settings = g_settings_new("jp.angeltech.MoeMoji"); self->settings = g_settings_new("net.angeltech.MoeMoji");
self->window_created = FALSE; self->window_created = FALSE;
self->shortcuts_bound = FALSE; self->shortcuts_bound = FALSE;
g_autoptr(GSimpleAction) quit_action = g_simple_action_new("quit", NULL); g_autoptr(GSimpleAction) quit_action = g_simple_action_new("quit", NULL);

View File

@ -11,6 +11,7 @@ struct _MoeMojiApplication {
gboolean shortcuts_bound; gboolean shortcuts_bound;
GDBusConnection *dbus_conn; GDBusConnection *dbus_conn;
guint sni_registration_id; guint sni_registration_id;
guint sni_bus_name_id;
guint menu_registration_id; guint menu_registration_id;
gchar *icon_theme_path; gchar *icon_theme_path;
const gchar *tray_icon_name; const gchar *tray_icon_name;

View File

@ -260,7 +260,7 @@ static void on_search_changed(GtkSearchEntry *entry, gpointer user_data) {
static void moemoji_window_class_init(MoeMojiWindowClass *klass) { static void moemoji_window_class_init(MoeMojiWindowClass *klass) {
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
gtk_widget_class_set_template_from_resource( gtk_widget_class_set_template_from_resource(
widget_class, "/jp/angeltech/MoeMoji/moemoji-window.ui"); widget_class, "/net/angeltech/MoeMoji/moemoji-window.ui");
gtk_widget_class_bind_template_child(widget_class, MoeMojiWindow, outer_box); gtk_widget_class_bind_template_child(widget_class, MoeMojiWindow, outer_box);
gtk_widget_class_bind_template_child(widget_class, MoeMojiWindow, gtk_widget_class_bind_template_child(widget_class, MoeMojiWindow,
content_box); content_box);

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<gresources> <gresources>
<gresource prefix="/jp/angeltech/MoeMoji"> <gresource prefix="/net/angeltech/MoeMoji">
<file>moemoji-window.ui</file> <file>moemoji-window.ui</file>
<file>style.css</file> <file>style.css</file>
<file>wp.png</file> <file>wp.png</file>
<file alias="icons/scalable/apps/jp.angeltech.MoeMoji.svg">../data/icons/hicolor/scalable/apps/jp.angeltech.MoeMoji.svg</file> <file alias="icons/scalable/apps/net.angeltech.MoeMoji.svg">../data/icons/hicolor/scalable/apps/net.angeltech.MoeMoji.svg</file>
<file alias="icons/scalable/apps/jp.angeltech.MoeMoji-symbolic.svg">../data/icons/hicolor/symbolic/apps/jp.angeltech.MoeMoji-symbolic.svg</file> <file alias="icons/scalable/apps/net.angeltech.MoeMoji-symbolic.svg">../data/icons/hicolor/symbolic/apps/net.angeltech.MoeMoji-symbolic.svg</file>
</gresource> </gresource>
</gresources> </gresources>

View File

@ -31,7 +31,7 @@
} }
.wallpaper-bg { .wallpaper-bg {
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("/jp/angeltech/MoeMoji/wp.png"); background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("/net/angeltech/MoeMoji/wp.png");
background-size: cover; background-size: cover;
background-color: transparent; background-color: transparent;
} }