-import ob, otk
+import ob, otk, config
class _Cycle:
"""
This is a basic cycling class for anything, from xOr's stackedcycle.py,
if not client.normal(): return 0
if not (client.canFocus() or client.focusNotify()): return 0
- if focus.AVOID_SKIP_TASKBAR and client.skipTaskbar(): return 0
+ if config.get('focus', 'avoid_skip_taskbar') and client.skipTaskbar():
+ return 0
if client.iconic():
if self.INCLUDE_ICONS:
if self.INCLUDE_ALL_DESKTOPS:
d = client.desktop()
if d == 0xffffffff: d = self.screen.desktop()
- t = self.screen.desktopName(d) + " - " + t
+ t = self.screen.desktopNames()[d] + " - " + t
return t
if not client.normal(): return 0
if not (client.canFocus() or client.focusNotify()): return 0
- if focus.AVOID_SKIP_TASKBAR and client.skipTaskbar(): return 0
+ if config.get('focus', 'avoid_skip_taskbar') and client.skipTaskbar():
+ return 0
if client.iconic(): return 0
if self.INCLUDE_OMNIPRESENT and desk == 0xffffffff: return 1
if self.INCLUDE_ALL_DESKTOPS:
d = client.desktop()
if d == 0xffffffff: d = self.screen.desktop()
- t = self.screen.desktopName(d) + " - " + t
+ t = self.screen.desktopNames()[d] + " - " + t
return t
_Cycle.__init__(self)
def populateItems(self):
- for i in range(self.screen.numDesktops()):
- self.items.append(
- _CycleDesktops.Desktop(self.screen.desktopName(i), i))
+ names = self.screen.desktopNames()
+ num = self.screen.numDesktops()
+ for n, i in zip(names[:num], range(num)):
+ self.items.append(_CycleDesktops.Desktop(n, i))
def menuLabel(self, desktop):
return desktop.name