Compare commits
	
		
			1 Commits
		
	
	
		
			0efee5882a
			...
			1b2a277a7a
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 1b2a277a7a | 
@ -12,17 +12,11 @@ fi
 | 
				
			|||||||
trap '[ -f $cache_file ] && rm $cache_file; exit' INT
 | 
					trap '[ -f $cache_file ] && rm $cache_file; exit' INT
 | 
				
			||||||
trap '[ -f $cache_file ] && rm $cache_file; exit' TERM
 | 
					trap '[ -f $cache_file ] && rm $cache_file; exit' TERM
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Check if a battery is installed.
 | 
					 | 
				
			||||||
if ioreg -w0 -l|grep BatteryInstalled &> /dev/null; then
 | 
					 | 
				
			||||||
  has_battery=true
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
  has_battery=false
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
while true; do
 | 
					while true; do
 | 
				
			||||||
  # Get the current CPU temperature.
 | 
					  # Get the current CPU temperature.
 | 
				
			||||||
  cpu_temp="`/usr/local/bin/osx-cpu-temp`"
 | 
					  cpu_temp="`/usr/local/bin/osx-cpu-temp`"
 | 
				
			||||||
  if $has_battery; then
 | 
					  # Check if a battery is installed.
 | 
				
			||||||
 | 
					  if ioreg -w0 -l|grep BatteryInstalled &> /dev/null; then
 | 
				
			||||||
    # Parse the current battery charge percentage.
 | 
					    # Parse the current battery charge percentage.
 | 
				
			||||||
    battery=" `pmset -g batt | grep --color=never -Eo '\d+%'` ↯"
 | 
					    battery=" `pmset -g batt | grep --color=never -Eo '\d+%'` ↯"
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user