diff --git a/common/.config/i3blocks/config b/common/.config/i3blocks/config index 29c926f..47479ad 100644 --- a/common/.config/i3blocks/config +++ b/common/.config/i3blocks/config @@ -8,15 +8,17 @@ command=df -h / | awk '/\//{ printf(" 💾 %sB \n", $4) }' interval=10 color=#C9E3DB -[BATTERY] -command=~/.config/i3blocks/battery/battery_info.sh -interval=20 - [CPU] full_text= CPU: 0.00% @ +00.0°C command=~/.config/i3blocks/cpu/cpu_info.sh interval=2 -color=#00B4EB +color=#0071C5 + +[GPU] +full_text= GPU: +command=~/.config/i3blocks/gpu/gpu_info.sh +interval=2 +color=#76B900 [MEM] command=free -h | awk '/Mem:/ { printf(" %5s/%s \n", $3, $2) }' diff --git a/common/.config/i3blocks/cpu/cpu_info.sh b/common/.config/i3blocks/cpu/cpu_info.sh index 10c7739..c276aec 100755 --- a/common/.config/i3blocks/cpu/cpu_info.sh +++ b/common/.config/i3blocks/cpu/cpu_info.sh @@ -1,4 +1,4 @@ #!/bin/sh -TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o) -CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}') -echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s% @ %s \n"), $1, $2 }' +TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '[0-9]*.[0-9]*°C' -o) +CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%i\n", $(NF-9))}') +echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%3s% @ %s \n"), $1, $2 }' diff --git a/common/i3blocks/gpu/gpu_info.sh b/common/.config/i3blocks/gpu/gpu_info.sh similarity index 100% rename from common/i3blocks/gpu/gpu_info.sh rename to common/.config/i3blocks/gpu/gpu_info.sh diff --git a/common/i3blocks/battery/battery_info.sh b/common/i3blocks/battery/battery_info.sh deleted file mode 100755 index 3ff37cc..0000000 --- a/common/i3blocks/battery/battery_info.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -# If ACPI was not installed, this probably is a battery-less computer. -ACPI_RES=$(acpi -b) -ACPI_CODE=$? -if [ $ACPI_CODE -eq 0 ] -then - # Get essential information. Due to som bug with some versions of acpi it is - # worth filtering the ACPI result from all lines containing "unavailable". - BAT_LEVEL_ALL=$(echo "$ACPI_RES" | grep -E -o "[0-9][0-9]?[0-9]?%") - BAT_LEVEL=$(echo "$BAT_LEVEL_ALL" | awk -F"%" 'BEGIN{tot=0;i=0} {i++; tot+=$1} END{printf("%d%%\n", tot/i)}') - TIME_LEFT=$(echo "$ACPI_RES" | grep -E -o "[0-9]{2}:[0-9]{2}:[0-9]{2}") - IS_CHARGING=$(echo "$ACPI_RES" | awk '{ printf("%s\n", substr($3, 0, length($3)-1) ) }') - - # If there is no 'time left' information (when almost fully charged) we - # provide information ourselvs. - if [ -z "$TIME_LEFT" ] - then - TIME_LEFT="00:00:00" - fi - - # Print full text. The charging data. - TIME_LEFT=$(echo $TIME_LEFT | awk '{ printf("%s\n", substr($1, 0, 5)) }') - echo "🔋$BAT_LEVEL ⏳$TIME_LEFT " - - # Print the short text. - echo "BAT: $BAT_LEVEL" - - # Change the font color, depending on the situation. - if [ "$IS_CHARGING" = "Charging" ] - then - # Charging yellow color. - echo "#D0D000" - else - if [ "${BAT_LEVEL%?}" -le 15 ] - then - # Battery very low. Red color. - echo "#FA1E44" - else - # Battery not charging but at decent level. Green color. - echo "#007872" - fi - fi -fi diff --git a/common/i3blocks/config b/common/i3blocks/config deleted file mode 100644 index 47479ad..0000000 --- a/common/i3blocks/config +++ /dev/null @@ -1,30 +0,0 @@ -[NOW_PLAYING] -command=mpris-ctl info '🎶 %player_name: %track_name - %artist_name' -interval=1 -color=#1DB954 - -[DISK] -command=df -h / | awk '/\//{ printf(" 💾 %sB \n", $4) }' -interval=10 -color=#C9E3DB - -[CPU] -full_text= CPU: 0.00% @ +00.0°C -command=~/.config/i3blocks/cpu/cpu_info.sh -interval=2 -color=#0071C5 - -[GPU] -full_text= GPU: -command=~/.config/i3blocks/gpu/gpu_info.sh -interval=2 -color=#76B900 - -[MEM] -command=free -h | awk '/Mem:/ { printf(" %5s/%s \n", $3, $2) }' -interval=5 -color=#FEC925 - -[TIME_DATE] -command=date +" %a, %d %b - %H:%M:%S" -interval=1 diff --git a/common/i3blocks/cpu/cpu_info.sh b/common/i3blocks/cpu/cpu_info.sh deleted file mode 100755 index c276aec..0000000 --- a/common/i3blocks/cpu/cpu_info.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '[0-9]*.[0-9]*°C' -o) -CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%i\n", $(NF-9))}') -echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%3s% @ %s \n"), $1, $2 }' diff --git a/common/i3blocks/sound/sound_burst.sh b/common/i3blocks/sound/sound_burst.sh deleted file mode 100755 index 330f395..0000000 --- a/common/i3blocks/sound/sound_burst.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -for i in $(seq 1 5) -do - sleep 0.2 - pkill -RTMIN+1 i3blocks -done diff --git a/common/i3blocks/sound/sound_info.sh b/common/i3blocks/sound/sound_info.sh deleted file mode 100755 index a5fd505..0000000 --- a/common/i3blocks/sound/sound_info.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -VOLUME_MUTE="🔇" -VOLUME_LOW="🔈" -VOLUME_MID="🔉" -VOLUME_HIGH="🔊" -SOUND_LEVEL=$(amixer -M get Master | awk -F"[][]" '/%/ { print $2 }' | awk -F"%" 'BEGIN{tot=0; i=0} {i++; tot+=$1} END{printf("%s\n", tot/i) }') -MUTED=$(amixer get Master | awk ' /%/{print ($NF=="[off]" ? 1 : 0); exit;}') - -ICON=$VOLUME_MUTE -if [ "$MUTED" = "1" ] -then - ICON="$VOLUME_MUTE" -else - if [ "$SOUND_LEVEL" -lt 34 ] - then - ICON="$VOLUME_LOW" - elif [ "$SOUND_LEVEL" -lt 67 ] - then - ICON="$VOLUME_MID" - else - ICON="$VOLUME_HIGH" - fi -fi - -echo "$ICON" "$SOUND_LEVEL" | awk '{ printf(" %s:%3s%% \n", $1, $2) }' - diff --git a/pc/.gitkeep b/pc/.gitkeep new file mode 100644 index 0000000..e69de29