From b8a4e7ecf060f8e3585b00239e9cf189e372d4ff Mon Sep 17 00:00:00 2001 From: surtur Date: Tue, 20 Apr 2021 22:50:11 +0200 Subject: [PATCH] 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++ --- bin/screen-share-sway | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/bin/screen-share-sway b/bin/screen-share-sway index a8c77bb..16c4ef0 100755 --- a/bin/screen-share-sway +++ b/bin/screen-share-sway @@ -7,6 +7,8 @@ grep -q "alias obs" ~/.zshrc || echo 'alias obs="QT_QPA_PLATFORM=xcb obs"' >> ~/ V4L2_VERSION="0.12.5" 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 "$U"/dotfiles/bin/v4l2pls "$V4L2_VERSION" @@ -21,7 +23,7 @@ git pull git submodule update --recursive mkdir -pv build && cd build cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr .. -make -j4 +make sudo make install @@ -33,8 +35,8 @@ cd "$U"/obs-v4l2sink || exit git pull mkdir -pv build && cd build -cmake -DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" -DCMAKE_INSTALL_PREFIX=~/.local .. -make -j4 +cmake -DLIBOBS_INCLUDE_DIR="$HOME/utils/obs-studio/libobs" -DCMAKE_INSTALL_PREFIX="$HOME/.local" .. +make make install @@ -45,7 +47,12 @@ fi cd "$U"/wlrobs || exit hg pull hg update +if [ ! -d build ]; then + mkdir -pv build + meson build +fi meson --reconfigure build ninja -C build -mkdir -pv "$HOME"/.config/obs-studio/plugins/wlrobs/bin/64bit -cp -v build/libwlrobs.so "$HOME"/.config/obs-studio/plugins/wlrobs/bin/64bit +TGT="$HOME/.config/obs-studio/plugins/wlrobs/bin/64bit" +mkdir -pv "$TGT" +cp -v build/libwlrobs.so "$TGT"