fix: properly run screenshare as user and service

This commit is contained in:
Leon Schwarzäugl 2025-03-22 23:11:50 +01:00
parent 868b8eaec5
commit d7a7571b00
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
5 changed files with 76 additions and 10 deletions

View file

@ -1,6 +1,23 @@
headless="false"
while [[ $# -gt 0 ]]; do
case "$1" in
-h)
headless="true"
;;
*)
echo "Invalid option detected."
;;
esac
shift
done
SHARESCREEN="$(nix eval --raw ~/.dotfiles#nixosConfigurations."$(hostname)".config.home-manager.users."$(whoami)".swarselsystems.sharescreen)"
wl-mirror "$SHARESCREEN" &
sleep 0.1
swaymsg '[app_id=at.yrlf.wl_mirror] move to workspace 14:T'
swaymsg '[app_id=at.yrlf.wl_mirror] fullscreen'
if [[ $headless == "true" ]]; then
wl-mirror "$SHARESCREEN"
else
wl-mirror "$SHARESCREEN" &
sleep 0.1
swaymsg '[app_id=at.yrlf.wl_mirror] move to workspace 14:T'
swaymsg '[app_id=at.yrlf.wl_mirror] fullscreen'
fi