Page 13 of 16 FirstFirst ... 31112131415 ... LastLast
Results 121 to 130 of 158

Thread: Aero Snap function?

  1. #121
    Join Date
    Jun 2009
    Location
    Houston
    Beans
    32
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question Re: Aero Snap function?

    it doesn't work for me, which one should I use?:...

    Code:
    ⎡ Virtual core pointer                        id=2    [master pointer  (3)]
    ⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
    ⎜   ↳ SynPS/2 Synaptics TouchPad                  id=11    [slave  pointer  (2)]
    ⎜   ↳ Macintosh mouse button emulation            id=12    [slave  pointer  (2)]
    ⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
        ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
        ↳ Power Button                                id=6    [slave  keyboard (3)]
        ↳ Sleep Button                                id=7    [slave  keyboard (3)]
        ↳ Video Bus                                   id=8    [slave  keyboard (3)]
        ↳ Power Button                                id=9    [slave  keyboard (3)]
        ↳ AT Translated Set 2 keyboard                id=10    [slave  keyboard (3)]

  2. #122
    Join Date
    Dec 2008
    Beans
    13

    Two mice

    Is there a way to enter two input devices, so that when I'm using my touchpad it works, and when I plug everything in at my desktop the mouse works as well? Something like Mouse="12,14"? Sorry if this is an entirely moronic question, but my google-fu is failing hard

  3. #123
    Join Date
    Oct 2010
    Location
    Turkey
    Beans
    4

    Re: Aero Snap function?

    Hi there,
    this latest version of the script now automatically checks, which device you are utilizing for CompizSnap, be it a mouse or a touchpad.

    You don't need to modify the script with "xinput list" values any more, and now you can switch your input-devices with no hassle while working!

    Here it is:

    Code:
    #!/bin/bash
    #
    # CompizSnap is a collaborative project from ubuntuforums.org and is free software. 
    # This script adds window snapping functionality to compiz using the commands plugin.
    # from http://ubuntuforums.org/showpost.php?p=9925230&postcount=117
    
    MOUSE=`xinput -list | grep -i 'mouse' | grep id= | sed 's:.*id=\([0-9]*\).*:\1:' `
    TP=`xinput -list | grep -i 'touchpad' | grep id= | sed 's:.*id=\([0-9]*\).*:\1:' `
    
    left() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_4' 'keyup Control_L' 'keyup Alt_L'
    }  
    
    right() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_6' 'keyup Control_L' 'keyup Alt_L'
    }
    
    top() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_8' 'keyup Control_L' 'keyup Alt_L'
    }
    
    bottom() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_2' 'keyup Control_L' 'keyup Alt_L'
    }
    
    topleft() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_7' 'keyup Control_L' 'keyup Alt_L'
    }
    
    topright() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_9' 'keyup Control_L' 'keyup Alt_L'
    }
    
    bottomleft() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_1' 'keyup Control_L' 'keyup Alt_L'
    }
    
    bottomright() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_3' 'keyup Control_L' 'keyup Alt_L'
    }
    	
    # ----- Don't edit below this line unless you know what you are doing.
    if /usr/bin/X11/xinput --query-state $MOUSE | grep down
    then
       	while (/usr/bin/X11/xinput --query-state $MOUSE | grep down)
    	do 
    		echo 'mouse button pressed'
    	done
        $1
    else if /usr/bin/X11/xinput --query-state $TP | grep down
    then
       	while (/usr/bin/X11/xinput --query-state $TP | grep down)
    	do 
    		echo 'touchpad button pressed'
    	done
        $1
    else
    	echo "exiting because button is not pressed"
        exit 1
    fi
    fi
    Just for the absolute newcomers: I have written down an installation-guide in post number 117. Just skip article 3 of the instructions, since it is obsolete now.

    Please let me know, whether it works for you. Maybe we could automate the whole installation process someday, including compiz-settings.

    Have fun
    YSN

    P.S.: Hi Keypel, thanx for your feedback, hope the script worked for you. Feel free to open a new thread with the script, if you wish to. Maybe you could write down new instructions as well. And maybe a more experienced person could review the code, since I believe that the same result can be achieved with a few lines less (IMHO at least one conditional is superfluous).

  4. #124
    Join Date
    Nov 2006
    Beans
    Hidden!

    Re: Aero Snap function?

    Hello everybody! I really like this function, but had problems getting it work in my Thinkpad. The reason was that i'm not using either mouse or touchpad, but Thinkpad's trackpad...

    So here is modified script, that works at least with my IBM TrackPoint:
    Code:
    #!/bin/bash
    #
    # CompizSnap is a collaborative project from ubuntuforums.org and is free software. 
    # This script adds window snapping functionality to compiz using the commands plugin.
    # from http://ubuntuforums.org/showpost.php?p=9925230&postcount=117
    
    MOUSE=`xinput -list | grep -i 'mouse' | grep id= | sed 's:.*id=\([0-9]*\).*:\1:' `
    TOUCHPAD=`xinput -list | grep -i 'touchpad' | grep id= | sed 's:.*id=\([0-9]*\).*:\1:' `
    #This applies at least to my Thinkpad trackpoint.
    TRACKPAD=`xinput -list | grep -i 'trackpoint' | grep id= | sed 's:.*id=\([0-9]*\).*:\1:' `
    
    left() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_4' 'keyup Control_L' 'keyup Alt_L'
    }  
    
    right() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_6' 'keyup Control_L' 'keyup Alt_L'
    }
    
    top() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_8' 'keyup Control_L' 'keyup Alt_L'
    }
    
    bottom() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_2' 'keyup Control_L' 'keyup Alt_L'
    }
    
    topleft() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_7' 'keyup Control_L' 'keyup Alt_L'
    }
    
    topright() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_9' 'keyup Control_L' 'keyup Alt_L'
    }
    
    bottomleft() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_1' 'keyup Control_L' 'keyup Alt_L'
    }
    
    bottomright() {
    xte 'keydown Control_L' 'keydown Alt_L' 'key KP_3' 'keyup Control_L' 'keyup Alt_L'
    }
        
    # ----- Don't edit below this line unless you know what you are doing.
    if /usr/bin/X11/xinput --query-state $MOUSE | grep down
    then
           while (/usr/bin/X11/xinput --query-state $MOUSE | grep down)
        do 
            echo 'mouse button pressed'
        done
        $1
    else if /usr/bin/X11/xinput --query-state $TOUCHPAD | grep down
    then
           while (/usr/bin/X11/xinput --query-state $TOUCHPAD | grep down)
        do 
            echo 'touchpad button pressed'
        done
        $1
    else if /usr/bin/X11/xinput --query-state $TRACKPAD | grep down
    then
           while (/usr/bin/X11/xinput --query-state $TRACKPAD | grep down)
        do 
            echo 'touchpad button pressed'
        done
        $1
    else
        echo "exiting because button is not pressed"
        exit 1
    fi
    fi
    fi
    I'm not very familiar with shell scripts so this may be unefficient way of doing things, but it works at least for me

    If you can't get this working with your own trackpad, try running xinput -list, searching your trackpad device from the output and adding it to the grep statement at line 10.

  5. #125
    Join Date
    Nov 2006
    Beans
    4

    Re: Aero Snap function?

    Is there anyway to change it so that my mouse hitting the edge of the screen while holding the window automatically changes the window?
    Last edited by irritated skin; October 20th, 2010 at 06:05 PM.

  6. #126
    Join Date
    Aug 2008
    Beans
    7

    Re: Aero Snap function?

    I love the work you two have put in on this (gotsanity and arrow.69), but I must say that gotbletu's YouTube video kills this. As soon as I saw that Compiz supported Grid functions, I suspected it would be child's play to bind the specific Grid functions to appropriate mouse/location postures, and lo and behold, that's exactly what is described here (also on page 12 of this thread):

    gotbletu's howto (link)

    To succeed, simply install (e.g. through Synaptec) 'compizconfig-settings-manager' and 'xautomation' (and their dependencies), and find 'CompizConfig Settings Manager' under System -> Preferences. The video-guide should be straightforward from there, and while I only applied the two sides, I imagine a great many other tweaks could be made for many other applications.

    Thanks to all who have worked on this!

    --
    Stan

  7. #127
    Join Date
    Jun 2007
    Beans
    30
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Smile Re: Aero Snap function?

    Good work on this guys! by far the best feature of windows 7.

    Perhaps we could automate a script to add the compiz settings also, see:

    http://ubuntuforums.org/archive/index.php/t-640199.html

    has a new thread been started for this? perhaps it should be moved to the howtos...


  8. #128
    Join Date
    Dec 2010
    Beans
    1

    Re: Aero Snap function?

    Hey, I'm trying to run YSN's code but can't seem to get it to work...

    I can use "~/.scripts/compizsnap.sh right" in the terminal and get the 'exiting because no button is pressed' response, but dragging the windows to the edges doesn't seem to work for me. (I have also checked to make sure that it's getting the right MOUSE varible...)

    Are there any conflicting features in compiz that may be messing this up, or is there a way to check if I'm doing something else wrong???

    EDIT:

    With a bit of testing it seems that the script works for my touchpad, but not my mouse... Weird...
    Last edited by blank_64; December 13th, 2010 at 04:09 AM.

  9. #129
    Join Date
    Feb 2006
    Beans
    31
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Some people are never satisfied...

    I like this window snapping effect, but to be honest the feature I liked most of Windows 7 was being able to double click a window edge and have that Window edge snap that way. This avoids any stray edge snaps from a wandering mouse.

    Does anyone have any idea how to implement that? If they make the "Window Edge Double Click" toggle the snapping of the Window too that would be beyond amazing.
    -=< AMD Athlon 64 X2 3800 ~ ASUS A8N-SLI Deluxe ~ 4 GB Corsair ~ GeForce 460 GT ~ Soundblaster Audigy eX >=-
    ~< Dual boot: Windows 7 Ultimate | Ubuntu 10.10 | Ubuntu 11.04 >~

  10. #130
    Join Date
    Nov 2010
    Location
    Mississippi, USA
    Beans
    2
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Aero Snap function?

    So... did anyone ever figure out how to do the "aero shake?"

    PS: Thanks to all who worked out the solution to the improved sero snap.
    Last edited by wathompson; January 4th, 2011 at 04:29 PM. Reason: To add thanks!

Page 13 of 16 FirstFirst ... 31112131415 ... 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
  •