加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

如何使用gnome中bash-script的最大化窗口启动gvim

发布时间:2020-12-15 21:14:14 所属栏目:安全 来源:网络整理
导读:我想编写一个bash脚本,直接在最大化窗口中启动g vim-session. 那是我的bash脚本: #!/bin/bash - set -o nounsetcd /home/alexthebird/vim-stuff; # directory of the gvim-session filegvim -S bootmap; # start gvim from the sessionfile 'bootmap' 你有
我想编写一个bash脚本,直接在最大化窗口中启动g vim-session.

那是我的bash脚本:

#!/bin/bash - 
set -o nounset

cd /home/alexthebird/vim-stuff; # directory of the gvim-session file
gvim -S bootmap;                # start gvim from the sessionfile 'bootmap'

你有任何想法如何用bashscript完成这个?只有在通过此脚本启动时才应最大化Gvim.当然,欢迎任何其他想法如何实现这一目标.

我使用Ubuntu 11.04和gnome.

感谢您抽出宝贵时间阅读我的留言.

AlexTheBird

这个脚本有效:

#!/bin/bash - 
set -o nounset
# directory of the gvim-session file
cd /home/alexthebird/vim-stuff;
# -f because of a ubuntu global-menu bug
# -S starts from session-file named 'bootmap'
# -geom solved the problem. see post of Lstor
gvim -geom '200x50+0+0' -f -S bootmap; # start gvim from the sessionfile 'bootmap';

谢谢大家的时间.

编辑:我刚刚发现上述解决方案仅适用于unity-2d(非3D加速)桌面.哪个对我好.它不适用于使用Unity的3D加速版本的默认Ubuntu-desktop.

解决方法

您可以使用-geom(etry)选项将大小与监视器的大小相匹配.

gvim -geom 200x50+0+0

其中200是可以水平放置的字符数,50是垂直相同的,0 0表示从屏幕左上角开始的零水平和垂直偏移.

请注意,窗口本身不会最大化,它只会(大约)与显示器大小相同.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读