Announcement

Collapse
No announcement yet.

Tiling windows on a desktop

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Tiling windows on a desktop

    Hi,

    Can some one help me with tiling windows, either horizontaly or vertically, on a desktop?

    Thanx<br />Ryno<br /><br />Os = Kubuntu 9.10, Kde 4 dual boot with Win Xp<br />Linux user # 471903<br />Kubuntu user # 22225<br /><br />If you can see yourself as God does than you will have no limitations.

    #2
    Re: Tiling windows on a desktop

    Originally posted by ryno
    Hi,

    Can some one help me with tiling windows, either horizontaly or vertically, on a desktop?

    You can choose Windows --> Unclutter Windows from the Desktop Menu (which opens with the right click on the desktop by default). That's not exactly "tiling," though.
    Registered Linux User: #281828 | Kubuntu User: #22280

    Kubuntu 18.04 LTS
    Dell Precision Workstation T5500 (Xeon @ 2.13GHz x 2 / 12 GB RAM)

    Comment


      #3
      Re: Tiling windows on a desktop

      Hi,

      daihard, it doesnt do anything at all!
      Thanx<br />Ryno<br /><br />Os = Kubuntu 9.10, Kde 4 dual boot with Win Xp<br />Linux user # 471903<br />Kubuntu user # 22225<br /><br />If you can see yourself as God does than you will have no limitations.

      Comment


        #4
        Re: Tiling windows on a desktop

        Originally posted by ryno
        Hi,

        daihard, it doesnt do anything at all!
        I assumed you wanted to rearrange your existing (open) windows so they wouldn't hide one another. Or are you saying that choosing that option doesn't rearrange the windows at all?
        Registered Linux User: #281828 | Kubuntu User: #22280

        Kubuntu 18.04 LTS
        Dell Precision Workstation T5500 (Xeon @ 2.13GHz x 2 / 12 GB RAM)

        Comment


          #5
          Re: Tiling windows on a desktop

          Tiling in Kubuntu and/or Ubuntu

          Execute the following script to generate wmctrl commands for GNOME and/or KDE for your resolution (without annoying overlapping windows). See the script itself for more info. grid.sh:

          Code:
          #!/bin/bash
          
          echo ""
          echo "Ubuntu (GNOME) contains a nice utility Compiz Grid:"
          echo "Tile, position and resize your windows to fit an imaginary grid."
          echo "The functionality is based on Winsplit Revolution for Microsoft Windows."
          echo "For more info, demos etc. see: [url]http://winsplit-revolution.com"[/url]
          echo ""
          echo "This script can be used to define wmctrl commands for Kubuntu (KDE)"
          echo "for your monitor resolution. These commands can be attached to"
          echo "Key Bindings (keyboard shortcuts), so you have the same functionality"
          echo "under KDE without the need to install a Tiling Window Manager like"
          echo "xmonad, awesome or ion3."
          echo ""
          echo "The commands can also be used to emulate Windows 7 Aero Snap"
          echo "without annoying overlapping windows."
          echo "For more info about this subject see youtube or for example" 
          echo "[url]http://www.omgubuntu.co.uk/2009/11/aero-snap-ubuntu-linux.html"[/url]
          echo ""
          echo "NOTES:" 
          echo "- This scipt uses xwininfo (part of x11-utils package) and wmctrl."
          echo " For (K)ubuntu:"
          echo " sudo apt-get install x11-utils wmctrl"
          echo "- This script is tested with:"
          echo " Ubuntu 9.10 (resolution 1920x1200)"
          echo " Kubuntu 9.10 (resolution 1920x1200)"
          echo " Kubuntu 8.10 (resolution 1600x1200)"
          
          # define maximum size of usable screen
          wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
          sleep 1
          
          WIDTH=$((`xwininfo -id $WINDOWID | grep 'Width:' | cut -f 2 -d ':'`))
          HEIGHT=$((`xwininfo -id $WINDOWID | grep 'Height:' | cut -f 2 -d ':'`))
          BORDERY=$((`xwininfo -id $WINDOWID | grep 'Corners:' | cut -f 11 -d ' ' | cut -f 2 -d '-'`))
          wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;
          sleep 1
          wmctrl -r :ACTIVE: -e 0,0,0,$WIDTH,$HEIGHT
          sleep 1
          
          BORDER=$((`xwininfo -id $WINDOWID | grep 'Absolute upper-left X:' | cut -f 2 -d ':'`))
          BOTTOM=$((`xwininfo -id $WINDOWID | grep 'Corners:' | cut -f 11 -d ' ' | cut -f 2 -d '-'`))
          BORDERY=$(($BORDERY-(`xwininfo -id $WINDOWID | grep 'Corners:' | cut -f 11 -d ' ' | cut -f 2 -d '-'`)))
          TOP=$((`xwininfo -id $WINDOWID | grep 'Relative upper-left Y:' | cut -f 2 -d ':'`))
          
          if [ $TOP -eq 0 ]
          then #KDE
          	echo ""
          	echo "----------------------"
          	echo "Assuming KDE, Correct?"
          	echo "----------------------"
          	WIDTH=$(((`xwininfo -id $WINDOWID | grep 'Width:' | cut -f 2 -d ':'`)-2*$BORDER))
          	HEIGHT=$(((`xwininfo -id $WINDOWID | grep 'Height:' | cut -f 2 -d ':'`)-2*$BORDERY))
          	TITLE=$((`xwininfo -id $WINDOWID | grep 'Absolute upper-left Y:' | cut -f 2 -d ':'`))
          
          	echo ""
          	echo "Below are the wmctrl commands for KDE (Kubuntu)."
          	echo ""
          	echo "The Key Bindings (keyboard shortcuts) can be set in the following way:"
          	echo "sudo apt-get install xbindkeys xbindkeys-config"
          	echo "xbindkeys --defaults > ~/.xbindkeysrc"
          	echo "echo \"xbindkeys\" > ~/.kde/Autostart/startxbindkeys.sh"
          	echo "chmod u+x ~/.kde/Autostart/startxbindkeys.sh"
          	echo "~/.kde/Autostart/startxbindkeys.sh"
          	echo "xbindkeys-config"
          	echo "finally add the commands below"
          	echo ""
          	echo "Centre    Control+Alt+KP_Begin:"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,0,$WIDTH,$HEIGHT"
          	echo ""
          	echo "Left     Control+Alt+KP_Left:"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,0,$(($WIDTH/2-$BORDER)),$HEIGHT"
          	echo ""
          	echo "Right    Control+Alt+KP_Right:"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$(($WIDTH/2+($BORDER))),0,$(($WIDTH/2-$BORDER)),$HEIGHT"
          	echo ""
          	echo "Top     Control+Alt+KP_Up:"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,0,$WIDTH,$(($HEIGHT/2-($TITLE/2+$BORDERY)))"
          	echo ""
          	echo "Bottom    Control+Alt+KP_Down:"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,$(($TITLE+$BORDERY+$TOP+($HEIGHT/2-($TITLE/2+$BORDERY)))),$WIDTH,$(($HEIGHT/2-($TITLE/2+$BORDERY)))"
          	echo ""
          	echo "Top Left   Control+Alt+KP_Home:"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,0,$(($WIDTH/2-$BORDER)),$(($HEIGHT/2-($TITLE/2+$BORDERY)))"
          	echo ""
          	echo "Top Right  Control+Alt+KP_Prior:"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$(($WIDTH/2+($BORDER))),0,$(($WIDTH/2-$BORDER)),$(($HEIGHT/2-($TITLE/2+$BORDERY)))"
          	echo ""
          	echo "Bottom Left Control+Alt+KP_End:"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,$(($TITLE+$BORDERY+$TOP+($HEIGHT/2-($TITLE/2+$BORDERY)))),$(($WIDTH/2-$BORDER)),$(($HEIGHT/2-($TITLE/2+$BORDERY)))"
          	echo ""
          	echo "Bottum Right Control+Alt+KP_Next:"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$(($WIDTH/2+($BORDER))),$(($TITLE+$BORDERY+$TOP+($HEIGHT/2-($TITLE/2+$BORDERY)))),$(($WIDTH/2-$BORDER)),$(($HEIGHT/2-($TITLE/2+$BORDERY)))"
          else #GNOME
          	echo ""
          	echo "------------------------"
          	echo "Assuming GNOME, Correct?"
          	echo "------------------------"
          	WIDTH=$((`xwininfo -id $WINDOWID | grep 'Width:' | cut -f 2 -d ':'`))
          	HEIGHT=$((`xwininfo -id $WINDOWID | grep 'Height:' | cut -f 2 -d ':'`))
          
          	wmctrl -r :ACTIVE: -e 0,0,$TOP,$WIDTH,$(($HEIGHT-2*$BOTTOM))
          	sleep 1
          	TITLE=$(((`xwininfo -id $WINDOWID | grep 'Absolute upper-left Y:' | cut -f 2 -d ':'`)-$TOP-$BORDER))
          	TOP=$(($TOP-$TITLE))
          	
          	echo ""
          	echo "Below are the wmctrl commands for GNOME (Ubuntu)."
          	echo "The Key Bindings (keyboard shortcuts)"
          	echo "or Edge Bindings (like Aero Snap) can be set under:"
          	echo "System -> Prefences -> CompizConfig Settings Manager ->"
          	echo "Commands -> Commands/Key Bindings/Edge Bindings"
          	echo ""
          	echo "Centre    <Control><Alt>KP_5:"
          	#echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$BORDER,$(($TITLE+$TOP)),$WIDTH,$HEIGHT"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,0,$WIDTH,$HEIGHT"
          	echo ""
          	echo "Left     <Control><Alt>KP_4:"
          	#echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$BORDER,$(($TITLE+$TOP)),$(($WIDTH/2-$BORDER)),$HEIGHT"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,0,$(($WIDTH/2-$BORDER)),$HEIGHT"
          	echo ""
          	echo "Right    <Control><Alt>KP_6:"
          	#echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$(($WIDTH/2+(2*$BORDER))),$(($TITLE+$TOP)),$(($WIDTH/2-$BORDER)),$HEIGHT"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$(($WIDTH/2+(2*$BORDER))),0,$(($WIDTH/2-$BORDER)),$HEIGHT"
          	echo ""
          	echo "Top     <Control><Alt>KP_8:"
          	#echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$BORDER,$(($TITLE+$TOP)),$WIDTH,$(($HEIGHT/2-($TITLE/2+$BORDER)))"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,0,$WIDTH,$(($HEIGHT/2-($TITLE/2+$BORDER)))"
          	echo ""
          	echo "Bottom    <Control><Alt>KP_2:"
          	#echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$BORDER,$(((2*($TITLE+$BORDER))+$TOP+($HEIGHT/2-($TITLE/2+$BORDER)))),$WIDTH,$(($HEIGHT/2-($TITLE/2+$BORDER)))"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,$(((2*($TITLE+$BORDER))+$TOP+($HEIGHT/2-($TITLE/2+$BORDER)))),$WIDTH,$(($HEIGHT/2-($TITLE/2+$BORDER)))"
          	echo ""
          	echo "Top Left   <Control><Alt>KP_7:"
          	#echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$BORDER,$(($TITLE+$TOP)),$(($WIDTH/2-$BORDER)),$(($HEIGHT/2-($TITLE/2+$BORDER)))"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,0,$(($WIDTH/2-$BORDER)),$(($HEIGHT/2-($TITLE/2+$BORDER)))"
          	echo ""
          	echo "Top Right  <Control><Alt>KP_9:"
          	#echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$(($WIDTH/2+(2*$BORDER))),$(($TITLE+$TOP)),$(($WIDTH/2-$BORDER)),$(($HEIGHT/2-($TITLE/2+$BORDER)))"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$(($WIDTH/2+(2*$BORDER))),0,$(($WIDTH/2-$BORDER)),$(($HEIGHT/2-($TITLE/2+$BORDER)))"
          	echo ""
          	echo "Bottom Left <Control><Alt>KP_1:"
          	#echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$BORDER,$(((2*($TITLE+$BORDER))+$TOP+($HEIGHT/2-($TITLE/2+$BORDER)))),$(($WIDTH/2-$BORDER)),$(($HEIGHT/2-($TITLE/2+$BORDER)))"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,$(((2*($TITLE+$BORDER))+$TOP+($HEIGHT/2-($TITLE/2+$BORDER)))),$(($WIDTH/2-$BORDER)),$(($HEIGHT/2-($TITLE/2+$BORDER)))"
          	echo ""
          	echo "Bottum Right <Control><Alt>KP_3:"
          	#echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$(($WIDTH/2+(2*$BORDER))),$(((2*($TITLE+$BORDER))+$TOP+($HEIGHT/2-($TITLE/2+$BORDER)))),$(($WIDTH/2-$BORDER)),$(($HEIGHT/2-($TITLE/2+$BORDER)))"
          	echo "wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,$(($WIDTH/2+(2*$BORDER))),$(((2*($TITLE+$BORDER))+$TOP+($HEIGHT/2-($TITLE/2+$BORDER)))),$(($WIDTH/2-$BORDER)),$(($HEIGHT/2-($TITLE/2+$BORDER)))"
          	echo ""
          	echo "TIP: For GNOME (Ubuntu) Key Bindings use Compiz Grid instead. Go to:"
          	echo "   System -> Prefences -> CompizConfig Settings Manager ->"
          	echo "   Window Management -> Grid"
          fi
          
          wmctrl -r :ACTIVE: -e 0,0,0,$WIDTH,$HEIGHT
          
          echo ""
          echo "Current used values:"
          echo "border: $BORDER pixels"
          if [ $TOP -eq 0 ]
          then #KDE
          	echo "bordery: $BORDERY pixels"
          fi
          echo "width: $WIDTH pixels"
          echo "height: $HEIGHT pixels"
          echo "bottom: $BOTTOM pixels"
          echo "top:  $TOP pixels"
          echo "title: $TITLE pixels"

          Comment

          Working...
          X