mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-10 21:53:46 +01:00
Optional parameters for print command
This commit is contained in:
parent
2dde57fcd7
commit
6d321e2ec5
@ -51,7 +51,7 @@ char* default_text = "[No Name]";
|
||||
|
||||
/* printing */
|
||||
char* list_printer_command = "lpstat -v | sed -n '/^.*device for \\(.*\\): .*$/s//\\1/p'";
|
||||
char* print_command = "lp -d '%s' -P %s '%s'"; /* printer / pages / file */
|
||||
char* print_command = "lp -d '%s' -P %s '%s' %s"; /* printer / pages / file */
|
||||
|
||||
/* open uri */
|
||||
char* uri_command = "firefox '%s'"; /* uri */
|
||||
|
17
zathura.c
17
zathura.c
@ -3162,9 +3162,20 @@ cmd_print(int argc, char** argv)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
char* printer = argv[0];
|
||||
char* sites = (argc == 2) ? g_strdup(argv[1]) : g_strdup_printf("1-%i", Zathura.PDF.number_of_pages);
|
||||
char* command = g_strdup_printf(print_command, printer, sites, Zathura.PDF.file);
|
||||
char* printer = argv[0];
|
||||
char* sites = (argc == 2) ? g_strdup(argv[1]) : g_strdup_printf("1-%i", Zathura.PDF.number_of_pages);
|
||||
GString *addit = g_string_new("");
|
||||
|
||||
int i;
|
||||
for(i = 2; i < argc; i++)
|
||||
{
|
||||
if(i != 0)
|
||||
addit = g_string_append_c(addit, ' ');
|
||||
|
||||
addit = g_string_append(addit, argv[i]);
|
||||
}
|
||||
|
||||
char* command = g_strdup_printf(print_command, printer, sites, addit->str, Zathura.PDF.file);
|
||||
system(command);
|
||||
|
||||
g_free(sites);
|
||||
|
Loading…
Reference in New Issue
Block a user