6

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.

Ringtail
  • 16,127
dimitar
  • 61

1 Answers1

5

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.

desgua
  • 32,917