make directories implicit

This commit is contained in:
willifan 2025-01-13 12:03:27 +01:00
parent 7b8e7c3b27
commit 54b0942de6
44 changed files with 285 additions and 285 deletions

23
eww/scripts/bluetooth.sh Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Get the list of connected Bluetooth devices
devices=$(bluetoothctl devices Connected | awk '{print $2}')
name[0]=""
battery[0]=0
i=0
# Iterate through each device and get its name and battery percentage
for device in $devices; do
# Get the device info using bluetoothctl
info=$(bluetoothctl info "$device")
# Extract the name and battery percentage from the device info
name[i]=$(echo "$info" | awk '/Name:/ {for(i=2; i<=NF; i++) printf "%s ", $i;}')
battery[i]=$(echo "$info" | awk '/Battery Percentage:/ {print $4}' | tr -d '()')
((i=i+1))
done
echo '{"name":"'"${name[0]}"'","battery":"'"${battery[0]}"'"}'

10
eww/scripts/brightness.sh Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
FILE_TO_WATCH="/sys/class/backlight/intel_backlight/brightness" # Replace with the actual file path
cat "$FILE_TO_WATCH"
while true; do
inotifywait -e modify "$FILE_TO_WATCH"
cat "$FILE_TO_WATCH"
done

BIN
eww/scripts/client Executable file

Binary file not shown.

8
eww/scripts/media.sh Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
status=$(playerctl status)
title=$(playerctl metadata title)
artist=$(playerctl metadata artist)
album=$(playerctl metadata album)
echo '{"status":"'"$status"'","title":"'"$title"'","artist":"'"$artist"'","album":"'"$album"'"}'

43
eww/scripts/network.sh Executable file
View file

@ -0,0 +1,43 @@
#!/usr/bin/env bash
ethernet() {
name="Wired"
image="ethernet"
}
wifi() {
wifiInfo=$(nmcli -t -f active,ssid,signal device wifi list)
signalStrength=$(awk -F: '/yes:/ {print $3}' <<< $wifiInfo)
name=$(awk -F: '/yes:/ {print $2}' <<< $wifiInfo)
if [[ $signalStrength -ge 70 ]]; then
image="wifiHigh"
elif [[ $signalStrength -ge 60 ]]; then
image="wifiMedium"
elif [[ $signalStrength -ge 40 ]]; then
image="wifiLow"
else
image="wifiVeryLow"
fi
}
while true; do
name="No Connection"
image="n.A."
networkInfo=$(nmcli -f NAME,TYPE connection show --active | awk '!/loopback/ && NR > 1')
if [[ $(awk '/wifi/' <<< "$networkInfo") ]]; then
wifi
fi
if [[ $(awk '/ethernet/' <<< "$networkInfo") ]]; then
ethernet
fi
echo '{"name":"'"$name"'","image":"'"$image"'"}'
sleep 2
done

24
eww/scripts/volume.sh Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
generate() {
message=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
volume=$(awk '{print $2 * 100}' <<< "$message")
if [[ $(awk '{print $3}' <<< "$message") == "[MUTED]" ]]; then
muted=1
else
muted=0
fi
echo '{"volume":"'"$volume"'","muted":"'"$muted"'"}'
}
generate
pactl subscribe | while read -r event; do
if [[ "$event" == *"Event 'change'"* ]]; then
generate
fi
done