commit 3035fca2c9943b1545f6d6b90d424e931ee3c8a0
parent 8ab277ebc0f9a8a1da0c58c0d366c3e996b63504
Author: Peter <peter@minskio.co.uk>
Date: Fri, 2 Oct 2026 09:38:54 +0100
This script has been superseded by vim plugins
Sorting and lowercase are in the vim config now
Diffstat:
4 files changed, 0 insertions(+), 92 deletions(-)
diff --git a/machines/artemis.nix b/machines/artemis.nix
@@ -27,7 +27,6 @@
../scripts/notes.nix
../scripts/restic.nix
../scripts/stagit-generate.nix
- ../scripts/startpage-sort.nix
../scripts/taudiobooker.nix
# sort:end
];
diff --git a/machines/atlas.nix b/machines/atlas.nix
@@ -36,7 +36,6 @@
../scripts/power-menu.nix
../scripts/restic.nix
../scripts/seedy.nix
- ../scripts/startpage-sort.nix
../scripts/taudiobooker.nix
../scripts/vidyaplace.nix
../scripts/watchedlist.nix
diff --git a/machines/ilias.nix b/machines/ilias.nix
@@ -47,7 +47,6 @@
../scripts/phone-dump.nix
../scripts/restic.nix
../scripts/seedy.nix
- ../scripts/startpage-sort.nix
../scripts/tank-log.nix
../scripts/tank-sort.nix
../scripts/taudiobooker.nix
diff --git a/scripts/startpage-sort.nix b/scripts/startpage-sort.nix
@@ -1,89 +0,0 @@
-{pkgs, ...}: let
- startpage-sort = pkgs.writeShellScriptBin "startpage-sort" ''
- set -euo pipefail
-
- source_file="$HOME/vault/src/startpage/index.html"
- tmp_file="$(mktemp)"
- trap 'rm -f "$tmp_file"' EXIT
-
- before_sum="$(sha256sum "$source_file" | cut -d" " -f1)"
-
- awk '
- function ci_cmp(i1, v1, i2, v2, a, b) {
- a = tolower(v1)
- b = tolower(v2)
- return (a < b ? -1 : a > b ? 1 : 0)
- }
-
- BEGIN {
- PROCINFO["sorted_in"] = "ci_cmp"
- in_bm = 0
- in_cm = 0
- nb = 0
- nc = 0
- }
-
- # Start of bookmarks block
- /^ const bookmarks = \[$/ {
- in_bm = 1
- print
- next
- }
-
- # End of bookmarks block
- in_bm && /^\s+\];$/ {
- for (i in bookmarks) print bookmarks[i]
- print
- in_bm = 0
- delete bookmarks
- next
- }
-
- # Inside bookmarks block
- in_bm {
- bookmarks[$0] = $0
- next
- }
-
- # Start of commandMap block
- /^ const commandMap = {$/ {
- in_cm = 1
- print
- next
- }
-
- # End of commandMap block
- in_cm && /^\s+\};$/ {
- for (i in commands) print commands[i]
- print
- in_cm = 0
- delete commands
- next
- }
-
- # Inside commandMap block
- in_cm {
- commands[$0] = $0
- next
- }
-
- # Default
- {
- print
- }
- ' "$source_file" > "$tmp_file"
-
- mv "$tmp_file" "$source_file"
- trap - EXIT
-
- after_sum="$(sha256sum "$source_file" | cut -d" " -f1)"
-
- if [ "$before_sum" != "$after_sum" ]; then
- echo "startpage index.html was reordered"
- else
- echo "startpage index.html already sorted, no changes made"
- fi
- '';
-in {
- environment.systemPackages = [startpage-sort];
-}