diff --git a/dist/50-xenia-systemd-inhibit.rules b/dist/50-xenia-systemd-inhibit.rules new file mode 100644 index 0000000..69c9e4b --- /dev/null +++ b/dist/50-xenia-systemd-inhibit.rules @@ -0,0 +1,16 @@ +/* allow inhibits all the time for xenia */ +polkit.addRule(function(action, subject) { + if ((action.id == "org.freedesktop.login1.inhibit-block-shutdown" || + action.id == "org.freedesktop.login1.inhibit-delay-shutdown" || + action.id == "org.freedesktop.login1.inhibit-block-sleep" || + action.id == "org.freedesktop.login1.inhibit-delay-sleep" || + action.id == "org.freedesktop.login1.inhibit-block-idle" || + action.id == "org.freedesktop.login1.inhibit-delay-idle" || + action.id == "org.freedesktop.login1.inhibit-handle-lid-switch" || + action.id == "org.freedesktop.login1.inhibit-handle-reboot-key" || + action.id == "org.freedesktop.login1.inhibit-handle-power-key" || + action.id == "org.freedesktop.login1.inhibit-handle-suspend-key" + ) && subject.isInGroup("xenia-systemd-inhibit")) { + return polkit.Result.YES; + } +}); diff --git a/dist/jitsi.sh b/dist/jitsi.sh new file mode 100755 index 0000000..4ce9717 --- /dev/null +++ b/dist/jitsi.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +if [ $# -lt 2 ]; then + echo "usage: $0 [mode]" +fi + +domain=$1 +room=$2 +mode=$3 + + +if [ $mode == "bosh" ]; then + exec systemd-inhibit --what=shutdown:sleep:idle --why="active jitsi session: $domain/$room" --who="gst-meet modxenia" -- .cargo/bin/gst-meet --bosh-url="https://$domain/http-bind?room=$room" --room-name=$room --send-pipeline "autoaudiosrc ! queue ! audioconvert ! audioresample ! opusenc name=audio" --recv-pipeline="audiomixer name=audio ! autoaudiosink" --nick="xeninya (pinephone)" +else + exec systemd-inhibit --what=shutdown:sleep:idle --why="active jitsi session: $domain/$room" --who="gst-meet modxenia" -- .cargo/bin/gst-meet --web-socket-url="wss://$domain/xmpp-websocket?room=$room" --room-name=$room --send-pipeline "autoaudiosrc ! queue ! audioconvert ! audioresample ! opusenc name=audio" --recv-pipeline="audiomixer name=audio ! autoaudiosink" -v --nick="xeninya (pinephone)" +fi