From 3eb4d872f7157b67691fb5a98e2cf53f716c5457 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sat, 18 Jan 2025 19:00:03 +0100 Subject: Resume gratuitous shuffling --- .../setups/operating-systems/apps-demo/.gitignore | 2 - guides/setups/operating-systems/apps-demo/activate | 34 ---- .../operating-systems/apps-demo/napp/bin/napp | 3 - .../operating-systems/apps-demo/napp/share/doc.sh | 18 -- .../operating-systems/apps-demo/napp/share/napp.md | 3 - guides/setups/operating-systems/apps.org | 186 --------------------- guides/setups/operating-systems/console.org | 19 --- guides/setups/operating-systems/opensuse.org | 29 ---- 8 files changed, 294 deletions(-) delete mode 100644 guides/setups/operating-systems/apps-demo/.gitignore delete mode 100644 guides/setups/operating-systems/apps-demo/activate delete mode 100755 guides/setups/operating-systems/apps-demo/napp/bin/napp delete mode 100755 guides/setups/operating-systems/apps-demo/napp/share/doc.sh delete mode 100644 guides/setups/operating-systems/apps-demo/napp/share/napp.md delete mode 100644 guides/setups/operating-systems/apps.org delete mode 100644 guides/setups/operating-systems/console.org delete mode 100644 guides/setups/operating-systems/opensuse.org (limited to 'guides/setups/operating-systems') diff --git a/guides/setups/operating-systems/apps-demo/.gitignore b/guides/setups/operating-systems/apps-demo/.gitignore deleted file mode 100644 index 111d960..0000000 --- a/guides/setups/operating-systems/apps-demo/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -man -info diff --git a/guides/setups/operating-systems/apps-demo/activate b/guides/setups/operating-systems/apps-demo/activate deleted file mode 100644 index b8c9138..0000000 --- a/guides/setups/operating-systems/apps-demo/activate +++ /dev/null @@ -1,34 +0,0 @@ -# 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/setups/operating-systems/apps-demo/napp/bin/napp b/guides/setups/operating-systems/apps-demo/napp/bin/napp deleted file mode 100755 index 1bd6e9f..0000000 --- a/guides/setups/operating-systems/apps-demo/napp/bin/napp +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -echo 😴 diff --git a/guides/setups/operating-systems/apps-demo/napp/share/doc.sh b/guides/setups/operating-systems/apps-demo/napp/share/doc.sh deleted file mode 100755 index e7c8eb1..0000000 --- a/guides/setups/operating-systems/apps-demo/napp/share/doc.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/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 < ~/.infokey -#var -# Disable INFODIR; fall back to DEFAULT_INFOPATH which prioritizes -# program PATH over /usr/share/info. -infopath-no-defaults=On -EOF -#+end_src - -* DONE systemd services -=systemd.unit(5)= § "User Unit Search Path" mentions a couple of -variables that we could append: - -- =$XDG_CONFIG_DIRS/systemd/user/*= -- =$XDG_DATA_DIRS/systemd/user/*= - -And: - -#+begin_quote -When the variable =$SYSTEMD_UNIT_PATH= is set, the contents of this -variable overrides the unit load path. If =$SYSTEMD_UNIT_PATH= ends -with an empty component (=:=), the usual unit load path will be -appended to the contents of the variable. -#+end_quote - -So we could either: - -1. find the directory 𝒟 where an app tucks =systemd/user= in its - installation tree, and append 𝒟 to one of the XDG variables, -2. find the directory where an app tucks its =.service= files, and - append that directory to =SYSTEMD_UNIT_PATH=, keeping a final - colon. - -(1) could feed multiple birds with one scone: in particular, -=XDG_DATA_DIRS= is used for other purposes (see § Desktop entry -files). Serendipitously, [[https://github.com/systemd/systemd/blob/1d87a00a951dca801c8ccd79c1460fa91efa7dce/src/basic/path-lookup.c#L147][the systemd sources]] suggest =DATA= over -=CONFIG= for our purposes: - -#+begin_src c - /* Implement the mechanisms defined in - * - * https://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html - * - * We look in both the config and the data dirs because we - * want to encourage that distributors ship their unit files - * as data, and allow overriding as configuration. - */ -#+end_src - -* DONE Desktop entry files -The Freedesktop [[https://specifications.freedesktop.org/menu-spec/menu-spec-latest.html][Desktop Menu]] and [[https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html][Desktop Entry]] specs spell out how -=XDG_DATA_DIRS= will be searched for =applications/*.desktop= files. - -* TODO ~bash~ completions - -* Putting it all together -Presenting [[./apps-demo/activate][=~/apps/activate=]], to be sourced from =~/.profile=: - -#+INCLUDE: "apps-demo/activate" src sh - -* Resources -** [[https://nullprogram.com/blog/2017/06/19/][nullprogram.com]] — Building and Installing Software in $HOME -Explains how to set things up so that one can use =~/.local= as a -first-class citizen for applications, libraries and development -resources (headers, pkg-config, manpages). - -** [[https://specifications.freedesktop.org][specifications.freedesktop.org]] — Freedesktop.org Specifications -Hosts the specifications for the behavior and environment variables -most GNU/Linux distros (that I have experience with) adhere to, e.g. - -- the [[https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html][Base Directory spec]] :: defines the various - =XDG_*_@(HOME|DIR|DIRS)= variables referenced here; -- the [[https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html][Desktop Entry spec]] :: explains the significance of a desktop - file's filename with respect to its position within =XDG_DATA_DIRS=; -- the [[https://specifications.freedesktop.org/menu-spec/menu-spec-latest.html][Desktop Menu spec]] :: defines the expected file locations for - desktop files (and more) with respect to XDG base directories. - -** [[https://wiki.archlinux.org/title/Environment_variables#Per_user][wiki.archlinux.org]] — Environment variables § Per user - ArchWiki -A thorough overview of the myriad of ways users can amend environment -variables, as examined in § PATH. diff --git a/guides/setups/operating-systems/console.org b/guides/setups/operating-systems/console.org deleted file mode 100644 index a6839c1..0000000 --- a/guides/setups/operating-systems/console.org +++ /dev/null @@ -1,19 +0,0 @@ -* Keyboard settings -Debian's =console-setup= package provides =setupcon=, a neat utility -that reads XKB settings from =/etc/default/keyboard= and translates -them to whatever format the Linux console understands. - -To get something similar to =ctrl:nocaps= on distros that do not -feature this utility: -#+begin_src sh -$ localectl | grep "VC Keymap" # To spot the current KEYMAP. -$ sudo mkdir -p /usr/local/share/kbd/keymaps -# KEYMAPS_DIR: depending on the distro: -# - /usr/share/kbd/keymaps/xkb -# - /lib/kbd/keymaps/xkb -$ gunzip --stdout ${KEYMAPS_DIR}/${KEYMAP}.map.gz | - sed 's/^keycode 58 = .*$/keycode 58 = Control/' | - sudo tee /usr/local/share/kbd/keymaps/${KEYMAP}-nocaps.map -# In /etc/vconsole.conf, change KEYMAP to ^this^ absolute filename. -# Reboot. -#+end_src diff --git a/guides/setups/operating-systems/opensuse.org b/guides/setups/operating-systems/opensuse.org deleted file mode 100644 index 5ea173c..0000000 --- a/guides/setups/operating-systems/opensuse.org +++ /dev/null @@ -1,29 +0,0 @@ -* Packages -… that took me more than one minute to find. -** spell-checking -- hunspell -- myspell-fr_FR -* HOWTO -** Open ports -#+begin_src sh -$ firewall-cmd --add-port=8000/tcp -$ firewall-cmd --add-service=mdns -#+end_src -To make permanent, either: -- run the command with =--permanent=, and restart ~firewalld~ for - immediate application, -- run the command /a second time/ with =--permanent=, -- run ~firewall-cmd --runtime-to-permanent~. -** Auto-mount second disk under =$HOME/media= -#+begin_example -$ lsblk --fs -[…] -nvme0n1 -└─nvme0n1p1 xfs […UUID…] -$ sudo $edit /etc/fstab -[… add: -UUID=[…UUID…] […$HOME…]/media xfs user,exec 0 0 -…] -$ mkdir ~/media -$ mount ~/media -#+end_example -- cgit v1.2.3