Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package otpclient for openSUSE:Factory checked in at 2026-04-22 17:01:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/otpclient (Old) and /work/SRC/openSUSE:Factory/.otpclient.new.11940 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "otpclient" Wed Apr 22 17:01:13 2026 rev:44 rq:1348692 version:4.4.2 Changes: -------- --- /work/SRC/openSUSE:Factory/otpclient/otpclient.changes 2026-03-05 17:31:35.123530629 +0100 +++ /work/SRC/openSUSE:Factory/.otpclient.new.11940/otpclient.changes 2026-04-22 17:02:02.926078533 +0200 @@ -1,0 +2,6 @@ +Tue Apr 21 12:54:49 UTC 2026 - Paolo Stivanin <[email protected]> + +- Update to 4.4.2: + * Allow click to copy when searching via desktop provider + +------------------------------------------------------------------- Old: ---- v4.4.1.tar.gz v4.4.1.tar.gz.asc New: ---- _scmsync.obsinfo build.specials.obscpio v4.4.2.tar.gz v4.4.2.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ otpclient.spec ++++++ --- /var/tmp/diff_new_pack.JyJk9C/_old 2026-04-22 17:02:04.090126568 +0200 +++ /var/tmp/diff_new_pack.JyJk9C/_new 2026-04-22 17:02:04.090126568 +0200 @@ -18,7 +18,7 @@ %define uclname OTPClient Name: otpclient -Version: 4.4.1 +Version: 4.4.2 Release: 0 Summary: Simple GTK+ client for managing TOTP and HOTP License: GPL-3.0-or-later ++++++ _scmsync.obsinfo ++++++ mtime: 1776776267 commit: d70d9ec83ceec5d66a7aa57ca86887acaa554f4de1bdfbee54c6af307de8f9ef url: https://src.opensuse.org/GNOME/otpclient revision: factory ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-04-21 20:49:43.000000000 +0200 @@ -0,0 +1,4 @@ +*.obscpio +*.osc +_build.* +.pbuild ++++++ v4.4.1.tar.gz -> v4.4.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-4.4.1/CMakeLists.txt new/OTPClient-4.4.2/CMakeLists.txt --- old/OTPClient-4.4.1/CMakeLists.txt 2026-03-03 16:02:04.000000000 +0100 +++ new/OTPClient-4.4.2/CMakeLists.txt 2026-04-17 15:34:59.000000000 +0200 @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.16) -project(OTPClient VERSION "4.4.1" LANGUAGES "C") +project(OTPClient VERSION "4.4.2" LANGUAGES "C") include(GNUInstallDirs) configure_file("src/common/version.h.in" "version.h") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-4.4.1/src/search-provider/search-provider.c new/OTPClient-4.4.2/src/search-provider/search-provider.c --- old/OTPClient-4.4.1/src/search-provider/search-provider.c 2026-03-03 16:02:04.000000000 +0100 +++ new/OTPClient-4.4.2/src/search-provider/search-provider.c 2026-04-17 15:34:59.000000000 +0200 @@ -4,6 +4,7 @@ #include <libsecret/secret.h> #include <gcrypt.h> #include <cotp.h> +#include <string.h> #include <time.h> /* Project-specific headers */ @@ -32,6 +33,7 @@ static gboolean entry_matches_terms (const OtpSearchEntry *entry, gchar **terms, gsize terms_len); static gchar *get_entry_otp_value (json_t *obj); static void send_notification (const gchar *label, const gchar *otp_value); +static void copy_to_clipboard (const gchar *otp_value, gboolean is_kde); static gchar *get_db_path (void); static gboolean get_use_secret_service (void); static gboolean get_search_provider_enabled (void); @@ -208,6 +210,45 @@ return TRUE; } +static gboolean copy_via_klipper (const gchar *otp_value) { + GDBusConnection *conn = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); + if (!conn) return FALSE; + GError *err = NULL; + GVariant *result = g_dbus_connection_call_sync (conn, + "org.kde.klipper", "/klipper", "org.kde.klipper.klipper", + "setClipboardContents", g_variant_new ("(s)", otp_value), + NULL, G_DBUS_CALL_FLAGS_NONE, 1000, NULL, &err); + g_object_unref (conn); + if (err) { g_error_free (err); return FALSE; } + if (result) g_variant_unref (result); + return TRUE; +} + +static gboolean copy_via_subprocess (const gchar *otp_value) { + const gchar *session = g_getenv ("XDG_SESSION_TYPE"); + gboolean is_wayland = (session && g_ascii_strcasecmp (session, "wayland") == 0); + const gchar *argv_wl[] = { "wl-copy", NULL }; + const gchar *argv_x11[] = { "xclip", "-selection", "clipboard", NULL }; + const gchar **argv = is_wayland ? argv_wl : argv_x11; + GError *err = NULL; + GSubprocess *proc = g_subprocess_newv (argv, + G_SUBPROCESS_FLAGS_STDIN_PIPE | G_SUBPROCESS_FLAGS_STDOUT_SILENCE | G_SUBPROCESS_FLAGS_STDERR_SILENCE, + &err); + if (!proc) { if (err) g_error_free (err); return FALSE; } + GBytes *input = g_bytes_new (otp_value, strlen (otp_value)); + gboolean ok = g_subprocess_communicate (proc, input, NULL, NULL, NULL, &err); + g_bytes_unref (input); + if (err) g_error_free (err); + g_object_unref (proc); + return ok; +} + +static void copy_to_clipboard (const gchar *otp_value, gboolean is_kde) { + if (!otp_value) return; + if (is_kde && copy_via_klipper (otp_value)) return; + copy_via_subprocess (otp_value); +} + static void send_notification (const gchar *label, const gchar *otp_value) { if (!otp_value) return; GDBusConnection *conn = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); @@ -284,6 +325,7 @@ } } g_ptr_array_free (entries, TRUE); + copy_to_clipboard (otp, FALSE); send_notification (label, otp); g_dbus_method_invocation_return_value (inv, NULL); } else { g_dbus_method_invocation_return_value (inv, NULL); } @@ -331,6 +373,7 @@ } } g_ptr_array_free (entries, TRUE); + copy_to_clipboard (otp, TRUE); send_notification (label, otp); g_dbus_method_invocation_return_value (inv, NULL); } else if (g_strcmp0 (method, "Actions") == 0) {
