chore: screen-share-sway script improvements

* add sanity checks
* speed-up build times by taking the honeybadger approach
* fix some shellcheck warnings (mostly quotes)
* legibility++
This commit is contained in:
surtur 2021-04-20 22:50:11 +02:00
parent 2718c6fb57
commit b8a4e7ecf0
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -7,6 +7,8 @@ grep -q "alias obs" ~/.zshrc || echo 'alias obs="QT_QPA_PLATFORM=xcb obs"' >> ~/
V4L2_VERSION="0.12.5" V4L2_VERSION="0.12.5"
U="$HOME/utils" U="$HOME/utils"
MAKEFLAGS="$MAKEFLAGS -j$(nproc)" # take the honeybadger approach
printf '*- MAKEFLAGS: %s\n*- v4l2 version: %s\n' "$MAKEFLAGS" "$V4L2_VERSION"
# grab and build latest v4l2 module # grab and build latest v4l2 module
"$U"/dotfiles/bin/v4l2pls "$V4L2_VERSION" "$U"/dotfiles/bin/v4l2pls "$V4L2_VERSION"
@ -21,7 +23,7 @@ git pull
git submodule update --recursive git submodule update --recursive
mkdir -pv build && cd build mkdir -pv build && cd build
cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr .. cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4 make
sudo make install sudo make install
@ -33,8 +35,8 @@ cd "$U"/obs-v4l2sink || exit
git pull git pull
mkdir -pv build && cd build mkdir -pv build && cd build
cmake -DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" -DCMAKE_INSTALL_PREFIX=~/.local .. cmake -DLIBOBS_INCLUDE_DIR="$HOME/utils/obs-studio/libobs" -DCMAKE_INSTALL_PREFIX="$HOME/.local" ..
make -j4 make
make install make install
@ -45,7 +47,12 @@ fi
cd "$U"/wlrobs || exit cd "$U"/wlrobs || exit
hg pull hg pull
hg update hg update
if [ ! -d build ]; then
mkdir -pv build
meson build
fi
meson --reconfigure build meson --reconfigure build
ninja -C build ninja -C build
mkdir -pv "$HOME"/.config/obs-studio/plugins/wlrobs/bin/64bit TGT="$HOME/.config/obs-studio/plugins/wlrobs/bin/64bit"
cp -v build/libwlrobs.so "$HOME"/.config/obs-studio/plugins/wlrobs/bin/64bit mkdir -pv "$TGT"
cp -v build/libwlrobs.so "$TGT"