From 75058c4bdfbe1b4fd5eef4ffcbae02ec73e9c71f Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Sun, 27 Oct 2019 04:25:34 +0300 Subject: make dropdown terminal spawn on the top part of the screen --- dotfiles/.scripts/ddquakemite | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'dotfiles/.scripts') diff --git a/dotfiles/.scripts/ddquakemite b/dotfiles/.scripts/ddquakemite index 16855f4..699c60f 100755 --- a/dotfiles/.scripts/ddquakemite +++ b/dotfiles/.scripts/ddquakemite @@ -1,12 +1,16 @@ -#!/bin/sh +#!/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 +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=st; TERMINAL=termite; tmux a || tmux'" + $TERMINAL -t "quakemite" -e "$SHELL -c 'TERM=st; 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 -- cgit v1.2.3