9

I make heavy use of workspaces, and have a lot of them (a 6x4 grid). I usually run openbox, but am currently using a machine that doesn't have openbox set up, so I'm using xfce because it's already mostly configured to my liking. I've gotten used to getting visual feedback when I switch workspaces, showing me which one I've just moved to, and am finding myself a bit disoriented in xfce. In openbox this is a big heads-up display, which is pretty much ideal. I'm aware that the workspace switcher panel applet will highlight the active workspace, but this only seems to work for workspaces which have some desktop space showing; since I generally have all my windows maximized, this isn't super helpful.

Is there a way to enable visual feedback showing the new workspace when switching workspaces in xfce?

4 Answers 4

2

If you're so inclined, you can install pyxfce and somehow handle active_workspace_changed callback, e.g. by showing a notification via notify-send or aosd_cat. But this is, of course, a hack, and no, I didn't try it.

1
  • Not sure if I want to dive that deep on this one. Thanks for the info in any case. I may end up doing this. (+1)
    – intuited
    Commented Feb 2, 2011 at 4:14
2

I have this little python3 code-blob that reacts to workspace switching.

It's not made to display a notification, but to work around a chromium redraw bug. Anything you want to happen on workspace switch, you can easily throw in to the "fire_the_kludge" function though.

https://github.com/aking1012/chromiumKludge/blob/master/kludge.py

Here's a reworked example that uses libnotify2 to tell you your workspace:

#!/usr/bin/env python3

from gi.repository import Wnck, Gtk, Notify
import signal, time

class Kludge:
    def __init__(self):
        self.first = True
        signal.signal(signal.SIGINT, signal.SIG_DFL)
        self.screen = Wnck.Screen.get_default()
        Notify.init("Workspace Switch Notifier")

    def fire_the_kludge(self, data_a, data_b):
        time.sleep(.1)
        try:
            workspace_num = str(self.screen.get_active_workspace().get_number())
        except:
            workspace_num = "Some error happened"
        popup = Notify.Notification.new("Workspace: " + workspace_num)
        popup.show()
        time.sleep(1)
        popup.close()

    def main(self):
        self.screen.connect("active-workspace-changed", self.fire_the_kludge)
        Gtk.main()

if __name__ == '__main__':
    print("Here comes the kludge")
    kludge = Kludge()
    kludge.main()
0
1

This is the content of my workspace_switcher_notification.sh file.

#!/bin/bash
#Description: Show notification when workspace changes
#Requires: xfce4-notifyd, libnotify, wmctrl

WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
while true
do
  UPDATED_WS=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
  if [ $WORKSPACE -ne $UPDATED_WS ]; then
    notify-send -i cs-workspaces "Workspace $UPDATED_WS" "Workspace changed "
    WORKSPACE=$UPDATED_WS
  fi
  sleep 1
done
exit 0

Make it executable via chmod +x workspace_switcher_notification.sh and add to Session and Startup

0

I also keep windows maximized 95% of the time, but the workspace switcher panel does change depending on what workspace I am in. For the currently selected workspace, the active window is light blue, all other windows are dark blue, and all windows in all other workspaces are grey. This may be a function of the theme I'm using (theme called 'Xfce-4.2'), I'm not sure. Have you tried using different themes?

I realize that this isn't as obvious as the big numbers that flash up when you change that I've seen elsewhere. If someone knows how to get those working in xfce, I would like to know.

But barring that, I'd poke around with the color settings, it is possible to get the workspace switcher to colorize the windows based on which workspace is active.

I am running ubuntu 10.4 with xfce 4.6.1 installed (I tried xubuntu, but couldn't get it to work as well).

1
  • There you go. See my answer for workspace number message-box on desktop switch. Commented Jul 13, 2014 at 14:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .