summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-02-10 23:03:02 +0000
committerDana Jansens <danakj@orodu.net>2003-02-10 23:03:02 +0000
commit33c0058f75cf8f100761254247e64e89256346ab (patch)
tree6a044b8978051b87e120eacaa085b4280e371d84
parent22b5d6458e3001a7bd930bf3491bf7fcd26ac3ce (diff)
add callbacks to show/hide the desktop
-rw-r--r--scripts/callbacks.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/callbacks.py b/scripts/callbacks.py
index f7cb37c1..1b7bf177 100644
--- a/scripts/callbacks.py
+++ b/scripts/callbacks.py
@@ -185,6 +185,29 @@ def change_desktop(data, num):
ob.send_client_msg(root, otk.atoms.net_current_desktop,
root, num)
+def show_desktop(data, show=1):
+ """Shows and focuses the desktop, hiding any client windows. Optionally,
+ if show is zero, this will hide the desktop, leaving show-desktop
+ mode."""
+ root = otk.display.screenInfo(data.screen).rootWindow()
+ ob.send_client_msg(root, otk.atoms.net_showing_desktop, root, show)
+
+def hide_desktop(data):
+ """Hides the desktop, re-showing the client windows. Leaves show-desktop
+ mode."""
+ show_desktop(data, 0)
+
+def toggle_show_desktop(data):
+ """Requests the Openbox to show the desktop, hiding the client windows, or
+ redisplay the clients."""
+ # get the current desktop state
+ root = otk.display.screenInfo(data.screen).rootWindow()
+ result, value = otk.Property_get(root, otk.atoms.net_showing_desktop,
+ otk.atoms.cardinal)
+ if not result: return
+ show = not value
+ ob.send_client_msg(root, otk.atoms.net_showing_desktop, root, show)
+
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."""