1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-30 22:42:11 -05:00
dotfiles/lib/systemd.py

11 lines
261 B
Python
Raw Normal View History

2018-12-10 21:05:23 -05:00
import lib.proc as proc
def enable(unit, user):
flags = (['--user'] if user else []) + ['enable', unit]
output = systemd(flags)
def systemd(flags):
cmd = ['systemctl'] + flags
subproc = proc.exec(cmd)
return proc.communicate(subproc, cmd)