mirror of
https://github.com/Foltik/dotfiles
synced 2025-02-02 00:10:23 -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.pacman as pacman
|
||||||
import lib.yay as yay
|
import lib.yay as yay
|
||||||
import lib.git as git
|
import lib.git as git
|
||||||
|
import lib.systemd as systemd
|
||||||
from lib.diff import diff
|
from lib.diff import diff
|
||||||
from lib.fish import fish
|
from lib.fish import fish
|
||||||
|
|
||||||
@ -91,7 +92,7 @@ def enable_units(package):
|
|||||||
return
|
return
|
||||||
for unit in package.userunit:
|
for unit in package.userunit:
|
||||||
print('systemctl --user enable', unit.name)
|
print('systemctl --user enable', unit.name)
|
||||||
#proc.exec(['systemctl', '--user', 'enable', unit.name])
|
systemd.enable(unit.name, True)
|
||||||
|
|
||||||
|
|
||||||
def deploy(package):
|
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
|
import lib.proc as proc
|
||||||
|
|
||||||
def install(package):
|
def install(package):
|
||||||
output = yay(['-S', package], True)
|
output = yay(['-S', package])
|
||||||
|
|
||||||
def install_all(packages):
|
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
|
cmd = ['yay', '--noconfirm'] + flags
|
||||||
subproc = proc.sudo(cmd) if sudo else proc.exec(cmd)
|
subproc = proc.exec(cmd)
|
||||||
return proc.communicate(subproc, cmd)
|
return proc.communicate(subproc, cmd)
|
||||||
|
Loading…
Reference in New Issue
Block a user