nixos-configs/config/eww/scripts/heart.sh

44 lines
764 B
Bash
Executable file

#!/usr/bin/env bash
FILE="$HOME/.config/.heart"
toggle() {
if grep -q 󰣐 "$FILE"; then
eww update heart-ts=false
echo  > "$FILE"
else
eww update heart-ts=true
echo 󰣐 >> "$FILE"
fi
}
[[ "$1" == "toggle" ]] && toggle
startup() {
if [[ ! -f "$FILE" ]]; then
echo 󰣐 > "$FILE"
fi
if [[ ! -f "$HOME/.config/.bluetooth" ]]; then
echo 󰂲 > "$FILE"
fi
if grep -q 󰂲 "$HOME/.config/.bluetooth"; then
rfkill block bluetooth
fi
"$HYPR_PATH"/osk-toggle.sh getState &
"$EWW_PATH"/on-release.sh &
"$EWW_PATH"/music.sh accents &
input-emulator start mouse -n &
if grep -q 󰣐 "$FILE"; then
sleep 0.9 &&
eww update heart-ts=true
fi
tail -f "$FILE"
}
[[ "$1" == "startup" ]] && startup