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:
@@ -38,6 +38,7 @@ cmd open &{{
|
||||
case $(file --mime-type -Lb $f) in
|
||||
text/*) lf -remote "send $id \$$EDITOR \$fx";;
|
||||
application/json) lf -remote "send $id \$$EDITOR \$fx";;
|
||||
video/*) movie $fx > /dev/null 2> /dev/null;;
|
||||
*) for f in $fx; do $OPENER $f > /dev/null 2> /dev/null & done;;
|
||||
esac
|
||||
}}
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user