#!/bin/bash

# Define the configuration file path
FILE="$HOME/.config/hypr/privacy.conf"

if [ ! -f "$FILE" ]; then
    echo "File not found: $FILE"
    exit 1
fi

# Toggle comments
# If the first line is not commented out, comment out the entire file
if ! grep -q '^#' "$FILE"; then

    if [ $1 = 'g' ]; then
        echo "true"
        exit 0
    fi
    sed -i 's/^/#/' "$FILE"
    echo "Commented out all lines in $FILE."
else
    if [ $1 = 'g' ]; then
        echo "false"
        exit 0
    fi

    sed -i 's/^#//g' "$FILE"
    echo "Uncommented all lines in $FILE."
fi
