diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2025-01-18 19:00:03 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2025-01-18 19:00:03 +0100 |
| commit | 3eb4d872f7157b67691fb5a98e2cf53f716c5457 (patch) | |
| tree | f8a994a39e359e2620ff01baa2e1096f7e0da633 /guides/sysadmin/apps-demo | |
| parent | 9398b60e08f07022cf02bb290f36718b1c744eae (diff) | |
| download | memory-leaks-3eb4d872f7157b67691fb5a98e2cf53f716c5457.tar.xz | |
Resume gratuitous shuffling
Diffstat (limited to 'guides/sysadmin/apps-demo')
| -rw-r--r-- | guides/sysadmin/apps-demo/.gitignore | 2 | ||||
| -rw-r--r-- | guides/sysadmin/apps-demo/activate | 34 | ||||
| -rwxr-xr-x | guides/sysadmin/apps-demo/napp/bin/napp | 3 | ||||
| -rwxr-xr-x | guides/sysadmin/apps-demo/napp/share/doc.sh | 18 | ||||
| -rw-r--r-- | guides/sysadmin/apps-demo/napp/share/napp.md | 3 |
5 files changed, 60 insertions, 0 deletions
diff --git a/guides/sysadmin/apps-demo/.gitignore b/guides/sysadmin/apps-demo/.gitignore new file mode 100644 index 0000000..111d960 --- /dev/null +++ b/guides/sysadmin/apps-demo/.gitignore @@ -0,0 +1,2 @@ +man +info diff --git a/guides/sysadmin/apps-demo/activate b/guides/sysadmin/apps-demo/activate new file mode 100644 index 0000000..b8c9138 --- /dev/null +++ b/guides/sysadmin/apps-demo/activate @@ -0,0 +1,34 @@ +# Hey Emacs; this is a -*- shell-script -*-. +# Hopefully invoked by bash 🤞 + +_apps_dir=$(realpath --no-symlinks $(dirname ${BASH_SOURCE})) + +_apps_PATH=$( + shopt -s nullglob + bins=( "${_apps_dir}"/*/bin ) + IFS=: eval 'echo "${bins[*]}"' +) +export PATH=${_apps_PATH}:${PATH} + +_apps_XDG_DATA_DIRS=$( + shopt -s nullglob + # We could set globstar and let Bash loose, searching the depths + # of _apps_dir for + # **/{applications/*.desktop,systemd/user/*.service} + # but it seems like asking for trouble. Make some assumptions + # about where applications typically dump their XDG-related files. + datadirs=($( + { + for dkentry in "${_apps_dir}"/*/share/applications/*.desktop + do + echo ${dkentry%/applications/*.desktop} + done + for unit in "${_apps_dir}"/*/lib*/systemd/user/*.service + do + echo ${unit%/systemd/user/*.service} + done + } | sort -u + )) + IFS=: eval 'echo "${datadirs[*]}"' +) +export XDG_DATA_DIRS="${_apps_XDG_DATA_DIRS}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" diff --git a/guides/sysadmin/apps-demo/napp/bin/napp b/guides/sysadmin/apps-demo/napp/bin/napp new file mode 100755 index 0000000..1bd6e9f --- /dev/null +++ b/guides/sysadmin/apps-demo/napp/bin/napp @@ -0,0 +1,3 @@ +#!/bin/bash + +echo 😴 diff --git a/guides/sysadmin/apps-demo/napp/share/doc.sh b/guides/sysadmin/apps-demo/napp/share/doc.sh new file mode 100755 index 0000000..e7c8eb1 --- /dev/null +++ b/guides/sysadmin/apps-demo/napp/share/doc.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -eux + +mkdir -p info man/man1 + +pandoc napp.md -s -o man/man1/napp.1 +pandoc napp.md -s -o info/napp.texi \ + -H <(cat <<EOF +@dircategory Software development +@direntry +* Napp: (napp). +* Napp node: (napp)napp +@end direntry +EOF +) +makeinfo info/napp.texi -o info +install-info info/napp.info info/dir diff --git a/guides/sysadmin/apps-demo/napp/share/napp.md b/guides/sysadmin/apps-demo/napp/share/napp.md new file mode 100644 index 0000000..ce841df --- /dev/null +++ b/guides/sysadmin/apps-demo/napp/share/napp.md @@ -0,0 +1,3 @@ +# napp + +You need it. |
