summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/simple/alacritty-tv.nix38
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
];