Skip to content

Commit 4986b99

Browse files
committed
Added profile and group name in the pre/post commands
1 parent 903c049 commit 4986b99

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

remmina/src/remmina_ext_exec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ GtkDialog* remmina_ext_exec_new(RemminaFile* remminafile, const char *remmina_ex
8989
remmina_utils_string_replace_all(cmd_str, "%t", remmina_file_get_string(remminafile, "ssh_server"));
9090
remmina_utils_string_replace_all(cmd_str, "%u", remmina_file_get_string(remminafile, "username"));
9191
remmina_utils_string_replace_all(cmd_str, "%U", remmina_file_get_string(remminafile, "ssh_username"));
92+
remmina_utils_string_replace_all(cmd_str, "%p", remmina_file_get_string(remminafile, "name"));
93+
remmina_utils_string_replace_all(cmd_str, "%g", remmina_file_get_string(remminafile, "group"));
9294
}else{
9395
return FALSE;
9496
}

remmina/src/remmina_file_editor.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ static const gchar * cmd_tips = N_( "<tt><big>"
8585
"* %t is substituted with the SSH server name\n"
8686
"* %u is substituted with the user name\n"
8787
"* %U is substituted with the SSH user name\n"
88+
"* %p is substituted with Remmina profile name\n"
89+
"* %g is substituted with Remmina profile group name\n"
8890
"Do not run in background if you want the command to be executed before connecting.\n"
8991
"</big></tt>");
9092

@@ -1429,7 +1431,7 @@ GtkWidget* remmina_file_editor_new_from_file(RemminaFile* remminafile)
14291431
priv->precommand_entry = widget;
14301432
cs = remmina_file_get_string(remminafile, "precommand");
14311433
gtk_entry_set_text(GTK_ENTRY(widget), cs ? cs : "");
1432-
gtk_entry_set_placeholder_text(GTK_ENTRY(widget), "command %h %u %t %U --option");
1434+
gtk_entry_set_placeholder_text(GTK_ENTRY(widget), "command %h %u %t %U %p %g --option");
14331435
gtk_widget_set_tooltip_markup(widget, _(cmd_tips));
14341436

14351437
/* POST Connection Command */
@@ -1447,7 +1449,7 @@ GtkWidget* remmina_file_editor_new_from_file(RemminaFile* remminafile)
14471449
priv->postcommand_entry = widget;
14481450
cs = remmina_file_get_string(remminafile, "postcommand");
14491451
gtk_entry_set_text(GTK_ENTRY(widget), cs ? cs : "");
1450-
gtk_entry_set_placeholder_text(GTK_ENTRY(widget), "/path/to/command -opt1 arg %h %u %t -opt2 %U");
1452+
gtk_entry_set_placeholder_text(GTK_ENTRY(widget), "/path/to/command -opt1 arg %h %u %t -opt2 %U %p %g");
14511453
gtk_widget_set_tooltip_markup(widget, _(cmd_tips));
14521454

14531455
/* Create the Preference frame */

0 commit comments

Comments
 (0)