mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 02:24:16 +02:00
Management panel shows update commands streams
This commit is contained in:
@@ -1,38 +1,29 @@
|
||||
# used for AUR installation
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
share_path = str(Path.home()) + '/.local/share'
|
||||
local_resources_path = share_path + '/fpakman'
|
||||
|
||||
if os.path.exists(local_resources_path):
|
||||
shutil.rmtree(local_resources_path)
|
||||
|
||||
os.mkdir(local_resources_path)
|
||||
|
||||
desktop_file = """
|
||||
[Desktop Entry]
|
||||
Type = Application
|
||||
Name = fpakman
|
||||
Categories=System;
|
||||
Categories = System;
|
||||
Comment = Manage your Flatpak applications
|
||||
Exec = /usr/bin/fpakman
|
||||
Icon = {resource_path}/resources/img/flathub_45.svg
|
||||
""".format(resource_path=local_resources_path)
|
||||
Icon = /usr/lib/python{version}/site-packages/fpakman/resources/img/flathub_45.svg
|
||||
""".format(version="{}.{}".format(sys.version_info.major, sys.version_info.minor))
|
||||
|
||||
apps_path = share_path + '/applications'
|
||||
apps_path = '{}/.local/share/applications'.format(str(Path.home()))
|
||||
|
||||
if not os.path.exists(apps_path):
|
||||
os.mkdir(apps_path)
|
||||
|
||||
file_path = apps_path + '/fpakman.desktop'
|
||||
|
||||
if os.path.exists(file_path):
|
||||
os.remove(file_path)
|
||||
file_path = '{}/fpakman.desktop'.format(apps_path)
|
||||
|
||||
with open(file_path, 'w+') as f:
|
||||
f.write(desktop_file)
|
||||
|
||||
subprocess.run('desktop-file-install {}'.format(file_path), shell=True)
|
||||
res = subprocess.run('desktop-file-install {}'.format(file_path), shell=True)
|
||||
|
||||
exit(res.returncode)
|
||||
|
||||
Reference in New Issue
Block a user