mirror of
				https://github.com/tiyn/dotfiles.git
				synced 2025-10-31 12:31:15 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			420 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			420 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/sh
 | |
| 
 | |
| # Status bar module for disk space
 | |
| # $1 should be drive mountpoint
 | |
| 
 | |
| disk=${STATUSBAR_DISK:-/home}
 | |
| 
 | |
| [ ! -z "$1" ] && disk="$1"
 | |
| 
 | |
| icon="$disk"
 | |
| 
 | |
| free=$(df "$disk" | awk ' /[0-9][0-9]/ {print $4}')
 | |
| 
 | |
| if [ $free -gt 104857600 ]
 | |
| then
 | |
|     icon="^b#282828^^c#dfdfdf^  ^d^"
 | |
| elif [ $free -gt 52428800 ]
 | |
| then
 | |
|     icon="^b#282828^^c#ffff00^  ^d^"
 | |
| else
 | |
|     icon="^b#282828^^c#ff0000^  ^d^"
 | |
| fi
 | |
| 
 | |
| printf "$icon %s"
 |