<commit_before>#!/bin/bash

while true
do
	date=`date '+%Y-%m-%d %H:%M:%S'`
	bat=$(cat /sys/class/power_supply/BAT0/capacity)%\ $(cat /sys/class/power_supply/BAT0/status)
	vol=`amixer get Master | tail -n1 | grep -Po '\\[\\K[^%]*' | head -n1`
	wifi_name=`nmcli | grep -m 1 wlp3s0 | cut -d ' ' -f 4`
	mem=`free -h | grep Mem: | awk 'OFS="/" {print $3, $2}'`
	swap=`free -h | grep Swap: | awk 'OFS="/" {print $3, $2}'`
	brightness=$(light)\%
	load=`uptime | awk '{print $10}'` # $11, $12
	cpu=`awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1) "%"; }' <(grep 'cpu ' /proc/stat) <(sleep 0.1; grep 'cpu ' /proc/stat)`


# This line is here in case I cannot use utf-8 fonts. This should not happen since fonts are in my dotfiles repository
#echo "CPU: $cpu | RAM: $mem | SWAP: $swap | LOAD: $load | WIFI: $wifi_name | BRIGHTNESS: $brightness | VOL: $vol % | BAT: $bat | $date"
	xsetroot -name " $cpu| $load| $mem| $swap| $wifi_name| $brightness| $vol%|  $bat|$date"
	sleep 1
done<commit_msg>Add condition to battery string, this won't display battery in dektop pc<commit_after>#!/bin/bash

while true
do
	date=`date '+%Y-%m-%d %H:%M:%S'`
	if [[ -f '/sys/class/power_supply/BAT0/capacity' ]]; then
		bat='|  '$(cat /sys/class/power_supply/BAT0/capacity)%\ $(cat /sys/class/power_supply/BAT0/status)
	else
		bat=''
	fi
	vol=`amixer get Master | tail -n1 | grep -Po '\\[\\K[^%]*' | head -n1`
	wifi_name=`nmcli | grep -m 1 wlp2s0 | cut -d ' ' -f 4`
	mem=`free -h | grep Mem: | awk 'OFS="/" {print $3, $2}'`
	swap=`free -h | grep Swap: | awk 'OFS="/" {print $3, $2}'`
	brightness=$(light)\%
	load=`uptime | awk '{print $10}'` # $11, $12
	cpu=`awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1) "%"; }' <(grep 'cpu ' /proc/stat) <(sleep 0.1; grep 'cpu ' /proc/stat)`


# This line is here in case I cannot use utf-8 fonts. This should not happen since fonts are in my dotfiles repository
#echo "CPU: $cpu | RAM: $mem | SWAP: $swap | LOAD: $load | WIFI: $wifi_name | BRIGHTNESS: $brightness | VOL: $vol % | BAT: $bat | $date"
	xsetroot -name " $cpu| $load| $mem| $swap| $wifi_name| $brightness| $vol%$bat|$date"
	sleep 1
done
{'fraction_non_alphanumeric': 0.23502722323049002, 'fraction_numerical': 0.03402903811252268, 'mean_word_length': 3.824945295404814, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '770809', 'n_tokens_mistral': 1070, 'n_tokens_neox': 990, 'n_words': 275}