19 lines
274 B
Plaintext
19 lines
274 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
window() {
|
||
|
NAME=$1
|
||
|
LOCK_FILE="$XDG_CACHE_HOME/eww_${NAME}.lock"
|
||
|
|
||
|
if [ ! -f "$LOCK_FILE" ]; then
|
||
|
eww open "${NAME}_win"
|
||
|
touch "$LOCK_FILE"
|
||
|
echo "opened $NAME"
|
||
|
else
|
||
|
eww close "${NAME}_win"
|
||
|
rm "$LOCK_FILE"
|
||
|
echo "closed $NAME"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
window "$1"
|