Page 10 of 16 FirstFirst ... 89101112 ... LastLast
Results 91 to 100 of 158

Thread: Aero Snap function?

  1. #91
    Join Date
    Jan 2008
    Beans
    64

    Re: Aero Snap function?

    grid is strictly a hotkey tiling program. it does not work with the mouse. This may change in the future but I was unable to find any information stating that the developer was working on that.

  2. #92
    Join Date
    May 2007
    Beans
    149

    Re: Aero Snap function?

    Then what about this?
    Its a different plugin? Grid2? Any way to test it?

    Quote Originally Posted by arrow.69 View Post
    For the sake of anyone who stumbles on this thread.

    The Compiz Developers have implemented a compiz plug-in called Grid which emulates and builds upon Aero Snap functionality. It will be included by default in Compiz 0.9, which is currently in beta. So if you can't seem to figure out all this scripting, don't fret. A more portable, universal solution will be out for everyone to enjoy soon.

  3. #93
    Join Date
    Aug 2008
    Location
    UK
    Beans
    24
    Distro
    Ubuntu

    Re: Aero Snap function?

    Couldnt get the first bits of code to work at all with variable set for a mouse, but the beta code u put up i altered for max and right, and it works brilliantly, many thanks!



    Quote Originally Posted by gotsanity View Post
    I have a working beta. give this a shot and let me know how it works.

    YOU MUST CHANGE THE COMMAND LINE FROM "sh compizsnap-left.sh" to "bash compizsnap-left.sh"
    compizsnap-left.sh
    Code:
    #!/bin/bash
    # ----- Don't edit below this line unless you know what you are doing.
    
    IDS=( $(xinput list | grep "slave  pointer" | sed s/".*id=\([0-9]*\).*"/\\1/) )
    for item in ${IDS[*]}
    	do
    
    		MOUSE=$item
    		WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2-10))
    		TEMPWIDTH=$(($WIDTH-10))
    		echo "Testing mouse #$item"
    		echo $WIDTH
    		echo $TEMPWIDTH
    		if /usr/bin/X11/xinput --query-state $MOUSE | grep down
    		then
    		   	while (/usr/bin/X11/xinput --query-state $MOUSE | grep down)
    			do 
    				echo 'button pressed'
    			done
    	
    			if [ "$(/usr/bin/X11/xinput --query-state $MOUSE | grep "valuator\[0\]=." | sed s/"valuator\[0\]="//)" -le 10 ]
    			then
    				wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$HALF,-10
    				exit 1
    			else
    				echo "exiting without matching"
    				exit 1
    			fi
    		else
    			echo "exiting because button isnt "
    	        #exit 1
    		fi
    done
    that should work with either mouse. Let me know if you run into anything like other mice having their buttons set to down even if nothing is pressed. from what I can tell in my office this works fine but your mileage may vary.

  4. #94
    Join Date
    Aug 2006
    Beans
    336
    Distro
    Ubuntu

    Re: Aero Snap function?

    found some great stuff in this thread, and now I have the snap working. Thanks!

  5. #95
    Join Date
    Apr 2007
    Location
    Pensacola, FL
    Beans
    418
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Aero Snap function?

    Quote Originally Posted by arrow.69 View Post
    Just a few notes related to the last few comments.

    The tutorial at OMG:Ubuntu! is a very basic implementation of Aero Snap. The main limitation is that the effect is activated whenever your cursor hits the edges, regardless of whether or not you're actually dragging a window. If that's good enough for you, that's great. It's probably simpler to stick to the tutorial. What gotsanity's been trying to accomplish is a more precise emulation of Windows 7's Aero Snap function.

    For oneadvent:

    Last I heard there were some problems implementing the script with Alps touchpad. My laptop has a Synaptics touchpad, so I'm afraid I can't debug that aspect.

    If you have some time on your hands, maybe you'd like to try some debugging yourself. Let me try to explain what the script is doing. Look for the text after '#' for my comments explaining what's happening:

    Code:
    # ----- Don't edit below this line unless you know what you are doing.
    
    # first, this code is executed when your cursor hits the edge of the screen
    
    WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2-10))  #Determine the pixel width of your monitor (used to determine the window size)
    
    echo $WIDTH #Output this value to console (debugging)
    TEMPWIDTH=$(($WIDTH-10)) # Store the value of the width minus 10 in a second variable
    echo $TEMPWIDTH #Again, output this new value to console
    if /usr/bin/X11/xinput --query-state $MOUSE | grep down #If you were holding down the mouse button (so if you're dragging a window)
    then
       	while (/usr/bin/X11/xinput --query-state $MOUSE | grep down) #then do nothing until the mouse is released
    	do 
    		echo 'button pressed'
    	done
    	
    	if [ "$(/usr/bin/X11/xinput --query-state $MOUSE | grep "valuator\[0\]=." | sed s/"valuator\[0\]="//)" -le 10 ]  #If you're still close enough to the edge
    	then
            
    		wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$HALF,-10 #finally do the resizing!
    
    	else
    		echo "exiting without matching"
    		exit 1 # Here, you dragged a window to the edge, but changed your mind. So when you released the mouse you were no longer on the edge
    	fi
    else
    		echo "exiting because button isnt " 
            exit 1 # You hit the edge, but you weren't dragging a window
    fi

    If you feel like doing some debugging, try the various commands used in the script and see if the output is correct. Maybe try running the whole script and see if there are error messages.

    IMO this line is screwing up:

    Code:
    $(/usr/bin/X11/xinput --query-state $MOUSE | grep valuator\[0\]=." | sed s/"valuator\[0\]="//)" -le 10 ]
    Try running simply : xinput --query-state 11 Look out for valuator lines.


    If your valuator values for the touchpad don't match up with your screen resolution, then for sure it won't work.

    The above line should output [0,0] on the upper left corner and [1400,900] on lower right for a 1400x900 res. So basically those values should be the same as your resolution, or close. 1 pixel difference is fine.

    Let me know if you think that's the problem, I might have a solution for you. Otherwise do keep debugging and let us know if you find something interesting. There's some pretty smart users on this forum.

    Good luck!
    Sorry it took so long. The screen resolution is set to 1600 x 900 but at the bottom right i get 1022 x 766, so that is def the problem.
    "Well, now that we have seen each other," said the Unicorn, "if you'll believe in me, I'll believe in you. Is that a bargain?" --Alice in Wonderland

    If someone asks you to sudo rm -rf anything don't do it.

  6. #96
    Join Date
    Apr 2007
    Location
    Pensacola, FL
    Beans
    418
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Aero Snap function?

    Code:
    MOUSE="11"
    
    # ----- Don't edit below this line unless you know what you are doing.
    WIDTH=`1022` && HALF=$(($WIDTH/2))
    sorry I didn't follow directions

    I think its working now, the first time it did it it seemed to snap to the right but as if the screen was 1600 wide, so it was cut off, but the second time it seemed to snap right, and thus far this is working.

    I had manually ran one of the lines, maybe that reset some variables (guessing). Thanks for the clue to the problem, I do not know if I would have ever found it.

    Thanks!
    "Well, now that we have seen each other," said the Unicorn, "if you'll believe in me, I'll believe in you. Is that a bargain?" --Alice in Wonderland

    If someone asks you to sudo rm -rf anything don't do it.

  7. #97
    Join Date
    Apr 2007
    Location
    Pensacola, FL
    Beans
    418
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Aero Snap function?

    Okay sorry to bump an older thread, but the script now recognizes the right side of the screen, but it doesn't position it right, its like it positions it off the right side a little bit.

    Can anyone shed light on this for me?
    "Well, now that we have seen each other," said the Unicorn, "if you'll believe in me, I'll believe in you. Is that a bargain?" --Alice in Wonderland

    If someone asks you to sudo rm -rf anything don't do it.

  8. #98
    Join Date
    Apr 2007
    Location
    Pensacola, FL
    Beans
    418
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Aero Snap function?

    Actually right after I posted that last message I figured it out, thought someone else may want the answer I found:

    Code:
    if [ "$(/usr/bin/X11/xinput --query-state $MOUSE | grep "valuator\[0\]=." | sed s/"valuator\[0\]="//)" -ge $TEMPWIDTH ]
    	then
            
    		wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,900,0,800,-1
    I wish I could tell you I had some crazy break through, but the truth is I just plugged numbers in until it did what I wanted. I figured they would be even numbers, although, I suppose that wouldn't always be true.

    Good luck!
    "Well, now that we have seen each other," said the Unicorn, "if you'll believe in me, I'll believe in you. Is that a bargain?" --Alice in Wonderland

    If someone asks you to sudo rm -rf anything don't do it.

  9. #99
    Join Date
    Jun 2008
    Beans
    170

    10x

    and this is why i love this OS so much.
    $THANKS

  10. #100
    Join Date
    Jul 2010
    Beans
    166

    Re: Aero Snap function?

    I can't get this to work. Nothing snaps at all. I remembered to change the mouse=11 to my correct number. This is on a fresh 10.03 install. all I did was install the compiz and do the tut on page=5 post=45








    Last edited by Keypel; July 23rd, 2010 at 07:22 AM.

Page 10 of 16 FirstFirst ... 89101112 ... 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
  •