From d732b8e68412e6ab76aaef7b2ec8c14ac41c7332 Mon Sep 17 00:00:00 2001
From: Jens Nolte <git@queezle.net>
Date: Fri, 19 Nov 2021 04:02:21 +0100
Subject: [PATCH] Add backup terminal, move more software to primary terminal
 command

---
 modules/sway/config.nix | 10 +++++-----
 modules/terminal.nix    | 16 ++++++++++++++--
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/modules/sway/config.nix b/modules/sway/config.nix
index 3f4b86d..2c61a80 100644
--- a/modules/sway/config.nix
+++ b/modules/sway/config.nix
@@ -45,7 +45,7 @@ set $wallpaper ${config.queezle.sway.wallpaper}
 set $lockscreen ${config.queezle.sway.lockscreen}
 
 set $terminal terminal
-set $terminal_client footclient
+set $terminal2 terminal2
 
 set $workspace_q 0:q
 set $workspace_irc 11:irc
@@ -236,7 +236,7 @@ bindsym $mod+Shift+asciicircum move container to workspace $workspace_q
 # start a terminal
 bindsym $mod+Return exec $terminal
 bindsym $mod+Shift+Return exec cool-retro-term --fullscreen --profile "Default Amber"
-bindsym $mod+Alt+Return exec footclient
+bindsym $mod+Alt+Return exec $terminal2
 
 # start program launcher
 bindsym $mod+Tab exec launcher
@@ -247,10 +247,10 @@ bindsym $mod+Tab exec launcher
 #bindsym $mod+o exec cool-retro-term --fullscreen --profile "Monochrome Green" -e run/edi/edish/edish
 bindsym $mod+o exec cool-retro-term --fullscreen --profile "Monochrome Green" -e ssh edi
 
-# start an ipython terminal
+# start a python terminal
 bindsym $mod+p exec $terminal python
 
-# start an haskel ghci terminal
+# start an haskel ghci terminal (TODO)
 bindsym $mod+Shift+p exec $terminal stack ghci --verbosity warning
 
 # start a browser
@@ -277,7 +277,7 @@ bindsym $mod+Shift+m move container to workspace $workspace_music
 # start spotify instead of mopidy web interface while mopidy is broken
 #bindsym $mod+Ctrl+m workspace $workspace_music; exec chromium --app=http://stargate:6680/iris/#/
 bindsym $mod+Ctrl+m workspace $workspace_music; exec spotify
-bindsym $mod+Alt+m exec $terminal_client pulsemixer
+bindsym $mod+Alt+m exec $terminal pulsemixer
 #bindsym $mod+Ctrl+m workspace $workspace_music; exec ~/run/spotify-singleton
 
 # scratchpad
diff --git a/modules/terminal.nix b/modules/terminal.nix
index 1b0b8bb..d9be7e6 100644
--- a/modules/terminal.nix
+++ b/modules/terminal.nix
@@ -5,16 +5,24 @@ let
   terminal = pkgs.writeScriptBin "terminal" ''
     PROMPT_NO_INITIAL_NEWLINE=1 ${config.queezle.terminal.executable} "$@"
   '';
+  terminal2 = pkgs.writeScriptBin "terminal2" ''
+    PROMPT_NO_INITIAL_NEWLINE=1 ${config.queezle.terminal.alt.executable} "$@"
+  '';
 in
 {
   options = {
     queezle.terminal.enable = mkOption {
       type = types.bool;
       default = false;
-      description = "Install a 'terminal' wrapper script that launches the configured terminal emulator.";
+      description = "Install a 'terminal' and 'terminal2' wrapper script that launches the configured terminal emulator.";
     };
 
     queezle.terminal.executable = mkOption {
+      type = types.path;
+      default = "${pkgs.foot}/bin/footclient";
+    };
+
+    queezle.terminal.alt.executable = mkOption {
       type = types.path;
       default = if config.queezle.terminal.forceSoftwareRenderer then "${pkgs.foot}/bin/foot" else "${pkgs.kitty}/bin/kitty";
     };
@@ -25,6 +33,10 @@ in
     };
   };
   config = mkIf config.queezle.terminal.enable {
-    environment.systemPackages = [ terminal ];
+    environment.systemPackages = [
+      terminal
+      terminal2
+      pkgs.foot
+    ] ++ optional (!config.queezle.terminal.forceSoftwareRenderer) pkgs.kitty;
   };
 }
-- 
GitLab