refactor: complete rewrite
This commit is contained in:
		
							parent
							
								
									19a4bbda3c
								
							
						
					
					
						commit
						8e81943cf9
					
				
					 399 changed files with 3396 additions and 8042 deletions
				
			
		
							
								
								
									
										199
									
								
								modules/home/console/tools/multiplexer/zellij/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										199
									
								
								modules/home/console/tools/multiplexer/zellij/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,199 @@ | |||
| { | ||||
|   osConfig, | ||||
|   config, | ||||
|   lib, | ||||
|   pkgs, | ||||
|   ... | ||||
| }: let | ||||
|   inherit (osConfig.ooknet.appearance.colorscheme) slug palette; | ||||
|   inherit (osConfig.ooknet) console; | ||||
|   inherit (osConfig.ooknet.host) admin; | ||||
|   inherit (lib) mkIf; | ||||
| 
 | ||||
|   cfg = osConfig.ooknet.console.tools.zellij; | ||||
| in { | ||||
|   config = mkIf (cfg.enable || console.multiplexer == "zellij") { | ||||
|     programs.zellij = { | ||||
|       enable = true; | ||||
|       settings = { | ||||
|         theme = "${slug}"; | ||||
|         default_shell = "${admin.shell}"; | ||||
|         default_layout = "default"; | ||||
|         pane_frames = false; | ||||
|         scrollback_editor = "${console.editor}"; | ||||
|         themes = { | ||||
|           "${slug}" = { | ||||
|             fg = "#${palette.base05}"; | ||||
|             bg = "#${palette.base00}"; | ||||
|             black = "#${palette.base00}"; | ||||
|             red = "#${palette.base08}"; | ||||
|             green = "#${palette.base0B}"; | ||||
|             yellow = "#${palette.base0A}"; | ||||
|             blue = "#${palette.base0D}"; | ||||
|             magenta = "#${palette.base0E}"; | ||||
|             cyan = "#${palette.base0C}"; | ||||
|             white = "#${palette.base05}"; | ||||
|             orange = "#${palette.base09}"; | ||||
|           }; | ||||
|         }; | ||||
|       }; | ||||
|     }; | ||||
| 
 | ||||
|     # Layouts | ||||
|     xdg.configFile = { | ||||
|       # Default layout | ||||
|       "zellij/layouts/default.kdl" = import ./layouts/defaultLayout.nix {inherit pkgs config osConfig;}; | ||||
|       # Layout for bash scripts | ||||
|       "zellij/layouts/script.kdl" = import ./layouts/scriptLayout.nix {inherit pkgs config osConfig;}; | ||||
|       # Layout for configuring my flake | ||||
|       "zellij/layouts/flake.kdl" = import ./layouts/flakeLayout.nix {inherit pkgs config osConfig;}; | ||||
|       # Additional keybinds | ||||
|       "zellij/config.kdl".text = | ||||
|         # kdl | ||||
|         '' | ||||
|           keybinds clear-defaults=true { | ||||
|               shared_except "locked" { | ||||
|                   bind "Alt 1" { GoToTab 1; } | ||||
|                   bind "Alt 2" { GoToTab 2; } | ||||
|                   bind "Alt 3" { GoToTab 3; } | ||||
|                   bind "Alt 4" { GoToTab 4; } | ||||
|                   bind "Alt 5" { GoToTab 5; } | ||||
|                   bind "Alt 6" { GoToTab 6; } | ||||
|                   bind "Alt 7" { GoToTab 7; } | ||||
|                   bind "Alt 8" { GoToTab 8; } | ||||
|                   bind "Alt 9" { GoToTab 9; } | ||||
|                   bind "Alt -" { Resize "Decrease" ; } | ||||
|                   bind "Alt =" { Resize "Increase" ; } | ||||
|               } | ||||
| 
 | ||||
|               locked { | ||||
|                   bind "Alt g" { SwitchToMode "Normal" ; } | ||||
|               } | ||||
| 
 | ||||
|               resize { | ||||
|                   bind "Alt r" { SwitchToMode "Normal" ; } | ||||
|                   bind "h" "Left" { Resize "Increase Left" ; } | ||||
|                   bind "j" "Down"  { Resize "Increase Down" ; } | ||||
|                   bind "k" "Up"    { Resize "Increase Up" ; } | ||||
|                   bind "l" "Right" { Resize "Increase Right" ; } | ||||
|               } | ||||
| 
 | ||||
|               pane { | ||||
|                   bind "Alt p"     { SwitchToMode "Normal" ; } | ||||
|                   bind "c"         { Clear ; } | ||||
|                   bind "e"         { TogglePaneEmbedOrFloating ; SwitchToMode "Normal" ; } | ||||
|                   bind "f"         { ToggleFocusFullscreen ; SwitchToMode "Normal" ; } | ||||
|                   bind "j" "Down"  { NewPane "Down" ; SwitchToMode "Normal" ; } | ||||
|                   bind "l" "Right" { NewPane "Right" ; SwitchToMode "Normal" ; } | ||||
|                   bind "n"         { NewPane ; SwitchToMode "Normal" ; } | ||||
|                   bind "p"         { SwitchFocus ; SwitchToMode "Normal" ; } | ||||
|                   bind "r"         { SwitchToMode "RenamePane" ; PaneNameInput 0 ; } | ||||
|                   bind "w"         { ToggleFloatingPanes ; SwitchToMode "Normal" ; } | ||||
|                   bind "x"         { CloseFocus ; SwitchToMode "Normal" ; } | ||||
|                   bind "z"         { TogglePaneFrames ; SwitchToMode "Normal" ; } | ||||
|               } | ||||
|               move { | ||||
|                   bind "Alt m"     { SwitchToMode "Normal"; } | ||||
|                   bind "h" "Left"  { MovePane "Left" ; } | ||||
|                   bind "j" "Down"  { MovePane "Down" ; } | ||||
|                   bind "k" "Up"    { MovePane "Up" ; } | ||||
|                   bind "l" "Right" { MovePane "Right" ; } | ||||
|               } | ||||
|               tab { | ||||
|                 bind "Alt t" { SwitchToMode "Normal" ; } | ||||
|                 bind "b"     { BreakPane; SwitchToMode "Normal" ; } | ||||
|                 bind "h"     { MoveTab "Left" ; } | ||||
|                 bind "l"     { MoveTab "Right" ; } | ||||
|                 bind "n"     { NewTab ; SwitchToMode "Normal" ; } | ||||
|                 bind "r"     { SwitchToMode "RenameTab" ; TabNameInput 0 ; } | ||||
|                 bind "x"     { CloseTab ; SwitchToMode "Normal" ; } | ||||
|                 bind "1"     { GoToTab 1 ; SwitchToMode "Normal" ; } | ||||
|                 bind "2"     { GoToTab 2 ; SwitchToMode "Normal" ; } | ||||
|                 bind "3"     { GoToTab 3 ; SwitchToMode "Normal" ; } | ||||
|                 bind "4"     { GoToTab 4 ; SwitchToMode "Normal" ; } | ||||
|                 bind "5"     { GoToTab 5 ; SwitchToMode "Normal" ; } | ||||
|                 bind "6"     { GoToTab 6 ; SwitchToMode "Normal" ; } | ||||
|                 bind "7"     { GoToTab 7 ; SwitchToMode "Normal" ; } | ||||
|                 bind "8"     { GoToTab 8 ; SwitchToMode "Normal" ; } | ||||
|                 bind "9"     { GoToTab 9 ; SwitchToMode "Normal" ; } | ||||
|             } | ||||
|             scroll { | ||||
|                 bind "Alt s"    { SwitchToMode "Normal" ; } | ||||
|                 bind "e"        { EditScrollback; SwitchToMode "Normal" ; } | ||||
|                 bind "d"        { HalfPageScrollDown ; } | ||||
|                 bind "u"        { HalfPageScrollUp ; } | ||||
|                 bind "j" "Down" { ScrollDown ; } | ||||
|                 bind "k" "Up"   { ScrollUp ; } | ||||
|                 bind "Home"     { ScrollToTop ; SwitchToMode "Normal" ; } | ||||
|                 bind "End"      { ScrollToBottom ; SwitchToMode "Normal" ; } | ||||
|                 bind "PageDown" { PageScrollDown ; } | ||||
|                 bind "PageUp"   { PageScrollUp ; } | ||||
|                 bind "s"        { SwitchToMode "EnterSearch" ; SearchInput 0 ; } | ||||
|             } | ||||
|             search { | ||||
|                 bind "Alt s" { SwitchToMode "Normal" ; } | ||||
|                 bind "n"     { Search "down" ; } | ||||
|                 bind "p"     { Search "up" ; } | ||||
|                 bind "c"     { SearchToggleOption "CaseSensitivity" ; } | ||||
|                 bind "w"     { SearchToggleOption "Wrap" ; } | ||||
|                 bind "o"     { SearchToggleOption "WholeWord" ; } | ||||
|             } | ||||
|             entersearch { | ||||
|                 bind "Alt c" "Esc" { SwitchToMode "Scroll" ; } | ||||
|                 bind "Enter"       { SwitchToMode "Search" ; } | ||||
|             } | ||||
|             renametab { | ||||
|                 bind "Alt c" { SwitchToMode "Normal" ; } | ||||
|                 bind "Esc"   { UndoRenameTab ; SwitchToMode "Tab" ; } | ||||
|             } | ||||
|             renamepane { | ||||
|                 bind "Alt c" { SwitchToMode "Normal"; } | ||||
|                 bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; } | ||||
|             } | ||||
|             session { | ||||
|                 bind "Alt o" { SwitchToMode "Normal" ; } | ||||
|                 bind "d"     { Detach ; } | ||||
|                 bind "w"     { | ||||
|                     LaunchOrFocusPlugin "session-manager" { | ||||
|                         floating true | ||||
|                         move_to_focused_tab true | ||||
|                     }; | ||||
|                     SwitchToMode "Normal" | ||||
|                 } | ||||
|             } | ||||
|             shared_except "locked" { | ||||
|                 bind "Alt g"             { SwitchToMode "Locked" ; } | ||||
|                 bind "Alt q"             { Quit ; } | ||||
|                 bind "Alt h" "Alt Left"  { MoveFocusOrTab "Left" ; } | ||||
|                 bind "Alt l" "Alt Right" { MoveFocusOrTab "Right" ; } | ||||
|                 bind "Alt j" "Alt Down"  { MoveFocus "Down" ; } | ||||
|                 bind "Alt k" "Alt Up"    { MoveFocus "Up" ; } | ||||
|                 bind "Alt ["             { PreviousSwapLayout ; } | ||||
|                 bind "Alt ]"             { NextSwapLayout ; } | ||||
|             } | ||||
|             shared_except "normal" "locked" { | ||||
|                 bind "Enter" "Esc" { SwitchToMode "Normal" ; } | ||||
|             } | ||||
|             shared_except "pane" "locked" { | ||||
|                 bind "Alt p" { SwitchToMode "Pane" ; } | ||||
|             } | ||||
|             shared_except "resize" "locked" { | ||||
|                 bind "Alt r" { SwitchToMode "Resize" ; } | ||||
|             } | ||||
|             shared_except "scroll" "locked" { | ||||
|                 bind "Alt s" { SwitchToMode "Scroll" ; } | ||||
|             } | ||||
|             shared_except "session" "locked" { | ||||
|                 bind "Alt o" { SwitchToMode "Session" ; } | ||||
|             } | ||||
|             shared_except "tab" "locked" { | ||||
|                 bind "Alt t" { SwitchToMode "Tab" ; } | ||||
|             } | ||||
|             shared_except "move" "locked" { | ||||
|                 bind "Alt m" { SwitchToMode "Move" ; } | ||||
|             } | ||||
|           } | ||||
|         ''; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  | @ -0,0 +1,62 @@ | |||
| { | ||||
|   pkgs, | ||||
|   osConfig, | ||||
|   ... | ||||
| }: let | ||||
|   inherit (osConfig.ooknet.appearance.colorscheme) palette; | ||||
| in { | ||||
|   text = | ||||
|     # kdl | ||||
|     '' | ||||
|       layout { | ||||
|         default_tab_template { | ||||
|           pane size=2 borderless=true { | ||||
|             plugin location="file:${pkgs.zjstatus}/bin/zjstatus.wasm" { | ||||
|               format_left  "{mode}" | ||||
|               format_right "{session} {command_git_branch} {datetime}" | ||||
|               format_center "#[fg=#${palette.base0D},bold] {tabs}" | ||||
|               format_space "" | ||||
| 
 | ||||
|               border_enabled  "true" | ||||
|               border_char     "─" | ||||
|               border_format   "#[fg=#${palette.base05}]{char}" | ||||
|               border_position "bottom" | ||||
| 
 | ||||
|               hide_frame_for_single_pane "true" | ||||
| 
 | ||||
|               mode_normal       "#[fg=#${palette.base0D}] " | ||||
|               mode_tmux         "#[fg=#${palette.base0E}] " | ||||
|               mode_pane         "#[fg=#${palette.base08}] " | ||||
|               mode_tab          "#[fg=#${palette.base08}] " | ||||
|               mode_rename_tab   "#[fg=#${palette.base08}] " | ||||
|               mode_rename_pane  "#[fg=#${palette.base08}] " | ||||
|               mode_session      "#[fg=#${palette.base08}] " | ||||
|               mode_locked       "#[fg=#${palette.base05}] " | ||||
|               mode_move         "#[fg=#${palette.base0B}] " | ||||
|               mode_resize       "#[fg=#${palette.base0B}] " | ||||
|               mode_prompt       "#[fg=#${palette.base0A}] " | ||||
|               mode_search       "#[fg=#${palette.base0A}] " | ||||
|               mode_enter_search "#[fg=#${palette.base0A}] " | ||||
| 
 | ||||
|               tab_normal   "#[bg=#${palette.base01}] {name} " | ||||
|               tab_active   "#[bg=#${palette.base02}] {name} " | ||||
|               tab_separator "  " | ||||
| 
 | ||||
|               command_git_branch_command     "git rev-parse --abbrev-ref HEAD" | ||||
|               command_git_branch_format      "#[fg=#${palette.base0C}] {stdout} " | ||||
|               command_git_branch_interval    "10" | ||||
|               command_git_branch_rendermode  "static" | ||||
| 
 | ||||
|               datetime        "#[fg=#${palette.base05},bold] {format} " | ||||
|               datetime_format "%I:%M %p" | ||||
|               datetime_timezone "${osConfig.time.timeZone}" | ||||
|             } | ||||
|           } | ||||
|         children | ||||
|       } | ||||
|         tab name="terminal" focus=true { | ||||
|             pane name="term" focus=true | ||||
|         } | ||||
|       } | ||||
|     ''; | ||||
| } | ||||
|  | @ -0,0 +1,70 @@ | |||
| { | ||||
|   pkgs, | ||||
|   osConfig, | ||||
|   ... | ||||
| }: let | ||||
|   inherit (osConfig.ooknet.appearance.colorscheme) palette; | ||||
| in { | ||||
|   text = | ||||
|     /* | ||||
|     kdl | ||||
|     */ | ||||
|     '' | ||||
|       layout { | ||||
|         default_tab_template { | ||||
|           pane size=2 borderless=true { | ||||
|             plugin location="file:${pkgs.zjstatus}/bin/zjstatus.wasm" { | ||||
|               format_left  "{mode}" | ||||
|               format_right "{session} {command_git_branch} {datetime}" | ||||
|               format_center "#[fg=#${palette.base0D},bold] {tabs}" | ||||
|               format_space "" | ||||
| 
 | ||||
|               border_enabled  "true" | ||||
|               border_char     "─" | ||||
|               border_format   "#[fg=#${palette.base05}]{char}" | ||||
|               border_position "bottom" | ||||
| 
 | ||||
|               hide_frame_for_single_pane "true" | ||||
| 
 | ||||
|               mode_normal       "#[fg=#${palette.base0D}] " | ||||
|               mode_tmux         "#[fg=#${palette.base0E}] " | ||||
|               mode_pane         "#[fg=#${palette.base08}] " | ||||
|               mode_tab          "#[fg=#${palette.base08}] " | ||||
|               mode_rename_tab   "#[fg=#${palette.base08}] " | ||||
|               mode_rename_pane  "#[fg=#${palette.base08}] " | ||||
|               mode_session      "#[fg=#${palette.base08}] " | ||||
|               mode_locked       "#[fg=#${palette.base05}] " | ||||
|               mode_move         "#[fg=#${palette.base0B}] " | ||||
|               mode_resize       "#[fg=#${palette.base0B}] " | ||||
|               mode_prompt       "#[fg=#${palette.base0A}] " | ||||
|               mode_search       "#[fg=#${palette.base0A}] " | ||||
|               mode_enter_search "#[fg=#${palette.base0A}] " | ||||
| 
 | ||||
|               tab_normal   "#[bg=#${palette.base01}] {name} " | ||||
|               tab_active   "#[bg=#${palette.base02}] {name} " | ||||
|               tab_separator "  " | ||||
| 
 | ||||
|               command_git_branch_command     "git rev-parse --abbrev-ref HEAD" | ||||
|               command_git_branch_format      "#[fg=#${palette.base0C}] {stdout} " | ||||
|               command_git_branch_interval    "10" | ||||
|               command_git_branch_rendermode  "static" | ||||
| 
 | ||||
|               datetime        "#[fg=#${palette.base05},bold] {format} " | ||||
|               datetime_format "%I:%M %p" | ||||
|               datetime_timezone "${osConfig.time.timeZone}" | ||||
|             } | ||||
|           } | ||||
|         children | ||||
|         } | ||||
|         tab name="terminal" focus=true { | ||||
|             pane name="term" cwd="$FLAKE" focus=true | ||||
|         } | ||||
|         tab name="editor" { | ||||
|             pane name="edit" edit="$FLAKE" | ||||
|         } | ||||
|         tab name="git" { | ||||
|             pane name="git" cwd="$FLAKE" command="lazygit" | ||||
|         } | ||||
|       } | ||||
|     ''; | ||||
| } | ||||
|  | @ -0,0 +1,68 @@ | |||
| { | ||||
|   pkgs, | ||||
|   osConfig, | ||||
|   ... | ||||
| }: let | ||||
|   inherit (osConfig.ooknet.appearance.colorscheme) palette; | ||||
| in { | ||||
|   text = | ||||
|     /* | ||||
|     kdl | ||||
|     */ | ||||
|     '' | ||||
|       layout { | ||||
|         default_tab_template { | ||||
|           pane size=2 borderless=true { | ||||
|             plugin location="file:${pkgs.zjstatus}/bin/zjstatus.wasm" { | ||||
|               format_left  "{mode}" | ||||
|                 format_right "{session} {command_git_branch} {datetime}" | ||||
|                 format_center "#[fg=#${palette.base0D},bold] {tabs}" | ||||
|                 format_space "" | ||||
| 
 | ||||
|                 border_enabled  "true" | ||||
|                 border_char     "─" | ||||
|                 border_format   "#[fg=#${palette.base05}]{char}" | ||||
|                 border_position "bottom" | ||||
| 
 | ||||
|                 hide_frame_for_single_pane "true" | ||||
| 
 | ||||
|                 mode_normal       "#[fg=#${palette.base0D}] " | ||||
|                 mode_tmux         "#[fg=#${palette.base0E}] " | ||||
|                 mode_pane         "#[fg=#${palette.base08}] " | ||||
|                 mode_tab          "#[fg=#${palette.base08}] " | ||||
|                 mode_rename_tab   "#[fg=#${palette.base08}] " | ||||
|                 mode_rename_pane  "#[fg=#${palette.base08}] " | ||||
|                 mode_session      "#[fg=#${palette.base08}] " | ||||
|                 mode_locked       "#[fg=#${palette.base05}] " | ||||
|                 mode_move         "#[fg=#${palette.base0B}] " | ||||
|                 mode_resize       "#[fg=#${palette.base0B}] " | ||||
|                 mode_prompt       "#[fg=#${palette.base0A}] " | ||||
|                 mode_search       "#[fg=#${palette.base0A}] " | ||||
|                 mode_enter_search "#[fg=#${palette.base0A}] " | ||||
| 
 | ||||
|                 tab_normal   "#[bg=#${palette.base01}] {name} " | ||||
|                 tab_active   "#[bg=#${palette.base02}] {name} " | ||||
|                 tab_separator "  " | ||||
| 
 | ||||
|                 command_git_branch_command     "git rev-parse --abbrev-ref HEAD" | ||||
|                 command_git_branch_format      "#[fg=#${palette.base0C}] {stdout} " | ||||
|                 command_git_branch_interval    "10" | ||||
|                 command_git_branch_rendermode  "static" | ||||
| 
 | ||||
|                 datetime        "#[fg=#${palette.base05},bold] {format} " | ||||
|                 datetime_format "%I:%M %p" | ||||
|                 datetime_timezone "${osConfig.time.timeZone}" | ||||
|             } | ||||
|           } | ||||
|           children | ||||
|         } | ||||
|           tab name="edit" focus=true { | ||||
|               pane edit="./" name="edit" focus=true size="85%" borderless=true | ||||
|               pane name="term" focus=false size="15%" borderless=false | ||||
|           } | ||||
|           tab name="git" focus=false { | ||||
|               pane name="git" focus=false command="lazygit" | ||||
|           } | ||||
|       } | ||||
|     ''; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue