aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/ddquakemite
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/.local/bin/ddquakemite')
-rwxr-xr-xdotfiles/.local/bin/ddquakemite16
1 files changed, 16 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/ddquakemite b/dotfiles/.local/bin/ddquakemite
new file mode 100755
index 0000000..ef67955
--- /dev/null
+++ b/dotfiles/.local/bin/ddquakemite
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+if ! [ -z "$(swaymsg -t get_tree | grep 'quakemite')" ]; then
+ if [ -z "$(swaymsg -t get_tree | grep -A 42 'quakemite' | tail -n 1 | grep 'true')" ]; then
+ swaymsg '[title="quakemite"] scratchpad show'
+ else
+ swaymsg '[title="quakemite"] move scratchpad'
+ fi
+else
+ $TERMINAL -t "quakemite" -e "$SHELL -c 'TERM=xterm-256color; TERMINAL=termite; tmux a || tmux'" &
+ sleep 0.2s
+ currenty=$(swaygetcurrentwindow | cut -d ' ' -f1 | cut -d ',' -f2 )
+ let moveup=$currenty-25
+ swaymsg move up "$moveup px"
+fi
+