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:
parent
24fc3ca2b4
commit
ac574513e9
@ -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
10
lib/systemd.py
Normal 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)
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user