#!/bin/sh if pidof vk > /dev/null; then if [ -z $(swaymsg -t get_tree | grep -B 6 'vk' | head -n 1 | grep 'true') ]; then swaymsg '[instance="vk"] scratchpad show' else swaymsg '[instance="vk"] move scratchpad' fi else vk-messenger fi