Files
dotfiles/hypr/scripts/grayscale-toggle.sh
2025-06-03 14:16:01 +03:00

23 lines
496 B
Bash
Executable File

#!/bin/bash
FILENAME="$HOME/.config/hypr/grayscale.conf"
# Check if the file exists
if [ ! -f "$FILENAME" ]; then
echo "File not found: $FILENAME"
exit 1
fi
# Check if the file is already commented
if grep -q '^[[:space:]]*#' "$FILENAME"; then
echo "Uncommenting the file: $FILENAME"
# Uncomment the lines
sed -i 's/^[[:space:]]*#\s*//g' "$FILENAME"
else
echo "Commenting the file: $FILENAME"
# Comment the lines
sed -i 's/^/# /' "$FILENAME"
fi
hyprctl reload