i3 init
This commit is contained in:
17
bin/i3-shutdown.py
Executable file
17
bin/i3-shutdown.py
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/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()
|
||||
Reference in New Issue
Block a user