此解决方案部署了一个具有多个选项卡和进程的窗口。
我创建了一个启动脚本(xfce4-terminal-startup.sh
),
xfce4-terminal --maximize --title='Neovim' -x bash -c "nvr -s; exec bash"
xfce4-terminal --tab --title='psql' -x bash -c "psql -d zzz; exec bash"
xfce4-terminal --tab --title='Cypher-shell' -x bash -c "cd /mnt/Vancouver/Programming/data/hmdb; exec bash"
xfce4-terminal --tab --title='Cycli' -x bash -c "source activate py35 && cycli -P *** -u *** -p ***; exec bash"
xfce4-terminal --tab --title='Py3' -x bash -c "source activate py35 && python; exec bash"
xfce4-terminal --tab --title='bc' -x bash -c "bc; exec bash"
xfce4-terminal --tab --title='ud' -x bash -c "pacaur -Syu; exec bash"
当执行时启动xfce4-terminal,最大化它,并按指示启动各种程序。
关于“exec bash”,上面见:
即:如果您在运行命令的屏幕中启动一个窗口,请保持该窗口打开...
这是一个动画GIF,显示了这些标签!
更新
这是我目前的xfce4-terminal-startup.sh
脚本(您可以在此处下载:https://persagen.com/files/misc/xfce4-terminal-startup.sh):
#!/bin/bash
# vim: set filetype=sh :
# vim: syntax=sh
# /mnt/Vancouver/programming/scripts/xfce4-terminal-startup.sh
# https://web.archive.org/web/20110314180918/http://www.davidpashley.com/articles/writing-robust-shell-scripts.html
# https://stackoverflow.com/questions/2870992/automatic-exit-from-bash-shell-script-on-error/2871034#2871034
set -e
# ----------------------------------------------------------------------------
# This one first:
# Python as basic calculator: 1/3; import math; 2*math.pi; ...
xfce4-terminal --maximize --title='calculations' -x bash -c "python; exec bash"
# ... then (these will open as child tabs in the parent terminal window, above):
# Open my (current) project directory:
xfce4-terminal --tab --title='bash' -x bash -c "cd /mnt/Vancouver/projects/ie/claws/; pwd; ls -l; echo ''; exec bash"
# Start Neovim:
xfce4-terminal --tab --title='neovim' -x bash -c "nvr -s; exec bash"
# Open ripgrep tab (echo sample command), for fast searches in that director:
xfce4-terminal --tab --title='ripgrep' -x bash -c "cd /mnt/Vancouver/domains/PERSAGEN.com/2.0/; echo rg . -i -e \'1903.03243\'; exec bash"
# Open an Arch Linux update tab:
xfce4-terminal --tab --title='ud' -x bash -c "yay -Syu; exec bash"