pin Thank you, but I preferred to wait, because changing it sometimes forces many other packages to upgrade/refresh. I had some mess in the past with this operation.

However, as announced in this message from the @netbsd-users Mailing List, now the link points to 2020Q3! And I found badwolf 😃

pin Also, IIRC, a pkgin developer suggested to use pkgin upgrade now. pkgin full-upgrade has been (or will soon be) deprecated.

  • pin replied to this.
  • Jay likes this.

    EDIT: simplified patch a lot by inserting the manwidth option right after the /usr/bin/mandoc command.

    kamil How would you like to see it implemented?

    The way I've done it now is in the patch at the end. It inserts a -O width=NN option to the _build tags where-ever /usr/bin/mandoc is present. It's a bit kludgey, but it is the least intrusive way. No other commands which read /etc/man.conf are affected.

    Another, cleaner, but more intrusive, way is to add a new tag _fmt, then use that in the _build tags. Eg.

    _build          .[1-9][a-z]*    %_fmt% %s
    ...
    _fmt             /usr/bin/mandoc -O width=$((`tput cols` - 3))

    OR

    _build          .[1-9][a-z]*    %_fmt% %s
    ...
    _fmt             /usr/bin/mandoc

    Here, a patch can simply append the -O width=NN option to the _fmt tag instead of inserting it into the _build tags.
    But, doing it this way means changes to all the commands: apropos, whatis, ..., to recognize the new tag.

    A third method would be, as you proposed, to add a wrapper around mandoc which calls it with the -O width option set. This wrapper can then be used in the _build tags. Again, no source changes would be needed; only man.conf changes.

    I'm OK with any of the 3 methods.

    Patch
    diff -urN a/man/man.c b/man/man.c
    --- a/man/man.c	2020-04-09 11:28:32.000000000 +0000
    +++ b/man/man.c	2020-11-14 08:21:48.576113574 +0000
    @@ -44,6 +44,7 @@
     #endif
     #endif /* not lint */
     
    +#include <sys/ioctl.h>
     #include <sys/param.h>
     #include <sys/queue.h>
     #include <sys/stat.h>
    @@ -51,6 +52,7 @@
     
     #include <ctype.h>
     #include <err.h>
    +#include <errno.h>
     #include <fcntl.h>
     #include <fnmatch.h>
     #include <glob.h>
    @@ -101,6 +103,7 @@
     	/* other misc stuff */
     	const char *pager;	/* pager to use */
     	size_t pagerlen;	/* length of the above */
    +	int manwidth;		/* pass -O width= to mandoc(1) if > RMRG */
     	const char *machine;	/* machine */
     	const char *machclass;	/* machine class */
     };
    @@ -120,6 +123,9 @@
     static void	 addpath(struct manstate *, const char *, size_t, const char *);
     static const char *getclass(const char *);
     static void printmanpath(struct manstate *);
    +static int	get_mw(void);
    +static char	*ins_mw(const char *, const char *, struct manstate *);
    +
     
     /*
      * main function
    @@ -222,6 +228,7 @@
     			else
     				m.pager = _PATH_PAGER;
     			m.pagerlen = strlen(m.pager);
    +			m.manwidth = get_mw();
     		}
     	}
     
    @@ -804,8 +811,11 @@
     		(void)cleanup();
     		exit(EXIT_FAILURE);
     	}
    +	if ((b = ins_mw(fmt, "/usr/bin/mandoc", mp)) != NULL)
    +		fmt = b;
     	(void)snprintf(buf, sizeof(buf), "%s > %s", fmt, tpath);
     	(void)snprintf(cmd, sizeof(cmd), fmtcheck_ok(buf, "%s"), p);
    +	free(b);
     	(void)system(cmd);
     	(void)close(fd);
     	if ((*pathp = strdup(tpath)) == NULL) {
    @@ -1077,3 +1087,61 @@
     		globfree(&pg);
     	}
     }
    +
    +/*
    + * get_mw --
    + *	Return a user-defined MANWIDTH or determine one if set to "tty",
    + *	or -1 on errors.
    + */
    +int
    +get_mw(void)
    +{
    +	char *p, *ep;
    +	int wid;
    +
    +	if ((p = getenv("MANWIDTH")) == NULL)
    +		return -1;
    +	if (strcmp(p, "tty") == 0) {
    +		struct winsize ws;
    +		if (!isatty(STDOUT_FILENO) ||
    +		    ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) < 0)
    +			return -1;
    +		return ws.ws_col;
    +	}
    +	errno = 0;
    +	wid = (int)strtol(p, &ep, 10);
    +	if (ep == p || *ep != '\0' || errno)
    +		return -1;
    +	return wid;
    +}
    +
    +/*
    + * ins_mw --
    + *	Insert a " -O width=NN " option right after the "/usr/bin/mandoc"
    + *      command.
    + *	Turns:
    + *	1. _build	stuff	/usr/bin/mandoc	->
    + *	   _build	stuff	/usr/bin/mandoc -O width=NN
    + *	2. _build	stuff	/usr/bin/mandoc stuff %s ->
    + *	   _build	stuff	/usr/bin/mandoc -O width=NN stuff %s
    + *	etc.
    + * 	We do it this way because mandoc(1) doesn't allow options after
    + *	filenames, so a simple append won't work.
    + */
    +static char*
    +ins_mw(const char* line, const char* s, struct manstate* mp)
    +{
    +	enum { RMRG = 3 };	/* Right margin to match mandoc's LHS */
    +	const char* p;
    +	char* ret;
    +
    +	if (mp->manwidth <= RMRG)
    +		return NULL;
    +	if ((p = strstr(line, s)) == NULL)
    +		return NULL;	/* not mandoc */
    +	p += strlen(s);
    +	if (asprintf(&ret, "%.*s -O width=%d %s",
    +	    (int)(p - line), line, mp->manwidth - RMRG, p) == -1)
    +		return NULL;
    +	return ret;
    +}

      rvp

      Thank you for the patch proposal.

      I'm OK with any of the 3 methods.

      Unfortunately none of them is still compatible with FreeBSD, as there is a dedicated sorting of detected manual pages. In case of specified MANWIDTH, CATPAGES are attempted to be avoided, otherwise they are picked first. Here we do not perform the reordering and pick CATPAGES first as specified in man.conf(5).

      To make your patch complete, we would need to also add smart handling of rules, reordering the configuration from the user.

      A workaround minimizing the impact is to drop MKCATPAGES distribution build option.

      I think a cleaner way would be to introduce hidden reordering of _build options for MANWIDTH inside man(1), picking CAT pages last, and then embed MANWIDTH inside mandoc(1) (assuming that upstream will accept it).

      • rvp replied to this.

        kamil In case of specified MANWIDTH, CATPAGES are attempted to be avoided, otherwise they are picked first.

        The way I've done it, pre-formatted "catpages" are always formatted using mandoc's defaults (usually 78 cols). This should be OK, I think--after all "catpages" are pre-formatted and one can't expect this to change size according to the current terminal width. And, if the user doesn't like the 80-cols version then he can just delete the pre-formated pages or re-order his man.conf.

        kamil think a cleaner way would be to introduce hidden reordering of _build options for MANWIDTH inside man(1), picking CAT pages last

        My preference is not to do any hidden re-ordering. The user should be able to impose his own search order, and NetBSD can always put catpages after the unformatted ones in its default man.conf.

        Even in my scheme 2., above, you can use more than one _fmt tag to do the same thing. One for use by man (with a -O width and the other for catman (without the width option).

          rvp For start, I will propose to obsolete MKCATPAGES. Over the past few years I was the only developer testing this type of the distribution. This way the reordering problem goes away.

          Next, I will work on adding support and I prefer to hide MANWIDTH inside mandoc. But we will see. Thank you for the patch!

          kamil wip/i3lock-color

          It works, kind of. But I think there is some configuration needed:

          On OpenBSD the i3lock binary needs to be setgid auth to call the authentication helpers, e.g. /usr/libexec/auth/login_passwd.

          This would be the same for NetBSD right?

          Basically, it locks my screen but my password does not unlock it! not so useful as is 😅

          kamil ffmpeg-sixel looks cool... however it relies on a very old ffmpeg branch (2.x) that pulls unsupported dependencies and conflicts with newer libraries. I recommend to either abandon it or convince upstream to rebase to the newer version. Unfortunately upstream is inactive in 5 years here. If you abandon it, please mark this package that it is an abandoned request.

          As for this, it doesn't appear to be possible to open an issue under the ffmpeg master branch, however I have raised it here. I'm not going to hold my breath, but I'll watch it and let you know if I get a response. 😉

            pfr Testing this fully needs configuring a dedicated testing environment which right now exceeds my spare time.

            • pfr replied to this.

              pfr Please convince upstream to submit this support to mainline ffmpeg. Otherwise it's going to be pain to package and keep around. I could work on sorting this out in upstream ffmpeg, but this exceeds my spare time possibilities.

              • pfr replied to this.

                pfr I'm not going to hold my breath

                Come on, ...5 years for such a tool. It means dead.
                Its a waste of time to package and to maintain, regardless of how cool it was.

                • pfr replied to this.

                  kamil Testing this fully needs configuring a dedicated testing environment which right now exceeds my spare time.

                  Of course. I will try test it tonight, I think that should be the solution, anyway I've just got to have dinner then I'll test it.

                  kamil Please convince upstream to submit this support to mainline ffmpeg.

                  Dont stress about this one. Like @pin says, its dead. I dont expect the dev to reply to my my issue on github. But if they do, I'll let you know.

                  pin Come on, ...5 years for such a tool. It means dead.
                  Its a waste of time to package and to maintain, regardless of how cool it was.

                  ðŸ˜ŋ I going to find someone to bring it back from the dead 😉

                  • rvp replied to this.

                    pfr I going to find someone to bring it back from the dead

                    You do realize that Sixel graphics is one of the slowest video rendering techniques? You take a highly compressed video file, then -> decompress/decode -> RGB pixels -> Sixel (frikkin' ASCII!) convert -> xterm interpretation of stream -> back into RGB -> X server -> display.

                    Only a stadium-full of people holding up coloured bits of cardboard in sequence would be slower than this. I mean, it's fine for static pictures, but even 15 frames/sec will red-line all your CPUs.

                    • pfr replied to this.
                    • pfr likes this.

                      pfr On the other hand, I'd like to add xnotify to the list. A far more useful application.

                      xmessage: even more minimal.

                      • pfr replied to this.
                      • pfr likes this.

                        rvp
                        True. But xnotify is a new application, with many nice features and is being actively developed and improved upon regularly and would be my notification applet of choice.

                        EDIT: A quote from the author [phillbush]

                        As for xmessage, I don't see why one would use it for notifications: it does not stack one instance above the other like most notification systems do. But yeah, you can use it, but you will lost notification stacking, xft fonts, image support, notification grouping/tagging, etc.

                        And as it turns out, xnotify is already in pkgsrc/wip but is an older version. Although, the last commit was only 4 hrs ago so I'll give it time ðŸĪĢ

                        • pin replied to this.