diff options
| author | tv <tv@krebsco.de> | 2025-07-17 11:43:42 +0200 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2025-07-17 11:49:52 +0200 |
| commit | b2bc4253dc57a42b9a05aa1feea878cde24d2f2b (patch) | |
| tree | 309d45e2ded6cbb07880131729225302b544b689 /pkgs | |
| parent | 0e60e214916ff2c6e6f3806df6dd18353b8a47c3 (diff) | |
alacritty-tv: check for --singleton at the top
Diffstat (limited to 'pkgs')
| -rw-r--r-- | pkgs/simple/alacritty-tv.nix | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/pkgs/simple/alacritty-tv.nix b/pkgs/simple/alacritty-tv.nix index 0d2fe59..86ca10f 100644 --- a/pkgs/simple/alacritty-tv.nix +++ b/pkgs/simple/alacritty-tv.nix @@ -12,11 +12,21 @@ pkgs.symlinkJoin { set -efu profile=default - case ''${1-} in - --profile=*) - profile=''${1#--profile=} - shift - esac + singleton= + while :; do + case ''${1-} in + --profile=*) + profile=''${1#--profile=} + shift + ;; + --singleton) + singleton=1 + shift + ;; + *) + break + esac + done config=/etc/alacritty/$profile.toml @@ -31,17 +41,13 @@ pkgs.symlinkJoin { ${pkgs.jq}/bin/jq .device_scale_factor ) - case ''${1-} in - --singleton) - shift - if ! ${pkgs.alacritty}/bin/alacritty --config-file "$config" msg create-window "$@"; then - ${pkgs.alacritty}/bin/alacritty --config-file "$config" "$@" & - fi - ;; - *) - exec ${pkgs.alacritty}/bin/alacritty --config-file "$config" "$@" - ;; - esac + if test "$singleton" = 1; then + if ! ${pkgs.alacritty}/bin/alacritty --config-file "$config" msg create-window "$@"; then + ${pkgs.alacritty}/bin/alacritty --config-file "$config" "$@" & + fi + else + exec ${pkgs.alacritty}/bin/alacritty --config-file "$config" "$@" + fi '') pkgs.alacritty ]; |
