From 7e37e2013692be3e91a3684aca631d3b9149d23f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bertalan=20G=C3=B6ller?= Date: Tue, 3 Feb 2026 11:26:59 +0100 Subject: [PATCH 1/2] Add K as link hotkey --- src/main-win-ui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main-win-ui.c b/src/main-win-ui.c index 8ca7424..3d3c5c1 100644 --- a/src/main-win-ui.c +++ b/src/main-win-ui.c @@ -206,7 +206,7 @@ static GtkActionEntry main_win_actions[]= {"CopyPath", NULL, N_("Copy Pat_h(s)"), NULL, NULL, G_CALLBACK(on_copy_path)}, {"Rename", NULL, N_("R_ename..."), "F2", NULL, G_CALLBACK(on_rename)}, {"Duplicate", NULL, N_("D_uplicate..."), "U", NULL, NULL}, - {"Link", NULL, N_("Create Lin_k..."), NULL, NULL, G_CALLBACK(on_link)}, + {"Link", NULL, N_("Create Lin_k..."), "K", NULL, G_CALLBACK(on_link)}, {"MoveTo", NULL, N_("_Move to..."), NULL, NULL, G_CALLBACK(on_move_to)}, {"CopyTo", NULL, N_("Copy to_..."), NULL, NULL, G_CALLBACK(on_copy_to)}, {"FileProp", GTK_STOCK_PROPERTIES, N_("Propertie_s"), "Return", NULL, G_CALLBACK(bounce_action)}, From fef306009ccc828b5deb0736127fdb2f45a5bd03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bertalan=20G=C3=B6ller?= Date: Tue, 3 Feb 2026 11:44:39 +0100 Subject: [PATCH 2/2] On Copy action, also copy paths as plain text to clipboard (to that flavor) --- src/main-win-ui.c | 2 +- src/main-win.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main-win-ui.c b/src/main-win-ui.c index 3d3c5c1..8ca7424 100644 --- a/src/main-win-ui.c +++ b/src/main-win-ui.c @@ -206,7 +206,7 @@ static GtkActionEntry main_win_actions[]= {"CopyPath", NULL, N_("Copy Pat_h(s)"), NULL, NULL, G_CALLBACK(on_copy_path)}, {"Rename", NULL, N_("R_ename..."), "F2", NULL, G_CALLBACK(on_rename)}, {"Duplicate", NULL, N_("D_uplicate..."), "U", NULL, NULL}, - {"Link", NULL, N_("Create Lin_k..."), "K", NULL, G_CALLBACK(on_link)}, + {"Link", NULL, N_("Create Lin_k..."), NULL, NULL, G_CALLBACK(on_link)}, {"MoveTo", NULL, N_("_Move to..."), NULL, NULL, G_CALLBACK(on_move_to)}, {"CopyTo", NULL, N_("Copy to_..."), NULL, NULL, G_CALLBACK(on_copy_to)}, {"FileProp", GTK_STOCK_PROPERTIES, N_("Propertie_s"), "Return", NULL, G_CALLBACK(bounce_action)}, diff --git a/src/main-win.c b/src/main-win.c index 49fc53b..07da3a6 100644 --- a/src/main-win.c +++ b/src/main-win.c @@ -1918,6 +1918,28 @@ static void bounce_action(GtkAction* act, FmMainWin* win) fm_folder_view_bounce_action(act, win->folder_view); /* restore focus back */ gtk_window_set_focus(window, current_focus); + + // If this is the Copy action, also copy paths as plain text to clipboard + const gchar* action_name = gtk_action_get_name(act); + if(action_name && strcmp(action_name, "Copy") == 0) + { + GdkDisplay *dpy = gtk_widget_get_display(GTK_WIDGET(win)); + GtkClipboard *clipboard = gtk_clipboard_get_for_display(dpy, GDK_SELECTION_CLIPBOARD); + GString *str = g_string_sized_new(128); + FmPathList *files = fm_folder_view_dup_selected_file_paths(win->folder_view); + GList *fl; + for (fl = fm_path_list_peek_head_link(files); fl; fl = fl->next) + { + char *path = fm_path_to_str(fl->data); + if (str->len > 0) + g_string_append_c(str, '\n'); + g_string_append(str, path); + g_free(path); + } + gtk_clipboard_set_text(clipboard, str->str, str->len); + g_string_free(str, TRUE); + fm_path_list_unref(files); + } } static guint icon_sizes[] =