]> Dogcows Code - chaz/openbox/blobdiff - scripts/builtins.py
add startup and shutdown callback events for each screen
[chaz/openbox] / scripts / builtins.py
index 5d31054e556771d39e7d0be238e0b7807900b184..82f21aea1a4922b4e7f4b79d587ba01cd66b5e83 100644 (file)
@@ -105,23 +105,23 @@ def unshade(data):
     if not client: return
     OBClient_shade(client, 0)
 
-def next_desktop(data):
+def next_desktop(data, no_wrap=0):
     screen = Openbox_screen(openbox, data.screen())
     d = OBScreen_desktop(screen)
     n = OBScreen_numDesktops(screen)
-    if (d == (n-1)):
-        d = 0
-    else:
+    if (d < (n-1)):
         d = d + 1
+    elif not no_wrap:
+        d = 0
     OBScreen_changeDesktop(screen, d)
     
-def prev_desktop(data):
+def prev_desktop(data, no_wrap=0):
     screen = Openbox_screen(openbox, data.screen())
     d = OBScreen_desktop(screen)
     n = OBScreen_numDesktops(screen)
     if (d > 0):
         d = d - 1
-    else:
+    elif not no_wrap:
         d = n - 1
     OBScreen_changeDesktop(screen, d)
     
This page took 0.020682 seconds and 4 git commands to generate.