Compare commits
	
		
			1 Commits
		
	
	
		
			0efee5882a
			...
			1b2a277a7a
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 1b2a277a7a | 
@ -10,6 +10,7 @@
 | 
			
		||||
    - tmux
 | 
			
		||||
    - urlview
 | 
			
		||||
    - reattach-to-user-namespace
 | 
			
		||||
    - osx-cpu-temp
 | 
			
		||||
- pacman:
 | 
			
		||||
    - tmux
 | 
			
		||||
    - xclip
 | 
			
		||||
 | 
			
		||||
@ -13,7 +13,15 @@ trap '[ -f $cache_file ] && rm $cache_file; exit' INT
 | 
			
		||||
trap '[ -f $cache_file ] && rm $cache_file; exit' TERM
 | 
			
		||||
 | 
			
		||||
while true; do
 | 
			
		||||
  battery="`pmset -g batt | grep --color=never -Eo '\d+%'` ↯"
 | 
			
		||||
  echo "$battery" > $cache_file
 | 
			
		||||
  # Get the current CPU temperature.
 | 
			
		||||
  cpu_temp="`/usr/local/bin/osx-cpu-temp`"
 | 
			
		||||
  # Check if a battery is installed.
 | 
			
		||||
  if ioreg -w0 -l|grep BatteryInstalled &> /dev/null; then
 | 
			
		||||
    # Parse the current battery charge percentage.
 | 
			
		||||
    battery=" `pmset -g batt | grep --color=never -Eo '\d+%'` ↯"
 | 
			
		||||
  fi
 | 
			
		||||
  # Write to the cache file.
 | 
			
		||||
  echo "$cpu_temp$battery" > $cache_file
 | 
			
		||||
  # Don't spin, sleep instead.
 | 
			
		||||
  sleep 2
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user