1
0
mirror of https://github.com/Foltik/dotfiles synced 2025-01-22 06:50:57 -05:00

Add systemd file and fix yay

This commit is contained in:
Jack Foltz 2018-12-10 21:05:23 -05:00
parent 24fc3ca2b4
commit ac574513e9
Signed by: foltik
GPG Key ID: D1F0331758D1F29A
3 changed files with 16 additions and 5 deletions

View File

@ -6,6 +6,7 @@ import lib.proc as proc
import lib.pacman as pacman
import lib.yay as yay
import lib.git as git
import lib.systemd as systemd
from lib.diff import diff
from lib.fish import fish
@ -91,7 +92,7 @@ def enable_units(package):
return
for unit in package.userunit:
print('systemctl --user enable', unit.name)
#proc.exec(['systemctl', '--user', 'enable', unit.name])
systemd.enable(unit.name, True)
def deploy(package):

10
lib/systemd.py Normal file
View File

@ -0,0 +1,10 @@
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)

View File

@ -1,12 +1,12 @@
import lib.proc as proc
def install(package):
output = yay(['-S', package], True)
output = yay(['-S', package])
def install_all(packages):
output = yay(['-S'] + packages, True)
output = yay(['-S'] + packages)
def yay(flags, sudo = False):
def yay(flags):
cmd = ['yay', '--noconfirm'] + flags
subproc = proc.sudo(cmd) if sudo else proc.exec(cmd)
subproc = proc.exec(cmd)
return proc.communicate(subproc, cmd)