elenapan/bin/scratchpad
elenapan c738169ca5 New theme: ephemeral, anti-aliased corners, app drawer, lock screen,
evil daemon system, dependency list update, README improvements.


Former-commit-id: db310f8e49
Former-commit-id: 4f25f9200c3ac9f9385daca5a68378249ff0329e
Former-commit-id: 69fa3954e5738446a59b409b7e326233e7c3ef55
Former-commit-id: 673176f7857e39f3455f4ccb426eef2789c0e891
2019-08-01 02:17:59 +03:00

16 lines
572 B
Bash
Executable file

#!/bin/bash
SCRATCHPAD_SESSION="$(tmux ls | grep scratchpad)"
SCRATCHPAD_WINDOW="$(xdotool search --classname scratchpad)"
# If there is no such window
# (Checking for the window should not be necessary if AwesomeWM does it already)
if [ ${#SCRATCHPAD_WINDOW} -eq "0" ]; then
# If the session does not exist, create a new one
if [ ${#SCRATCHPAD_SESSION} -eq "0" ]; then
kitty -1 --class scratchpad -e tmux new-session -s scratchpad &
# Else attach to the session
else
kitty -1 --class scratchpad -e tmux attach -t scratchpad &
fi
fi