18 lines
404 B
Python
Executable File
18 lines
404 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import i3ipc
|
|
import subprocess
|
|
|
|
def on_shutdown(conn=None):
|
|
for ws in range(1, 4):
|
|
file = open('/home/felix/.config/i3/workspace_' + str(ws) + '.json', 'w')
|
|
bashCommand = 'i3-save-tree --workspace ' + str(ws)
|
|
subprocess.Popen(bashCommand.split(), stdout=file)
|
|
|
|
on_shutdown()
|
|
conn = i3ipc.Connection()
|
|
|
|
conn.on('ipc_shutdown', on_shutdown)
|
|
|
|
conn.main()
|