mirror of
				https://github.com/kastdeur/dotfiles.git
				synced 2025-10-30 18:56:34 +01:00 
			
		
		
		
	Jobs in ps1, renamed bashrc to bash/rc
This commit is contained in:
		
							parent
							
								
									da8ef4041a
								
							
						
					
					
						commit
						8fc77963e6
					
				
					 6 changed files with 32 additions and 7 deletions
				
			
		|  | @ -51,6 +51,12 @@ function __prompt_command() { | ||||||
| 	if [ -n $RETVAL ]; then | 	if [ -n $RETVAL ]; then | ||||||
| 		PS1+="$(retval ${RETVAL})" | 		PS1+="$(retval ${RETVAL})" | ||||||
| 	fi | 	fi | ||||||
|  | 
 | ||||||
|  | ### Add amount of jobs ### | ||||||
|  | 	if true; then | ||||||
|  | 		PS1+="$(jobscount)" | ||||||
|  | 	fi | ||||||
|  | 	 | ||||||
| ### Add Git Status ###  | ### Add Git Status ###  | ||||||
| 	if [[ $(command -v git) ]]; then | 	if [[ $(command -v git) ]]; then | ||||||
| 		PS1+="$(git_status) " | 		PS1+="$(git_status) " | ||||||
|  | @ -73,6 +79,7 @@ function __prompt_command() { | ||||||
| 			'fatserf')	PS1+="${Pur}\H${RCol}";; | 			'fatserf')	PS1+="${Pur}\H${RCol}";; | ||||||
| 			'lilo'*)	PS1+="${BWhi}\H${RCol}";; | 			'lilo'*)	PS1+="${BWhi}\H${RCol}";; | ||||||
| 			'hg'*)	PS1+="${BRed}\H${RCol}";; | 			'hg'*)	PS1+="${BRed}\H${RCol}";; | ||||||
|  | 			'gouda'|'bunnik'|'houten'|'zandberg'|'bussum') PS1+="${Gre}${On_Whi}HEF:${Blu}${On_Whi}\H${RCol}";; | ||||||
| 			*)	PS1+="${Blu}${On_Whi}\H${RCol}";; | 			*)	PS1+="${Blu}${On_Whi}\H${RCol}";; | ||||||
| 		esac | 		esac | ||||||
| 	else  | 	else  | ||||||
|  | @ -121,6 +128,13 @@ function retval() { | ||||||
| 	echo "${PS1}" | 	echo "${PS1}" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | ### count jobs | ||||||
|  | function jobscount() { | ||||||
|  |   local stopped=$(jobs -sp | wc -l) | ||||||
|  |   local running=$(jobs -rp | wc -l) | ||||||
|  |   ((running+stopped)) && echo -n "${IYel}${running}${RCol}|${Yel}${stopped}${RCol}" | ||||||
|  | } | ||||||
|  | 
 | ||||||
| function git_status() { | function git_status() { | ||||||
| ### Determine Git Status | ### Determine Git Status | ||||||
| 		local PS1 | 		local PS1 | ||||||
|  |  | ||||||
							
								
								
									
										10
									
								
								bash/profile
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								bash/profile
									
										
									
									
									
								
							|  | @ -1,3 +1,13 @@ | ||||||
|  | # ~/.bash_profile | ||||||
| [ -z "$DOTFILES" ] && source "$HOME/.profile" | [ -z "$DOTFILES" ] && source "$HOME/.profile" | ||||||
| 
 | 
 | ||||||
| [ -r "$HOME/.bash_profile.local" ] && source "$HOME/.bash_profile.local" | [ -r "$HOME/.bash_profile.local" ] && source "$HOME/.bash_profile.local" | ||||||
|  | 
 | ||||||
|  | if shopt -q login_shell | ||||||
|  | then | ||||||
|  | # This is a bash login shell | ||||||
|  | 	LOGINHISTORY=~/.login.history | ||||||
|  | 	LOGINSTRING="$(date) ${USER}@${HOSTNAME}" | ||||||
|  | 
 | ||||||
|  | 	echo $LOGINSTRING > $LOGINHISTORY  | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | @ -6,7 +6,8 @@ | ||||||
| - clean: ['~'] | - clean: ['~'] | ||||||
| 
 | 
 | ||||||
| - link: | - link: | ||||||
|     ~/.bashrc: bash/bashrc |     ~/.bashrc: bash/rc | ||||||
|  |     ~/.bash_profile: bash/profile | ||||||
|     ~/.gitconfig: git/gitconfig |     ~/.gitconfig: git/gitconfig | ||||||
|     ~/.gitignore_global: git/gitignore_global |     ~/.gitignore_global: git/gitignore_global | ||||||
|     ~/.ncmpcpp/config: ncmpcpp/config |     ~/.ncmpcpp/config: ncmpcpp/config | ||||||
|  |  | ||||||
|  | @ -30,7 +30,7 @@ then | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| # Source Bashrc if BASH | # Source Bashrc if BASH | ||||||
| if [ "$BASH" ] && [ -f $DOTFILES/bash/bashrc ] | if [ "$BASH" ] && [ -f $DOTFILES/bash/rc ] | ||||||
| then | then | ||||||
| 	source $DOTFILES/bash/bashrc | 	source $DOTFILES/bash/rc | ||||||
| fi | fi | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue