Age | Commit message (Collapse) | Author | Files | Lines |
|
Adds a script for developers that builds a given xdg-util using the Makefile, shellchecks it and calculates the lines in the source file.
This should allow easier shellchecking of the final output and avoid getting used to false positives.
This also disables SC3043 (`local <name>` statements without an declaration) which causes more noise than necessary.
|
|
|
|
|
|
the new quotes
|
|
|
|
|
|
|
|
|
|
This replaces calls to `realpath -f` which isn't available on all shells. (fix #66)
|
|
|
|
|
|
Original patch by ssk-wh
Rebased and shellchecked (quoting)
|
|
This fixes autotests with Dash prior 0.5.11 and Bash of any version.
See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=975228
Original patch by Nicolas Guriev.
Rebased and updated.
|
|
will be attributed correctly
|
|
and runners
|
|
|
|
* Replace backticks with `"$(`
* Quote variables and replacements (non un-quotes seemed intentional)
* Moved `local` variable definitions to their own lines so they don't clash with value assignment
* fixed formattting in `open_envvar`
Not fixed:
* SC3037 (warning): In POSIX sh, echo flags are undefined.
(Fixing those is a bit more involved)
|
|
Guriev)
See also: https://www.gnu.org/software/autoconf/manual/autoconf-2.70/html_node/Changed-Directory-Variables.html
(cherry picked from commit 14bc86bc0b329346c36a05c08320b27b85cda14b)
(Rebased from b0c38f04da30f6829f88bbeede903853ffd80430 by Slatian)
|
|
* Replace legacy backticks with "$(
* Fix ``for `echo $a | sed 's/:/ /g'`; …`` antipattern usinf IFS=:
* Quote a lot of filepaths to avoid time of check time od use inconsistencies
* Quote all other use of variables
* for none of them not-quoting seemend intentional
* even where it just "doen't hurt"
* except for `for` loops 😉
* disable checks for mispelled variables where the spelling is intentional
* move the `local` bashisms to thwir own lines so that when a posix shell trips over them the script shouldn't fail because of them.
Did *not* fix:
* local is posix "incompatible" (SC3043) (but worked around it)
* SC2086 (info): Double quote to prevent globbing and word splitting. For `$xdg_redirect_output` pattern.
|
|
|
|
* Added a .shellcheckrc file
* Replace legacy backticks with `"$(`
* Comment where `read -r` is inteletially placed and where the `-r` is omitted.
* Add quotes where they don't hurt
* fix iterating over user and system_dirs by using IFS properly in `open_generic_xdg_mime`
* Moved some `local` declarations out of the way
* Remove unused variable from `open_envvar`
* Disable checks fir the scary looking part of `open_envvar`
* Removed unneccessary variable in `open_flatpak`
*
Did *not* fix:
* `local` is posix "incompatible"
|
|
with an always quote, unless intended policy
except for SC2268 (x prefixes)
|
|
Now it shouldn't require a change for every KDE major version.
|
|
* Converted the READMEs to Markdown
* Added useful links (like the one to the [DocBook guide](https://tdg.docbook.org/))
* Updated obviously out of date content
* Added some Notes
* Added test byproducts to `tests/.gitignore`
My hope is that this makes the xdg-utils seem less like a dead project and lowers the barrier for contributing.
|
|
|
|
prefer the modern setting and if that is not available fall back to the
legacy setting. this ensures that clients can correctly identify the
"modern" default browser rather than the legacy one (there is
opportunity for disagreement between the two settings because of the
defect fixed in d11b33ec7f24cfb1546f6b459611d440013bdc72)
|
|
and possible workarounds.
|
|
|
|
|
|
* which was replaced with command -v
|
|
The function was added in 8c2615d3 to be used by open_generic
but that one does the filetype querying itself now.
|
|
|
|
correctly.
This will:
* make sure that applications that indicate that they don't support URIs don't get started when opening URIs
* when handling a file:// url, make sure tht applications that supports URIs will get the file URI
Fixes: #169
|
|
This is because commit: c22a09fc
Fixes issue: #227
|
|
|
|
The issue was raised in [1]. The earlier fix [2] makes xdg-mime always
pick the first item from a list, and that differs from the standard [3].
> If the application is no longer installed, the next application in the
> list is attempted, and so on.
A latter fix [4] implements the standard-compliant behavior, while it
does not actually work until [2] is reverted.
[1] https://bugs.freedesktop.org/show_bug.cgi?id=44163
[2] https://gitlab.freedesktop.org/xdg/xdg-utils/-/commit/a5ec775d7631bf32760acc1c1b54a4905cfdec89
[3] https://specifications.freedesktop.org/mime-apps-spec/1.0.1/ar01s04.html
[4] https://gitlab.freedesktop.org/xdg/xdg-utils/-/commit/1f8e58d51e6fb3f50f59ed2d8265f2f346ac68e6
|
|
|
|
|
|
|
|
|
|
|
|
The LXQt project has developed a CLI mime apps toolset (qtxdg-mat).
LXQt uses the '$desktop-mimeapps.list' file to store the associations and
defaults.
In xdg-settings we use the already existent set_browser_mime() function so
that the fix_local_desktop_file() can be run. set_browser_mime calls uses
xdg-mime to set the protocols, so LXQt desktop aware mimeapps.list is
properly taken care.
|
|
'kreadconfig' is a KDE4 executable. The program is called 'kreadconfig5' in
KDE Frameworks 5.xx.
|
|
!55 changed the behavior of the generic implementation to
background processes to make the behavior more similar to the
other implementations. However as per #224 this leads to a
workflow break for some users so given that change was only done
for consistency we will revert it for now.
Fixes: #224
|
|
|
|
Removed code that was
1. redundant since xdg-open already tries different browsers
2. broken (if you set BROWSER="firefox %s", it will not wordsplit
correctly but try to run an executable named "firefox mailto")
3. potentially dangerous:
https://bugs.freedesktop.org/show_bug.cgi?id=103807
|
|
Some systems, such as Ubuntu, use DASH to provide `/bin/sh` instead of BASH.
This means that we need to use POSIX compliant shell scripting as BASHisms are
unsupported in DASH. There are two BASH variable substition instances within
the code of `xdg-settings.in` that cause KDE users to be unable to find the
current web browser because the script dies when hitting this unsupported code.
DASH also doesn't support the BASHism that allows `==` inside `[]` tests.
* Replace `${variable:0:1}` with `printf`-based equivalent.
* Replace use of `==` with `=`
Signed-off-by: Lucy Llewellyn <lucyllewy@ubuntu.com>
|
|
|
|
|
|
This was not correctly implemented, and perhaps no-one noticed because until
now it was only used for KDE 3. But now GNOME 3 needs it!
The main problem is that, like the gnome-screensaver method, inhibiting the
screensaver requires a long-held DBus connection.
So, reuse the embedded Perl script from screensaver_gnome_screensaver,
parametrized suitably, and implement the ‘suspend’ and ‘resume’ commands for
freedesktop in the same way as for gnome-screensaver.
Also rewrite the code for ‘reset’, which was incorrectly calling
‘UnInhibit’, which does not necessarily disable the screensaver (quite the
reverse, possibly!). Instead, call ‘SimulateUserActivity’, as for the
gnome-screensaver case.
Note that on a current GNOME system (e.g. GNOME 42) some of the DBus
freedesktop endpoints are advertised but unimplemented; xdg-screensaver will
give an error for these cases.
|