You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
601 B
Bash
21 lines
601 B
Bash
#!/bin/bash
|
|
|
|
# checks if instance of arg 1 exists, will show it if it does
|
|
exists=$(swaymsg "[instance=$1] scratchpad show" 2>&1 | grep -i error)
|
|
if [ -n "$exists" ] ; then
|
|
# creating it then showing
|
|
if [ -z "$1" ] ; then
|
|
echo "Missing class in arg 1" >&2
|
|
exit 1
|
|
elif [ -z "$2" ] ; then
|
|
echo "Missing command to launch application in arg 2" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# runs remaining commands and shows
|
|
${@:2} 2>&1 1>/dev/null &
|
|
sleep 1
|
|
# lets application load then shows it on scratchpad
|
|
swaymsg "[instance=$1] scratchpad show" 1>/dev/null
|
|
fi
|