Skip to content

Instantly share code, notes, and snippets.

@meesha7
Last active May 18, 2020
Embed
What would you like to do?
ros stands for "run or switch", a simple script to either start a program or switch to its window using wmctrl, ideal for shortcuts
#!/bin/bash
PID=$(pgrep $1)
if [ ${PID:-null} = null ]
then
$1 &
else
wmctrl -xa $1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment