add: zellij session selector script
This commit is contained in:
		
							parent
							
								
									697fa6e1d2
								
							
						
					
					
						commit
						5379ea4d15
					
				
					 2 changed files with 24 additions and 3 deletions
				
			
		|  | @ -44,6 +44,26 @@ in | ||||||
|     }; |     }; | ||||||
|     functions = { |     functions = { | ||||||
|       fish_greeting = ""; |       fish_greeting = ""; | ||||||
|  |       zellij_session_select = '' | ||||||
|  |         if not set -q ZELLIJ | ||||||
|  |         set -l ZJ_SESSIONS (zellij list-sessions | awk '{print $1}') | ||||||
|  |         set -l NO_SESSIONS (count $ZJ_SESSIONS) | ||||||
|  | 
 | ||||||
|  |         if test $NO_SESSIONS -gt 0 | ||||||
|  |             set -l SELECTED_SESSION (printf "%s\n" $ZJ_SESSIONS | sk --ansi) | ||||||
|  | 
 | ||||||
|  |             if test -n "$SELECTED_SESSION" | ||||||
|  |                 zellij attach -c $SELECTED_SESSION | ||||||
|  |             else | ||||||
|  |                 zellij | ||||||
|  |             end | ||||||
|  |         else | ||||||
|  |             zellij | ||||||
|  |         end | ||||||
|  |     end | ||||||
|  | 
 | ||||||
|  |       ''; | ||||||
|  | 
 | ||||||
|       fish_flake_edit = '' |       fish_flake_edit = '' | ||||||
|       cd $FLAKE |       cd $FLAKE | ||||||
|       hx $FLAKE |       hx $FLAKE | ||||||
|  | @ -57,8 +77,11 @@ in | ||||||
|         bind --preset -M insert \ec skim_cd_widget |         bind --preset -M insert \ec skim_cd_widget | ||||||
|       ''; |       ''; | ||||||
|     }; |     }; | ||||||
|       # kitty integration |  | ||||||
|     interactiveShellInit = |     interactiveShellInit = | ||||||
|  |     # zellij auto start script | ||||||
|  |       '' | ||||||
|  |       zellij_session_select | ||||||
|  |       '' + | ||||||
|       '' |       '' | ||||||
|         set --global KITTY_INSTALLATION_DIR "${pkgs.kitty}/lib/kitty" |         set --global KITTY_INSTALLATION_DIR "${pkgs.kitty}/lib/kitty" | ||||||
|         set --global KITTY_SHELL_INTEGRATION enabled |         set --global KITTY_SHELL_INTEGRATION enabled | ||||||
|  |  | ||||||
|  | @ -7,7 +7,6 @@ in | ||||||
| { | { | ||||||
|   programs.zellij = { |   programs.zellij = { | ||||||
|     enable = true; |     enable = true; | ||||||
|     enableFishIntegration = true; |  | ||||||
|     settings = { |     settings = { | ||||||
|       theme = "${colorscheme.slug}"; |       theme = "${colorscheme.slug}"; | ||||||
|       themes = { |       themes = { | ||||||
|  | @ -27,5 +26,4 @@ in | ||||||
|       }; |       }; | ||||||
|     }; |     }; | ||||||
|   }; |   }; | ||||||
| #  home.sessionVariable = ZELLIJ_AUTO_ATTACH = "1"; |  | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue