This commit is contained in:
2026-01-05 10:57:27 +04:00
parent 842e1c94f2
commit cc03ff37c4
25 changed files with 373 additions and 114 deletions

11
.scripts/dwmblocks/cpu Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/env bash
colors_path=$HOME/.cache/wal/colors.sh
cpu_usage=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}')
# cpu_usage=$(echo "$cpu_usage" | cut -c1-1)
cpu_usage=$(printf "%.0f" "$cpu_usage")
if [ -f "$colors_path" ]; then
source $colors_path
echo "^b$color1^^c$color0^  ^d^^b$color8^^c$color0^ $cpu_usage% ^d^"
fi

6
.scripts/dwmblocks/date Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/env bash
colors_path=$HOME/.cache/wal/colors.sh
if [ -f "$colors_path" ]; then
source $colors_path
echo "^c$color0^^b$color1^$(date +" %d") ^d^^c$color0^^b$color8^$(date +" %I:%M%p") ^d^ ^d^ "
fi

9
.scripts/dwmblocks/memory Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/env bash
colors_path=$HOME/.cache/wal/colors.sh
memory_usage=$(free -h | awk '/^Mem/ { print $3 }' | sed s/i//g)
if [ -f "$colors_path" ]; then
source $colors_path
echo "^b$color1^^c$color0^  ^d^^b$color8^^c$color0^ $memory_usage ^d^"
fi

18
.scripts/dwmblocks/volume_mic Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/env bash
colors_path=$HOME/.cache/wal/colors.sh
vol=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F "Volume: " '{print $2}')
vol=$(echo "$vol * 100" | bc)
vol=$(printf "%.0f" "$vol")
mic=$(wpctl get-volume @DEFAULT_SOURCE@ | awk -F "Volume: " '{print $2}')
mic=$(echo "$mic * 100" | bc)
mic=$(printf "%.0f" "$mic")
if [ -f "$colors_path" ]; then
source $colors_path
echo "^b$color1^^c$color0^  $vol ^d^^b$color8^^c$color0^  $mic ^d^"
fi

3
.scripts/dwmblocks/weather Executable file
View File

@@ -0,0 +1,3 @@
#! /bin/bash
curl -s -H "Accept-language: ru" wttr.in/Samara?Mm