summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-02-08Better shellcheck toolingHEADmasterSlatian2-0/+159
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.
2024-02-06Use 1.2.99 for the Version in the development branch while not releasing.Simon Lees1-2/+1
2024-02-06Update ChangeLogSimon Lees1-0/+7
2024-02-03Adapt the script the places the _MANUALPAGE and _USAGE sections to handle ↵Slatian1-4/+4
the new quotes
2024-02-03Quote all _MANUALPAGE and _USAGE openers to interpret them as literalsSlatian13-26/+26
2024-02-03Made slightly misleading command example easier to understand. (Hopefully)Slatian1-1/+1
2024-01-30xdg-icon-resource: unbreak syntax by removing stray grave accentHarald Sitter1-1/+1
2024-01-30Update ChangeLog with latest changesv1.2.0Simon Lees1-0/+19
2024-01-23Add xdg-realpath to better handle Canonicalizing filenamesSlatian12-12/+345
This replaces calls to `realpath -f` which isn't available on all shells. (fix #66)
2024-01-23Use url.dll as url opener on wslSlatian1-5/+6
2023-12-04Fixed missing `$` for variableSlatian1-1/+1
2023-12-04Add support for deeping-desktop browser setting in xdg-settings.Slatian1-0/+42
Original patch by ssk-wh Rebased and shellchecked (quoting)
2023-12-03Fix quoting issues in t-xdg-open.shSlatian1-28/+32
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.
2023-11-27Added a reporting issues section to xdg-open in the hopes that more issues ↵Slatian1-0/+18
will be attributed correctly
2023-11-27Added a secutity note on xdg-mime default to warn against confusing openers ↵Slatian1-0/+6
and runners
2023-11-27Added paragraph explaining the wiered return behaviour of xdg-openSlatian1-0/+3
2023-11-27Shellchecked xdg-email:Slatian1-43/+45
* 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)
2023-11-27Fix config.status warning about ignored --datarootdir setting (by Nicholas ↵Slatian2-1/+1
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)
2023-11-16Shellchecked xdg-mime.in:Slatian1-53/+78
* 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.
2023-11-15Update ChangeLog with latest changesSimon Lees1-0/+23
2023-11-15Shellchecked xdg-openSlatian2-19/+42
* 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"
2023-11-15Shellchecked xdg-utils-common.inSlatian1-35/+41
with an always quote, unless intended policy except for SC2268 (x prefixes)
2023-11-14xdg-mime: Create a generic implementation for KDESlatian1-5/+19
Now it shouldn't require a change for every KDE major version.
2023-11-14Markdown and updated READMEs and gitignoreSlatian7-241/+332
* 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.
2023-10-29Document quirks with xdg-mime for query file and query defaultSlatian1-11/+25
2023-10-25xdg-settings: read KDE browser settings the right way aroundHarald Sitter1-3/+4
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)
2023-10-11Documented xdg-opens inablity to handle minuses at the start of arguments ↵Slatian1-2/+10
and possible workarounds.
2023-10-11Reapply LC_ALL fix from !84Slatian1-1/+1
2023-10-11Deduplicate URL recognitionSlatian1-3/+7
2023-10-11Apply patch* from issue #230, thanks Najib IdrissiSlatian2-4/+8
* which was replaced with command -v
2023-10-10The open_generic_xdg_file_mime function is never called, removed it.Slatian1-6/+0
The function was added in 8c2615d3 to be used by open_generic but that one does the filetype querying itself now.
2023-10-09Make URI matching specification compliant by setting LC_ALL=C for grepSlatian1-2/+2
2023-10-09Make sure URIs/URLs get passed to the correct applications and get passed ↵Slatian1-7/+22
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
2023-10-09Remove no longer needed default BROWSER logic from xdg-emailSlatian1-8/+0
This is because commit: c22a09fc Fixes issue: #227
2023-10-09Applied fix suggested in issue #145 for xdg-mime synopsisSlatian1-3/+2
2023-09-29xdg-mime: actually handle lists in mimeapps.list correctlyChih-Hsuan Yen1-1/+1
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
2023-09-29Set Version to 1.2.0-beta1v1.2.0-beta1Simon Lees1-1/+1
2023-09-29Update Changes and Release NotesSimon Lees2-0/+120
2023-09-28fix(xdg-open): handle spaces in .desktop file pathAlexandre Abrioux2-6/+6
2023-09-26Quote Browser variable to avod unintentional code executionSlatian1-1/+1
2023-09-25Add missing result gatheringSlatian1-0/+1
2023-09-21Enhance LXQt Desktop Enviromment supportLuís Pereira4-6/+202
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.
2023-09-11xdg-terminal: don't run 'kreadconfig' if KDE_SESSION_VERSION is >= 5Christophe Giboudeaux1-1/+14
'kreadconfig' is a KDE4 executable. The program is called 'kreadconfig5' in KDE Frameworks 5.xx.
2023-08-31Revert putting process in background from !55Simon Lees1-1/+1
!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
2023-08-30shellcheck fixes; make xdg-mime DASH-compatibleLennard Hofmann10-70/+59
2023-08-22xdg-email: do not run BROWSER if xdg-open failedLennard Hofmann1-25/+1
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
2023-08-14Ensure POSIX-compliant shell scripting to support DASHDani Llewellyn1-2/+2
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>
2023-08-12*: spelling fixesVille Skyttä9-12/+12
2023-08-09Fix set_url_scheme_handler_gnome3 to not associate text/html handlerJoe Mou1-1/+0
2023-08-09xdg-screensaver: fix the freedesktop screensaverReuben Thomas1-46/+25
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.