Switch to Dracula theme

This commit is contained in:
sankalp committed 2024-03-26 01:01:28 +05:45
1 parent 5a9704167b
commit 2e6288f46b
4362 files changed
+442691 -3809

No files matched your search

+29 -31
View File
@@ -1,5 +1,9 @@
#!/bin/bash
source ~/.config/hypr/scripts/Ref.sh
# Source the configuration file.
CONFIG_FILE=~/dotfiles/hypr/scripts/Ref.sh
source "$CONFIG_FILE"
######################################
# #
@@ -68,8 +72,6 @@ reload_all() {
waybar &
sleep 0.5
swaync > /dev/null 2>&1 &
# for cava-pywal (note, need to manually restart cava once wallpaper changes)
ln -sf "$HOME/.cache/wal/cava-colors" "$HOME/dotfiles/cava/config" || true
}
######################################
@@ -124,42 +126,38 @@ lock_screen() {
######################################
battery_notify() {
PREV_STATUS="Unknown" # Initialize previous status
FULL_CHARGE_NOTIFIED=0
LOW_BATTERY_NOTIFIED=0
PREV_STATUS="Unknown" # Initialize previous status
FULL_CHARGE_NOTIFIED=0
LOW_BATTERY_NOTIFIED=0
while true; do
STATUS=$(cat /sys/class/power_supply/AC/online 2>/dev/null) # Get charger status using power supply directory
while true; do
STATUS=$(cat /sys/class/power_supply/AC/online 2>/dev/null) # Get charger status using power supply directory
if [ "$STATUS" != "$PREV_STATUS" ]; then # Check if the charger status has changed
FULL_CHARGE_NOTIFIED=0 # Reset full charge notification state when charger status changes
LOW_BATTERY_NOTIFIED=0 # Reset low battery notification state when charger status changes
if [ "$STATUS" == "1" ]; then # Send a notification when charger is plugged in or unplugged
notify-send -u low "🔌 Charger Plugged In" "Battery charging"
else
notify-send -u low "🔌 Charger Unplugged" "Battery not charging"
if [ "$STATUS" != "$PREV_STATUS" ]; then # Check if the charger status has changed
FULL_CHARGE_NOTIFIED=0 # Reset full charge notification state when charger status changes
LOW_BATTERY_NOTIFIED=0 # Reset low battery notification state when charger status changes
PREV_STATUS="$STATUS" # Update previous status
fi
PREV_STATUS="$STATUS" # Update previous status
fi
# Get battery percentage and remaining time using acpi
BATTERY_INFO=$(acpi)
PERCENT=$(echo "$BATTERY_INFO" | awk -F ',|%' '{print $2}')
# Get battery percentage and remaining time using acpi
BATTERY_INFO=$(acpi)
PERCENT=$(echo "$BATTERY_INFO" | awk -F ',|%' '{print $2}')
if [ "$STATUS" == "1" ] && [ "$PERCENT" -eq 100 ] && [ "$FULL_CHARGE_NOTIFIED" -eq 0 ]; then # Check if the battery is charging and the percentage is 100%
notify-send -u low "🔌 Battery Fully Charged" "You can unplug the charger" # Send a notification when the battery is fully charged
FULL_CHARGE_NOTIFIED=1 # Set the state to indicate that the full charge notification has been sent
fi
if [ "$STATUS" == "1" ] && [ "$PERCENT" -eq 100 ] && [ "$FULL_CHARGE_NOTIFIED" -eq 0 ]; then # Check if the battery is charging and the percentage is 100%
notify-send -u low "🔌 Battery Fully Charged" "You can unplug the charger" # Send a notification when the battery is fully charged
FULL_CHARGE_NOTIFIED=1 # Set the state to indicate that the full charge notification has been sent
fi
if [ "$PERCENT" -le 20 ] && [ "$LOW_BATTERY_NOTIFIED" -eq 0 ]; then # Check if the battery percentage is less than or equal to 20% and low battery notification has not been sent
notify-send -u critical "🪫 Low Battery" "Plug in the charger" # Send low battery notification
LOW_BATTERY_NOTIFIED=1 # Set the state to indicate that the low battery notification has been sent
fi
sleep 0.1 # Sleep for some time before checking again
done
if [ "$PERCENT" -le 20 ] && [ "$LOW_BATTERY_NOTIFIED" -eq 0 ]; then # Check if the battery percentage is less than or equal to 20% and low battery notification has not been sent
notify-send -u critical "🪫 Low Battery" "Plug in the charger" # Send low battery notification
LOW_BATTERY_NOTIFIED=1 # Set the state to indicate that the low battery notification has been sent
fi
sleep 0.1 # Sleep for some time before checking again
done
}
######################################
# #
# Polkit #