Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #16 from tott/master
Browse files Browse the repository at this point in the history
Make sure to keep workspaces ordered by number
  • Loading branch information
city41 authored Dec 9, 2018
2 parents c75682b + 526a6c8 commit 77833eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion matei3applet.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def init_widgets(self):
self.modeLabel.set_use_markup(True)

def set_initial_buttons(self):
self.set_workspace_buttons(self.i3conn.get_workspaces())
workspaces = self.i3conn.get_workspaces()
workspaces = sorted(workspaces, key = lambda i: i['num'])
self.set_workspace_buttons(workspaces)

def init_colors(self):
global DEFAULT_COLORS
Expand Down Expand Up @@ -119,6 +121,7 @@ def go_to_workspace(self, workspace):

def set_workspace_buttons(self, workspaces):
logging.debug('set_workspace_buttons')
workspaces = sorted(workspaces, key = lambda i: i['num'])

for child in self.box.get_children():
self.box.remove(child)
Expand Down

0 comments on commit 77833eb

Please sign in to comment.