aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/ddquakemite
blob: c38225a9413c3c122a8694113eea050a0c480aaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

if ! [ -z "$(swaymsg -t get_tree | grep 'ddterminal')" ]; then
    if [ -z "$(swaymsg -t get_tree | grep -A 46 'ddterminal' | tail -n 1 | grep 'true')" ]; then
        swaymsg '[title="ddterminal"] scratchpad show'
    else
        swaymsg '[title="ddterminal"] move scratchpad'
    fi
else
    $TERMINAL -t "ddterminal" -e tmuxatt &
    sleep 0.2s
    currenty=$(swaygetcurrentwindow | cut -d ' ' -f1 | cut -d ',' -f2 )
    let moveup=$currenty-30
    swaymsg move up "$moveup px"
fi