Launch or Bring to Front and Launch if Not Running

Started by Ampera, January 26, 2022, 08:47:23 AM

Previous topic - Next topic

Ampera

January 26, 2022, 08:47:23 AM Last Edit: January 26, 2022, 08:52:52 AM by Ampera
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