15 lines
762 B
Bash
15 lines
762 B
Bash
open_new_tab () {
|
|
if [[ -x `which guake` ]]; then
|
|
guake --new-tab=DUMB --rename-tab=$2 --execute-command=" command $* && logout; read; logout"
|
|
elif [[ -x `which yakuake` ]]; then
|
|
if [ "`qdbus org.kde.yakuake /yakuake/MainWindow_1 org.freedesktop.DBus.Properties.Get com.trolltech.Qt.QWidget visible`" = "false" ];then
|
|
qdbus org.kde.yakuake /yakuake/window toggleWindowState
|
|
fi
|
|
qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.addSession>/dev/null
|
|
qdbus org.kde.yakuake /yakuake/tabs org.kde.yakuake.setTabTitle "`qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.activeSessionId`" "$2">/dev/null
|
|
qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.runCommand " command $* && exit; read; exit">/dev/null
|
|
else
|
|
command $*
|
|
fi
|
|
}
|