-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathi3blocks.conf
40 lines (31 loc) · 2.18 KB
/
i3blocks.conf
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
37
38
39
# i3blocks config file
# Shows the wifi signal strength
[wifi]
label=WIFI
command=/usr/share/i3blocks/wifi
interval=5
# Shows whether Bluetooth is connected
[bluetooth]
label=BT
command=/usr/share/i3blocks/bluetooth
interval=5
[cpu_temp]
#command=$HOME/.scripts/cpu_temp.sh
command=sh -c 'temp=$(sensors | awk "/^Package id 0:/ {print \$4}") && echo "🌡️CPU: $temp"'
interval=10
# Shows the system time
[time]
command=sh -c 'date=$(date +"%H:%M %Z %a %d %b %Y"); echo "📅 $date"'
interval=60
[cpu_ram]
command=sh -c 'cpu_usage=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '"'"'{print 100 - $1"%"}'"'"'); ram_usage=$(free | grep Mem | awk '"'"'{print $3/$2 * 100.0}'"'"' | xargs printf "%.2f%%"); echo "🖥️ CPU: $cpu_usage | 🧠 RAM: $ram_usage"; case $BLOCK_BUTTON in 1) notify-send "🖥️ CPU Usage" "$(top -bn1 | head -n 20)" ;; 3) notify-send "🧠 RAM Usage" "$(ps aux --sort=-%mem | head -n 20)" ;; esac'
interval=10
[battery]
command=sh -c 'capacity0=$(cat /sys/class/power_supply/BAT0/capacity 2>/dev/null); status0=$(cat /sys/class/power_supply/BAT0/status 2>/dev/null); capacity1=$(cat /sys/class/power_supply/BAT1/capacity 2>/dev/null); status1=$(cat /sys/class/power_supply/BAT1/status 2>/dev/null); output=""; if [ -n "$capacity0" ]; then output="BAT0: $capacity0% ($status0)"; fi; if [ -n "$capacity1" ]; then output="$output BAT1: $capacity1% ($status1)"; fi; if [ -z "$output" ]; then echo "No Battery"; else echo "🔋 $output"; fi'
interval=10
[brightness]
command=sh -c 'icon() { if [ "$1" -lt 30 ]; then echo "🌑"; elif [ "$1" -lt 70 ]; then echo "🌕"; else echo "☀️"; fi }; case $BLOCK_BUTTON in 1) brightnessctl -q set +10% ;; 3) brightnessctl -q set 10%- ;; esac; bri=$(brightnessctl -m | cut -d, -f4 | tr -d %); icon=$(icon $bri); echo "$icon $bri%"'
interval=10
[volume]
command=sh -c 'icon() { if [ "$1" -lt 30 ]; then echo "🔈"; elif [ "$1" -lt 70 ]; then echo "🔉"; else echo "🔊"; fi }; volume=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -oP "\\d+%" | head -1 | tr -d %); echo "$(icon $volume) $volume%"; case $BLOCK_BUTTON in 1) pactl set-sink-volume @DEFAULT_SINK@ +5% ;; 3) pactl set-sink-volume @DEFAULT_SINK@ -5% ;; esac'
interval=10