3

How can I roll up windows by mouse wheel up on title bar ?

This solution for Ubuntu 11.10 does not work :

gconftool-2 -s -t string /apps/gwd/mouse_wheel_action shade 

I am on ubuntu 12.04 with unity-2d.

Thanks.

ppg
  • 31
  • Need to merge these questions: http://askubuntu.com/questions/67009/how-to-roll-up-the-window – fossfreedom Mar 27 '13 at 12:48
  • @fossfreedom Should I delete my answer here and move it to that question? –  Mar 27 '13 at 17:04
  • @Mik - not just yet - this is just a reminder that we've got two very closely related Q's that could/should be merged at some-point. – fossfreedom Mar 27 '13 at 17:05
  • @fossfreedom this is not exactly the same problem. Mine is specific to unity-2d. – ppg Apr 02 '13 at 17:16

1 Answers1

0

There is one workaround I have used before, and it may be of use to you so I record it here.

If it's not possible to configure the rolling up of the window in your window manager (Xfce users have the mousewheel_rollup option in xfwm4), it is often worth trying tools like wmctrl and xdotool, though some window managers ignore their commands. The shade option seems to be present in wmctrl, but not in xdotool.

It is possible to use wmctrl to select the currently active window and roll it up by using this command, adapted from the helpful manpage:

wmctrl -r :ACTIVE: -b toggle,shaded

This command lets wmmctrl select the active window and toggle whether it is shaded or not. This should be supported on most window managers including metacity: test it in gnome-terminal but not guake as it won't have any effect because of the way guake terminal displays.

I would not bind it to mouse wheel, but to another button on the mouse, like a secondary one on the side (if you have one). Then just clicking it will toggle the rollup of the active window.

So install the programs with

sudo apt-get install wmctrl xbindkeys

You need to add the lines below to ~/.xbindkeysrc (you can choose your own binding or combination; this is just my additional mouse key as an example):

# specify a mouse button/combination
"wmctrl -r :ACTIVE: -b toggle,shaded"
b:9

Run killall xbindkeys and then xbindkeys & so that the configuration file is reread (or logout and login again).

This is about the best you can do for the minute, and is the same as what you ask for, but done in a slightly different way, so it might be useful for you.

For more information, see man wmctrl, man xbindkeys or the Ubuntu manpages online.

  • Thanks for the answer. But now if I do a mouse wheel up on a window, it will be rolled up. I would like this behaviour only if I rotate wheel on title bar, not the whole windows. Because with this method I can not use mouse wheel anymore to scroll in a window.

    Pierre

    – ppg Apr 02 '13 at 17:15
  • @ppg Yes, that's true; that's why I recommended binding the command to a spare mouse button if you have one. This is really just a rough workaround, but I'll see if there is any way to alter it. –  Apr 02 '13 at 17:18