mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 11:44:15 +02:00
search and install
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import os
|
||||
import subprocess
|
||||
from typing import List
|
||||
|
||||
from fpakman.core import resource
|
||||
|
||||
|
||||
def run_cmd(cmd: str, expected_code: int = 0, ignore_return_code: bool = False) -> str:
|
||||
res = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, env={'LANG': 'en'})
|
||||
@@ -9,3 +12,8 @@ def run_cmd(cmd: str, expected_code: int = 0, ignore_return_code: bool = False)
|
||||
|
||||
def stream_cmd(cmd: List[str]):
|
||||
return subprocess.Popen(cmd, stdout=subprocess.PIPE, env={'LANG': 'en'}).stdout
|
||||
|
||||
|
||||
def notify_user(msg: str, icon_path: str = resource.get_path('img/flathub_45.svg')):
|
||||
if bool(os.getenv('FPAKMAN_UPDATE_NOTIFICATION', 1)):
|
||||
os.system("notify-send {} '{}'".format("-i {}".format(icon_path) if icon_path else '', msg))
|
||||
|
||||
Reference in New Issue
Block a user