feat: mirror display toggle
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||
monitor=eDP-1, 1920x1080, 0x0, 1
|
||||
monitor=HDMI-A-1, 1920x1080, -1920x-100, 1
|
||||
# monitor=eDP-1, 1920x1080, 0x0, 1
|
||||
# monitor=HDMI-A-1, 1920x1080, -1920x-100, 1
|
||||
|
||||
###################
|
||||
### MY PROGRAMS ###
|
||||
@@ -663,4 +663,4 @@ debug {
|
||||
disable_logs = false
|
||||
}
|
||||
|
||||
# source = ~/.config/hypr/monitors.conf
|
||||
source = ~/.config/hypr/monitors.conf
|
||||
|
||||
22
hypr/scripts/toggle_mirror_display.sh
Executable file
22
hypr/scripts/toggle_mirror_display.sh
Executable 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
|
||||
Reference in New Issue
Block a user