summary refs log tree commit diff
path: root/.local/bin/gnome-terminal-newtab
blob: a45da9ad502cd69f386d82ac46f96dade88876fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

# We need to set these for it to work
# specific tab that is focused
#export GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/2fabbbb8_c971_4140_a182_64474ffb18c5
screen="$(busctl --user tree  org.gnome.Terminal | grep -o '/org/gnome/Terminal/screen/.*$' | head -n1)"
if test "$screen"; then
    export GNOME_TERMINAL_SCREEN="$screen"
    export GNOME_TERMINAL_SERVICE="$(busctl --user status  org.gnome.Terminal | grep UniqueName | cut -d= -f2)"
fi

echo GNOME_TERMINAL_SCREEN="$GNOME_TERMINAL_SCREEN" >> /tmp/terminal-newtab.log
echo GNOME_TERMINAL_SERVICE="$GNOME_TERMINAL_SERVICE" >> /tmp/terminal-newtab.log
echo "$@" "\n" >> /tmp/terminal-newtab.log

/usr/bin/gnome-terminal --tab "$@"