~exec64/imv-devel

imv: Add method to name window through args v1 APPLIED

Wang Zheng: 1
 Add method to name window through args

 2 files changed, 16 insertions(+), 1 deletions(-)
#644548 fedora.yml success
#644552 ubuntu.yml success
#644553 archlinux.yml success
#644554 freebsd.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~exec64/imv-devel/patches/27186/mbox | git am -3
Learn more about email & git

[PATCH imv] Add method to name window through args Export this patch

From: aeghn <aeghn@outlook.com>

Hello, I think it's better if we could set window title when we start
it, it is more flexible than only set it in the config file.

So, I add an option `-w <window_title>' to set it.

Sorry for the incorrect format of my previous patch email.

---
 doc/imv.1.txt |  3 +++
 src/imv.c     | 14 +++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/doc/imv.1.txt b/doc/imv.1.txt
index 37d60c0..e06c179 100644
--- a/doc/imv.1.txt
+++ b/doc/imv.1.txt
@@ -70,6 +70,9 @@ Options
*-u* <linear|nearest_neighbour>::
	Set upscaling method used by imv.

*-w* <windowtitle>::
    Set window title when starting imv.

*-x*::
	Disable looping of input paths.

diff --git a/src/imv.c b/src/imv.c
index c56a1ca..8380a12 100644
--- a/src/imv.c
+++ b/src/imv.c
@@ -731,6 +731,17 @@ static bool parse_upscaling_method(struct imv *imv, const char *method)
  return false;
}

static bool parse_window_title(struct imv *imv, const char *name)
{
  if (strcmp(name, "")) {
    free(imv->title_text);
    imv->title_text = strdup(name);
    return true;
  }

  return false;
}

static bool parse_initial_pan(struct imv *imv, const char *pan_params)
{
  char *next_val;
@@ -823,7 +834,7 @@ bool imv_parse_args(struct imv *imv, int argc, char **argv)
  int o;

 /* TODO getopt_long */
  while ((o = getopt(argc, argv, "frdxhvlu:s:n:b:t:c:")) != -1) {
  while ((o = getopt(argc, argv, "frdxhvlu:s:n:b:t:c:w:")) != -1) {
    switch(o) {
      case 'f': imv->start_fullscreen = true;                    break;
      case 'r': imv->recursive_load = true;                      break;
@@ -864,6 +875,7 @@ bool imv_parse_args(struct imv *imv, int argc, char **argv)
        }
        break;
      case 'c': list_append(imv->startup_commands, optarg); break;
      case 'w': parse_window_title(imv, optarg); break;
      case '?':
        imv_log(IMV_ERROR, "Unknown argument '%c'. Aborting.\n", optopt);
        return false;
-- 
2.34.1
imv/patches: SUCCESS in 5m56s

[Add method to name window through args][0] from [Wang Zheng][1]

[0]: https://lists.sr.ht/~exec64/imv-devel/patches/27186
[1]: mailto:aeghn@outlook.com

✓ #644553 SUCCESS imv/patches/archlinux.yml https://builds.sr.ht/~exec64/job/644553
✓ #644548 SUCCESS imv/patches/fedora.yml    https://builds.sr.ht/~exec64/job/644548
✓ #644554 SUCCESS imv/patches/freebsd.yml   https://builds.sr.ht/~exec64/job/644554
✓ #644552 SUCCESS imv/patches/ubuntu.yml    https://builds.sr.ht/~exec64/job/644552