Files
dotfiles/.local/bin/movie
T
Daniele Fucini b10970bf36 Keep the wallpaper when movie restores the screen layout
.fehbg now saves its random picks to ~/.cache/wallpapers and redraws them with
--keep; screen-layout passes this through with --keep-wallpaper, used by movie.
2026-10-24 16:31:02 +02:00

15 lines
449 B
Bash
Executable File

#!/bin/bash
# Plays videos on the external monitor only, with the laptop screen off.
# Opened from lf for video/* files; restores the normal layout when mpv exits.
# Single-screen mode only makes sense with the external monitor plugged in
if ! xrandr --query | grep -q '^HDMI-1-0 connected'; then
exec mpv "$@"
fi
trap '"$HOME"/.local/bin/screen-layout --keep-wallpaper' EXIT
trap 'exit 130' INT TERM HUP
xrandr --output eDP-1 --off
mpv "$@"