1. 07 Nov, 2022 1 commit
    • Baltazár Radics's avatar
      xdg-open: fix search_desktop_file's logic · a3956655
      Baltazár Radics authored
      It's only supposed to try other applications when the first one failed
      to start, but currently it continues searching even if an executable was
      found but exited with a non-zero status code. Also, the current approach
      waits for the program to exit, which is not consistent with how various
      DE's launching scripts work. This patch fixes both issues.
  2. 06 Nov, 2022 4 commits
    • Eli Schwartz's avatar
      Replace all remaining usage of non-portable 'which' with POSIX command -v · 8ae02631
      Eli Schwartz authored
      The "which" utility is not guaranteed to be installed, and if it
      is, its behavior is not portable.
      Conversely, the "command -v" shell builtin is required to exist in all
      POSIX 2008 compliant shells, and is thus guaranteed to work everywhere.
      Examples of open-source shells likely to be installed as /bin/sh on
      Linux, which implement the 12-year-old standard: ash, bash, busybox,
      dash, ksh, mksh and zsh.
      A side benefit of using the POSIX portable option is that it does not
      require an external disk executable to be forked. This therefore
      represents a mild speedup.
    • Eli Schwartz's avatar
      command_exec: run external command using env instead of which · 80d025ae
      Eli Schwartz authored
      Instead of using the 'which' program to resolve a command to an on-disk
      executable filename, use the 'env' program to run it. The former is
      non-portable and may not be installed on all systems, while the latter
      is guaranteed to be anywhere.
      I believe the intention of this code was to ensure that when running
      completely arbitrary third-party Exec= specifications, we do not
      accidentally end up running a conflicting shell function definition.
      Using 'env' fulfills this goal by entering a new environment context
      with an unmodified environment (we do not make use of env's stated
      purpose of creating a modified enviroment context) and then invoking the
      command using exec(3) rather than a shell.
    • Eli Schwartz's avatar
      remove bashisms from POSIX sh script · 1d580420
      Eli Schwartz authored
      The &> redirection operator is a bash-specific shorthand for the POSIX
      combined redirection operators >/dev/null 2>&1 and must not be used in
      portable scripts under any circumstances.
    • Eli Schwartz's avatar
      kill off whitespace errors · 3eaf2f3c
      Eli Schwartz authored
      Trailing whitespace makes my .vimrc unhappy, and serves no useful
      purpose. Remove them now, so they don't intermingle with followup commit
  3. 05 Aug, 2021 1 commit
  4. 13 Nov, 2020 1 commit
  5. 20 Feb, 2020 1 commit
  6. 13 Apr, 2019 1 commit
    • Martin Puppe's avatar
      xdg-mime: return correct exit code for GNOME · 0547886c
      Martin Puppe authored
      If the desktop environment was GNOME and none of the commands for
      detecting the MIME type of a file was available, xdg-mime used to return
      exit code 0 even though it failed. The man page says it should return
      exit code 3. This commit fixes the issue.
      I have considered returning exit code 4 instead since that is what would
      be returned if info_kde() or info_generic() fail to find a tool for MIME
      type detection. But I have decided to implement the behavior as
      specified in the man page.
      The exit code of an if construct is 0 if no condition
      tested true [^1]. The author of the original code probably was not aware
      of this.
      [^1]: https://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html#Conditional-Constructs
  7. 01 Apr, 2019 6 commits
  8. 27 Mar, 2019 2 commits
  9. 26 Mar, 2019 1 commit
  10. 19 Mar, 2019 2 commits
  11. 12 Jan, 2019 1 commit
    • Richard Tollerton's avatar
      test-lib.sh: run: eat xdg-open's exit code · af7b34a6
      Richard Tollerton authored
      It was observed that t-xdg-open.sh exits after only a fraction of the tests have
      been run, e.g.
      ASSERTION FAILED: expected command to be run: gio open http://www.freedesktop.org/
      ASSERTION FAILED: expected command to be run: gio open http://www.freedesktop.org/
        - opens a URL with gvfs-open if gio open is missing in GNOME 3, GNOME 2, and Cinnamon
      gio: http://www.freedesktop.org/
      : Operation not supported
      make: *** [Makefile:21: t-xdg-open.sh] Error 4
      Given that some tests are failing on my machine (likely because of the
      peculiarities of my archlinux install), the root cause is `set -e`. The nonzero
      exit code returned by xdg-open gets returned by run(), which is also returned by
      e.g. test_open_url(), which causes the script to exit immediately.
      All test passes/failures at present are being defined by explicit assertions,
      not by exit codes, and it seems at least plausible that some xdg-open calls are
      meant to fail. So rather than report the nonzero error code, just ignore it, and
      trust that the assertions determine the results.
      Signed-off-by: Richard Tollerton's avatarRichard Tollerton <rich.tollerton@ni.com>
  12. 10 Jan, 2019 1 commit
  13. 13 Sep, 2018 1 commit
  14. 11 Sep, 2018 1 commit
  15. 24 May, 2018 1 commit
  16. 13 May, 2018 1 commit
  17. 10 May, 2018 4 commits
  18. 09 May, 2018 2 commits
  19. 02 May, 2018 1 commit
  20. 27 Feb, 2018 2 commits
    • Rex Dieter's avatar
      Changelog for prior commit · 13963edd
      Rex Dieter authored
    • Luís Pereira's avatar
      xdg-open: Fixes LXQt behavior · 7d4360c6
      Luís Pereira authored and Rex Dieter's avatar Rex Dieter committed
      Commit 6387086e introduced LXQt support.
      In xdg-open it assumed that LXQt and LXDE are the same. They aren't. LXQt
      does not have pcmanfm, it has pcmanfm-qt.
      LXQt doesn't want to rely on pcmamfm-qt to handle it: LXQt is very modular
      and can be deployed without pcmanfm-qt.
      open_generic() works for LXQt but it depends on mimeopen and mimetype. In
      the future we will want, for sure, to drop those dependencies. That's the
      reason for the existence of open_lxqt().
  21. 18 Dec, 2017 1 commit
  22. 29 Nov, 2017 3 commits
  23. 08 May, 2017 1 commit