#!/bin/sh

start_if_not_running()
{
    program=$1
    pidof -sq $program
    if [ "$?" -eq "1" ]; then
        start_program $1
    else
        echo "$program is already running"
    fi
}

start_program()
{
    program=$1
    echo "Starting $program..."
    $program & > /dev/null
}

i3-msg 'workspace 9; append_layout ~/.config/i3/workspace-messaging.json'
start_program nheko
sleep 0.1
start_program telegram-desktop
sleep 0.1
start_program thunderbird
sleep 0.1
