feat: more sp[ace between icon and text, disable network monitor untillfigure out how to handle its bar changes

This commit is contained in:
Krzysztof Rudnicki 2024-11-18 08:45:20 +01:00
parent 98a69a96ba
commit f9e3dc72eb
6 changed files with 42 additions and 16 deletions

View File

@ -1,58 +1,69 @@
[global]
separator=false
markup=pango
[cpu_monitor]
command=~/.config/i3blocks/cpu_monitor.sh
interval=5
markup=pango
[gpu_monitor]
command=~/.config/i3blocks/gpu_monitor.sh
interval=5
markup=pango
[motherboard_temperature]
command=~/.config/i3blocks/motherboard_temp.sh
interval=5
[memory]
command=free -h | awk '/^Mem:/ {print " " $3 "/" $2}' #  for RAM
interval=5
color=#50FA7B
[disk]
command=df -h / | awk '/\// {print " " $3 "/" $2}' #  for disk
interval=60
color=#50FA7B
[volume]
command=~/.config/i3blocks/volume.sh
interval=1
[bluetooth]
command=~/.config/i3blocks/bluetooth.sh
interval=5
color=#FFFFFF
[battery]
command=~/.config/i3blocks/battery_status.sh
interval=1
color=#50FA7B
[ethernet]
command=ip -o -4 addr show enp6s0 | awk '{print " "$4}' || echo " down" #  for Ethernet
command=ip -o -4 addr show enp6s0 | awk '{print " "$4}' || echo " down" #  for Ethernet
interval=10
color=#FFFFFF
[wifi]
command=~/.config/i3blocks/wifi_monitor.sh
interval=10
color=#FFFFFF
#[network_monitor]
#command=~/.config/i3blocks/network_monitor.sh
#interval=1
#color=#FFFFFF
[network_monitor]
command=~/.config/i3blocks/network_monitor.sh
interval=1
[time]
command=echo " $(date '+%Y-%m-%d %H:%M')" #  for time (Font Awesome icon)
command=echo " $(date '+%Y-%m-%d %H:%M')" #  for time (Font Awesome icon)
interval=1
color=#50FA7B

View File

@ -45,4 +45,4 @@ if [[ "$cpu_temp" != "N/A" ]]; then
fi
fi
echo -e "<span color=\"$cpu_color\"> ${cpu_temp}°C, ${cpu_load}</span>"
echo -e "<span color=\"$cpu_color\"> ${cpu_temp}°C, ${cpu_load}</span>"

View File

@ -59,7 +59,7 @@ else
fi
# Output<
echo -e "<span color=\"$gpu_color\"> ${gpu_temp}, ${gpu_load}%</span>"
echo -e "<span color=\"$gpu_color\"> ${gpu_temp}, ${gpu_load}%</span>"
echo
echo "#FFFFFF" # Default color for fallback (ignored if markup is enabled)

View File

@ -75,5 +75,5 @@ rx_rate_human=$(numfmt --to=iec --suffix=B/s $total_rx_rate)
tx_rate_human=$(numfmt --to=iec --suffix=B/s $total_tx_rate)
# Output the result with fixed width
printf " %-8s  %-8s\n" "$rx_rate_human" "$tx_rate_human"
printf " %-8s  %-8s\n" "$rx_rate_human" "$tx_rate_human"
echo "#50FA7B"

View File

@ -5,7 +5,7 @@ wifi_interface=$(iw dev | awk '$1=="Interface"{print $2}')
# If no WiFi interface is found, exit
if [ -z "$wifi_interface" ]; then
echo " down"
echo " down"
exit 1
fi
@ -18,7 +18,7 @@ signal=$(echo "$wifi_info" | awk '/Signal level/ {print $4}' | tr -d 'level=')
# Output the result
if [ -z "$ssid" ]; then
echo " down"
echo " down"
else
echo "$ssid ($signal dBm)"
echo " $ssid ($signal dBm)"
fi

View File

@ -5,6 +5,17 @@ is_ubuntu() {
[ -f /etc/os-release ] && grep -qi 'ubuntu' /etc/os-release
}
# Function to detect screen resolution and set font size
set_font_size() {
resolution=$(xdpyinfo | grep dimensions | awk '{print $2}')
width=$(echo $resolution | cut -d 'x' -f 1)
if [ "$width" -gt 1920 ]; then
echo "14"
else
echo "8"
fi
}
# Check if Intel GPU is detected
if lspci | grep -i 'vga' | grep -i 'intel'; then
if is_ubuntu; then
@ -24,6 +35,10 @@ else
yes | sudo pacman -S --needed ttf-dejavu noto-fonts ttf-font-awesome bc jq iw
fi
# Set font size based on screen resolution
font_size=$(set_font_size)
cp -r i3blocks ~/.config/
cp -r i3 ~/.config/
sed -i "s/font pango:System San Francisco Display, FontAwesome [0-9]*/font pango:System San Francisco Display, FontAwesome $font_size/" ~/.config/i3/config
i3-msg reload