forked from qtile/qtile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'kenji/layout_change'
- Loading branch information
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ | |
pass | ||
from maildir import Maildir | ||
from volume import Volume | ||
from currentlayout import CurrentLayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import base | ||
from .. import manager, bar, hook | ||
|
||
class CurrentLayout(base._TextBox): | ||
defaults = manager.Defaults( | ||
("font", "Arial", "Text font"), | ||
("fontsize", None, "Font pixel size. Calculated if None."), | ||
("padding", None, "Padding left and right. Calculated if None."), | ||
("background", None, "Background colour."), | ||
("foreground", "#ffffff", "Foreground colour.") | ||
) | ||
|
||
def __init__(self, width = bar.CALCULATED, **config): | ||
base._TextBox.__init__(self, "", width, **config) | ||
|
||
def _configure(self, qtile, bar): | ||
base._TextBox._configure(self, qtile, bar) | ||
self.text = self.bar.screen.group.layouts[0].name | ||
self.setup_hooks() | ||
|
||
def setup_hooks(self): | ||
def hook_response(layout): | ||
self.text = layout.name | ||
self.bar.draw() | ||
hook.subscribe.layout_change(hook_response) | ||
|