开发者

Geany windows size and position

How can you specify the windows size and position when r开发者_运维知识库unning Geany from a command line. Usually this is done as

-g, --geometry string

Where you specify the size and location of the window, using the standard X window geometry syntax: WIDTHxHEIGHT+XOFF+YOFF.


I know it is a Year after question, but it might help others ...

This is a way to modify position and size at any time.

Debian Linux has (had?) preinstalled xdotool, which can move and resize windows.

Moves window to position 300 20 and sets size to 100 x 10 (in console/terminal):

geany_find() { xdotool search Geany 2>/dev/null | sed 1q; }
geany_x_y_w_h() { WINDOW=`geany_find`; xdotool windowsize $WINDOW $1 $2; }
geany_x_y_w_h 300 20 100 10

It has false positives because it searches windows by name, so Firefox with tab opened with this question ("console - Geany...") might might get resized.


If you want the geany window to always open using certain dimensions, you can just open it normally and change the size of the window. By default geany remembers the size of it's window.

if it doesn't, you can go to Edit, then preferences, select the general tab and then the start up tab, and finally make sure "Save window position and geometry" is checked.


Replace the geometry line in the configuration file, and run geany:

sed -i "/geometry=.*/c\geometry=x;y;sh;sv;0;" ~/.config/geany/geany.conf
geany &

or subscribe this format if you're using a variable:

newgeometry="geometry=x;y;sh;sv;0"
sed -i "/geometry=.*/c $newgeometry" ~/.config/geany/geany.conf
geany &

where these parameters are referred to the geany window:
- x is the horizontal coordinate of the left-top corner
- y is the vertical coordinate of the left-top corner
- hs is the size in the horizontal axis
- vs is the size in the vertical axis

Note: sed is a canonical command, it should work fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜