yeet
This commit is contained in:
@@ -21,7 +21,10 @@ if [ "$BLUETOOTH_POWERED" != "yes" ]; then
|
||||
fi
|
||||
|
||||
# Get connected devices
|
||||
CONNECTED_DEVICES=$(bluetoothctl devices Connected | grep "^Device" | awk '{for(i=3;i<=NF;i++) printf "%s ", $i; print ""}' | sed 's/ $//')
|
||||
# Note: bluetoothctl devices Connected doesn't work as a direct command argument
|
||||
# It must be piped through bluetoothctl's interactive shell
|
||||
# Also need to strip ANSI escape codes from output
|
||||
CONNECTED_DEVICES=$(echo "devices Connected" | bluetoothctl 2>/dev/null | sed 's/\x1b\[[0-9;]*m//g' | grep "Device " | awk '{for(i=3;i<=NF;i++) printf "%s ", $i; print ""}' | sed 's/ $//')
|
||||
|
||||
if [ -z "$CONNECTED_DEVICES" ]; then
|
||||
echo "$BT_ICON No devices"
|
||||
@@ -39,7 +42,7 @@ fi
|
||||
# Handle click events (for i3status-rust custom block)
|
||||
if [ "${BLOCK_BUTTON:-}" = "1" ]; then
|
||||
# Left click - show all connected devices with details
|
||||
DETAILED_DEVICES=$(bluetoothctl devices Connected | while read -r line; do
|
||||
DETAILED_DEVICES=$(echo "devices Connected" | bluetoothctl 2>/dev/null | sed 's/\x1b\[[0-9;]*m//g' | grep "Device " | while read -r line; do
|
||||
MAC=$(echo "$line" | awk '{print $2}')
|
||||
NAME=$(echo "$line" | awk '{for(i=3;i<=NF;i++) printf "%s ", $i; print ""}' | sed 's/ $//')
|
||||
echo "• $NAME ($MAC)"
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#!/bin/bash
|
||||
# Find a random image file
|
||||
#IMAGE=$(find /run/media/raga/970/qBittorrent/nsfw/xd -type f \( -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' \) | shuf -n 1)
|
||||
IMAGE=$(find /run/media/raga/970/images/cars/wallpaper -type f \( -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' \) | shuf -n 1)
|
||||
IMAGES=/run/media/raga/970/images/cars/wallpaper
|
||||
IMAGES=/run/media/raga/730/shared/photos/hr
|
||||
IMAGE=$(find $IMAGES -type f \( -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' \) | shuf -n 1)
|
||||
|
||||
if [ -n "$IMAGE" ]; then
|
||||
echo "Image: $IMAGE"
|
||||
|
||||
Reference in New Issue
Block a user