xsel

Program for manipulating the X clipboard
git clone https://git.sinitax.com/kfish/xsel
Log | Files | Refs | README | LICENSE | sfeed.txt

commit 9265da0db772e41820ff55c7ec376a1c41cab02d
parent 30070515a5bd9e5a42343c206fe67cbe2160b998
Author: uosis <uosisl@gmail.com>
Date:   Mon, 30 Sep 2019 15:00:23 -0600

set window name

Diffstat:
Mxsel.c | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xsel.c b/xsel.c @@ -2034,6 +2034,7 @@ main(int argc, char *argv[]) int i, s=0; unsigned char * old_sel = NULL, * new_sel = NULL; char * display_name = NULL; + char * window_name = "xsel"; long timeout_ms = 0L; zerot.it_value.tv_sec = 0; @@ -2110,6 +2111,9 @@ main(int argc, char *argv[]) } else if (OPT("--display")) { i++; if (i >= argc) goto usage_err; display_name = argv[i]; + } else if (OPT("--windowName")) { + i++; if (i >= argc) goto usage_err; + window_name = argv[i]; } else if (OPT("--selectionTimeout") || OPT("-t")) { i++; if (i >= argc) goto usage_err; timeout_ms = strtol(argv[i], (char **)NULL, 10); @@ -2172,7 +2176,9 @@ main(int argc, char *argv[]) print_debug (D_INFO, "Window id: 0x%x (unmapped)", window); - /* Set window class */ + /* Set window name and class */ + XStoreName(display, window, window_name); + class_hints = XAllocClassHint(); if (class_hints==NULL) { exit_err ("Can't allocate class hints memory\n");