style: update waybar style

This commit is contained in:
DACHXY 2025-01-15 01:02:38 +08:00
parent 69e41c6e05
commit 984bc4c5d8
27 changed files with 275 additions and 103 deletions

0
home/config/scripts/getIcons.sh Normal file → Executable file
View file

38
home/config/scripts/rofiWifi.sh Executable file
View file

@ -0,0 +1,38 @@
#!/usr/bin/env bash
notify-send "Getting list of available Wi-Fi networks..."
# Get a list of available wifi connections and morph it into a nice-looking list
wifi_list=$(nmcli --fields "SECURITY,SSID" device wifi list | sed 1d | sed 's/ */ /g' | sed -E "s/WPA*.?\S/ /g" | sed "s/^--/ /g" | sed "s/ //g" | sed "/--/d")
connected=$(nmcli -fields WIFI g)
if [[ "$connected" =~ "enabled" ]]; then
toggle=" Disable Wi-Fi"
elif [[ "$connected" =~ "disabled" ]]; then
toggle=" Enable Wi-Fi"
fi
# Use rofi to select wifi network
chosen_network=$(echo -e "$toggle\n$wifi_list" | uniq -u | rofi -dmenu -i -selected-row 1 -p "Wi-Fi SSID: ")
# Get name of connection
chosen_id=$(echo "${chosen_network:3}" | xargs)
if [ "$chosen_network" = "" ]; then
exit
elif [ "$chosen_network" = " Enable Wi-Fi" ]; then
nmcli radio wifi on
elif [ "$chosen_network" = " Disable Wi-Fi" ]; then
nmcli radio wifi off
else
# Message to show when connection is activated successfully
success_message="Connected: \"$chosen_id\""
# Get saved connections
saved_connections=$(nmcli -g NAME connection)
if [[ $(echo "$saved_connections" | grep -w "$chosen_id") = "$chosen_id" ]]; then
nmcli connection up id "$chosen_id" | grep "successfully" && notify-send "Connection Established" "$success_message"
else
if [[ "$chosen_network" =~ "" ]]; then
wifi_password=$(rofi -dmenu -p "Password: ")
fi
nmcli device wifi connect "$chosen_id" password "$wifi_password" | grep "successfully" && notify-send "Connection Established" "$success_message"
fi
fi

View file

@ -1,8 +1,9 @@
#!/usr/bin/env bash
#Restart Waybar and swaync
XDG_CONFIG_HOME="$HOME/.dummy" # Prevent swaync use default gtk theme
pkill -f waybar
pkill -f swaync
killall .waybar-wrapped
killall .swaync-wrapped
waybar -c ~/.config/waybar/config.json -s ~/.config/waybar/style.css &
XDG_CONFIG_HOME="$HOME/.dummy" # Prevent swaync use default gtk theme
swaync -c ~/.config/swaync/config.json -s ~/.config/swaync/style.css &