integrate home-manager config
This commit is contained in:
parent
a470338c43
commit
826a0e5525
45 changed files with 5308 additions and 1 deletions
30
home-manager/jwm/ptray/i3sway/commands.py
Normal file
30
home-manager/jwm/ptray/i3sway/commands.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
from i3sway.protocol import Connection, ConnType
|
||||
|
||||
class Client:
|
||||
conn = None
|
||||
def __init__(self):
|
||||
self.conn = Connection()
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, *details):
|
||||
self.conn.close()
|
||||
|
||||
def cmd_on_window(self, id, cmd):
|
||||
if self.conn.type == ConnType.SWAY:
|
||||
criteria = '[con_id={}]'.format(id)
|
||||
else:
|
||||
criteria = '[id={}]'.format(id)
|
||||
|
||||
return self.conn.exec('{} {}'.format(criteria, cmd))
|
||||
|
||||
def show_window(self, id):
|
||||
self.cmd_on_window(id, "focus")
|
||||
|
||||
def hide_window(self, id):
|
||||
self.cmd_on_window(id, "move to scratchpad")
|
||||
|
||||
def run(self, command):
|
||||
self.conn.exec("exec {}".format(command))
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue