From b23856722cb89cf3c0044153369d7f201913f951 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Thu, 1 Aug 2024 20:01:04 +0200 Subject: [PATCH 1/2] fix weird bug with some flags sometimes crashing (on even numbers) --- other/scripts/desktop/shell-startup.nu | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/other/scripts/desktop/shell-startup.nu b/other/scripts/desktop/shell-startup.nu index d4b9a51..245927b 100644 --- a/other/scripts/desktop/shell-startup.nu +++ b/other/scripts/desktop/shell-startup.nu @@ -17,14 +17,14 @@ def flag [ mut cols = $colors | wrap color | insert width $col_size | flatten; let last = ($colors | length) - 1; - $cols = if not ($rest | is even) { + if not ($rest | is even) { $rest = $rest - 1; - (if not ($colors | length | is even) { + $cols = (if not ($colors | length | is even) { $cols | update (($colors | length) / 2 | math floor) { $in | update width {|w| ($w.width + 1)}} } else { $cols | update $last { $in | update width {|w| ($w.width + 1)}} - }) + }); }; std assert ($rest | is even); From 3d2719f2f7dbba1ad806734228271394116bcb5e Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Thu, 1 Aug 2024 20:14:38 +0200 Subject: [PATCH 2/2] add TODO --- other/scripts/desktop/shell-startup.nu | 2 ++ 1 file changed, 2 insertions(+) diff --git a/other/scripts/desktop/shell-startup.nu b/other/scripts/desktop/shell-startup.nu index 245927b..af5e93a 100644 --- a/other/scripts/desktop/shell-startup.nu +++ b/other/scripts/desktop/shell-startup.nu @@ -2,6 +2,8 @@ def "is even" [] { $in mod 2 == 0 } +# TODO: flag stuff as module to be used in other stuff in shell + const TRANS = [ 5BCEFA F5A9B8 FFFFFF F5A9B8 5BCEFA ]; const LESBIAN = [ D52D00 EF7627 FF9A56 FFFFFF D162A4 B55690 A30262 ]; const ENBY = [ FCF434 FFFFFF 9C59D1 2C2C2C ];