Add movie mode for watching videos on the external monitor

The screen layout and trayer setup moved from xmonad.hs to a shared
screen-layout script. lf opens videos with movie.
This commit is contained in:
Daniele Fucini
2026-10-10 18:52:07 +02:00
parent 6dfc81e54b
commit 4d51374801
4 changed files with 40 additions and 16 deletions
+4 -16
View File
@@ -68,30 +68,18 @@ myScreenshotDir = "/home/fuxino/Pictures/Screenshots/"
myScreenshotName :: String
myScreenshotName = "Screenshot-%Y-%m-%d-%H%M%S.png"
-- Sets up the outputs and the wallpaper, and leaves the tray's monitor in $tray
-- Sets up the outputs, the wallpaper and trayer; shared with ~/.local/bin/movie
myScreenLayout :: String
myScreenLayout =
"if xrandr --query | grep -q '^HDMI-1-0 connected'; then"
++ " xrandr --output HDMI-1-0 --preferred --primary --output eDP-1 --right-of HDMI-1-0 --preferred; tray=1;"
++ " else xrandr --output eDP-1 --preferred --primary --output HDMI-1-0 --off; tray=0; fi"
++ "; ~/.fehbg"
-- Replaces any running trayer, so there's never more than one
myTrayer :: String
myTrayer =
"pkill -x trayer; while pgrep -x trayer > /dev/null; do sleep 0.1; done; \
\trayer -l --edge top --align right --SetDockType true \
\--SetPartialStrut true --expand true --widthtype request \
\--tint 0x232634 --height 18 --monitor $tray"
myScreenLayout = "/home/fuxino/.local/bin/screen-layout"
-- Safe to re-run (e.g. spawnOnce after this string changes and xmonad restarts)
myScreenSetup :: String
myScreenSetup =
"sleep 1; " ++ myScreenLayout ++ "; pgrep -x picom > /dev/null || picom -b -c; " ++ myTrayer
"sleep 1; " ++ myScreenLayout ++ "; pgrep -x picom > /dev/null || picom -b -c"
-- Run when a monitor is (dis)connected; restarts trayer so it moves to the right screen
myScreenHotplug :: String
myScreenHotplug = myScreenLayout ++ "; " ++ myTrayer
myScreenHotplug = myScreenLayout
myScratchpads :: [NamedScratchpad]
myScratchpads =