From 6867488a4a31a1281c8853ebab1ddc8d98a8a266 Mon Sep 17 00:00:00 2001 From: relikd Date: Sat, 7 Feb 2026 12:25:08 +0100 Subject: [PATCH] feat: ignore items which start with underscore --- res/examples/Dyn [dyn] | 4 ++-- res/examples/{Dyn-icon.png => _icons/draw.png} | Bin src/main.swift | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) rename res/examples/{Dyn-icon.png => _icons/draw.png} (100%) diff --git a/res/examples/Dyn [dyn] b/res/examples/Dyn [dyn] index 09abd20..b17fa55 100755 --- a/res/examples/Dyn [dyn] +++ b/res/examples/Dyn [dyn] @@ -21,8 +21,8 @@ case $ACTION in esac;; icon) case $ITEM in - "") cat Dyn-icon.png;; # Main menu icon - "Item 1") cat Dyn-icon.png;; + "") cat _icons/draw.png;; # Main menu icon + "Item 1") cat _icons/draw.png;; # relative to root scripts dir *Status) status green;; esac;; *) diff --git a/res/examples/Dyn-icon.png b/res/examples/_icons/draw.png similarity index 100% rename from res/examples/Dyn-icon.png rename to res/examples/_icons/draw.png diff --git a/src/main.swift b/src/main.swift index 8ba1216..7d33c62 100755 --- a/src/main.swift +++ b/src/main.swift @@ -248,7 +248,9 @@ func listDir(_ path: String) -> [Entry] { } // else: static menu for url in (try? FileManager.default.contentsOfDirectory(at: target, includingPropertiesForKeys: [.isDirectoryKey, .isExecutableKey])) ?? [] { - if url.hasDirectoryPath || FileManager.default.isExecutableFile(atPath: url.path) { + if url.hasDirectoryPath || FileManager.default.isExecutableFile(atPath: url.path), + !url.lastPathComponent.hasPrefix("_") + { rv.append(Entry(url)) } }