~exec64/imv-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH imv] Add method to name window through args

Wang Zheng <aeghn@outlook.com>
Details
Message ID
<TYCP286MB06691D723BDF7E832086F975B96F9@TYCP286MB0669.JPNP286.PROD.OUTLOOK.COM>
DKIM signature
pass
Download raw message
Patch: +16 -1
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] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CG9MOALVPFQP.3QUF8WFHQ0W52@cirno2>
In-Reply-To
<TYCP286MB06691D723BDF7E832086F975B96F9@TYCP286MB0669.JPNP286.PROD.OUTLOOK.COM> (view parent)
DKIM signature
missing
Download raw message
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]: 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
Reply to thread Export thread (mbox)