diff --git a/i3/i3/scripts/open-messaging b/i3/i3/scripts/open-messaging new file mode 100755 index 0000000..b4f09fd --- /dev/null +++ b/i3/i3/scripts/open-messaging @@ -0,0 +1,23 @@ +#!/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 +} + +start_program schildichat-desktop +start_program telegram-desktop +start_program thunderbird