### Vala AppIndicator Example Source: https://context7.com/linuxmint/libappindicator/llms.txt A complete Vala example demonstrating the creation and management of an application indicator. It includes setting status, attention icons, labels, titles, handling scroll events for updates, and setting up a context menu with toggle and quit actions. This code relies on the Gtk and AppIndicator namespaces. ```vala using Gtk; using AppIndicator; public class MyIndicator { private Indicator indicator; private int counter = 0; public MyIndicator() { indicator = new Indicator( "my-vala-indicator", "indicator-messages", IndicatorCategory.APPLICATION_STATUS ); indicator.set_status(IndicatorStatus.ACTIVE); indicator.set_attention_icon("indicator-messages-new"); indicator.set_label("Ready", ""); indicator.set_title("My Vala Application"); /* Handle scroll events */ indicator.scroll_event.connect((delta, direction) => { if (direction == Gdk.ScrollDirection.UP) { counter++; } else if (direction == Gdk.ScrollDirection.DOWN) { counter--; } indicator.set_label(@"Count: $counter", ""); }); setup_menu(); } private void setup_menu() { var menu = new Gtk.Menu(); var status_item = new Gtk.MenuItem.with_label("Toggle Attention"); status_item.activate.connect(() => { if (indicator.get_status() == IndicatorStatus.ATTENTION) { indicator.set_status(IndicatorStatus.ACTIVE); } else { indicator.set_status(IndicatorStatus.ATTENTION); } }); menu.append(status_item); var quit_item = new Gtk.MenuItem.with_label("Quit"); quit_item.activate.connect(Gtk.main_quit); menu.append(quit_item); menu.show_all(); indicator.set_menu(menu); indicator.set_secondary_activate_target(status_item); } public static int main(string[] args) { Gtk.init(ref args); new MyIndicator(); Gtk.main(); return 0; } } ``` -------------------------------- ### C# (Mono) AppIndicator Example Source: https://context7.com/linuxmint/libappindicator/llms.txt A complete C# example for creating an application indicator using the AppIndicator namespace. This code initializes the application, creates an indicator, sets its status, and configures a context menu with actions to toggle attention status and quit the application. It utilizes Gtk# and the AppIndicator library. ```csharp using Gtk; using AppIndicator; public class MyIndicatorApp { private ApplicationIndicator indicator; private bool isAttention = false; public MyIndicatorApp() { Application.Init(); indicator = new ApplicationIndicator( "my-csharp-indicator", "indicator-messages", Category.ApplicationStatus ); indicator.Status = Status.Active; SetupMenu(); } private void SetupMenu() { Menu menu = new Menu(); MenuItem toggleItem = new MenuItem("Toggle Attention"); toggleItem.Activated += (sender, e) => { isAttention = !isAttention; indicator.Status = isAttention ? Status.Attention : Status.Active; System.Console.WriteLine("Status: " + indicator.Status); }; menu.Append(toggleItem); MenuItem quitItem = new MenuItem("Quit"); quitItem.Activated += (sender, e) => Application.Quit(); menu.Append(quitItem); indicator.Menu = menu; indicator.Menu.ShowAll(); /* Set middle-click action */ indicator.SecondaryActivateTarget = toggleItem; } public void Run() { Application.Run(); } public static void Main() { MyIndicatorApp app = new MyIndicatorApp(); app.Run(); } } ``` -------------------------------- ### Compile Commands for libappindicator Source: https://context7.com/linuxmint/libappindicator/llms.txt Compilation commands for creating applications that use libappindicator. This includes examples for C with GTK2 and GTK3, Vala with GTK3, and C# (Mono) applications. These commands utilize pkg-config to correctly link against the necessary libraries. ```bash # GTK2 build gcc -o myindicator myindicator.c \ $(pkg-config --cflags --libs appindicator-0.1) # GTK3 build gcc -o myindicator myindicator.c \ $(pkg-config --cflags --libs appindicator3-0.1) # Vala build (GTK3) valac --pkg gtk+-3.0 --pkg appindicator3-0.1 -o myindicator myindicator.vala # C# Mono build mcs -pkg:gtk-sharp-2.0 -r:appindicator-sharp.dll -out:myindicator.exe MyIndicator.cs mono myindicator.exe ``` -------------------------------- ### app_indicator_set_label Source: https://context7.com/linuxmint/libappindicator/llms.txt Sets a text label displayed next to the indicator icon. The 'guide' parameter helps the panel allocate consistent space for varying label content. ```APIDOC ## app_indicator_set_label ### Description Sets a text label displayed next to the indicator icon. The guide parameter helps the panel allocate consistent space for varying label content. ### Method (Not applicable for C functions) ### Endpoint (Not applicable for C functions) ### Parameters (Not directly applicable as this is a C function signature) - `indicator` (AppIndicator *) - The indicator to modify. - `label` (const gchar *) - The text label to display. Can be NULL to hide the label. - `guide` (const gchar *) - A string representing the maximum expected width of the label (e.g., "100%" for a 3-digit percentage) to help with panel layout. ### Request Example ```c #include // Assuming 'indicator' is an initialized AppIndicator pointer // Set initial label and guide app_indicator_set_label(indicator, "0%", "100%"); // Example of updating label dynamically (e.g., progress) static gboolean update_progress(gpointer user_data) { static int percentage = 0; AppIndicator *ind = APP_INDICATOR(user_data); percentage = (percentage + 1) % 101; gchar *label = g_strdup_printf("%d%%", percentage); app_indicator_set_label(ind, label, "100%"); g_free(label); return TRUE; // Continue timer } // To hide the label // app_indicator_set_label(indicator, NULL, NULL); ``` ### Response (Not applicable for C functions, modifies the indicator in place) #### Success Response (200) (Not applicable) #### Response Example (Not applicable) ``` -------------------------------- ### Update Indicator Label Source: https://context7.com/linuxmint/libappindicator/llms.txt Updates the text label next to the icon, using a guide string to reserve consistent space for dynamic content. ```c #include static gboolean update_progress(gpointer user_data) { static int percentage = 0; AppIndicator *indicator = APP_INDICATOR(user_data); percentage = (percentage + 1) % 101; gchar *label = g_strdup_printf("%d%%", percentage); app_indicator_set_label(indicator, label, "100%"); g_free(label); return TRUE; } void hide_label(AppIndicator *indicator) { app_indicator_set_label(indicator, NULL, NULL); } ``` -------------------------------- ### Build Menu from Desktop File Source: https://context7.com/linuxmint/libappindicator/llms.txt Automates the creation of an indicator menu by parsing a standard .desktop file. This simplifies integration by reusing existing application metadata. ```c #include void setup_menu_from_desktop(AppIndicator *indicator) { /* Load menu from desktop file * desktop_file: path to .desktop file * desktop_profile: profile name for menu actions */ app_indicator_build_menu_from_desktop( indicator, "/usr/share/applications/myapp.desktop", "myapp" ); } ``` -------------------------------- ### app_indicator_build_menu_from_desktop Source: https://context7.com/linuxmint/libappindicator/llms.txt Builds a menu automatically from a .desktop file. ```APIDOC ## app_indicator_build_menu_from_desktop ### Description Builds an application indicator's menu dynamically by parsing a specified `.desktop` file. ### Method (Not applicable - this is a function call within C code) ### Endpoint (Not applicable - this is a function call within C code) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Request Example ```c #include // Assuming 'indicator' is an initialized AppIndicator pointer app_indicator_build_menu_from_desktop( indicator, "/usr/share/applications/myapp.desktop", "myapp" ); ``` ### Response #### Success Response (200) (Not applicable - this is a function call within C code) #### Response Example (None) ``` -------------------------------- ### Manage Indicator Icons Source: https://context7.com/linuxmint/libappindicator/llms.txt Shows how to update the indicator icon dynamically, including support for accessibility descriptions and custom file paths. ```c #include void set_connected_icon(AppIndicator *indicator) { app_indicator_set_icon(indicator, "network-wired"); } void set_disconnected_icon(AppIndicator *indicator) { app_indicator_set_icon_full( indicator, "network-offline", "Network disconnected" ); } void set_custom_icon(AppIndicator *indicator, const gchar *icon_path) { app_indicator_set_icon_full(indicator, icon_path, "Custom application icon"); } ``` -------------------------------- ### Attach GTK Menu to Indicator Source: https://context7.com/linuxmint/libappindicator/llms.txt Demonstrates how to create a GTK menu and attach it to an AppIndicator. The menu is displayed when the user interacts with the indicator icon. ```c #include static void on_quit_clicked(GtkWidget *widget, gpointer data) { gtk_main_quit(); } static void on_action_clicked(GtkWidget *widget, gpointer data) { g_print("Action clicked: %s\n", (const gchar *)data); } int main(int argc, char **argv) { gtk_init(&argc, &argv); AppIndicator *indicator = app_indicator_new( "menu-example", "indicator-messages", APP_INDICATOR_CATEGORY_APPLICATION_STATUS ); app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE); GtkWidget *menu = gtk_menu_new(); GtkWidget *item1 = gtk_menu_item_new_with_label("Open"); g_signal_connect(item1, "activate", G_CALLBACK(on_action_clicked), "Open"); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item1); GtkWidget *item2 = gtk_check_menu_item_new_with_label("Enable Feature"); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item2); GtkWidget *separator = gtk_separator_menu_item_new(); gtk_menu_shell_append(GTK_MENU_SHELL(menu), separator); GtkWidget *quit_item = gtk_menu_item_new_with_label("Quit"); g_signal_connect(quit_item, "activate", G_CALLBACK(on_quit_clicked), NULL); gtk_menu_shell_append(GTK_MENU_SHELL(menu), quit_item); gtk_widget_show_all(menu); app_indicator_set_menu(indicator, GTK_MENU(menu)); gtk_main(); return 0; } ``` -------------------------------- ### Create a new application indicator Source: https://context7.com/linuxmint/libappindicator/llms.txt Initializes a new AppIndicator instance using a unique identifier, an icon name, and a category. The category defines how the indicator is grouped within the system panel. ```c #include int main(int argc, char **argv) { gtk_init(&argc, &argv); AppIndicator *indicator = app_indicator_new( "my-application-indicator", "indicator-messages", APP_INDICATOR_CATEGORY_APPLICATION_STATUS ); g_assert(IS_APP_INDICATOR(indicator)); return 0; } ``` -------------------------------- ### Retrieve AppIndicator Properties Source: https://context7.com/linuxmint/libappindicator/llms.txt Shows how to use various getter functions to access the current state, icon paths, and menu configuration of an active AppIndicator instance. ```c #include void print_indicator_info(AppIndicator *indicator) { /* Get basic properties */ const gchar *id = app_indicator_get_id(indicator); const gchar *icon = app_indicator_get_icon(indicator); const gchar *icon_desc = app_indicator_get_icon_desc(indicator); const gchar *title = app_indicator_get_title(indicator); const gchar *label = app_indicator_get_label(indicator); const gchar *label_guide = app_indicator_get_label_guide(indicator); const gchar *icon_path = app_indicator_get_icon_theme_path(indicator); /* Get enum properties */ AppIndicatorCategory category = app_indicator_get_category(indicator); AppIndicatorStatus status = app_indicator_get_status(indicator); guint32 ordering = app_indicator_get_ordering_index(indicator); /* Get attention icon */ const gchar *attention_icon = app_indicator_get_attention_icon(indicator); const gchar *attention_desc = app_indicator_get_attention_icon_desc(indicator); /* Get menu */ GtkMenu *menu = app_indicator_get_menu(indicator); /* Get secondary activate target */ GtkWidget *secondary = app_indicator_get_secondary_activate_target(indicator); g_print("Indicator ID: %s\n", id); g_print("Icon: %s (%s)\n", icon, icon_desc ? icon_desc : "no description"); g_print("Status: %d\n", status); } ``` -------------------------------- ### app_indicator_set_menu Source: https://context7.com/linuxmint/libappindicator/llms.txt Attaches a GTK menu to the indicator, which is displayed when the user clicks on the indicator icon. ```APIDOC ## app_indicator_set_menu ### Description Attaches a GTK menu to the indicator, displayed when user clicks on the indicator icon. ### Method (Not applicable for C functions, typically part of a larger application flow) ### Endpoint (Not applicable for C functions) ### Parameters (Not directly applicable as this is a C function signature, but the function takes an AppIndicator and a GtkMenu) ### Request Example ```c #include // ... (indicator creation and menu creation code) ... app_indicator_set_menu(indicator, GTK_MENU(menu)); ``` ### Response (Not applicable for C functions, modifies the indicator in place) #### Success Response (200) (Not applicable) #### Response Example (Not applicable) ``` -------------------------------- ### Create an indicator with a custom icon path Source: https://context7.com/linuxmint/libappindicator/llms.txt Initializes an AppIndicator while specifying a custom directory path for icon assets. This is useful for applications that do not store icons in standard system theme directories. ```c #include int main(int argc, char **argv) { gtk_init(&argc, &argv); AppIndicator *indicator = app_indicator_new_with_path( "custom-icon-indicator", "my-custom-icon", APP_INDICATOR_CATEGORY_APPLICATION_STATUS, "/usr/share/myapp/icons" ); return 0; } ``` -------------------------------- ### Getter Functions Source: https://context7.com/linuxmint/libappindicator/llms.txt Retrieve current indicator properties. ```APIDOC ## Getter Functions ### Description Provides functions to retrieve various properties of an application indicator, such as its ID, icon, status, and menu. ### Method (Not applicable - these are function calls within C code) ### Endpoint (Not applicable - these are function calls within C code) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Request Example ```c #include // Assuming 'indicator' is an initialized AppIndicator pointer const gchar *id = app_indicator_get_id(indicator); AppIndicatorStatus status = app_indicator_get_status(indicator); ``` ### Response #### Success Response (200) (Not applicable - these are function calls within C code) #### Response Example (None) ``` -------------------------------- ### Handle Scroll Events on AppIndicator Source: https://context7.com/linuxmint/libappindicator/llms.txt Demonstrates how to connect to the scroll-event signal to respond to mouse wheel movement over the indicator icon. The handler receives the delta and scroll direction to update application state. ```c #include static void on_scroll_event(AppIndicator *indicator, gint delta, GdkScrollDirection direction, gpointer data) { int *volume = (int *)data; switch (direction) { case GDK_SCROLL_UP: *volume = MIN(*volume + 5, 100); break; case GDK_SCROLL_DOWN: *volume = MAX(*volume - 5, 0); break; default: break; } g_print("Volume: %d%% (delta: %d)\n", *volume, delta); gchar *label = g_strdup_printf("%d%%", *volume); app_indicator_set_label(indicator, label, "100%"); g_free(label); } int main(int argc, char **argv) { static int volume = 50; gtk_init(&argc, &argv); AppIndicator *indicator = app_indicator_new( "scroll-example", "audio-volume-medium", APP_INDICATOR_CATEGORY_APPLICATION_STATUS ); app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE); app_indicator_set_label(indicator, "50%", "100%"); /* Connect scroll event handler */ g_signal_connect(indicator, "scroll-event", G_CALLBACK(on_scroll_event), &volume); GtkWidget *menu = gtk_menu_new(); GtkWidget *quit = gtk_menu_item_new_with_label("Quit"); g_signal_connect(quit, "activate", G_CALLBACK(gtk_main_quit), NULL); gtk_menu_shell_append(GTK_MENU_SHELL(menu), quit); gtk_widget_show_all(menu); app_indicator_set_menu(indicator, GTK_MENU(menu)); gtk_main(); return 0; } ``` -------------------------------- ### app_indicator_set_icon / app_indicator_set_icon_full Source: https://context7.com/linuxmint/libappindicator/llms.txt Changes the indicator's icon dynamically. The full version allows specifying an accessibility description. ```APIDOC ## app_indicator_set_icon / app_indicator_set_icon_full ### Description Changes the indicator's icon dynamically. The full version allows specifying an accessibility description. ### Method (Not applicable for C functions) ### Endpoint (Not applicable for C functions) ### Parameters (Not directly applicable as these are C function signatures) - `indicator` (AppIndicator *) - The indicator to modify. - `icon_name` (const gchar *) - The name of the icon to set (e.g., "network-wired"). - `icon_desc` (const gchar *) - An accessibility description for the icon (for `app_indicator_set_icon_full`). ### Request Example ```c #include // Assuming 'indicator' is an initialized AppIndicator pointer // Simple icon change app_indicator_set_icon(indicator, "network-wired"); // Icon with accessibility description app_indicator_set_icon_full( indicator, "network-offline", "Network disconnected" ); // Set custom icon from file path app_indicator_set_icon_full(indicator, "/path/to/custom/icon.png", "Custom application icon"); ``` ### Response (Not applicable for C functions, modifies the indicator in place) #### Success Response (200) (Not applicable) #### Response Example (Not applicable) ``` -------------------------------- ### Set Secondary Activation Target for AppIndicator Source: https://context7.com/linuxmint/libappindicator/llms.txt Configures which specific menu item is triggered when the user middle-clicks the indicator icon. This requires an initialized AppIndicator and a valid GtkWidget menu item. ```c #include static void on_toggle_mute(GtkWidget *widget, gpointer data) { gboolean *muted = (gboolean *)data; *muted = !(*muted); g_print("Muted: %s\n", *muted ? "Yes" : "No"); } int main(int argc, char **argv) { static gboolean muted = FALSE; gtk_init(&argc, &argv); AppIndicator *indicator = app_indicator_new( "secondary-example", "audio-volume-high", APP_INDICATOR_CATEGORY_APPLICATION_STATUS ); app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE); GtkWidget *menu = gtk_menu_new(); GtkWidget *mute_item = gtk_menu_item_new_with_label("Toggle Mute"); g_signal_connect(mute_item, "activate", G_CALLBACK(on_toggle_mute), &muted); gtk_menu_shell_append(GTK_MENU_SHELL(menu), mute_item); gtk_widget_show_all(menu); app_indicator_set_menu(indicator, GTK_MENU(menu)); /* Middle-click will activate mute_item directly */ app_indicator_set_secondary_activate_target(indicator, mute_item); gtk_main(); return 0; } ``` -------------------------------- ### Configure Attention State Source: https://context7.com/linuxmint/libappindicator/llms.txt Configures an attention icon and toggles the indicator status to notify the user of events. ```c #include void configure_attention(AppIndicator *indicator) { app_indicator_set_attention_icon_full( indicator, "indicator-messages-new", "You have new messages" ); app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ATTENTION); } void clear_attention(AppIndicator *indicator) { app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE); } ``` -------------------------------- ### AppIndicator Functions Source: https://github.com/linuxmint/libappindicator/blob/master/docs/reference/libappindicator-sections.txt Provides a comprehensive list of functions for creating, managing, and retrieving information about AppIndicators. ```APIDOC ## AppIndicator Functions ### Description This section details the functions available for interacting with AppIndicators, including creation, configuration, and status retrieval. ### Core Functions - **app_indicator_get_type()**: Retrieves the GType for AppIndicator. - **app_indicator_new(id, icon_name, category)**: Creates a new AppIndicator. - **id** (string): Unique identifier for the indicator. - **icon_name** (string): Name of the default icon. - **category** (AppIndicatorCategory): The category of the indicator. - **app_indicator_new_with_path(id, icon_name, category, icon_theme_path)**: Creates a new AppIndicator with a specified icon theme path. - **id** (string): Unique identifier for the indicator. - **icon_name** (string): Name of the default icon. - **category** (AppIndicatorCategory): The category of the indicator. - **icon_theme_path** (string): Path to the icon theme. ### Status and Icon Management - **app_indicator_set_status(indicator, status)**: Sets the status of the indicator. - **indicator** (AppIndicator): The indicator instance. - **status** (AppIndicatorStatus): The new status. - **app_indicator_set_attention_icon(indicator, icon_name)**: Sets the attention icon. - **indicator** (AppIndicator): The indicator instance. - **icon_name** (string): Name of the attention icon. - **app_indicator_set_attention_icon_full(indicator, icon_name, icon_desc)**: Sets the attention icon with a description. - **indicator** (AppIndicator): The indicator instance. - **icon_name** (string): Name of the attention icon. - **icon_desc** (string): Description of the attention icon. - **app_indicator_set_icon(indicator, icon_name)**: Sets the standard icon. - **indicator** (AppIndicator): The indicator instance. - **icon_name** (string): Name of the icon. - **app_indicator_set_icon_full(indicator, icon_name, icon_desc)**: Sets the standard icon with a description. - **indicator** (AppIndicator): The indicator instance. - **icon_name** (string): Name of the icon. - **icon_desc** (string): Description of the icon. - **app_indicator_set_icon_theme_path(indicator, icon_theme_path)**: Sets the path for the icon theme. - **indicator** (AppIndicator): The indicator instance. - **icon_theme_path** (string): Path to the icon theme. ### Menu and Label Management - **app_indicator_set_menu(indicator, menu)**: Sets the context menu for the indicator. - **indicator** (AppIndicator): The indicator instance. - **menu** (GtkMenu): The GtkMenu to set. - **app_indicator_set_label(indicator, label)**: Sets a label for the indicator. - **indicator** (AppIndicator): The indicator instance. - **label** (string): The label text. ### Ordering and Activation - **app_indicator_set_ordering_index(indicator, ordering_index)**: Sets the ordering index for the indicator. - **indicator** (AppIndicator): The indicator instance. - **ordering_index** (int): The ordering index. - **app_indicator_set_secondary_activate_target(indicator, widget)**: Sets the target widget for secondary activation. - **indicator** (AppIndicator): The indicator instance. - **widget** (GtkWidget): The target widget. ### Title - **app_indicator_set_title(indicator, title)**: Sets the title for the indicator. - **indicator** (AppIndicator): The indicator instance. - **title** (string): The title text. ### Information Retrieval - **app_indicator_get_id(indicator)**: Retrieves the ID of the indicator. - **indicator** (AppIndicator): The indicator instance. - Returns: (string) The indicator ID. - **app_indicator_get_category(indicator)**: Retrieves the category of the indicator. - **indicator** (AppIndicator): The indicator instance. - Returns: (AppIndicatorCategory) The indicator category. - **app_indicator_get_status(indicator)**: Retrieves the status of the indicator. - **indicator** (AppIndicator): The indicator instance. - Returns: (AppIndicatorStatus) The indicator status. - **app_indicator_get_icon(indicator)**: Retrieves the icon name of the indicator. - **indicator** (AppIndicator): The indicator instance. - Returns: (string) The icon name. - **app_indicator_get_icon_desc(indicator)**: Retrieves the description of the indicator's icon. - **indicator** (AppIndicator): The indicator instance. - Returns: (string) The icon description. - **app_indicator_get_icon_theme_path(indicator)**: Retrieves the icon theme path. - **indicator** (AppIndicator): The indicator instance. - Returns: (string) The icon theme path. - **app_indicator_get_attention_icon(indicator)**: Retrieves the attention icon name. - **indicator** (AppIndicator): The indicator instance. - Returns: (string) The attention icon name. - **app_indicator_get_attention_icon_desc(indicator)**: Retrieves the description of the attention icon. - **indicator** (AppIndicator): The indicator instance. - Returns: (string) The attention icon description. - **app_indicator_get_menu(indicator)**: Retrieves the context menu. - **indicator** (AppIndicator): The indicator instance. - Returns: (GtkMenu) The context menu. - **app_indicator_get_label(indicator)**: Retrieves the label. - **indicator** (AppIndicator): The indicator instance. - Returns: (string) The label text. - **app_indicator_get_label_guide(indicator)**: Retrieves the label guide. - **indicator** (AppIndicator): The indicator instance. - Returns: (string) The label guide. - **app_indicator_get_ordering_index(indicator)**: Retrieves the ordering index. - **indicator** (AppIndicator): The indicator instance. - Returns: (int) The ordering index. - **app_indicator_get_secondary_activate_target(indicator)**: Retrieves the secondary activate target. - **indicator** (AppIndicator): The indicator instance. - Returns: (GtkWidget) The target widget. - **app_indicator_get_title(indicator)**: Retrieves the title. - **indicator** (AppIndicator): The indicator instance. - Returns: (string) The title. ### Utility Functions - **app_indicator_build_menu_from_desktop(indicator, desktop_file_path, menu_name)**: Builds a menu from a desktop file. - **indicator** (AppIndicator): The indicator instance. - **desktop_file_path** (string): Path to the desktop file. - **menu_name** (string): Name of the menu entry. ``` -------------------------------- ### app_indicator_set_title Source: https://context7.com/linuxmint/libappindicator/llms.txt Sets the title shown in tooltips and accessibility contexts for the indicator. ```APIDOC ## app_indicator_set_title ### Description Sets the title shown in tooltips and accessibility contexts. ### Method (Not applicable for C functions) ### Endpoint (Not applicable for C functions) ### Parameters (Not directly applicable as this is a C function signature) - `indicator` (AppIndicator *) - The indicator to modify. - `title` (const gchar *) - The title string to set. ### Request Example ```c #include // Assuming 'indicator' is an initialized AppIndicator pointer app_indicator_set_title(indicator, "My Application Status"); // This title will appear in tooltips and screen readers. ``` ### Response (Not applicable for C functions, modifies the indicator in place) #### Success Response (200) (Not applicable) #### Response Example (Not applicable) ``` -------------------------------- ### AppIndicator Constants and Types Source: https://github.com/linuxmint/libappindicator/blob/master/docs/reference/libappindicator-sections.txt Defines the various constants, types, and enums related to AppIndicator functionality. ```APIDOC ## AppIndicator Constants and Types ### Description This section lists the fundamental constants, types, and enumerations used within the AppIndicator API. ### Constants - **APP_INDICATOR_TYPE**: Type identifier for AppIndicator. - **APP_INDICATOR_CLASS**: Class identifier for AppIndicator. - **IS_APP_INDICATOR**: Checks if an object is an AppIndicator. - **IS_APP_INDICATOR_CLASS**: Checks if an object is an AppIndicatorClass. - **APP_INDICATOR_GET_CLASS**: Retrieves the AppIndicatorClass. - **APP_INDICATOR_SIGNAL_NEW_ICON**: Signal emitted when a new icon is set. - **APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON**: Signal emitted when a new attention icon is set. - **APP_INDICATOR_SIGNAL_NEW_STATUS**: Signal emitted when the status changes. - **APP_INDICATOR_SIGNAL_NEW_LABEL**: Signal emitted when the label changes. - **APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH**: Signal emitted when the icon theme path changes. - **APP_INDICATOR_SIGNAL_CONNECTION_CHANGED**: Signal emitted when the connection status changes. - **APP_INDICATOR_SIGNAL_SCROLL_EVENT**: Signal emitted on scroll events. ### Enumerations - **AppIndicatorCategory**: Defines categories for application indicators (e.g., SYSTEM_SERVICES, COMMUNICATIONS, HARDWARE, SOFTWARE, GAMES, UTILITY, OTHER). - **AppIndicatorStatus**: Defines the status of an application indicator (e.g., ACTIVE, ATTENTION, PASSIVE). ``` -------------------------------- ### Manage indicator status and visibility Source: https://context7.com/linuxmint/libappindicator/llms.txt Updates the visibility and attention state of an existing indicator. It supports passive (hidden), active (visible), and attention (highlighted) states. ```c #include void update_indicator_status(AppIndicator *indicator, gboolean needs_attention) { if (needs_attention) { app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ATTENTION); } else { app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE); } } void hide_indicator(AppIndicator *indicator) { app_indicator_set_status(indicator, APP_INDICATOR_STATUS_PASSIVE); } ``` -------------------------------- ### app_indicator_set_secondary_activate_target Source: https://context7.com/linuxmint/libappindicator/llms.txt Sets which menu item is activated on middle-click of the indicator icon. ```APIDOC ## app_indicator_set_secondary_activate_target ### Description Sets which menu item is activated on middle-click of the indicator icon. ### Method (Not applicable - this is a function call within C code) ### Endpoint (Not applicable - this is a function call within C code) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Request Example ```c #include // Assuming 'indicator' is an initialized AppIndicator pointer // and 'menu_item' is a GtkWidget representing a menu item app_indicator_set_secondary_activate_target(indicator, menu_item); ``` ### Response #### Success Response (200) (Not applicable - this is a function call within C code) #### Response Example (None) ``` -------------------------------- ### Set Indicator Title Source: https://context7.com/linuxmint/libappindicator/llms.txt Sets the title for the indicator, which is used by tooltips and screen readers for accessibility. ```c #include void configure_indicator(AppIndicator *indicator) { app_indicator_set_title(indicator, "My Application Status"); } ``` -------------------------------- ### Scroll Event Signal Source: https://context7.com/linuxmint/libappindicator/llms.txt Handle scroll wheel events on the indicator icon. ```APIDOC ## Scroll Event Signal ### Description Handles scroll wheel events on the indicator icon, often used for volume control or similar adjustments. ### Method (Not applicable - this is a signal connection within C code) ### Endpoint (Not applicable - this is a signal connection within C code) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Request Example ```c #include // Assuming 'indicator' is an initialized AppIndicator pointer // and 'volume' is an integer pointer to store the volume level g_signal_connect(indicator, "scroll-event", G_CALLBACK(on_scroll_event), &volume); ``` ### Response #### Success Response (200) (Not applicable - this is a signal handler within C code) #### Response Example (None) ``` -------------------------------- ### app_indicator_set_attention_icon / app_indicator_set_attention_icon_full Source: https://context7.com/linuxmint/libappindicator/llms.txt Sets the icon displayed when the indicator status is set to the ATTENTION state. ```APIDOC ## app_indicator_set_attention_icon / app_indicator_set_attention_icon_full ### Description Sets the icon displayed when indicator status is set to ATTENTION state. ### Method (Not applicable for C functions) ### Endpoint (Not applicable for C functions) ### Parameters (Not directly applicable as these are C function signatures) - `indicator` (AppIndicator *) - The indicator to modify. - `icon_name` (const gchar *) - The name of the attention icon. - `icon_desc` (const gchar *) - An accessibility description for the attention icon (for `app_indicator_set_attention_icon_full`). ### Request Example ```c #include // Assuming 'indicator' is an initialized AppIndicator pointer // Configure attention icon with description and trigger attention state app_indicator_set_attention_icon_full( indicator, "indicator-messages-new", "You have new messages" ); app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ATTENTION); // To clear attention state // app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE); ``` ### Response (Not applicable for C functions, modifies the indicator in place) #### Success Response (200) (Not applicable) #### Response Example (Not applicable) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.