feat: add mirror-display toggle to launch menu
Adds a "Mirror Display" entry that calls a helper script which finds the first connected non-internal monitor and toggles mirroring of eDP-1 onto it via hyprctl. Use case: plugging into a conference room TV/projector while travelling. Also fixes the menu's "Screenshot full" entry to capture the active output instead of the hardcoded DP-1, matching the equivalent fix to the Ctrl+Print keybind. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8ac4023dc1
commit
ebea0fd6ec
2 changed files with 28 additions and 1 deletions
|
|
@ -1,7 +1,8 @@
|
||||||
Screenshot full=hyprshot -m output -m DP-1
|
Screenshot full=hyprshot -m active -m output
|
||||||
Screenshot window=hyprshot -m window
|
Screenshot window=hyprshot -m window
|
||||||
Screenshot region=hyprshot -m region
|
Screenshot region=hyprshot -m region
|
||||||
Color Picker=hyprpicker --autocopy
|
Color Picker=hyprpicker --autocopy
|
||||||
Hypertension=xdg-open ~/Documents/Private-Documents/High-Blood-Preassure-test-results.ods
|
Hypertension=xdg-open ~/Documents/Private-Documents/High-Blood-Preassure-test-results.ods
|
||||||
Emoji Picker=~/.config/hypr/scripts/emoji-picker.py
|
Emoji Picker=~/.config/hypr/scripts/emoji-picker.py
|
||||||
Shortcuts=~/.config/hypr/scripts/cheatsheet.py ~/.config/hypr/shortcuts.txt
|
Shortcuts=~/.config/hypr/scripts/cheatsheet.py ~/.config/hypr/shortcuts.txt
|
||||||
|
Mirror Display=~/.config/hypr/scripts/monitor-mirror.sh
|
||||||
|
|
|
||||||
26
hypr/scripts/monitor-mirror.sh
Executable file
26
hypr/scripts/monitor-mirror.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Toggle: mirror the internal display to the first connected external monitor.
|
||||||
|
# Travel use case — plug into a conference room TV/projector via HDMI, press
|
||||||
|
# the bound key, and the external mirrors the laptop. Press again to revert
|
||||||
|
# to the host's default monitor layout (via hyprctl reload).
|
||||||
|
|
||||||
|
set -u
|
||||||
|
|
||||||
|
internal="eDP-1"
|
||||||
|
|
||||||
|
external=$(hyprctl monitors -j | jq -r ".[] | select(.name != \"$internal\") | .name" | head -n1)
|
||||||
|
|
||||||
|
if [[ -z "$external" ]]; then
|
||||||
|
notify-send "Mirror" "No external display connected"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
mirror_of=$(hyprctl monitors -j | jq -r ".[] | select(.name == \"$external\") | .mirrorOf // \"\"")
|
||||||
|
|
||||||
|
if [[ -n "$mirror_of" ]]; then
|
||||||
|
hyprctl reload
|
||||||
|
notify-send "Mirror" "Off — reverted to default layout"
|
||||||
|
else
|
||||||
|
hyprctl keyword monitor "$external,preferred,auto,1,mirror,$internal"
|
||||||
|
notify-send "Mirror" "On — $internal → $external"
|
||||||
|
fi
|
||||||
Loading…
Add table
Add a link
Reference in a new issue