8

I'm using mint 18.1 and searching a way to resize of opened window and center it by hotkey (resize to default value that set up).

In cinnamon keyboard preferences I found in shortcuts a way to set window's position at center, but didn't find anything about set default window size (in other preferences sections).

Is there a way to do such stuff?

1 Answer 1

4

Install Devilspie:

sudo apt-get update && sudo apt-get install devilspie

Devilspie is a non-gui utility that lets you make applications start in specified workplaces, in specified sizes and placements, minimized or maximized and much more based on simple config files.

Create a Devilspie configuration directory for the current user and then create a configuration file for devilspie, for example for gnome-terminal:

mkdir ~/.devilspie && echo gedit ~/.devilspie/gnome-terminal.ds

Add a desired contents, for example:

(if (is (application_name) "Terminal")
     (begin
         (geometry "800x400")
         (center)
     )
)

Then assign a custom keyboard shortcut in Cinnamon:

Go to main menu and search for app "Keyboard" and run it. Choose the "Shortcuts" tab, choose Category "Custom Shortcuts" in the left and click "Add custom shortcut" enter image description here

In the command window, enter "devilspie"

enter image description here

Click Add an in the Keyboard bindings, choose your desired shortcut, for example I chose Ctrl+Alt+D and close this window: enter image description here

Now after pressing the shortcut, all open Terminal windows will change the size to desired size and will be centered.

Study the Devilspie documentation for other possibilities and usage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.