wip waybar and swaync updates

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-08-24 22:11:54 -05:00
parent d1053b6282
commit 69de4ca87b
11 changed files with 124 additions and 15 deletions

View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
COMMAND_TO_RUN="$1"
PROMPT_MESSAGE="$2"
if [ -z "$PROMPT_MESSAGE" ]; then
PROMPT_MESSAGE="Are you sure?"
fi
choice=$(echo -e "No\nYes" | wofi --dmenu --location center -p "$PROMPT_MESSAGE")
if [ "$choice" == "Yes" ]; then
eval "$COMMAND_TO_RUN"
fi

View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
if [ "$(nmcli radio all)" = "enabled" ]; then
nmcli radio all off
else
nmcli radio all on
fi

View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
if [ "$(powerprofilesctl get)" = "performance" ]; then
powerprofilesctl set balanced
else
powerprofilesctl set performance
fi

View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
devices=$(bluetoothctl devices | awk '{print $2, $3}')
if [ -z "$devices" ]; then
options="󰂲 Power On\n󰂬 Scan for devices"
else
options="$devices\n󰂲 Power Off\n󰂬 Scan for devices"
fi
chosen=$(echo -e "$options" | wofi --dmenu --location 3 --yoffset 40 --xoffset -20 -p "Bluetooth")
case "$chosen" in
"󰂲 Power On") bluetoothctl power on;;
"󰂲 Power Off") bluetoothctl power off;;
"󰂬 Scan for devices") bluetoothctl scan on;;
*)
mac=$(echo "$chosen" | awk '{print $1}')
bluetoothctl connect "$mac"
;;
esac

View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Get a list of available Wi-Fi networks
nets=$(nmcli --terse --fields SSID,SECURITY,BARS device wifi list | sed '/^--/d' | sed 's/\\:/__/g')
# Get the current connection status
connected_ssid=$(nmcli -t -f active,ssid dev wifi | egrep '^yes' | cut -d: -f2)
if [[ ! -z "$connected_ssid" ]]; then
toggle="󰖪 Toggle Wi-Fi Off"
else
toggle="󰖩 Toggle Wi-Fi On"
fi
# Present the menu to the user
chosen_network=$(echo -e "$toggle\n$nets" | wofi --dmenu --location 3 --yoffset 40 --xoffset -20 -p "Wi-Fi Networks")
# Perform an action based on the user's choice
if [ "$chosen_network" = "$toggle" ]; then
nmcli radio wifi $([ "$connected_ssid" = "" ] && echo "on" || echo "off")
elif [ ! -z "$chosen_network" ]; then
ssid=$(echo "$chosen_network" | sed 's/__/\\:/g' | awk -F' ' '{print $1}')
nmcli device wifi connect "$ssid"
fi