Exemplo n.º 1
0
 def do_workspaces(self, screen):
     for x in range(config.workspaces):
         self.workspaces.append(Workspace(screen, self.win_store))
         
     self.current_workspace = self.workspaces[0]
     self.current_workspace.shown = True
     ewmh.set_number_of_desktops(config.workspaces)
     ewmh.set_current_desktop(0)
Exemplo n.º 2
0
    def do_workspaces(self, screen):
        for x in range(config.workspaces):
            self.workspaces.append(Workspace(screen, self.win_store))

        self.current_workspace = self.workspaces[0]
        self.current_workspace.shown = True
        ewmh.set_number_of_desktops(config.workspaces)
        ewmh.set_current_desktop(0)
Exemplo n.º 3
0
 def next_workspace(self):
     '''
     Part of Mozzarella's primative workspaces
     this switches to the next grid
     '''
     work_n = self.workspaces.index(self.current_workspace) + 1
     print "workspace num is:", work_n
     self.current_workspace_num += 1
     if self.current_workspace_num > config.workspaces:
         self.current_workspace_num = 1
     if work_n > len(self.workspaces)-1:
         work_n = 0
     self.current_workspace.hide()
     self.current_workspace = self.workspaces[work_n]
     self.current_workspace.show()
     ewmh.set_current_desktop(work_n)
Exemplo n.º 4
0
 def next_workspace(self):
     '''
     Part of Mozzarella's primative workspaces
     this switches to the next grid
     '''
     work_n = self.workspaces.index(self.current_workspace) + 1
     print "workspace num is:", work_n
     self.current_workspace_num += 1
     if self.current_workspace_num > config.workspaces:
         self.current_workspace_num = 1
     if work_n > len(self.workspaces) - 1:
         work_n = 0
     self.current_workspace.hide()
     self.current_workspace = self.workspaces[work_n]
     self.current_workspace.show()
     ewmh.set_current_desktop(work_n)
Exemplo n.º 5
0
 def prev_workspace(self):
     '''
     Part of Mozzarella's primative workspaces
     this switches to the previous grid
     '''
     work_p = self.workspaces.index(self.current_workspace) - 1
     print "workspace num is:", work_p
     self.current_workspace.hide()
     self.current_workspace = self.workspaces[work_p]
     self.current_workspace.show()
     if work_p < 0:
         work_p = len(self.workspaces)
     self.current_workspace_num -= 1
     if self.current_workspace_num <= 0:
         self.current_workspace_num = config.workspaces
         
     ewmh.set_current_desktop(work_p)
Exemplo n.º 6
0
    def prev_workspace(self):
        '''
        Part of Mozzarella's primative workspaces
        this switches to the previous grid
        '''
        work_p = self.workspaces.index(self.current_workspace) - 1
        print "workspace num is:", work_p
        self.current_workspace.hide()
        self.current_workspace = self.workspaces[work_p]
        self.current_workspace.show()
        if work_p < 0:
            work_p = len(self.workspaces)
        self.current_workspace_num -= 1
        if self.current_workspace_num <= 0:
            self.current_workspace_num = config.workspaces

        ewmh.set_current_desktop(work_p)
Exemplo n.º 7
0
import sys

from xpybutil import conn, root

import xpybutil.ewmh as ewmh

if len(sys.argv) == 2 and sys.argv[1] == '--help':
    print("Usage: ")
    print("   set_desktop_name NAME_OF_NEW_DESKTOP  - sets current desktop name")
    print("   set_desktop_name NR NAME_OF_NEW_DESKTOP - sets name of NRth desktop")

if len(sys.argv) > 2:
    desktop_offset = int(sys.argv[1])
    new_name = sys.argv[2]

else:
    desktop_offset = ewmh.get_current_desktop().reply()
    new_name = sys.argv[1]

current_names = ewmh.get_desktop_names().reply()

current_names[desktop_offset] = new_name

# Not sure why I have to do it twice - somehow
# doesn't work if I only call it once
c = ewmh.set_desktop_names(current_names)
c = ewmh.set_desktop_names(current_names)

ewmh.set_current_desktop(0)