Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Windows 7 half screen feature

  1. #1
    Join Date
    Nov 2008
    Location
    Melbourne
    Beans
    48
    Distro
    Ubuntu 10.04 Lucid Lynx

    Windows 7 half screen feature

    Is it possible to emulate the feature of Windows 7 whereby you drag a window to the left or right of the screen and it resizes to take up that half of the screen?

    Is this already possible or does it require some fiddling? (a shell script for example)

    Thanks

    -Nik

  2. #2
    Join Date
    Dec 2008
    Location
    /home/john/
    Beans
    174
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Windows 7 half screen feature

    I like the idea

    Bump


  3. #3
    Join Date
    Jan 2008
    Location
    the space between spaces.
    Beans
    1,654

    Re: Windows 7 half screen feature

    As good an idea as that is, it won't work very well for people with multiple workspaces.
    "If a cluttered desk signs a cluttered mind, Of what, then, is an empty desk a sign?" -Albert Einstein.

  4. #4
    Join Date
    Nov 2008
    Location
    Melbourne
    Beans
    48
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Windows 7 half screen feature

    Why the issue with multiple workspaces?

    Also is there any promise in using the --geometry flag?
    Last edited by Niksko; January 18th, 2009 at 03:36 AM.

  5. #5
    Join Date
    Nov 2008
    Location
    Melbourne
    Beans
    48
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Windows 7 half screen feature

    May have found a solution.
    I'm thinking of using the wmctrl program to move and resize the window. Now all I need to do is incorporate some hotkeys (I'm thinking <ctrl><super><left/right> and then you click on the window) and I'll be set.

    I'll post back if I get it working.

    Edit: Might take longer than expected, as wmctrl doesn't want to behave
    Last edited by Niksko; January 18th, 2009 at 08:47 AM.

  6. #6
    Join Date
    Nov 2008
    Location
    Melbourne
    Beans
    48
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Windows 7 half screen feature

    All done. Found some other resources that were trying to do a similar thing and adapted from that.

    Here's how I did it:

    You need to install wmctrl first using "sudo apt-get install wmctrl"

    Download the scripts that I've attached. I put the scripts in ~/bin. I used the command feature of Compiz (under general settings) to setup hotkeys for each script. In my case, this was ~/bin/rightdock.sh and ~/bin/leftdock.sh.

    You'll need to edit the scripts to match your screen resolution and some other things, but all the instructions are included in the script.

    Hope it works for you and pm me if you have any problems.

    It's turned out really well for me. Works just like I wanted it to. Plus, now I know how to use wmctrl

    -Nik

    -PS Take THAT Windows 7
    -PPS One last thing. This also works for dual screen setups using Twinview like I am. Again, instructions are in the scripts
    Attached Files Attached Files
    Last edited by Niksko; January 18th, 2009 at 12:48 PM.

  7. #7
    Join Date
    Sep 2006
    Beans
    18

    Re: Windows 7 half screen feature

    I use GridMove for windows xp at my work and have looked for this feature for Ubuntu/Gnome for a while.

    I've made som minor changes to the script. Mainly using xrandr to read the resolutions and offsets.

    Too lazy to update the comments, though

    I have tested this on metacity without compositing and native multi-monitor (not nvidia twinview).
    Attached Files Attached Files

  8. #8
    Join Date
    Nov 2008
    Beans
    92

    Re: Windows 7 half screen feature

    As I hope to catch some interest for a project (more than half screen feature).
    http://ubuntuforums.org/showthread.php?p=6579904


    g
    z

  9. #9
    Join Date
    Nov 2008
    Beans
    10

    Re: Windows 7 half screen feature

    Quote Originally Posted by damis648 View Post
    As good an idea as that is, it won't work very well for people with multiple workspaces.
    That would be a good place to start.. Getting to view multiple desktops within the same screen. I'm not sure if there's something similar in KDE

  10. #10
    Join Date
    Jan 2008
    Location
    Lake Forest, CA
    Beans
    4

    Re: Windows 7 half screen feature

    Quote Originally Posted by homburg View Post
    I use GridMove for windows xp at my work and have looked for this feature for Ubuntu/Gnome for a while.

    I've made som minor changes to the script. Mainly using xrandr to read the resolutions and offsets.

    Too lazy to update the comments, though

    I have tested this on metacity without compositing and native multi-monitor (not nvidia twinview).

    Looking at this script, it seems that for my configuration the sed commands don't prune the output of xrandr quite right. Running your commands, I get an extra line I think wasn't meant to be there:

    Code:
    sean@seans-laptop:~$ xrandr | sed -e '/connected/!d' -e "s/.*connected\s\([0-9]*\)x\([0-9]*\)+\([0-9]*\)+\([0-9]*\).*/\1\n\2\n\3\n\4/"
    1680
    1050
    0
    0
    DVI-0 disconnected (normal left inverted right x axis y axis)
    1280
    800
    1680
    250
    I'm no expert on sed by any means, but I fixed it like so:

    Code:
    sean@seans-laptop:~$ xrandr | sed -e '/[^s]connected/!d' -e "s/.*connected\s\([0-9]*\)x\([0-9]*\)+\([0-9]*\)+\([0-9]*\).*/\1\n\2\n\3\n\4/"
    1680
    1050
    0
    0
    1280
    800
    1680
    250
    I just put the [^s] in there so it wouldn't match "disconnected." There may be a more appropriate solution, but like I said, I don't know enough about sed to think of anything better, and this works for me

    EDIT:

    I've made a few changes of my own to the script, including what I've mentioned above. Also, it was incorrectly assuming which monitor was on the left, and which was on the right, so I put in a check to see that screen0xoffset is 0. If it isn't, then it swaps the two screens. So now, it should autodetect anyone's monitor layout, hopefully. One last thing I changed was to make it maximize the vertical component of the window to the vertical size of the screen measured initially (which it does not seem to do fully, anyway), not to be done automatically by wmctrl using maximized_vert, as homburg had it do. I found that I wasn't able to resize the window vertically after the script is run using maximized_vert, and it was very frustrating to me. I also changed it so that framecomp was added to the x position of a window being put on the right instead of subtracted, so that 2 windows maximized next to each other on the same screen won't overlap (if you set the right framecomp). I'm adding the new script, if nobody minds. I also added a few comments

    EDIT2:

    Script now supports maximizing windows to take up the top or bottom half of the screen as well. Just pass it up or down as an argument.
    Attached Files Attached Files
    Last edited by soccermonster5; January 30th, 2009 at 06:01 AM.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •