mirror of
https://github.com/Snigdha-OS/snigdhaos-blackbox.git
synced 2025-09-21 20:15:02 +02:00
removed stock file
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
sofirem
|
|
@@ -1,51 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
# this script should not be run as root
|
|
||||||
# the polkit agent running on the desktop environment should prompt for root password
|
|
||||||
|
|
||||||
echo "---------------------------------------------------------------------------"
|
|
||||||
echo "[INFO] Checking session"
|
|
||||||
test $(whoami) == "root" && echo "[ERROR] Do not run this script as root." && exit 1
|
|
||||||
test -z $DISPLAY && echo "[ERROR] DISPLAY variable is not set." && exit 1
|
|
||||||
|
|
||||||
# check session is either one of X11, Wayland or TTY
|
|
||||||
session=$(loginctl show-session $(loginctl|grep $(whoami) | awk '{print $1}') -p Type | awk -F= '{print $2}' | grep "x11\|wayland\|tty")
|
|
||||||
|
|
||||||
test -z "$session" && echo "[ERROR] Failed to verify session for user." && exit 1
|
|
||||||
|
|
||||||
xauth_file=$(xauth info | awk -F"Authority file:" '{print $2}' | tr -d ' ')
|
|
||||||
test -s "$xauth_file" || touch "$xauth_file"
|
|
||||||
|
|
||||||
case "$session" in
|
|
||||||
"wayland")
|
|
||||||
# Wayland session, generate Xauth session cookie for $DISPLAY
|
|
||||||
xauth gen $DISPLAY &> /dev/null
|
|
||||||
echo "[INFO] Display = $DISPLAY"
|
|
||||||
echo "[INFO] Session = $session"
|
|
||||||
|
|
||||||
test -z "$(xauth list)" || echo "[INFO] Xauth session = OK"
|
|
||||||
;;
|
|
||||||
"x11")
|
|
||||||
# X11 session, don't do anything here
|
|
||||||
echo "[INFO] Display = $DISPLAY"
|
|
||||||
echo "[INFO] Session = $session"
|
|
||||||
|
|
||||||
# just show msg on whether the Xauth session cookie is setup
|
|
||||||
test -z "$(xauth list)" || echo "[INFO] Xauth session = OK"
|
|
||||||
;;
|
|
||||||
"tty")
|
|
||||||
# TTY session, as user may not use a display manager
|
|
||||||
echo "[INFO] Display = $DISPLAY"
|
|
||||||
echo "[INFO] Session = $session"
|
|
||||||
|
|
||||||
test -z "$(xauth list)" || echo "[INFO] Xauth session = OK"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
# anything here is an unknown session, most likely Sofirem will fail to load
|
|
||||||
echo "[WARN] Cannot verify session for user."
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo "---------------------------------------------------------------------------"
|
|
||||||
|
|
||||||
echo "[INFO] Starting Sofirem"
|
|
||||||
pkexec '/usr/share/sofirem/sofirem.py'
|
|
@@ -1,12 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Name=Sofirem - Software installer/remover for Arch Linux based systems
|
|
||||||
GenericName=Sofirem
|
|
||||||
X-GNOME-FullName=Sofirem
|
|
||||||
Comment=Software installer/remover for Arch Linux based systems
|
|
||||||
Exec=/usr/bin/sofirem
|
|
||||||
Icon=sofirem
|
|
||||||
Terminal=false
|
|
||||||
Type=Application
|
|
||||||
Categories=GTK;GNOME;Utility;Settings;Security;X-GNOME-Settings-Panel;X-GNOME-SystemSettings;X-Unity-Settings-Panel;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;
|
|
||||||
Keywords=application;installer;
|
|
||||||
StartupNotify=true
|
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 155 KiB |
@@ -1,104 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
|
|
||||||
<policyconfig>
|
|
||||||
<vendor>ArcoLinux</vendor>
|
|
||||||
<vendor_url>http://arcolinux.info/</vendor_url>
|
|
||||||
<icon_name>package-x-generic</icon_name>
|
|
||||||
<action id="org.arcolinux.pkexec.sofirem">
|
|
||||||
<description>Change your own user data</description>
|
|
||||||
<description xml:lang="zh_TW">變更您自身的使用者資料</description>
|
|
||||||
<description xml:lang="zh_CN">修改您的用户数据</description>
|
|
||||||
<description xml:lang="uk">Зміна даних вашого користувача</description>
|
|
||||||
<description xml:lang="tr">Kullanıcı bilgilerinizi değiştirin</description>
|
|
||||||
<description xml:lang="sv">Ändra ditt egna användardata</description>
|
|
||||||
<description xml:lang="sr">Измените ваше личне корисничке податке</description>
|
|
||||||
<description xml:lang="sr@latin">Izmenite vaše lične korisničke podatke</description>
|
|
||||||
<description xml:lang="sl">Spremenite lastne uporabniške podatke</description>
|
|
||||||
<description xml:lang="sk">Zmeniť svoje vlastné používateľské údaje</description>
|
|
||||||
<description xml:lang="ru">Изменить личные пользовательские данные</description>
|
|
||||||
<description xml:lang="pt">Alterar os seus próprios dados</description>
|
|
||||||
<description xml:lang="pt_BR">Alterar dados do próprio usuário</description>
|
|
||||||
<description xml:lang="pl">Zmiana własnych danych</description>
|
|
||||||
<description xml:lang="pa">ਆਪਣਾ ਯੂਜ਼ਰ ਡਾਟਾ ਬਦਲੋ</description>
|
|
||||||
<description xml:lang="oc">Modificar sas pròprias donadas</description>
|
|
||||||
<description xml:lang="nl">Uw eigen gebruikersgegevens bewerken</description>
|
|
||||||
<description xml:lang="lv">Mainīt pašam savus lietotāja datus</description>
|
|
||||||
<description xml:lang="lt">Keisti savo naudotojo duomenis</description>
|
|
||||||
<description xml:lang="ko">개인 사용자 데이터 변경</description>
|
|
||||||
<description xml:lang="kk">Өзіңіздің пайдаланушы ақпаратыңызды өзгерту</description>
|
|
||||||
<description xml:lang="ka">თქვენი პირადი ინფორმაციის შეცვლა</description>
|
|
||||||
<description xml:lang="ja">自身のユーザーデータを変更する</description>
|
|
||||||
<description xml:lang="it">Cambia i propri dati utente</description>
|
|
||||||
<description xml:lang="id">Ubah data penggunamu sendiri</description>
|
|
||||||
<description xml:lang="ia">Modificar tu proprie datos de usator</description>
|
|
||||||
<description xml:lang="hu">Saját felhasználói adatainak módosítása</description>
|
|
||||||
<description xml:lang="hr">Promijenite vlastite korisničke podatke</description>
|
|
||||||
<description xml:lang="gl">Cambiar os seus propios datos de usuario</description>
|
|
||||||
<description xml:lang="fur">Cambie i tiei dâts utent</description>
|
|
||||||
<description xml:lang="fr">Modifier ses propres données</description>
|
|
||||||
<description xml:lang="fi">Muuta omia käyttäjätietojasi</description>
|
|
||||||
<description xml:lang="eu">Aldatu zure erabiltzaile-datuak</description>
|
|
||||||
<description xml:lang="es">Cambie sus propios datos de usuario</description>
|
|
||||||
<description xml:lang="eo">Ŝanĝi viajn proprajn uzantodatumojn</description>
|
|
||||||
<description xml:lang="en">Change your own user data</description>
|
|
||||||
<description xml:lang="en_GB">Change your own user data</description>
|
|
||||||
<description xml:lang="el">Αλλάξτε τα δεδομένα χρήστη σας</description>
|
|
||||||
<description xml:lang="de">Ändern Sie Ihre eigenen Benutzerdaten</description>
|
|
||||||
<description xml:lang="da">Skift data for din egen bruger</description>
|
|
||||||
<description xml:lang="cs">Změnit své vlastní údaje</description>
|
|
||||||
<description xml:lang="ca">Canvieu les dades d'usuari pròpies</description>
|
|
||||||
<description xml:lang="ast">Camudacia de los tos datos d'usuariu</description>
|
|
||||||
<description xml:lang="ar">غيّر بيانات المستخدم خاصتك</description>
|
|
||||||
<message>Authentication is required to change your own user data</message>
|
|
||||||
<message xml:lang="zh_TW">若要變更您自身的使用者資料需要核對身分</message>
|
|
||||||
<message xml:lang="zh_CN">需要授权以修改您的用户数据</message>
|
|
||||||
<message xml:lang="uk">Для зміни даних вашого користувача потрібно пройти розпізнавання</message>
|
|
||||||
<message xml:lang="tr">Kendi kullanıcı bilginizi değiştirmek için kimlik kanıtlaması gereklidir</message>
|
|
||||||
<message xml:lang="sv">Autentisering krävs för att ändra ditt egna användardata</message>
|
|
||||||
<message xml:lang="sr">Потребно је потврђивање идентитета за промену ваших личних корисничких података</message>
|
|
||||||
<message xml:lang="sr@latin">Potrebno je potvrđivanje identiteta za promenu vaših ličnih korisničkih podataka</message>
|
|
||||||
<message xml:lang="sl">Za spremembo lastnih podatkov je zahtevana overitev</message>
|
|
||||||
<message xml:lang="sk">Na zmenu vlastných používateľských údajov je potrebné overenie totožnosti</message>
|
|
||||||
<message xml:lang="ru">Для изменения личных пользовательских данных требуется аутентификация</message>
|
|
||||||
<message xml:lang="pt">É necessária autenticação para alterar os seus próprios dados de utilizador</message>
|
|
||||||
<message xml:lang="pt_BR">Autenticação é necessária para alterar dados do próprio usuário</message>
|
|
||||||
<message xml:lang="pl">Wymagane jest uwierzytelnienie, aby zmienić własne dane</message>
|
|
||||||
<message xml:lang="pa">ਤੁਹਾਡਾ ਯੂਜ਼ਰ ਡਾਟਾ ਬਦਲਣ ਲਈ ਪਰਮਾਣਿਤ ਹੋਣ ਦੀ ਲੋੜ ਹੈ</message>
|
|
||||||
<message xml:lang="oc">Vos cal vos autentificar per modificar vòstras pròprias donadas d'utilizaire</message>
|
|
||||||
<message xml:lang="nl">Authenticatie vereist om uw eigen gebruikersgegevens te kunnen veranderen</message>
|
|
||||||
<message xml:lang="lv">Nepieciešama autentifikācija, lai mainītu pats savus lietotāja datus</message>
|
|
||||||
<message xml:lang="lt">Norint keisti savo naudotojo duomenis, reikia patvirtinti tapatybę</message>
|
|
||||||
<message xml:lang="ko">내 사용자 데이터를 변경하려면 인증해야 합니다</message>
|
|
||||||
<message xml:lang="kk">Өзіңіздің пайдаланушы ақпаратыңызды өзгерту үшін аутентификация керек</message>
|
|
||||||
<message xml:lang="ka">თქვენი პირადი მონაცემების შესაცვლელად აუცილებელია ავთენტიფიკაციის გავლა.</message>
|
|
||||||
<message xml:lang="ja">自分自身のユーザーデータを変更するには認証が必要です</message>
|
|
||||||
<message xml:lang="it">È richiesto autenticarsi per cambiare i propri dati utente</message>
|
|
||||||
<message xml:lang="id">Otentikasi diperlukan untuk mengubah data pengguna milikmu</message>
|
|
||||||
<message xml:lang="ia">Authentication es necessari pro modificar tu proprie datos de usator</message>
|
|
||||||
<message xml:lang="hu">Hitelesítés szükséges a saját felhasználói adatai módosításához</message>
|
|
||||||
<message xml:lang="hr">Potrebna je ovjera za promjenu vlastitih korisničkih podataka</message>
|
|
||||||
<message xml:lang="gl">Requírese autenticación para cambiar os seus propios datos de usuario</message>
|
|
||||||
<message xml:lang="fur">La autenticazion e je necssarie par cambiâ i propris dâts utent</message>
|
|
||||||
<message xml:lang="fr">Vous devez vous authentifier pour modifier vos propres données utilisateur</message>
|
|
||||||
<message xml:lang="fi">Omien käyttäjätietojen muuttaminen vaatii tunnistautumisen</message>
|
|
||||||
<message xml:lang="eu">Derrigorrezkoa da autentifikatzea zure erabiltzaile-datuak aldatzeko</message>
|
|
||||||
<message xml:lang="es">Se necesita autenticación para cambiar sus datos de usuario</message>
|
|
||||||
<message xml:lang="eo">Aŭtentigo bezonatas por ŝanĝi viajn proprajn uzantodatumojn</message>
|
|
||||||
<message xml:lang="en">Authentication is required to change your own user data</message>
|
|
||||||
<message xml:lang="en_GB">Authentication is required to change your own user data</message>
|
|
||||||
<message xml:lang="el">Απαιτείται πιστοποίηση για αλλαγή των δικών σας δεδομένων χρήστη</message>
|
|
||||||
<message xml:lang="de">Zur Änderung Ihrer eigenen Benutzerdaten ist eine Authentifizierung erforderlich</message>
|
|
||||||
<message xml:lang="da">Der kræves autentifikation for at skifte data for din egen bruger</message>
|
|
||||||
<message xml:lang="cs">Pro změnu svých vlastních údajů je vyžadována autentizace</message>
|
|
||||||
<message xml:lang="ca">Es requereix autenticació per canviar les vostres dades d'usuari</message>
|
|
||||||
<message xml:lang="ast">Ríquese l'autenticación pa camudar los tos datos d'usuairu</message>
|
|
||||||
<message xml:lang="ar">الاستيثاق مطلوب لتغيير بيانات المستخدم التي تملكها</message>
|
|
||||||
<defaults>
|
|
||||||
<allow_any>auth_admin</allow_any>
|
|
||||||
<allow_inactive>auth_admin</allow_inactive>
|
|
||||||
<allow_active>auth_admin</allow_active>
|
|
||||||
</defaults>
|
|
||||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/share/sofirem/sofirem.py</annotate>
|
|
||||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
|
||||||
</action>
|
|
||||||
</policyconfig>
|
|
File diff suppressed because it is too large
Load Diff
@@ -1,728 +0,0 @@
|
|||||||
# =================================================================
|
|
||||||
# = Author: Cameron Percival =
|
|
||||||
# =================================================================
|
|
||||||
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import shutil
|
|
||||||
import psutil
|
|
||||||
import datetime
|
|
||||||
|
|
||||||
# import time
|
|
||||||
import subprocess
|
|
||||||
import threading # noqa
|
|
||||||
import gi
|
|
||||||
|
|
||||||
# import configparser
|
|
||||||
gi.require_version("Gtk", "3.0")
|
|
||||||
from gi.repository import GLib, Gtk # noqa
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# Create log file
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
log_dir = "/var/log/arcolinux/"
|
|
||||||
aai_log_dir = "/var/log/arcolinux/aai/"
|
|
||||||
|
|
||||||
|
|
||||||
def create_log(self):
|
|
||||||
print("Making log in /var/log/arcolinux")
|
|
||||||
now = datetime.datetime.now()
|
|
||||||
time = now.strftime("%Y-%m-%d-%H-%M-%S")
|
|
||||||
destination = aai_log_dir + "aai-log-" + time
|
|
||||||
command = "sudo pacman -Q > " + destination
|
|
||||||
subprocess.call(
|
|
||||||
command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
|
|
||||||
)
|
|
||||||
# GLib.idle_add(show_in_app_notification, self, "Log file created")
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# GLOBAL FUNCTIONS
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def _get_position(lists, value):
|
|
||||||
data = [string for string in lists if value in string]
|
|
||||||
position = lists.index(data[0])
|
|
||||||
return position
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# PERMISSIONS
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def permissions(dst):
|
|
||||||
try:
|
|
||||||
groups = subprocess.run(
|
|
||||||
["sh", "-c", "id " + sudo_username],
|
|
||||||
shell=False,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
)
|
|
||||||
for x in groups.stdout.decode().split(" "):
|
|
||||||
if "gid" in x:
|
|
||||||
g = x.split("(")[1]
|
|
||||||
group = g.replace(")", "").strip()
|
|
||||||
subprocess.call(["chown", "-R", sudo_username + ":" + group, dst], shell=False)
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
|
|
||||||
|
|
||||||
#######ANYTHING UNDER THIS LINE IS CURRENTLY UNUSED!
|
|
||||||
|
|
||||||
sudo_username = os.getlogin()
|
|
||||||
home = "/home/" + str(sudo_username)
|
|
||||||
|
|
||||||
sddm_default = "/etc/sddm.conf"
|
|
||||||
sddm_default_original = "/usr/local/share/arcolinux/sddm/sddm.conf"
|
|
||||||
|
|
||||||
sddm_default_d1 = "/etc/sddm.conf"
|
|
||||||
sddm_default_d2 = "/etc/sddm.conf.d/kde_settings.conf"
|
|
||||||
sddm_default_d2_dir = "/etc/sddm.conf.d/"
|
|
||||||
sddm_default_d_sddm_original_1 = "/usr/local/share/arcolinux/sddm.conf.d/sddm.conf"
|
|
||||||
sddm_default_d_sddm_original_2 = (
|
|
||||||
"/usr/local/share/arcolinux/sddm.conf.d/kde_settings.conf"
|
|
||||||
)
|
|
||||||
|
|
||||||
if os.path.exists("/etc/sddm.conf.d/kde_settings.conf"):
|
|
||||||
sddm_conf = "/etc/sddm.conf.d/kde_settings.conf"
|
|
||||||
else:
|
|
||||||
sddm_conf = "/etc/sddm.conf"
|
|
||||||
|
|
||||||
arcolinux_mirrorlist = "/etc/pacman.d/arcolinux-mirrorlist"
|
|
||||||
arcolinux_mirrorlist_original = "/usr/local/share/arcolinux/arcolinux-mirrorlist"
|
|
||||||
pacman = "/etc/pacman.conf"
|
|
||||||
oblogout_conf = "/etc/oblogout.conf"
|
|
||||||
# oblogout_conf = home + "/oblogout.conf"
|
|
||||||
gtk3_settings = home + "/.config/gtk-3.0/settings.ini"
|
|
||||||
gtk2_settings = home + "/.gtkrc-2.0"
|
|
||||||
grub_theme_conf = "/boot/grub/themes/Vimix/theme.txt"
|
|
||||||
xfce_config = home + "/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml"
|
|
||||||
slimlock_conf = "/etc/slim.conf"
|
|
||||||
termite_config = home + "/.config/termite/config"
|
|
||||||
neofetch_config = home + "/.config/neofetch/config.conf"
|
|
||||||
lightdm_conf = "/etc/lightdm/lightdm.conf"
|
|
||||||
bd = ".att_backups"
|
|
||||||
config = home + "/.config/archlinux-tweak-tool/settings.ini"
|
|
||||||
config_dir = home + "/.config/archlinux-tweak-tool/"
|
|
||||||
polybar = home + "/.config/polybar/"
|
|
||||||
desktop = ""
|
|
||||||
autostart = home + "/.config/autostart/"
|
|
||||||
zsh_config = home + "/.zshrc"
|
|
||||||
account_list = ["Standard", "Administrator"]
|
|
||||||
i3wm_config = home + "/.config/i3/config"
|
|
||||||
awesome_config = home + "/.config/awesome/rc.lua"
|
|
||||||
qtile_config = home + "/.config/qtile/config.py"
|
|
||||||
|
|
||||||
seedhostmirror = "Server = https://ant.seedhost.eu/arcolinux/$repo/$arch"
|
|
||||||
|
|
||||||
arepo_test = "[arcolinux_repo_testing]\n\
|
|
||||||
SigLevel = Required DatabaseOptional\n\
|
|
||||||
Include = /etc/pacman.d/arcolinux-mirrorlist"
|
|
||||||
|
|
||||||
arepo = "[arcolinux_repo]\n\
|
|
||||||
SigLevel = Required DatabaseOptional\n\
|
|
||||||
Include = /etc/pacman.d/arcolinux-mirrorlist"
|
|
||||||
|
|
||||||
a3drepo = "[arcolinux_repo_3party]\n\
|
|
||||||
SigLevel = Required DatabaseOptional\n\
|
|
||||||
Include = /etc/pacman.d/arcolinux-mirrorlist"
|
|
||||||
|
|
||||||
axlrepo = "[arcolinux_repo_xlarge]\n\
|
|
||||||
SigLevel = Required DatabaseOptional\n\
|
|
||||||
Include = /etc/pacman.d/arcolinux-mirrorlist"
|
|
||||||
|
|
||||||
hefftor_repo = "[hefftor-repo]\n\
|
|
||||||
SigLevel = Optional TrustedOnly\n\
|
|
||||||
Include = /etc/pacman.d/arcolinux-mirrorlist-bradheff"
|
|
||||||
|
|
||||||
bobo_repo = "[chaotic-aur]\n\
|
|
||||||
SigLevel = Required DatabaseOptional\n\
|
|
||||||
Include = /etc/pacman.d/chaotic-mirrorlist"
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# NOTIFICATIONS
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def show_in_app_notification(self, message):
|
|
||||||
if self.timeout_id is not None:
|
|
||||||
GLib.source_remove(self.timeout_id)
|
|
||||||
self.timeout_id = None
|
|
||||||
|
|
||||||
self.notification_label.set_markup(
|
|
||||||
'<span foreground="white">' + message + "</span>"
|
|
||||||
)
|
|
||||||
self.notification_revealer.set_reveal_child(True)
|
|
||||||
self.timeout_id = GLib.timeout_add(3000, timeOut, self)
|
|
||||||
|
|
||||||
|
|
||||||
def timeOut(self):
|
|
||||||
close_in_app_notification(self)
|
|
||||||
|
|
||||||
|
|
||||||
def close_in_app_notification(self):
|
|
||||||
self.notification_revealer.set_reveal_child(False)
|
|
||||||
GLib.source_remove(self.timeout_id)
|
|
||||||
self.timeout_id = None
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# PERMISSIONS
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def test(dst):
|
|
||||||
for root, dirs, filesr in os.walk(dst):
|
|
||||||
# print(root)
|
|
||||||
for folder in dirs:
|
|
||||||
pass
|
|
||||||
# print(dst + "/" + folder)
|
|
||||||
for file in filesr:
|
|
||||||
pass
|
|
||||||
# print(dst + "/" + folder + "/" + file)
|
|
||||||
for file in filesr:
|
|
||||||
pass
|
|
||||||
# print(dst + "/" + file)
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# COPY FUNCTION
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def copy_func(src, dst, isdir=False):
|
|
||||||
if isdir:
|
|
||||||
subprocess.run(["cp", "-Rp", src, dst], shell=False)
|
|
||||||
else:
|
|
||||||
subprocess.run(["cp", "-p", src, dst], shell=False)
|
|
||||||
# permissions(dst)
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# SOURCE
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def source_shell(self):
|
|
||||||
process = subprocess.run(["sh", "-c", 'echo "$SHELL"'], stdout=subprocess.PIPE)
|
|
||||||
|
|
||||||
output = process.stdout.decode().strip()
|
|
||||||
print(output)
|
|
||||||
if output == "/bin/bash":
|
|
||||||
subprocess.run(
|
|
||||||
[
|
|
||||||
"bash",
|
|
||||||
"-c",
|
|
||||||
"su - " + sudo_username + ' -c "source ' + home + '/.bashrc"',
|
|
||||||
],
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
)
|
|
||||||
elif output == "/bin/zsh":
|
|
||||||
subprocess.run(
|
|
||||||
["zsh", "-c", "su - " + sudo_username + ' -c "source ' + home + '/.zshrc"'],
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def run_as_user(script):
|
|
||||||
subprocess.call(["su - " + sudo_username + " -c " + script], shell=False)
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# MESSAGEBOX
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def MessageBox(self, title, message):
|
|
||||||
md2 = Gtk.MessageDialog(
|
|
||||||
parent=self,
|
|
||||||
flags=0,
|
|
||||||
message_type=Gtk.MessageType.INFO,
|
|
||||||
buttons=Gtk.ButtonsType.OK,
|
|
||||||
text=title,
|
|
||||||
)
|
|
||||||
md2.format_secondary_markup(message)
|
|
||||||
md2.run()
|
|
||||||
md2.destroy()
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# CONVERT COLOR
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def rgb_to_hex(rgb):
|
|
||||||
if "rgb" in rgb:
|
|
||||||
rgb = rgb.replace("rgb(", "").replace(")", "")
|
|
||||||
vals = rgb.split(",")
|
|
||||||
return "#{0:02x}{1:02x}{2:02x}".format(
|
|
||||||
clamp(int(vals[0])), clamp(int(vals[1])), clamp(int(vals[2]))
|
|
||||||
)
|
|
||||||
return rgb
|
|
||||||
|
|
||||||
|
|
||||||
def clamp(x):
|
|
||||||
return max(0, min(x, 255))
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# GLOBAL FUNCTIONS
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def _get_variable(lists, value):
|
|
||||||
data = [string for string in lists if value in string]
|
|
||||||
|
|
||||||
if len(data) >= 1:
|
|
||||||
|
|
||||||
data1 = [string for string in data if "#" in string]
|
|
||||||
|
|
||||||
for i in data1:
|
|
||||||
if i[:4].find("#") != -1:
|
|
||||||
data.remove(i)
|
|
||||||
if data:
|
|
||||||
data_clean = [data[0].strip("\n").replace(" ", "")][0].split("=")
|
|
||||||
return data_clean
|
|
||||||
|
|
||||||
|
|
||||||
# Check value exists
|
|
||||||
|
|
||||||
|
|
||||||
def check_value(list, value):
|
|
||||||
data = [string for string in list if value in string]
|
|
||||||
if len(data) >= 1:
|
|
||||||
data1 = [string for string in data if "#" in string]
|
|
||||||
for i in data1:
|
|
||||||
if i[:4].find("#") != -1:
|
|
||||||
data.remove(i)
|
|
||||||
return data
|
|
||||||
|
|
||||||
|
|
||||||
def check_backups(now):
|
|
||||||
if not os.path.exists(home + "/" + bd + "/Backup-" + now.strftime("%Y-%m-%d %H")):
|
|
||||||
os.makedirs(home + "/" + bd + "/Backup-" + now.strftime("%Y-%m-%d %H"), 0o777)
|
|
||||||
permissions(home + "/" + bd + "/Backup-" + now.strftime("%Y-%m-%d %H"))
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# Check if File Exists
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def file_check(file):
|
|
||||||
if os.path.isfile(file):
|
|
||||||
return True
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def path_check(path):
|
|
||||||
if os.path.isdir(path):
|
|
||||||
return True
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# GTK3 CONF
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def gtk_check_value(my_list, value):
|
|
||||||
data = [string for string in my_list if value in string]
|
|
||||||
if len(data) >= 1:
|
|
||||||
data1 = [string for string in data if "#" in string]
|
|
||||||
for i in data1:
|
|
||||||
if i[:4].find("#") != -1:
|
|
||||||
data.remove(i)
|
|
||||||
return data
|
|
||||||
|
|
||||||
|
|
||||||
def gtk_get_position(my_list, value):
|
|
||||||
data = [string for string in my_list if value in string]
|
|
||||||
position = my_list.index(data[0])
|
|
||||||
return position
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# OBLOGOUT CONF
|
|
||||||
# =====================================================
|
|
||||||
# Get shortcuts index
|
|
||||||
|
|
||||||
|
|
||||||
def get_shortcuts(conflist):
|
|
||||||
sortcuts = _get_variable(conflist, "shortcuts")
|
|
||||||
shortcuts_index = _get_position(conflist, sortcuts[0])
|
|
||||||
return int(shortcuts_index)
|
|
||||||
|
|
||||||
|
|
||||||
# Get commands index
|
|
||||||
|
|
||||||
|
|
||||||
def get_commands(conflist):
|
|
||||||
commands = _get_variable(conflist, "commands")
|
|
||||||
commands_index = _get_position(conflist, commands[0])
|
|
||||||
return int(commands_index)
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# LIGHTDM CONF
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def check_lightdm_value(list, value):
|
|
||||||
data = [string for string in list if value in string]
|
|
||||||
# if len(data) >= 1:
|
|
||||||
# data1 = [string for string in data if "#" in string]
|
|
||||||
|
|
||||||
return data
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# SDDM CONF
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def check_sddm_value(list, value):
|
|
||||||
data = [string for string in list if value in string]
|
|
||||||
return data
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# HBLOCK CONF
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def hblock_get_state(self):
|
|
||||||
lines = int(
|
|
||||||
subprocess.check_output("wc -l /etc/hosts", shell=True).strip().split()[0]
|
|
||||||
)
|
|
||||||
if os.path.exists("/usr/local/bin/hblock") and lines > 100:
|
|
||||||
return True
|
|
||||||
|
|
||||||
self.firstrun = False
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def do_pulse(data, prog):
|
|
||||||
prog.pulse()
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def set_hblock(self, toggle, state):
|
|
||||||
GLib.idle_add(toggle.set_sensitive, False)
|
|
||||||
GLib.idle_add(self.label7.set_text, "Run..")
|
|
||||||
GLib.idle_add(self.progress.set_fraction, 0.2)
|
|
||||||
|
|
||||||
timeout_id = None
|
|
||||||
timeout_id = GLib.timeout_add(100, do_pulse, None, self.progress)
|
|
||||||
|
|
||||||
try:
|
|
||||||
|
|
||||||
install = "pacman -S arcolinux-hblock-git --needed --noconfirm"
|
|
||||||
enable = "/usr/local/bin/hblock"
|
|
||||||
|
|
||||||
if state:
|
|
||||||
if os.path.exists("/usr/local/bin/hblock"):
|
|
||||||
GLib.idle_add(self.label7.set_text, "Database update...")
|
|
||||||
subprocess.call(
|
|
||||||
[enable],
|
|
||||||
shell=False,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
GLib.idle_add(self.label7.set_text, "Install Hblock......")
|
|
||||||
subprocess.call(
|
|
||||||
install.split(" "),
|
|
||||||
shell=False,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
)
|
|
||||||
GLib.idle_add(self.label7.set_text, "Database update...")
|
|
||||||
subprocess.call(
|
|
||||||
[enable],
|
|
||||||
shell=False,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
)
|
|
||||||
|
|
||||||
else:
|
|
||||||
GLib.idle_add(self.label7.set_text, "Remove update...")
|
|
||||||
subprocess.run(
|
|
||||||
["sh", "-c", "HBLOCK_SOURCES='' /usr/local/bin/hblock"],
|
|
||||||
shell=False,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
)
|
|
||||||
|
|
||||||
GLib.idle_add(self.label7.set_text, "Complete")
|
|
||||||
GLib.source_remove(timeout_id)
|
|
||||||
timeout_id = None
|
|
||||||
GLib.idle_add(self.progress.set_fraction, 0)
|
|
||||||
|
|
||||||
GLib.idle_add(toggle.set_sensitive, True)
|
|
||||||
if state:
|
|
||||||
GLib.idle_add(self.label7.set_text, "HBlock Active")
|
|
||||||
else:
|
|
||||||
GLib.idle_add(self.label7.set_text, "HBlock Inactive")
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
MessageBox(self, "ERROR!!", str(e))
|
|
||||||
print(e)
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# UBLOCK ORIGIN
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def ublock_get_state(self):
|
|
||||||
if os.path.exists(
|
|
||||||
"/usr/lib/firefox/browser/extensions/uBlock0@raymondhill.net.xpi"
|
|
||||||
):
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def set_firefox_ublock(self, toggle, state):
|
|
||||||
GLib.idle_add(toggle.set_sensitive, False)
|
|
||||||
GLib.idle_add(self.label7.set_text, "Run..")
|
|
||||||
GLib.idle_add(self.progress.set_fraction, 0.2)
|
|
||||||
|
|
||||||
timeout_id = None
|
|
||||||
timeout_id = GLib.timeout_add(100, do_pulse, None, self.progress)
|
|
||||||
|
|
||||||
try:
|
|
||||||
|
|
||||||
install_ublock = "pacman -S firefox-ublock-origin --needed --noconfirm"
|
|
||||||
uninstall_ublock = "pacman -Rs firefox-ublock-origin --noconfirm"
|
|
||||||
|
|
||||||
if state:
|
|
||||||
GLib.idle_add(self.label7.set_text, "Installing ublock Origin...")
|
|
||||||
subprocess.call(
|
|
||||||
install_ublock.split(" "),
|
|
||||||
shell=False,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
GLib.idle_add(self.label7.set_text, "Removing ublock Origin...")
|
|
||||||
subprocess.call(
|
|
||||||
uninstall_ublock.split(" "),
|
|
||||||
shell=False,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
)
|
|
||||||
|
|
||||||
GLib.idle_add(self.label7.set_text, "Complete")
|
|
||||||
GLib.source_remove(timeout_id)
|
|
||||||
timeout_id = None
|
|
||||||
GLib.idle_add(self.progress.set_fraction, 0)
|
|
||||||
|
|
||||||
GLib.idle_add(toggle.set_sensitive, True)
|
|
||||||
if state:
|
|
||||||
GLib.idle_add(self.label7.set_text, "uBlock Origin installed")
|
|
||||||
else:
|
|
||||||
GLib.idle_add(self.label7.set_text, "uBlock Origin removed")
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
MessageBox(self, "ERROR!!", str(e))
|
|
||||||
print(e)
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# ALACRITTY
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def install_alacritty(self):
|
|
||||||
install = "pacman -S alacritty --needed --noconfirm"
|
|
||||||
|
|
||||||
if os.path.exists("/usr/bin/alacritty"):
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
subprocess.call(
|
|
||||||
install.split(" "),
|
|
||||||
shell=False,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# ARCOLINUX-DESKTOP-TRASHER
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def install_adt(self):
|
|
||||||
install = "pacman -S arcolinux-desktop-trasher-git --noconfirm"
|
|
||||||
|
|
||||||
if os.path.exists("/usr/local/bin/arcolinux-desktop-trasher"):
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
subprocess.call(
|
|
||||||
install.split(" "),
|
|
||||||
shell=False,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# GRUB CONF
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def get_grub_wallpapers():
|
|
||||||
if os.path.isdir("/boot/grub/themes/Vimix"):
|
|
||||||
lists = os.listdir("/boot/grub/themes/Vimix")
|
|
||||||
|
|
||||||
rems = [
|
|
||||||
"select_e.png",
|
|
||||||
"terminal_box_se.png",
|
|
||||||
"select_c.png",
|
|
||||||
"terminal_box_c.png",
|
|
||||||
"terminal_box_s.png",
|
|
||||||
"select_w.png",
|
|
||||||
"terminal_box_nw.png",
|
|
||||||
"terminal_box_w.png",
|
|
||||||
"terminal_box_ne.png",
|
|
||||||
"terminal_box_sw.png",
|
|
||||||
"terminal_box_n.png",
|
|
||||||
"terminal_box_e.png",
|
|
||||||
]
|
|
||||||
|
|
||||||
ext = [".png", ".jpeg", ".jpg"]
|
|
||||||
|
|
||||||
new_list = [x for x in lists if x not in rems for y in ext if y in x]
|
|
||||||
|
|
||||||
new_list.sort()
|
|
||||||
return new_list
|
|
||||||
|
|
||||||
|
|
||||||
def set_grub_wallpaper(self, image):
|
|
||||||
if os.path.isfile(grub_theme_conf):
|
|
||||||
if not os.path.isfile(grub_theme_conf + ".bak"):
|
|
||||||
shutil.copy(grub_theme_conf, grub_theme_conf + ".bak")
|
|
||||||
try:
|
|
||||||
with open(grub_theme_conf, "r") as f:
|
|
||||||
lists = f.readlines()
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
val = _get_position(lists, "desktop-image: ")
|
|
||||||
lists[val] = 'desktop-image: "' + os.path.basename(image) + '"' + "\n"
|
|
||||||
|
|
||||||
with open(grub_theme_conf, "w") as f:
|
|
||||||
f.writelines(lists)
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
show_in_app_notification(self, "Settings Saved Successfully")
|
|
||||||
# MessageBox(self, "Success!!", "Settings Saved Successfully")
|
|
||||||
except: # noqa
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# NEOFETCH CONF
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def neofetch_set_value(lists, pos, text, state):
|
|
||||||
if state:
|
|
||||||
if text in lists[pos]:
|
|
||||||
if "#" in lists[pos]:
|
|
||||||
lists[pos] = lists[pos].replace("#", "")
|
|
||||||
else:
|
|
||||||
if text in lists[pos]:
|
|
||||||
if "#" not in lists[pos]:
|
|
||||||
lists[pos] = "#" + lists[pos]
|
|
||||||
|
|
||||||
return lists
|
|
||||||
|
|
||||||
|
|
||||||
def neofetch_set_backend_value(lists, pos, text, value):
|
|
||||||
if text in lists[pos] and "#" not in lists[pos]:
|
|
||||||
lists[pos] = text + value + '"\n'
|
|
||||||
|
|
||||||
|
|
||||||
# ====================================================================
|
|
||||||
# CUSTOM FUNCTION
|
|
||||||
# ====================================================================
|
|
||||||
|
|
||||||
|
|
||||||
def get_desktop(self):
|
|
||||||
base_dir = os.path.dirname(os.path.realpath(__file__))
|
|
||||||
|
|
||||||
desktop = subprocess.run(
|
|
||||||
["sh", base_dir + "/get_desktop.sh", "-n"],
|
|
||||||
shell=False,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
)
|
|
||||||
dsk = desktop.stdout.decode().strip().split("\n")
|
|
||||||
self.desktop = dsk[-1].strip()
|
|
||||||
|
|
||||||
|
|
||||||
def copytree(self, src, dst, symlinks=False, ignore=None): # noqa
|
|
||||||
|
|
||||||
if not os.path.exists(dst):
|
|
||||||
os.makedirs(dst)
|
|
||||||
for item in os.listdir(src):
|
|
||||||
s = os.path.join(src, item)
|
|
||||||
d = os.path.join(dst, item)
|
|
||||||
if os.path.exists(d):
|
|
||||||
try:
|
|
||||||
shutil.rmtree(d)
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
os.unlink(d)
|
|
||||||
if os.path.isdir(s):
|
|
||||||
try:
|
|
||||||
shutil.copytree(s, d, symlinks, ignore)
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
print("ERROR2")
|
|
||||||
self.ecode = 1
|
|
||||||
else:
|
|
||||||
try:
|
|
||||||
shutil.copy2(s, d)
|
|
||||||
except: # noqa
|
|
||||||
print("ERROR3")
|
|
||||||
self.ecode = 1
|
|
||||||
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# CHECK RUNNING PROCESS
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
|
|
||||||
def checkIfProcessRunning(processName):
|
|
||||||
for proc in psutil.process_iter():
|
|
||||||
try:
|
|
||||||
pinfo = proc.as_dict(attrs=["pid", "name", "create_time"])
|
|
||||||
if processName == pinfo["pid"]:
|
|
||||||
return True
|
|
||||||
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
|
|
||||||
pass
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def restart_program():
|
|
||||||
python = sys.executable
|
|
||||||
os.execl(python, python, *sys.argv)
|
|
||||||
|
|
||||||
|
|
||||||
# JUNK CODE FOR LEARNING PROGRESS BARS:
|
|
||||||
# from tqdm import tqdm
|
|
||||||
# loop = tqdm(total = 1000, position = 0, leave = False)
|
|
||||||
# for k in range(1001):
|
|
||||||
# loop.set_description("Loading...".format(k))
|
|
||||||
# loop.update(1)
|
|
||||||
# loop.close
|
|
@@ -1,19 +0,0 @@
|
|||||||
# This class is to encapsulate package metadata, taken from the yaml files stored inside the sofirem github repository
|
|
||||||
|
|
||||||
|
|
||||||
class Package(object):
|
|
||||||
def __init__(
|
|
||||||
self,
|
|
||||||
name,
|
|
||||||
description,
|
|
||||||
category,
|
|
||||||
subcategory,
|
|
||||||
subcategory_description,
|
|
||||||
version,
|
|
||||||
):
|
|
||||||
self.name = name
|
|
||||||
self.description = description
|
|
||||||
self.category = category
|
|
||||||
self.subcategory = subcategory
|
|
||||||
self.subcategory_description = subcategory_description
|
|
||||||
self.version = version
|
|
@@ -1,132 +0,0 @@
|
|||||||
# This class is used to process configuration data for the app
|
|
||||||
|
|
||||||
import os
|
|
||||||
import Functions as fn
|
|
||||||
from string import Template
|
|
||||||
|
|
||||||
base_dir = os.path.dirname(os.path.realpath(__file__))
|
|
||||||
# a default configuration file if one doesn't exist is copied over from /usr/share/sofirem/defaults to $HOME/.config
|
|
||||||
default_file = "%s/defaults/sofirem.yaml" % base_dir
|
|
||||||
|
|
||||||
|
|
||||||
class Settings(object):
|
|
||||||
def __init__(self, display_versions, display_package_progress):
|
|
||||||
self.display_versions = display_versions
|
|
||||||
self.display_package_progress = display_package_progress
|
|
||||||
|
|
||||||
def write_config_file(self):
|
|
||||||
try:
|
|
||||||
content = []
|
|
||||||
with open(fn.config_file, "r", encoding="UTF-8") as f:
|
|
||||||
contents = f.readlines()
|
|
||||||
|
|
||||||
if len(contents) > 0:
|
|
||||||
self.read(contents)
|
|
||||||
|
|
||||||
conf_settings = {}
|
|
||||||
|
|
||||||
conf_settings["Display Package Versions"] = self.display_versions
|
|
||||||
|
|
||||||
conf_settings[
|
|
||||||
"Display Package Progress"
|
|
||||||
] = self.display_package_progress
|
|
||||||
|
|
||||||
index = 0
|
|
||||||
for line in contents:
|
|
||||||
if line.startswith("- name:"):
|
|
||||||
if (
|
|
||||||
line.strip("- name: ")
|
|
||||||
.strip()
|
|
||||||
.strip('"')
|
|
||||||
.strip("\n")
|
|
||||||
.strip()
|
|
||||||
== "Display Package Versions"
|
|
||||||
):
|
|
||||||
index = contents.index(line)
|
|
||||||
|
|
||||||
index += 2
|
|
||||||
|
|
||||||
if contents[index].startswith(" enabled: "):
|
|
||||||
del contents[index]
|
|
||||||
contents.insert(
|
|
||||||
index,
|
|
||||||
" enabled: %s\n"
|
|
||||||
% conf_settings["Display Package Versions"],
|
|
||||||
)
|
|
||||||
|
|
||||||
if (
|
|
||||||
line.strip("- name: ")
|
|
||||||
.strip()
|
|
||||||
.strip('"')
|
|
||||||
.strip("\n")
|
|
||||||
.strip()
|
|
||||||
== "Display Package Progress"
|
|
||||||
):
|
|
||||||
index += 4
|
|
||||||
if contents[index].startswith(" enabled: "):
|
|
||||||
del contents[index]
|
|
||||||
contents.insert(
|
|
||||||
index,
|
|
||||||
" enabled: %s\n"
|
|
||||||
% conf_settings["Display Package Progress"],
|
|
||||||
)
|
|
||||||
|
|
||||||
if len(contents) > 0:
|
|
||||||
with open(fn.config_file, "w", encoding="UTF-8") as f:
|
|
||||||
f.writelines(contents)
|
|
||||||
|
|
||||||
fn.permissions(fn.config_dir)
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
fn.logger.error("Exception in write_config_file(): %s" % e)
|
|
||||||
|
|
||||||
def read_config_file(self):
|
|
||||||
try:
|
|
||||||
if os.path.exists(fn.config_file):
|
|
||||||
contents = []
|
|
||||||
with open(fn.config_file, "r", encoding="UTF-8") as f:
|
|
||||||
contents = f.readlines()
|
|
||||||
|
|
||||||
# file is empty, string replace template file
|
|
||||||
if len(contents) == 0:
|
|
||||||
fn.shutil.copy(default_file, fn.config_file)
|
|
||||||
fn.permissions(fn.config_dir)
|
|
||||||
else:
|
|
||||||
return self.read(contents)
|
|
||||||
|
|
||||||
else:
|
|
||||||
# config file doesn't exist, string replace template file
|
|
||||||
fn.shutil.copy(default_file, fn.config_file)
|
|
||||||
fn.permissions(fn.config_dir)
|
|
||||||
|
|
||||||
with open(fn.config_file, "r", encoding="UTF-8") as f:
|
|
||||||
contents = f.readlines()
|
|
||||||
|
|
||||||
return self.read(contents)
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
print("Exception in read_config_file(): %s" % e)
|
|
||||||
|
|
||||||
def read(self, contents):
|
|
||||||
setting_name = None
|
|
||||||
setting_value_enabled = None
|
|
||||||
conf_settings = {}
|
|
||||||
for line in contents:
|
|
||||||
if line.startswith("- name:"):
|
|
||||||
setting_name = (
|
|
||||||
line.strip("- name: ").strip().strip('"').strip("\n").strip()
|
|
||||||
)
|
|
||||||
elif line.startswith(" enabled: "):
|
|
||||||
setting_value_enabled = (
|
|
||||||
line.strip(" enabled: ").strip().strip('"').strip("\n").strip()
|
|
||||||
)
|
|
||||||
|
|
||||||
if setting_value_enabled == "False":
|
|
||||||
conf_settings[setting_name] = False
|
|
||||||
else:
|
|
||||||
conf_settings[setting_name] = True
|
|
||||||
|
|
||||||
if len(conf_settings) > 0:
|
|
||||||
return conf_settings
|
|
||||||
else:
|
|
||||||
print("[ERROR] Failed to read settings into memory")
|
|
@@ -1 +0,0 @@
|
|||||||
Beautyline icons completed for ArcoLinux + Candy icons
|
|
1
usr/share/sofirem/cache/abiword
vendored
1
usr/share/sofirem/cache/abiword
vendored
@@ -1 +0,0 @@
|
|||||||
Fully-featured word processor
|
|
1
usr/share/sofirem/cache/acpilight
vendored
1
usr/share/sofirem/cache/acpilight
vendored
@@ -1 +0,0 @@
|
|||||||
a backward-compatible xbacklight replacement based on ACPI
|
|
1
usr/share/sofirem/cache/adapta-gtk-theme
vendored
1
usr/share/sofirem/cache/adapta-gtk-theme
vendored
@@ -1 +0,0 @@
|
|||||||
An adaptive Gtk+ theme based on Material Design Guidelines
|
|
@@ -1 +0,0 @@
|
|||||||
Monospaced font family for user interface and coding environment
|
|
@@ -1 +0,0 @@
|
|||||||
Sans-serif font family for user interface environments
|
|
@@ -1 +0,0 @@
|
|||||||
Serif typeface designed to complement Source Sans
|
|
1
usr/share/sofirem/cache/airdroid-nativefier
vendored
1
usr/share/sofirem/cache/airdroid-nativefier
vendored
@@ -1 +0,0 @@
|
|||||||
An Airdroid client build with nativefier
|
|
1
usr/share/sofirem/cache/aisleriot
vendored
1
usr/share/sofirem/cache/aisleriot
vendored
@@ -1 +0,0 @@
|
|||||||
A collection of patience games written in guile scheme
|
|
1
usr/share/sofirem/cache/alacritty
vendored
1
usr/share/sofirem/cache/alacritty
vendored
@@ -1 +0,0 @@
|
|||||||
A cross-platform, GPU-accelerated terminal emulator
|
|
1
usr/share/sofirem/cache/alacritty-themes
vendored
1
usr/share/sofirem/cache/alacritty-themes
vendored
@@ -1 +0,0 @@
|
|||||||
A utility for choosing and applying Alacritty terminal themes.
|
|
1
usr/share/sofirem/cache/albert
vendored
1
usr/share/sofirem/cache/albert
vendored
@@ -1 +0,0 @@
|
|||||||
A sophisticated standalone keyboard launcher
|
|
1
usr/share/sofirem/cache/alsi
vendored
1
usr/share/sofirem/cache/alsi
vendored
@@ -1 +0,0 @@
|
|||||||
ALSI: a configurable system information tool for Arch Linux.
|
|
1
usr/share/sofirem/cache/amberol
vendored
1
usr/share/sofirem/cache/amberol
vendored
@@ -1 +0,0 @@
|
|||||||
Plays music, and nothing else
|
|
1
usr/share/sofirem/cache/amd-ucode
vendored
1
usr/share/sofirem/cache/amd-ucode
vendored
@@ -1 +0,0 @@
|
|||||||
Microcode update image for AMD CPUs
|
|
@@ -1 +0,0 @@
|
|||||||
Android MTP client with minimalistic UI
|
|
@@ -1 +0,0 @@
|
|||||||
Platform-Tools for Google Android SDK (adb and fastboot)
|
|
1
usr/share/sofirem/cache/android-tools
vendored
1
usr/share/sofirem/cache/android-tools
vendored
@@ -1 +0,0 @@
|
|||||||
Android platform tools
|
|
1
usr/share/sofirem/cache/anydesk-bin
vendored
1
usr/share/sofirem/cache/anydesk-bin
vendored
@@ -1 +0,0 @@
|
|||||||
Fast remote desktop application
|
|
1
usr/share/sofirem/cache/appimagelauncher
vendored
1
usr/share/sofirem/cache/appimagelauncher
vendored
@@ -1 +0,0 @@
|
|||||||
A Helper application for running and integrating AppImages.
|
|
@@ -1 +0,0 @@
|
|||||||
A darker version of famous Arc theme
|
|
1
usr/share/sofirem/cache/arc-icon-theme
vendored
1
usr/share/sofirem/cache/arc-icon-theme
vendored
@@ -1 +0,0 @@
|
|||||||
Arc icon theme. Official releases only.
|
|
1
usr/share/sofirem/cache/arc-x-icons-theme
vendored
1
usr/share/sofirem/cache/arc-x-icons-theme
vendored
@@ -1 +0,0 @@
|
|||||||
Modern free desktop icon theme whose design is based around the use of bold colours and simple geometric shapes to compose icons with pixel perfect rendering.
|
|
1
usr/share/sofirem/cache/archey3
vendored
1
usr/share/sofirem/cache/archey3
vendored
@@ -1 +0,0 @@
|
|||||||
Output a logo and various system information
|
|
@@ -1 +0,0 @@
|
|||||||
Backgrounds for any login manager - sddm, lightdm, ...
|
|
1
usr/share/sofirem/cache/archlinux-logout-git
vendored
1
usr/share/sofirem/cache/archlinux-logout-git
vendored
@@ -1 +0,0 @@
|
|||||||
Arch Linux logout
|
|
@@ -1 +0,0 @@
|
|||||||
Arch Linux Tweak Tool or ATT
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
1
usr/share/sofirem/cache/arcolinux-arc-kde
vendored
1
usr/share/sofirem/cache/arcolinux-arc-kde
vendored
@@ -1 +0,0 @@
|
|||||||
Arc theme for KDE Plasma 5
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux with Arc Colora script
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux with Arc Colora script
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux with Arc Colora script
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux with Arc Colora scrip
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Arc themes created for ArcoLinux
|
|
@@ -1 +0,0 @@
|
|||||||
Desktop configuration for ArcoLinux -D -B
|
|
1
usr/share/sofirem/cache/arcolinux-berry-git
vendored
1
usr/share/sofirem/cache/arcolinux-berry-git
vendored
@@ -1 +0,0 @@
|
|||||||
Configuration files for ArcoLinux Iso
|
|
1
usr/share/sofirem/cache/arcolinux-bspwm-git
vendored
1
usr/share/sofirem/cache/arcolinux-bspwm-git
vendored
@@ -1 +0,0 @@
|
|||||||
Desktop configuration for ArcoLinux -D -B
|
|
@@ -1 +0,0 @@
|
|||||||
Configuration files for ArcoLinux Iso
|
|
1
usr/share/sofirem/cache/arcolinux-budgie-git
vendored
1
usr/share/sofirem/cache/arcolinux-budgie-git
vendored
@@ -1 +0,0 @@
|
|||||||
Desktop configuration for ArcoLinux -D -B
|
|
1
usr/share/sofirem/cache/arcolinux-chadwm-git
vendored
1
usr/share/sofirem/cache/arcolinux-chadwm-git
vendored
@@ -1 +0,0 @@
|
|||||||
Configuration files for ArcoLinux Iso
|
|
@@ -1 +0,0 @@
|
|||||||
Configuration files for ArcoLinux Iso
|
|
@@ -1 +0,0 @@
|
|||||||
Desktop configuration for ArcoLinux -D -B
|
|
1
usr/share/sofirem/cache/arcolinux-common-git
vendored
1
usr/share/sofirem/cache/arcolinux-common-git
vendored
@@ -1 +0,0 @@
|
|||||||
ArcoLinux common files
|
|
@@ -1 +0,0 @@
|
|||||||
Configuration files for all desktops from ArcoLinux
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user