-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathvlc-hangouts
executable file
·50 lines (44 loc) · 2.28 KB
/
vlc-hangouts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
xrandr --listactivemonitors
read -p "Which monitor you want to share: " MON_NUMBER
# MON_NUMBER=0 # for debugging
MON_PARSE=`xrandr --listactivemonitors | grep "$MON_NUMBER:" | cut -f4 -d' '`
MON_HEIGHT=`echo $MON_PARSE | cut -f2 -d'/' | cut -f2 -d'x'`
MON_WIDTH=`echo $MON_PARSE | cut -f1 -d'/'`
MON_X=`echo $MON_PARSE | cut -f2 -d'+'`
MON_Y=`echo $MON_PARSE | cut -f3 -d'+'`
vlc ${IFS# } \
--ignore-config ${IFS# I use pause-click plugin, but in this script I want it to be disabled} \
--no-qt-privacy-ask ${IFS# Suppress first-run dialog pop-up } \
${IFS# --fullscreen to maximize window, so no borders will be seen } \
${IFS# --marq-marquee="VLC window" Overlay text in VLC window for ability to recognize fullscreen vlc window} \
--meta-title "ShareMe" ${IFS# To simplify selecting vlc window in hangouts } \
${IFS# --no-video-title For not confusing you while target window opens } \
--qt-minimal-view ${IFS# hide video control and window menu }\
--screen-fps=20 \
--screen-top=$MON_Y \
--screen-left=$MON_X \
--screen-width=$MON_WIDTH \
--screen-height=$MON_HEIGHT \
screen:// &> /dev/null &
VLC_PID=$!
# echo $VLC_PID
# wmctrl -r "Do NOT share this window - VLC media player" -b toggle,shaded # shading playlist window
# xdotool windowminimize `xdotool search --name "Do NOT share this window - VLC media player"` # Minimizing playlist window
# sleep 1 # sleep a while, otherwize rename will not work
# TARGETWINDOW=`wmctrl -l | grep VLC | cut -f 1 -d " "`
# TARGETWINDOW=`wmctrl -l | grep Dolphin | cut -f 1 -d " "`
# echo TARGETWINDOW=$TARGETWINDOW
# wmctrl -i -r $TARGETWINDOW -N "share me" # rename to easily spot in hangouts window chooser. I do it such way cos title differs in different locales
# wmctrl -r "share me" -t 1 # Move target window to second virtual desktop
# rename and move to other desktop works, but for some reason it disappears from hangouts window chooser. So, I decided to not rename it
# wmctrl -i -r $TARGETWINDOW -t 1
cat << EOF | bash & # run extramaus while vlc is running
~/bin/extramaus & # launch extramaus and background it
while ps -p $VLC_PID > /dev/null; do
# date; echo "PROCESS IS RUNNING"
sleep 1
done
# echo "PROCESS TERMINATED"
killall extramaus &> /dev/null # kill extramaus after vlc was terminated
EOF