#
#  _ _____ _     _            _
# (_)___ /| |__ | | ___   ___| | _____
# | | |_ \| '_ \| |/ _ \ / __| |/ / __|
# | |___) | |_) | | (_) | (__|   <\__ \
# |_|____/|_.__/|_|\___/ \___|_|\_\___/
# 
# Official repository for community contributed blocklets:
#   https://github.com/vivien/i3blocks-contrib
#
# NOTE: every command's ouput should end with a newline character (\n), otherwise the block may not be displayed correctly.

# Global properties
# The top properties below are applied to every block, but can be overridden.
separator=false
markup=pango

[terminal]
full_text= 
color=#807dfe
command=i3-msg -q exec kitty

[browser]
full_text=  
color=#ff7f81
command=i3-msg -q exec firefox

[files]
full_text=  
color=#7f3fbf
command=i3-msg -q exec thunar ~/

[simple-2]
full_text=: :
color=#717171


# Disk usage
#
# The directory defaults to $HOME if the instance is not specified.
# The script may be called with a optional argument to set the alert
# (defaults to 10 for 10%).
[disk]
command=df -h / | awk '/\//{ printf(" %4s/%s \n", $4, $2) }'
interval=30
label=<span color="#50fa7b"> </span>
border=#50fa7b
border_top=1
border_right=0
border_bottom=0
border_left=0


# Memory usage
#
# The type defaults to "mem" if the instance is not specified.
[memory]
command=free -h | awk '/Mem:/ { printf(" %5s/%s \n", $3, $2) }'
interval=2
label=<span color="#f1fa8c"> </span>
border=#f1fa8c
border_top=1
border_right=0
border_bottom=0
border_left=0

[cpu_stats]
command=(mpstat 1 1 | grep Average | awk '{ printf "%04.1f<span color=\"#ff5555\">%</span>", (100 - $12) }') && (sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*' -o | awk '{ printf "%s<span color=\"#ff5555\">°C</span>\n", $2 }')
interval=2
label=<span color="#ff5555"><b>CPU: </b></span>
border=#ff5555
border_top=1
border_right=0
border_bottom=0
border_left=0


[nvidia_gpu_stats]
command=nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits | awk '{ printf "%02i<span color=\"#ffb86c\">%</span>", $0}' && nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits | awk '{ printf "+%i<span color=\"#ffb86c\">°C</span>\n", $0}'
label=<span color="#ffb86c"><b>GPU: </b></span>
interval=5
border=#ffb86c
border_top=1
border_right=0
border_bottom=0
border_left=0


# https://github.com/vivien/i3blocks-contrib/blob/master/bandwidth3/README.md
[bandwidth]
command=~/.config/i3/scripts/bandwidth
label=<span color="#ff79c6"></span>
interval=persist
border=#ff79c6
border_top=1
border_right=0
border_bottom=0
border_left=0


[pavucontrol]
full_text= 
command=pavucontrol
border=#ffffff
border_top=1
border_right=0
border_bottom=0
border_left=0


[date]
command=date
interval=60
label=<span color="#ff5555"> </span>
border=#ff5555
border_top=1
border_right=0
border_bottom=0
border_left=0


# power-profiles-daemon implementation:
# needs package power-profiles-daemon installed and the service running see here:
# https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon
[ppd_menu]
full_text= 
command=~/.config/i3/scripts/power-profiles
color=#50fa7b

#Show the current power-profile
[ppd-status]
command=powerprofilesctl get
interval=5


[shutdown_menu]
full_text= 
command=~/.config/i3/scripts/powermenu

[simple-2]
full_text=: :
color=#717171
