#!/bin/bash

export FBK_BLOCK_IDLE=true

if [[ -n "$SSH_CONNECTION" ]]; then
    exec systemd-inhibit \
        --who="SSH session" \
        --why="Don't sleep while SSH session active" \
        --what=idle \
        --mode=block \
        zsh
else
    echo "This script is intended to be run in an SSH session."
    echo "You can run systemd-inhibit directly if you want to block anyway."
    exit 1
fi
