Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to set my own dimensions for a shortcut so when I activate it the window to resize to my preferred dimensions?

I like the new shortcuts in 11.04 with the numpads, but I would like for example ctrl+alt+num5 to make the window with a lower hight just like the width.

share|improve this question

1 Answer 1

I've made a script for you:

#!/bin/bash
#
# by desgua
#
# To make the window with a lower hight just like the width.
#############################################################

win=`xdotool getactivewindow`
w=`xwininfo -id $win | grep "Width" | awk '{print $2}'`
#h=`xwininfo -id $win | grep "Height" | awk '{print $2}'`

xdotool windowsize $win $w $w

exit 0

If you're lazy, run this at terminal, and skip to step "6":

cd ~/ && wget dl.dropbox.com/u/4098082/resize.sh && chmod +x ~/resize.sh && ~/resize.sh && rm ~/resize.sh  

Step by step instructions:

1) We will need XDoTool and Compiz.

(You can install these from the software center (or by clicking here))

2) Make a file .resize.sh in your home folder.

3) Paste the above script into it.

4) Make it executable (Here's how to do that).

5) Open Compiz (Menu > System > Preferences > CompizConfig Manager)

6) Go to Commands and add ~/.resize.sh to one command

7) Then go to Keybindings and make a shortcut for it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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