From ArchWiki
Revision as of 15:29, 22 October 2012 by Flu (talk | contribs) (Feh and "--")
Jump to: navigation, search

File Browser Image Launcher

After this revision, the script was no longer usable. This was noted on the forum by a user who had tried the script.

  • Do not post scripts that you have not tested, especially when replacing a working script.
  • Giving credit is not "pimping". Respect others and their contributions.
  • Comments that include "sweet jesus" and disparaging terms are inappropriate . Given that the changes broke the script, they are also ironic.

unsigned comment

The only substantial change were the quotation marks, which are completely superficial since word expansion does not occur in double-brackets, and that's covered in the bash manual. There's plenty of content in the wiki, some of it of varying quality, and if everybody placed their name besides it, I'd say they had it coming. I'm not going to address the supossed brokenness since the previous itineration didn't handle name's with [[:space:]], at all. Stick to perl :) Lavandero 11:59, 1 February 2011 (EST)

Feh and "--"

Xyne, you've recently taken out "--", which disallows opening filenames that are the same as flags.

The following is an example run and a source code excerpt that implements "--".

Feh does recognize "--" as the end of flags:

andres@pote:~/torrents/Land of Lisp $ feh -- -F
feh WARNING: -F does not exist - skipping
feh - No loadable images specified.
Use feh --help for detailed usage information
andres@pote:~/torrents/Land of Lisp $

And here's the responsible code in GITROOT/src/getopt.c

	/* The special ARGV-element `--' means premature end of options. Skip
	   it like a null option, then exchange with previous non-options as if 
	   it were an option, then skip everything else like a non-option.  */

	if (optind != argc && !strcmp(argv[optind], "--")) {

		if (first_nonopt != last_nonopt && last_nonopt != optind)
			exchange((char **) argv);
		else if (first_nonopt == last_nonopt)
			first_nonopt = optind;
		last_nonopt = argc;

		optind = argc;

You can access the feh source repository and the specific file responsible for "--" here. Lavandero 08:01, 5 February 2011 (EST)

Then there is a bug in the code. The inclusion of "--" in the random background script generates the following error:
  feh WARNING: -- - File does not exist
  feh ERROR: Couldn't load image in order to set bg
Until this bug is resolved upstream. "--" should not be included in the script. Again, I ask you to please test your scripts, however trivial the change may be. Pointing to source code files is meaningless if the currently available application does not behave as expected. --Xyne 13:26, 6 February 2011 (EST)

Can't you just use a variable like that?