feat: clear screen on SIGUSR1
This commit is contained in:
parent
b684ad2b2f
commit
9df608901c
1 changed files with 8 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import copy
|
||||
import signal
|
||||
import datetime
|
||||
import collections
|
||||
|
||||
|
|
@ -221,6 +222,8 @@ class Broker:
|
|||
|
||||
self.deck = collections.deque()
|
||||
|
||||
signal.signal(signal.SIGUSR1, self.sigusr1)
|
||||
|
||||
DBusGMainLoop(set_as_default=True)
|
||||
|
||||
bus = dbus.SessionBus()
|
||||
|
|
@ -254,6 +257,11 @@ class Broker:
|
|||
self.print()
|
||||
|
||||
|
||||
def sigusr1(self, signum, stack):
|
||||
self.deck.clear()
|
||||
self.print()
|
||||
|
||||
|
||||
def width(self, deck):
|
||||
w = 0
|
||||
for msg,mlen in deck:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue