forked from Airblader/i3-sticky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathi3-sticky-open
executable file
·33 lines (26 loc) · 1.05 KB
/
i3-sticky-open
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3
# vim:ts=4:sw=4:expandtab
import sys
import tkinter as tk
"""
Opens a placeholder window for a sticky group.
This utility opens a mostly empty window to be used as a placeholder container
with i3-sticky. It takes an optional argument describing the group for which
the container should be, defaulting to '1'. i3-sticky will pick up on this
window and automatically mark it as a placeholder container for the
corresponding group.
(C) 2016 Ingo Bürk
Licensed under The MIT License (https://opensource.org/licenses/MIT), see LICENSE.
"""
def create_text_widget(root, label):
widget = tk.Text(root, height = 1, borderwidth = 0, highlightthickness = 0)
widget.place(relx = .5, rely = .5, anchor = 'c')
widget.tag_configure('tag-center', justify = 'center')
widget.insert('end', label, 'tag-center')
if __name__ == '__main__':
group = "1"
if len(sys.argv) > 1:
group = sys.argv[1]
win = tk.Tk(className="i3-sticky-%s" % group)
create_text_widget(win, 'Sticky Placeholder – Group %s' % group)
win.mainloop()