aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/ddquakemite
blob: 0393f1e97eea3eedcca22b7b40a48458511e672c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/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" tmuxatt &
    sleep 0.2s
    curwiny=$(swaygetcurrentwindow | cut -d ' ' -f1 | cut -d ',' -f2 )
    curdisy=$(swaymsg -pt get_outputs | grep -A3 focused | grep Position | cut -d ',' -f2)
    moveup=$(($curwiny - $curdisy - 30))
    swaymsg move up "$moveup px"
fi