Update config

This commit is contained in:
stitchy 2024-02-11 23:37:14 +00:00
parent 9f35c3997a
commit 46c65664f1
Signed by: stitchy
SSH key fingerprint: SHA256:yz2SoxdnY67tfY5Jzb0f2v8f5W3o/IF359kbcquWip8
10 changed files with 748 additions and 0 deletions

View file

@ -0,0 +1,33 @@
#!/usr/bin/env bash
# Low battery notifier
# Kill already running processes
already_running="$(ps -fC 'grep' -N | grep 'low-battery.sh' | wc -l)"
if [[ $already_running -gt 1 ]]; then
pkill -f --older 1 'low-battery.sh'
fi
while [[ 0 -eq 0 ]]; do
battery_status="$(cat /sys/class/power_supply/BAT1/status)"
battery_charge="$(cat /sys/class/power_supply/BAT1/capacity)"
if [[ $battery_status == 'Discharging' && $battery_charge -le 25 ]]; then
if [[ $battery_charge -le 5 ]]; then
notify-send --icon="${XDG_CONFIG_HOME:-~/.config}/dunst/images/Low-Battery.png" --urgency=critical "Battery critical!" "${battery_charge}%"
sleep 180
elif [[ $battery_charge -le 10 ]]; then
notify-send --icon="${XDG_CONFIG_HOME:-~/.config}/dunst/images/Low-Battery2.png" --urgency=critical "Battery critical!" "${battery_charge}%"
sleep 600
elif [[ $battery_charge -le 15 ]]; then
notify-send --icon="${XDG_CONFIG_HOME:-~/.config}/dunst/images/Low-Battery2.png" "Battery low!" "${battery_charge}%"
sleep 600
elif [[ $battery_charge -le 20 ]]; then
notify-send --icon="${XDG_CONFIG_HOME:-~/.config}/dunst/images/Low-Battery2.png" "Battery low!" "${battery_charge}%"
sleep 600
else
sleep 600
fi
else
sleep 1200
fi
done

View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Mute Toggle Script
# Toggle Mute State
$(wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle)
# Query Pipewire for Mute State
mute="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $3}')"
# Send Different Notification if Muted or Not
if [[ "$mute" == "" ]]; then
# Send the notification
$(dunstify "Unmuted" -i ${XDG_CONFIG_HOME:-~/.config}/dunst/images/volumeUnMute.png -h string:x-dunst-stack-tag:volume)
else
# Send the other notification
$(dunstify "Muted" -i ${XDG_CONFIG_HOME:-~/.config}/dunst/images/volumeMute.png -h string:x-dunst-stack-tag:volume)
fi

View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
#Change Volume Script
# Query Pipewire and Parse Mute State
mute="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $3}')"
# Check to see if it is muted, if so, don't change volume.
# Otherwise, change volume and Send the notification.
if [[ "$mute" == "" ]]; then
# Change the volume
$(wpctl set-volume @DEFAULT_AUDIO_SINK@ $@)
# Query Pipewire and Parse Volume as an Int
volume="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2}')"
vol=${volume//.}
# Send the notification
$(dunstify -h int:value:"$vol" Volume: $vol -h string:x-dunst-stack-tag:volume)
$(echo $vol > ${XDG_CACHE_HOME:-~/.cache}/eww/vol)
else
# Send the other notification
$(dunstify -i ${XDG_CONFIG_HOME:-~/.config}/dunst/images/volumeMute.png "Volume Muted" -h string:x-dunst-stack-tag:volume)
fi