mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Use system command to print window title
This commit is contained in:
parent
e7ddff61dc
commit
032baa78a1
@ -2274,21 +2274,23 @@ _ui_draw_term_title(void)
|
|||||||
|
|
||||||
if (unread != 0) {
|
if (unread != 0) {
|
||||||
snprintf(new_win_title, sizeof(new_win_title),
|
snprintf(new_win_title, sizeof(new_win_title),
|
||||||
"%c]0;%s (%d) - %s%c", '\033', "Profanity",
|
"echo -n \"%c]0;%s (%d) - %s%c\"", '\033', "Profanity",
|
||||||
unread, jid, '\007');
|
unread, jid, '\007');
|
||||||
} else {
|
} else {
|
||||||
snprintf(new_win_title, sizeof(new_win_title),
|
snprintf(new_win_title, sizeof(new_win_title),
|
||||||
"%c]0;%s - %s%c", '\033', "Profanity", jid,
|
"echo -n \"%c]0;%s - %s%c\"", '\033', "Profanity", jid,
|
||||||
'\007');
|
'\007');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
snprintf(new_win_title, sizeof(new_win_title), "%c]0;%s%c", '\033',
|
snprintf(new_win_title, sizeof(new_win_title), "echo -n \"%c]0;%s%c\"", '\033',
|
||||||
"Profanity", '\007');
|
"Profanity", '\007');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_strcmp0(win_title, new_win_title) != 0) {
|
if (g_strcmp0(win_title, new_win_title) != 0) {
|
||||||
// print to x-window title bar
|
// print to x-window title bar
|
||||||
printf("%s", new_win_title);
|
int res = system(new_win_title);
|
||||||
|
if (res == -1) {
|
||||||
|
log_error("Error printing title");
|
||||||
|
}
|
||||||
if (win_title != NULL) {
|
if (win_title != NULL) {
|
||||||
free(win_title);
|
free(win_title);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user