summaryrefslogtreecommitdiff
path: root/.wmii/wmiirc_local
blob: 616f5696d40ba892029938998c40ee388c83c644 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash

# wmiirc file for my HP Pavilion dv6426us laptop

export MODKEY=Mod4

status() {
	buffer=$(
	echo -n ' '
	# Wifi status
	echo -n 'Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality)
	
	echo -n ' | '
	
	# Battery charge (not status)
	echo -n $(acpi -b | sed 's/.*, \{0,2\}\([0-9]\{1,3\}%\),.*/Bat: \1/')
	
	echo -n ' | '
	# CPU
	# This doesn't work for me, it shows capacity
	#echo -n 'Core MHz:' $(cat /proc/cpuinfo | grep 'cpu MHz' | sed 's/.*: //g; s/\..*//g;')
	# This actually displays %idle
	echo -n 'CPU: [ '$(tail -n3 ~/tmp/cputime|sed -ur 's/\s\s+/\t/g'|cut -f2,11|sed 's/\t\(.*\)/(\1)/')' ]'
	
	#echo -n ' | '
	
	#echo -n $(uptime | sed 's/.*://; s/,//g')
	
	echo -n ' | '
	
	echo -n $(date) 
	
	echo -n ' '
	)
	echo "$buffer"
}