From 66921633e5e0c071f2ccfb36e6b9f533889af9d8 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 7 Jan 2003 02:27:51 +0000 Subject: [PATCH] add next/prev desktop, give them the no_wrap optional arg --- scripts/builtins.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/builtins.py b/scripts/builtins.py index 5d31054e..82f21aea 100644 --- a/scripts/builtins.py +++ b/scripts/builtins.py @@ -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) -- 2.45.2