X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=scripts%2Fbuiltins.py;h=e180c7b5f022207d74b45f16c8b2473edf757424;hb=ee0591bf39b252760370cf238961cf9ef5dc7cde;hp=82f21aea1a4922b4e7f4b79d587ba01cd66b5e83;hpb=66921633e5e0c071f2ccfb36e6b9f533889af9d8;p=chaz%2Fopenbox diff --git a/scripts/builtins.py b/scripts/builtins.py index 82f21aea..e180c7b5 100644 --- a/scripts/builtins.py +++ b/scripts/builtins.py @@ -106,6 +106,8 @@ def unshade(data): OBClient_shade(client, 0) def next_desktop(data, no_wrap=0): + """Switches to the next desktop, optionally (by default) cycling around to + the first when going past the last.""" screen = Openbox_screen(openbox, data.screen()) d = OBScreen_desktop(screen) n = OBScreen_numDesktops(screen) @@ -116,6 +118,8 @@ def next_desktop(data, no_wrap=0): OBScreen_changeDesktop(screen, d) def prev_desktop(data, no_wrap=0): + """Switches to the previous desktop, optionally (by default) cycling around + to the last when going past the first.""" screen = Openbox_screen(openbox, data.screen()) d = OBScreen_desktop(screen) n = OBScreen_numDesktops(screen) @@ -124,6 +128,11 @@ def prev_desktop(data, no_wrap=0): elif not no_wrap: d = n - 1 OBScreen_changeDesktop(screen, d) + +def change_desktop(data, num): + """Switches to a specified desktop""" + screen = Openbox_screen(openbox, data.screen()) + OBScreen_changeDesktop(screen, num) ######################################### ### Convenience functions for scripts ###