Ampera's Forums

Hobby Discussion => Software => Topic started by: Ampera on January 26, 2022, 08:47:23 AM

Title: Launch or Bring to Front and Launch if Not Running
Post by: Ampera on January 26, 2022, 08:47:23 AM
Small helper scripts

"laorbtf" (Launch or Bring to Front)


#!/bin/sh

if [ "$(pgrep $1)" == "" ]; then
        exec $1 &
else
        wmctrl -a $2
fi


Needs wmctrl. First argument is command/process name, second argument is window class/name

"laifnr" Launch if Not Running


#!/bin/sh
if [" $(pgrep $1)" == "" ]; then
        exec $1 &
fi


First argument is name of the command/process name