mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
refactor: changed Spotube to SpoTube
This commit is contained in:
parent
acdb02e3ac
commit
57afad430c
@ -1,4 +1,4 @@
|
||||
# Contributing to Spotube
|
||||
# Contributing to SpoTube
|
||||
|
||||
First off, thanks for taking the time to contribute!
|
||||
|
||||
@ -22,7 +22,7 @@ community looks forward to your contributions.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Contributing to Spotube](#contributing-to-spotube)
|
||||
- [Contributing to SpoTube](#contributing-to-spotube)
|
||||
- [Table of Contents](#table-of-contents)
|
||||
- [Code of Conduct](#code-of-conduct)
|
||||
- [I Have a Question](#i-have-a-question)
|
||||
@ -39,7 +39,7 @@ community looks forward to your contributions.
|
||||
## Code of Conduct
|
||||
|
||||
This project and everyone participating in it is governed by the
|
||||
[Spotube Code of Conduct](https://github.com/KRTirtho/spotube/blob/master/CODE_OF_CONDUCT.md).
|
||||
[SpoTube Code of Conduct](https://github.com/KRTirtho/spotube/blob/master/CODE_OF_CONDUCT.md).
|
||||
By participating, you are expected to uphold this code. Please report unacceptable behavior
|
||||
to krtirtho@gmail.com.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
**Privacy Policy**
|
||||
|
||||
Kingkor Roy Tirtho built the Spotube app as an Open Source app. This SERVICE is provided by Kingkor Roy Tirtho at no
|
||||
Kingkor Roy Tirtho built the SpoTube app as an Open Source app. This SERVICE is provided by Kingkor Roy Tirtho at no
|
||||
cost and is intended for use as is.
|
||||
|
||||
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal
|
||||
@ -11,7 +11,7 @@ Personal Information that I collect is used for providing and improving the Serv
|
||||
information with anyone except as described in this Privacy Policy.
|
||||
|
||||
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which are accessible at
|
||||
Spotube unless otherwise defined in this Privacy Policy.
|
||||
SpoTube unless otherwise defined in this Privacy Policy.
|
||||
|
||||
**Information Collection and Use**
|
||||
|
||||
|
@ -50,7 +50,7 @@ preferably by buying their merch/concert tickets/physical media).
|
||||
## Installation guide
|
||||
|
||||
New versions usually release every 3-4 months.<br />
|
||||
This handy table lists all the methods you can use to install Spotube:
|
||||
This handy table lists all the methods you can use to install SpoTube:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
@ -6,7 +6,7 @@ plugins {
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.spotube"
|
||||
namespace = "oss.krtirtho.spotube"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
@ -21,7 +21,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "com.example.spotube"
|
||||
applicationId = "oss.krtirtho.spotube"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = flutter.minSdkVersion
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.example.spotube
|
||||
package oss.krtirtho.spotube
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
|
@ -86,7 +86,6 @@ Future<void> main(List<String> rawArgs) async {
|
||||
await KVStoreService.initialize();
|
||||
|
||||
if (kIsDesktop) {
|
||||
await windowManager.setPreventClose(true);
|
||||
await YtDlp.instance
|
||||
.setBinaryLocation(
|
||||
KVStoreService.getYoutubeEnginePath(YoutubeClientEngine.ytDlp) ??
|
||||
@ -106,7 +105,6 @@ Future<void> main(List<String> rawArgs) async {
|
||||
|
||||
if (kIsDesktop) {
|
||||
await localNotifier.setup(appName: "SpoTube");
|
||||
await WindowManagerTools.initialize();
|
||||
}
|
||||
|
||||
if (kIsIOS) {
|
||||
|
@ -80,14 +80,14 @@ class SettingsAppearanceSection extends HookConsumerWidget {
|
||||
}
|
||||
},
|
||||
),
|
||||
// ListTile(
|
||||
// leading: const Icon(SpotubeIcons.amoled),
|
||||
// title: Text(context.l10n.use_amoled_mode),
|
||||
// subtitle: Text(context.l10n.pitch_dark_theme),
|
||||
// trailing: Switch(
|
||||
// value: preferences.amoledDarkTheme,
|
||||
// onChanged: preferencesNotifier.setAmoledDarkTheme,
|
||||
// )),
|
||||
ListTile(
|
||||
leading: const Icon(SpotubeIcons.amoled),
|
||||
title: Text(context.l10n.use_amoled_mode),
|
||||
subtitle: Text(context.l10n.pitch_dark_theme),
|
||||
trailing: Switch(
|
||||
value: preferences.amoledDarkTheme,
|
||||
onChanged: preferencesNotifier.setAmoledDarkTheme,
|
||||
)),
|
||||
ListTile(
|
||||
leading: const Icon(SpotubeIcons.palette),
|
||||
title: Text(context.l10n.accent_color),
|
||||
@ -103,14 +103,14 @@ class SettingsAppearanceSection extends HookConsumerWidget {
|
||||
),
|
||||
onTap: pickColorScheme(),
|
||||
),
|
||||
// ListTile(
|
||||
// leading: const Icon(SpotubeIcons.colorSync),
|
||||
// title: Text(context.l10n.sync_album_color),
|
||||
// subtitle: Text(context.l10n.sync_album_color_description),
|
||||
// trailing: Switch(
|
||||
// value: preferences.albumColorSync,
|
||||
// onChanged: preferencesNotifier.setAlbumColorSync,
|
||||
// )),
|
||||
ListTile(
|
||||
leading: const Icon(SpotubeIcons.colorSync),
|
||||
title: Text(context.l10n.sync_album_color),
|
||||
subtitle: Text(context.l10n.sync_album_color_description),
|
||||
trailing: Switch(
|
||||
value: preferences.albumColorSync,
|
||||
onChanged: preferencesNotifier.setAlbumColorSync,
|
||||
)),
|
||||
];
|
||||
|
||||
if (isGettingStarted) {
|
||||
|
@ -1,11 +1,19 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
# Project-level configuration.
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(runner LANGUAGES CXX)
|
||||
|
||||
# The name of the executable created for the application. Change this to change
|
||||
# the on-disk name of your application.
|
||||
set(BINARY_NAME "spotube")
|
||||
# The unique GTK application identifier for this application. See:
|
||||
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
|
||||
set(APPLICATION_ID "oss.krtirtho.spotube")
|
||||
|
||||
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
|
||||
# versions of CMake.
|
||||
cmake_policy(SET CMP0063 NEW)
|
||||
|
||||
# Load bundled libraries from the lib/ directory relative to the binary.
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
|
||||
|
||||
# Root filesystem for cross-building.
|
||||
@ -18,7 +26,7 @@ if(FLUTTER_TARGET_PLATFORM_SYSROOT)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
endif()
|
||||
|
||||
# Configure build options.
|
||||
# Define build configuration options.
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE
|
||||
STRING "Flutter build mode" FORCE)
|
||||
@ -27,6 +35,10 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
endif()
|
||||
|
||||
# Compilation settings that should be applied to most targets.
|
||||
#
|
||||
# Be cautious about adding new options here, as plugins use this function by
|
||||
# default. In most cases, you should add new options to specific targets instead
|
||||
# of modifying this function.
|
||||
function(APPLY_STANDARD_SETTINGS TARGET)
|
||||
target_compile_features(${TARGET} PUBLIC cxx_std_14)
|
||||
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
|
||||
@ -34,27 +46,20 @@ function(APPLY_STANDARD_SETTINGS TARGET)
|
||||
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
|
||||
endfunction()
|
||||
|
||||
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
|
||||
|
||||
# Flutter library and tool build rules.
|
||||
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
|
||||
add_subdirectory(${FLUTTER_MANAGED_DIR})
|
||||
|
||||
# System-level dependencies.
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
||||
|
||||
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
|
||||
# Application build; see runner/CMakeLists.txt.
|
||||
add_subdirectory("runner")
|
||||
|
||||
# Application build
|
||||
add_executable(${BINARY_NAME}
|
||||
"main.cc"
|
||||
"my_application.cc"
|
||||
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
|
||||
)
|
||||
apply_standard_settings(${BINARY_NAME})
|
||||
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
|
||||
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
|
||||
# Run the Flutter tool portions of the build. This must not be removed.
|
||||
add_dependencies(${BINARY_NAME} flutter_assemble)
|
||||
|
||||
# Only the install-generated bundle's copy of the executable will launch
|
||||
# correctly, since the resources must in the right relative locations. To avoid
|
||||
# people trying to run the unbundled copy, put it in a subdirectory instead of
|
||||
@ -64,12 +69,11 @@ set_target_properties(${BINARY_NAME}
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
|
||||
)
|
||||
|
||||
|
||||
# Generated plugin build rules, which manage building the plugins and adding
|
||||
# them to the application.
|
||||
include(flutter/generated_plugins.cmake)
|
||||
|
||||
target_link_libraries(${BINARY_NAME} PRIVATE ${MIMALLOC_LIB})
|
||||
|
||||
|
||||
# === Installation ===
|
||||
# By default, "installing" just makes a relocatable bundle in the build
|
||||
@ -96,11 +100,17 @@ install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}
|
||||
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||
COMPONENT Runtime)
|
||||
|
||||
if(PLUGIN_BUNDLED_LIBRARIES)
|
||||
install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
|
||||
foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
|
||||
install(FILES "${bundled_library}"
|
||||
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||
COMPONENT Runtime)
|
||||
endforeach(bundled_library)
|
||||
|
||||
# Copy the native assets provided by the build.dart from all packages.
|
||||
set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/")
|
||||
install(DIRECTORY "${NATIVE_ASSETS_DIR}"
|
||||
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||
COMPONENT Runtime)
|
||||
endif()
|
||||
|
||||
# Fully re-copy the assets directory on each build to avoid having stale files
|
||||
# from a previous install.
|
||||
|
@ -1,72 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>com.github.KRTirtho.Spotube</id>
|
||||
<name>Spotube</name>
|
||||
<summary>
|
||||
Freedom of music
|
||||
</summary>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>BSD-4-Clause</project_license>
|
||||
<recommends>
|
||||
<control>pointing</control>
|
||||
<control>keyboard</control>
|
||||
<control>touch</control>
|
||||
</recommends>
|
||||
<developer_name>Kingkor Roy Tirtho</developer_name>
|
||||
<url type="bugtracker">https://github.com/krtirtho/spotube/issues</url>
|
||||
<url type="homepage">https://spotube.krtirtho.dev</url>
|
||||
<url type="donation">https://opencollective.com/spotube</url>
|
||||
<description>
|
||||
<p>Open source Spotify client that doesn't require Premium nor uses Electron! Available for
|
||||
both desktop & mobile!</p>
|
||||
<p>Following are the features that currently spotube offers:</p>
|
||||
<ul>
|
||||
<li>🚫 No ads, thanks to the use of public & free Spotify and YT Music APIs¹</li>
|
||||
<li>⬇️ Downloadable tracks</li>
|
||||
<li>🖥️ 📱 Cross-platform support</li>
|
||||
<li>🪶 Small size & less data usage</li>
|
||||
<li>🕵️ Anonymous/guest login</li>
|
||||
<li>🕒 Time synced lyrics</li>
|
||||
<li>✋ No telemetry, diagnostics or user data collection</li>
|
||||
<li>🚀 Native performance</li>
|
||||
<li>📖 Open source/libre software</li>
|
||||
<li>🔉 Playback control is done locally, not on the server</li>
|
||||
</ul>
|
||||
</description>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image type="source">
|
||||
https://rawcdn.githack.com/KRTirtho/spotube/refs/heads/master/assets/spotube-screenshot.png
|
||||
</image>
|
||||
<caption>Spotube screenshot</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<launchable type="desktop-id">com.github.KRTirtho.Spotube.desktop</launchable>
|
||||
<releases> %{{APPDATA_RELEASE}}% <release version="2.6.0" date="2022-12-09" />
|
||||
<release
|
||||
version="2.5.0" date="2022-10-13" />
|
||||
<release version="2.4.1" date="2022-09-13" />
|
||||
<release
|
||||
version="2.4.0" date="2022-09-09" />
|
||||
<release version="2.3.1" date="2022-07-11" />
|
||||
<release
|
||||
version="2.2.1" date="2022-06-09" />
|
||||
<release version="2.2.0" date="2022-06-05" />
|
||||
<release
|
||||
version="2.1.0" date="2022-05-10" />
|
||||
<release version="2.0.0" date="2022-03-24" />
|
||||
<release
|
||||
version="1.2.0" date="2022-02-02" />
|
||||
<release version="1.1.0" date="2022-01-27" />
|
||||
<release
|
||||
version="1.0.1" date="2022-01-15" />
|
||||
<release version="1.0.0" date="2022-01-14" />
|
||||
<release
|
||||
version="0.0.3" date="2021-05-08" />
|
||||
<release version="0.0.2" date="2021-03-31" />
|
||||
<release
|
||||
version="0.0.1" date="2021-03-20" />
|
||||
</releases>
|
||||
<content_rating type="oars-1.1" />
|
||||
<update_contact>krtirtho@gmail.com</update_contact>
|
||||
</component>
|
@ -1,3 +1,4 @@
|
||||
# This file controls Flutter-level build steps. It should not be edited.
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
|
||||
|
@ -1,16 +0,0 @@
|
||||
display_name: Spotube
|
||||
icon: assets/spotube-logo.png
|
||||
|
||||
keywords:
|
||||
- Music
|
||||
- Spotify
|
||||
- Media
|
||||
- Streaming
|
||||
- YouTube
|
||||
|
||||
generic_name: Music Streaming Application
|
||||
categories:
|
||||
- Music
|
||||
|
||||
supported_mime_type:
|
||||
- x-scheme-handler/spotify
|
@ -1,47 +0,0 @@
|
||||
display_name: Spotube
|
||||
package_name: spotube
|
||||
|
||||
maintainer:
|
||||
name: Kingkor Roy Tirtho
|
||||
email: krtirtho@gmail.com
|
||||
|
||||
priority: optional
|
||||
section: x11
|
||||
installed_size: 24400
|
||||
|
||||
dependencies:
|
||||
- mpv
|
||||
- libappindicator3-1 | libayatana-appindicator3-1
|
||||
- gir1.2-appindicator3-0.1 | gir1.2-ayatanaappindicator3-0.1
|
||||
- libsecret-1-0
|
||||
- libnotify-bin
|
||||
- libjsoncpp25
|
||||
- libmpv1 | libmpv2
|
||||
- xdg-user-dirs
|
||||
- avahi-daemon
|
||||
- avahi-discover
|
||||
- avahi-utils
|
||||
- libnss-mdns
|
||||
- mdns-scan
|
||||
- libwebkit2gtk-4.1-0 | libwebkit2gtk-4.0-0
|
||||
- libsoup-3.0-0 | libsoup-2.4-0
|
||||
|
||||
suggested_dependencies:
|
||||
- yt-dlp
|
||||
|
||||
essential: false
|
||||
icon: assets/spotube-logo.png
|
||||
|
||||
keywords:
|
||||
- Music
|
||||
- Spotify
|
||||
- Media
|
||||
- Streaming
|
||||
- YouTube
|
||||
|
||||
generic_name: Music Streaming Application
|
||||
categories:
|
||||
- Music
|
||||
|
||||
supported_mime_type:
|
||||
- x-scheme-handler/spotify
|
@ -1,38 +0,0 @@
|
||||
icon: assets/spotube-logo.png
|
||||
summary: Lightweight cross-platform Spotify desktop client
|
||||
group: Applications/Multimedia
|
||||
vendor: Kingkor Roy Tirtho
|
||||
packager: Kingkor Roy Tirtho
|
||||
packagerEmail: krtirtho@gmail.com
|
||||
license: BSD-4-Clause
|
||||
url: https://github.com/KRTirtho/spotube
|
||||
requires:
|
||||
- mpv
|
||||
- libappindicator
|
||||
- jsoncpp
|
||||
- libsecret
|
||||
- libnotify
|
||||
- xdg-user-dirs
|
||||
- avahi
|
||||
- mdns-scan
|
||||
- nss-mdns
|
||||
- webkit2gtk4.1
|
||||
- libsoup3
|
||||
|
||||
display_name: Spotube
|
||||
|
||||
keywords:
|
||||
- Music
|
||||
- Spotify
|
||||
- Media
|
||||
- Streaming
|
||||
- YouTube
|
||||
|
||||
generic_name: Music Streaming Application
|
||||
categories:
|
||||
- Music
|
||||
|
||||
startup_notify: true
|
||||
|
||||
supported_mime_type:
|
||||
- x-scheme-handler/spotify
|
26
linux/runner/CMakeLists.txt
Normal file
26
linux/runner/CMakeLists.txt
Normal file
@ -0,0 +1,26 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(runner LANGUAGES CXX)
|
||||
|
||||
# Define the application target. To change its name, change BINARY_NAME in the
|
||||
# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
|
||||
# work.
|
||||
#
|
||||
# Any new source files that you add to the application should be added here.
|
||||
add_executable(${BINARY_NAME}
|
||||
"main.cc"
|
||||
"my_application.cc"
|
||||
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
|
||||
)
|
||||
|
||||
# Apply the standard set of build settings. This can be removed for applications
|
||||
# that need different build settings.
|
||||
apply_standard_settings(${BINARY_NAME})
|
||||
|
||||
# Add preprocessor definitions for the application ID.
|
||||
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
|
||||
|
||||
# Add dependency libraries. Add any application-specific dependencies here.
|
||||
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
|
||||
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
|
||||
|
||||
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
|
@ -17,13 +17,6 @@ G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
|
||||
// Implements GApplication::activate.
|
||||
static void my_application_activate(GApplication* application) {
|
||||
MyApplication* self = MY_APPLICATION(application);
|
||||
|
||||
GList* windows = gtk_application_get_windows(GTK_APPLICATION(application));
|
||||
if (windows) {
|
||||
gtk_window_present(GTK_WINDOW(windows->data));
|
||||
return;
|
||||
}
|
||||
|
||||
GtkWindow* window =
|
||||
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
|
||||
|
||||
@ -58,8 +51,7 @@ static void my_application_activate(GApplication* application) {
|
||||
gtk_widget_show(GTK_WIDGET(window));
|
||||
|
||||
g_autoptr(FlDartProject) project = fl_dart_project_new();
|
||||
fl_dart_project_set_dart_entrypoint_arguments(
|
||||
project, self->dart_entrypoint_arguments);
|
||||
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
|
||||
|
||||
FlView* view = fl_view_new(project);
|
||||
gtk_widget_show(GTK_WIDGET(view));
|
||||
@ -71,9 +63,7 @@ static void my_application_activate(GApplication* application) {
|
||||
}
|
||||
|
||||
// Implements GApplication::local_command_line.
|
||||
static gboolean my_application_local_command_line(GApplication* application,
|
||||
gchar*** arguments,
|
||||
int* exit_status) {
|
||||
static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
|
||||
MyApplication* self = MY_APPLICATION(application);
|
||||
// Strip out the first argument as it is the binary name.
|
||||
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
|
||||
@ -88,7 +78,25 @@ static gboolean my_application_local_command_line(GApplication* application,
|
||||
g_application_activate(application);
|
||||
*exit_status = 0;
|
||||
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Implements GApplication::startup.
|
||||
static void my_application_startup(GApplication* application) {
|
||||
//MyApplication* self = MY_APPLICATION(object);
|
||||
|
||||
// Perform any actions required at application startup.
|
||||
|
||||
G_APPLICATION_CLASS(my_application_parent_class)->startup(application);
|
||||
}
|
||||
|
||||
// Implements GApplication::shutdown.
|
||||
static void my_application_shutdown(GApplication* application) {
|
||||
//MyApplication* self = MY_APPLICATION(object);
|
||||
|
||||
// Perform any actions required at application shutdown.
|
||||
|
||||
G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application);
|
||||
}
|
||||
|
||||
// Implements GObject::dispose.
|
||||
@ -100,31 +108,23 @@ static void my_application_dispose(GObject* object) {
|
||||
|
||||
static void my_application_class_init(MyApplicationClass* klass) {
|
||||
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
|
||||
G_APPLICATION_CLASS(klass)->local_command_line =
|
||||
my_application_local_command_line;
|
||||
G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
|
||||
G_APPLICATION_CLASS(klass)->startup = my_application_startup;
|
||||
G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown;
|
||||
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
|
||||
}
|
||||
|
||||
static void my_application_init(MyApplication* self) {}
|
||||
|
||||
bool is_flatpak(void) {
|
||||
if (getenv("container") || getenv("FLATPAK_ID") || getenv("FLATPAK")) {
|
||||
/* flatpak */
|
||||
return true;
|
||||
}
|
||||
return false; /* No container detected */
|
||||
}
|
||||
|
||||
MyApplication* my_application_new() {
|
||||
// gchar based alternate MY_APPLICATION_ID
|
||||
const char* my_application_id = APPLICATION_ID;
|
||||
// Set the program name to the application ID, which helps various systems
|
||||
// like GTK and desktop environments map this running application to its
|
||||
// corresponding .desktop file. This ensures better integration by allowing
|
||||
// the application to be recognized beyond its binary name.
|
||||
g_set_prgname(APPLICATION_ID);
|
||||
|
||||
if (is_flatpak()) {
|
||||
my_application_id = "com.github.KRTirtho.Spotube";
|
||||
}
|
||||
|
||||
return MY_APPLICATION(g_object_new(
|
||||
my_application_get_type(), "application-id", my_application_id, "flags",
|
||||
G_APPLICATION_HANDLES_COMMAND_LINE | G_APPLICATION_HANDLES_OPEN,
|
||||
return MY_APPLICATION(g_object_new(my_application_get_type(),
|
||||
"application-id", APPLICATION_ID,
|
||||
"flags", G_APPLICATION_NON_UNIQUE,
|
||||
nullptr));
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Spotube
|
||||
Exec=/usr/bin/spotube
|
||||
Icon=/usr/share/icons/spotube/spotube-logo.png
|
||||
Comment=A music streaming app combining the power of Spotify & YouTube
|
||||
Terminal=false
|
||||
Categories=Audio;Music;Player;AudioVideo;
|
||||
MimeType=x-scheme-handler/spotify;
|
Loading…
Reference in New Issue
Block a user