feat: mirror display toggle

This commit is contained in:
2025-09-27 03:10:45 +03:00
parent e5e4220398
commit e2428035ca
3 changed files with 31 additions and 3 deletions

View File

@@ -0,0 +1,22 @@
#!/bin/bash
# Define the file to modify
FILE="$HOME/.config/hypr/monitors.conf"
# Get the last line of the file
LAST_LINE=$(tail -n 1 "$FILE")
# Check if the first argument is "g"
if [ "$1" = "g" ]; then
[[ $LAST_LINE == \#* ]] && echo false || echo true
exit 0
fi
# Check if the last line is commented
if [[ $LAST_LINE == \#* ]]; then
# Uncomment the last line
sed -i '$s/^# //' "$FILE"
else
# Comment the last line
sed -i '$s/^/# /' "$FILE"
fi