mirror of
				https://gitlab.com/ceda_ei/wish
				synced 2025-10-31 10:00:04 +01:00 
			
		
		
		
	Add main function to generate prompt
This commit is contained in:
		
							
								
								
									
										13
									
								
								wish.sh
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								wish.sh
									
									
									
									
									
								
							| @@ -2,6 +2,8 @@ | ||||
|  | ||||
| function wish_init() { | ||||
| 	# Source all plugins | ||||
| 	local i | ||||
| 	local j | ||||
| 	for i in ${WISH_PLUGINS[@]}; do | ||||
| 		for j in "$XDG_CONFIG_HOME" "/usr/share" "$HOME/.config"; do | ||||
| 			source "$j/wish/plugins/$i.sh" &> /dev/null && break | ||||
| @@ -18,4 +20,15 @@ function wish_init() { | ||||
| 	[[ $? -ne 0 ]] && echo "Theme $WISH_THEME not found." >&2 | ||||
| } | ||||
|  | ||||
|  | ||||
| function wish_main() { | ||||
| 	local prev=$? | ||||
| 	PS1="" | ||||
| 	local i | ||||
| 	for i in $(seq 0 $((${#WISH_PLUGINS[@]} - 1))); do | ||||
| 		wish_${WISH_PLUGINS[i]}_main $prev | ||||
| 	done | ||||
| } | ||||
|  | ||||
| wish_init | ||||
| PROMPT_COMMAND="wish_main; $PROMPT_COMMAND" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user