2021-02-17 23:47:43 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Screen Sharing with OBS Studio on Fedora and Sway
|
|
|
|
# ref: https://github.com/hw0lff/screen-share-sway
|
|
|
|
|
|
|
|
grep -q "alias obs" ~/.zshrc || echo 'alias obs="QT_QPA_PLATFORM=xcb obs"' >> ~/.zshrc
|
|
|
|
|
2021-02-27 15:17:02 +01:00
|
|
|
V4L2_VERSION="0.12.5"
|
|
|
|
U="$HOME/utils"
|
2021-04-20 22:50:11 +02:00
|
|
|
MAKEFLAGS="$MAKEFLAGS -j$(nproc)" # take the honeybadger approach
|
|
|
|
printf '*- MAKEFLAGS: %s\n*- v4l2 version: %s\n' "$MAKEFLAGS" "$V4L2_VERSION"
|
2021-02-17 23:47:43 +01:00
|
|
|
|
2021-02-27 15:17:02 +01:00
|
|
|
# grab and build latest v4l2 module
|
|
|
|
"$U"/dotfiles/bin/v4l2pls "$V4L2_VERSION"
|
2021-02-17 23:47:43 +01:00
|
|
|
|
|
|
|
# ref: https://github.com/obsproject/obs-studio/wiki/Install-Instructions#red-hatfedora-based-build-directions
|
2021-02-27 15:17:02 +01:00
|
|
|
if [ ! -d "$U/obs-studio" ]; then
|
|
|
|
cd "$U" || exit
|
|
|
|
git clone --recursive https://github.com/obsproject/obs-studio.git
|
|
|
|
fi
|
|
|
|
cd "$U"/obs-studio || exit
|
2021-02-17 23:47:43 +01:00
|
|
|
git pull
|
|
|
|
git submodule update --recursive
|
|
|
|
mkdir -pv build && cd build
|
|
|
|
cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr ..
|
2021-04-20 22:50:11 +02:00
|
|
|
make
|
2021-02-17 23:47:43 +01:00
|
|
|
sudo make install
|
|
|
|
|
|
|
|
|
2021-02-27 15:17:02 +01:00
|
|
|
if [ ! -d "$U/obs-v4l2sink" ]; then
|
|
|
|
cd "$U" || exit
|
|
|
|
git clone https://github.com/CatxFish/obs-v4l2sink.git
|
|
|
|
fi
|
|
|
|
cd "$U"/obs-v4l2sink || exit
|
2021-02-17 23:47:43 +01:00
|
|
|
git pull
|
|
|
|
|
|
|
|
mkdir -pv build && cd build
|
2021-04-20 22:50:11 +02:00
|
|
|
cmake -DLIBOBS_INCLUDE_DIR="$HOME/utils/obs-studio/libobs" -DCMAKE_INSTALL_PREFIX="$HOME/.local" ..
|
|
|
|
make
|
2021-02-17 23:47:43 +01:00
|
|
|
make install
|
|
|
|
|
|
|
|
|
2021-02-27 15:17:02 +01:00
|
|
|
if [ ! -d "$U/wlrobs" ]; then
|
|
|
|
cd "$U" || exit
|
|
|
|
hg clone https://hg.sr.ht/~scoopta/wlrobs
|
|
|
|
fi
|
|
|
|
cd "$U"/wlrobs || exit
|
2021-02-17 23:47:43 +01:00
|
|
|
hg pull
|
2021-03-14 04:52:19 +01:00
|
|
|
hg update
|
2021-04-20 22:50:11 +02:00
|
|
|
if [ ! -d build ]; then
|
|
|
|
mkdir -pv build
|
|
|
|
meson build
|
|
|
|
fi
|
2021-02-27 15:17:02 +01:00
|
|
|
meson --reconfigure build
|
2021-02-17 23:47:43 +01:00
|
|
|
ninja -C build
|
2021-04-20 22:50:11 +02:00
|
|
|
TGT="$HOME/.config/obs-studio/plugins/wlrobs/bin/64bit"
|
|
|
|
mkdir -pv "$TGT"
|
|
|
|
cp -v build/libwlrobs.so "$TGT"
|