add scripts

This commit is contained in:
surtur 2023-07-14 14:13:49 +02:00
parent f409b2c14b
commit d896285682
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI
2 changed files with 90 additions and 0 deletions

68
screen-share-sway Executable file

@ -0,0 +1,68 @@
#!/bin/bash
set -e -o pipefail
# 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
V4L2_VERSION="0.12.5 (unused)"
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"
# ref: https://github.com/obsproject/obs-studio/wiki/Install-Instructions#red-hatfedora-based-build-directions
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
git pull
git submodule update --recursive
mkdir -pv build && cd build
# cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr ..
# cmake -DUNIX_STRUCTURE=1 -DENABLE_PIPEWIRE=OFF -DCMAKE_INSTALL_PREFIX=/usr ..
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DUNIX_STRUCTURE=1 \
-DENABLE_PIPEWIRE=ON \
-DENABLE_BROWSER=OFF \
-DENABLE_AJA=OFF \
-DCMAKE_INSTALL_PREFIX=/usr .. \
&& \
make clean && \
sudo make install
###if [ ! -d "$U/obs-v4l2sink" ]; then
### cd "$U" || exit
### git clone https://github.com/CatxFish/obs-v4l2sink.git
###fi
###cd "$U"/obs-v4l2sink || exit
###git pull
###
###mkdir -pv build && cd build
###cmake -DLIBOBS_INCLUDE_DIR="$HOME/utils/obs-studio/libobs" -DCMAKE_INSTALL_PREFIX="$HOME/.local" ..
###make
###make install
###if [ ! -d "$U/wlrobs" ]; then
### cd "$U" || exit
### hg clone https://hg.sr.ht/~scoopta/wlrobs
###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
###TGT="$HOME/.config/obs-studio/plugins/wlrobs/bin/64bit"
###mkdir -pv "$TGT"
###cp -v build/libwlrobs.so "$TGT"

22
v4l2pls Executable file

@ -0,0 +1,22 @@
#!/bin/bash
nutmp=$(mktemp -d)
cd "$nutmp"
mkdir -v src && cd ./src/
version="$1"
modn="v4l2loopback"
# download and extract the tarball
curl -L https://github.com/umlaeute/${modn}/archive/v${version}.tar.gz | tar xvzf -
# sudo mkdir -pv /usr/src/${modn}-${version}
sudo cp -Rv ${modn}-${version} /usr/src/
# build and install the DKMS-module (requires superuser privileges)
sudo dkms add -m ${modn} -v ${version}
sudo dkms build -m ${modn} -v ${version}
sudo dkms install -m ${modn} -v ${version}
sudo rm -rfv /usr/src/${modn}-${version}
cd /tmp
rm -rfv $nutmp
# see
# https://github.com/umlaeute/v4l2loopback#load-the-module-at-boot