Xfce Forum

Sub domains
 

You are not logged in.

#1 2011-05-05 19:52:07

pistachepastis
Member
Registered: 2011-05-05
Posts: 4

Automatically Switch To Workspace With Active Application

Hi all,

I wondered whether there is a way of not just assigning particular applications to default workspaces (e.g. using Devil's pie), but also, when an application is opened, to switch to the designated workspace automatically. (That is, "follow" the active application)

So suppose:
Firefox is assigned to workspace 2.
I am currently in workspace 1, where I launch Firefox.
Firefox opens in workspace 2, but I myself am still in workspace 1.

What I wonder then is: Is there a way of following Firefox, so to speak? That is, in my example, that I switch automatically to workspace 2.

Hope this is clear.
Thanks in advance!


========
Recently moved from Gnome to Xfce (Xubuntu Natty)

Last edited by pistachepastis (2011-05-05 19:52:36)

Offline

#2 2011-05-13 15:12:03

felixherve
Member
Registered: 2011-05-13
Posts: 3

Re: Automatically Switch To Workspace With Active Application

Hi there,

new to xfce myself. I've been wondering about this too and found the answer in the faq:
http://wiki.xfce.org/faq
Check under Window Manager, see "Firefox jumps between workspaces, why?" which is the first subject of the section.

What I believe you want is this:

"""
For Xfce 4.6 you can go to Xfce Menu > Settings > Window Manager Tweaks and go to the tab Focus, or you need to use the xfconf-query tool to change the setting:
  xfconf-query -c xfwm4 -p /general/activate_action -s bring|switch|none
As the name suggests, the “bring” option moves the window requesting to be raised to the current workspace, the “switch” option switches workspaces, and the “none” option takes no action.
"""

Offline

#3 2011-05-21 10:13:52

pistachepastis
Member
Registered: 2011-05-05
Posts: 4

Re: Automatically Switch To Workspace With Active Application

I had tried your suggestion before, but it doesn't seem to work.

I have now found a workaround:

I have written a script using a set of wmctrl-commands:
==
#!/bin/bash
if [ $(ps -A | grep firefox | wc -l) -eq 0 ] ; then
firefox &
sleep 1

wmctrl -r firefox -t 2
wmctrl -s 2
wmctrl -a firefox

else
wmctrl -s 2
wmctrl -a firefox
fi
==

Whenever it is invoked, the script opens firefox, brings it to workspace 2, and switches to workspace 2 (if firefox was already open, it just moves to workspace 2).

If you have an idea as to why your suggestion doesn't work for me: suggestions welcome.

Offline

#4 2011-05-22 16:08:52

felixherve
Member
Registered: 2011-05-13
Posts: 3

Re: Automatically Switch To Workspace With Active Application

That's odd. I'm using Xubuntu natty and the FAQ trick I posted worked for me right away. Did you install Ubuntu and then install the xubuntu-desktop package or is this a clean Xubuntu install? If you simply installed the package on top of a basic Ubuntu install, I'm guessing there might be something conflicting between xfce4 and the old gnome or unity packages.

Also, can you check which version of xfce4 you're running with 'xfce4-about'?
What's the output of 'xfconf-query -c xfwm4 -p /general/activate_action'?
You can also try 'xconf-query -x xfwm4 -l' for a list of all possible properties in the window manager channel.

Offline

#5 2011-05-22 20:12:04

pistachepastis
Member
Registered: 2011-05-05
Posts: 4

Re: Automatically Switch To Workspace With Active Application

Thanks for your time. Here are my answers to your questions:
- I did a clean Xubuntu install.
- xfce4 version is 4.8.
- the output of xfconf-query -c xfwm4 -p /general/activate_action is: SWITCH

Honestly, I am satisfied with my workaround. So no need for you to dig further, unless we could help others doing so.

Offline

#6 2011-05-22 20:18:54

felixherve
Member
Registered: 2011-05-13
Posts: 3

Re: Automatically Switch To Workspace With Active Application

If you're happy with the script, then I guess I'll drop it, but personally I'd be annoyed. One last thing, is the output of that last line SWITCH all in caps? In which case try setting it to switch in uncapitalized characters and see if that does anything.

Offline

#7 2011-05-23 05:37:05

pistachepastis
Member
Registered: 2011-05-05
Posts: 4

Re: Automatically Switch To Workspace With Active Application

it is not in CAPS, sorry for that. I wrote it in CAPS just for clarity.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.009 seconds, 7 queries executed - Memory usage: 539.9 KiB (Peak: 541.18 KiB) ]