diff --git a/iso_configs/PepProTools/xDaily b/iso_configs/PepProTools/xDaily index e1259c36..530515a9 100755 --- a/iso_configs/PepProTools/xDaily +++ b/iso_configs/PepProTools/xDaily @@ -1,210 +1,3 @@ #!/bin/bash -PROGNAME="xDaily" -[ "$USER" != "root" ] && - echo -e "\t$PROGNAME must be run as root. \n\tOr with \`sudo $PROGNAME\` ." && exit - -### Our options are going to be -# = "full output to the terminal, no stopping." -# -i = "interactive" -# -q = "interactive but suppressed output" -OPTIND="0" -for i in _quiet _interactive ; do unset -v $i ; done - -while getopts 'iq' OPTION; do - case "$OPTION" in - i) - _interactive="yes" - echo -e " Entering interactive mode\n" - break - ;; - - q) - _quiet="yes" - echo -e " Entering interactive mode, without verbose output.\n" - break - ;; - - ?) - echo "Usage: $(basename ${PROGNAME}) [-i = interactive] [-q = suppressed ouput]" - return 1 - ;; - esac -done - -[ "$(which nala)" ] && PkgMgr="nala" || PkgMgr="apt" - -see_it() { - [ "$_interactive" = "yes" ] && ( read -n1 -p " $_msg ? \"Y/n\" " answ - [ -z $answ ] || [ "$answ" = "y" ] || [ "$answ" = "Y" ] && echo && - do_it && - echo -e " $_msg - Completed.\n" || - echo -e "\r $_msg - Skipped.\n" ) -} - -no_see() { - [ "$_quiet" = "yes" ] && ( read -n1 -p " $_msg ? \"Y/n\" " answ - [ -z $answ ] || [ "$answ" = "y" ] || [ "$answ" = "Y" ] && echo && - do_it > /dev/null && - echo -e " $_msg - Completed.\n" || - echo -e "\r $_msg - Skipped.\n" ) -} - -run_it() { - [ "$_interactive" != "yes" ] && [ "$_quiet" != "yes" ] && ( - echo -e "\n $_msg ." && - do_it && - echo -e " $_msg - Completed." ) -} - -# Begin xDaily command functions -_update() { - _msg="Check apt repositories for Updates" - do_it() { - [ "$_quiet" != "yes" ] && - $PkgMgr update || - $PkgMgr update 2>&1 >/dev/null -} - see_it - no_see - run_it -} - -_upgradable() { - _msg="See upgradable packages" - do_it() { - [ "$_quiet" != "yes" ] && - $PkgMgr list --upgradable || - $PkgMgr list --upgradable 2>&1 >/dev/null -} - see_it -# no_see -# run_it -} - -_upgrade() { - _msg="Install available updated packages" - do_it() { - [ "$_quiet" != "yes" ] && - $PkgMgr upgrade || - $PkgMgr upgrade 2>&1 >/dev/null -} - see_it - no_see - run_it -} - -_apt_clean() { - _msg="Remove unneccessary packages from APT cache" - do_it() { - [ "$_quiet" != "yes" ] && - $PkgMgr clean || - $PkgMgr clean 2>&1 >/dev/null -} - see_it - no_see - run_it -} - -_autoclean () { - _msg="Remove unavailable entries from APT cache" - do_it() { - [ "$_quiet" != "yes" ] && - $PkgMgr autoclean || - $PkgMgr autoclean 2>&1 >/dev/null -} - see_it - no_see - run_it -} - -_autoremove() { - _msg="Remove old dependencies not required by the system" - do_it() { - [ "$_quiet" != "yes" ] && - $PkgMgr autoremove || - $PkgMgr autoremove 2>&1 >/dev/null -} - see_it - no_see - run_it -} - -_clear_thumbnails() { - _msg="Clear browser thumbnail caches" - do_it() { - for i in ".thumbnails" ".cache/thumbnails" ; do - for j in "*/*.png" "*/*/*.png" ; do - [ "$_quiet" != "yes" ] && - rm -v /home/${SUDO_USER}/${i}/${j} 2>/dev/null || - rm /home/${SUDO_USER}/${i}/${j} 2>/dev/null - done - done ; true - } - see_it - no_see - run_it -} - -_clear_recents() { - _msg="Clear the \"Recently Used\" list in FireFox" - do_it() { - dd bs=1 count=1 status=none if=/dev/null of=/home/${SUDO_USER}/.local/share/recently-used.xbel - chown ${SUDO_USER} /home/${SUDO_USER}/.local/share/recently-used.xbel -} - see_it - no_see - run_it -} - -_rbranding() { - _msg="Reconfirm Peppermint Branding in os-release" - do_it() { - diff -q /opt/pepconf/os-release /usr/lib/os-release || cp /opt/pepconf/os-release /usr/lib/os-release - diff -q /opt/pepconf/os-release /etc/os-release || cp /opt/pepconf/os-release /etc/os-release - } - see_it - no_see - run_it -} - -_ssd_trimfs() { - _msg="For SSDs: trim eligible ext2/3/4 filesystems" - do_it() { - for mnt in $(grep -E "(ext2|ext3|ext4)" /etc/mtab | cut -f2 -d" ") - do fstrim ${mnt} &>/dev/null && - echo -e " Completed fstrim for \"${mnt}\"" || - echo -e " No fstrim required for \"${mnt}\"" - done - } - see_it - no_see - run_it -} - - -_udcache() { - _msg="Caching icons at /usr/share/icons/" - do_it() { update-icon-caches /usr/share/icons/* ;} - see_it - no_see - run_it -} - - -_update -_upgradable -_upgrade -_apt_clean -if [ "$PkgMgr" = "apt" ]; then _autoclean ; fi -_autoremove -_clear_thumbnails -_clear_recents -_udcache -_rbranding -_ssd_trimfs - -[ "$_interactive" = "yes" ] && - read -n1 -p " Press any key to continue ... " answ -echo - +pkexec python3 ~/.local/share/pmostools/peptools/xDaily.py diff --git a/iso_configs/loaded-application/gparted.desktop b/iso_configs/loaded-application/gparted.desktop new file mode 100644 index 00000000..56bbc1c4 --- /dev/null +++ b/iso_configs/loaded-application/gparted.desktop @@ -0,0 +1,295 @@ +[Desktop Entry] +Name=GParted +Name[ar]=مُقسِّم‌ج +Name[be]=GParted +Name[bg]=GParted +Name[br]=GParted +Name[bs]=GParted +Name[ca]=GParted +Name[ca@valencia]=GParted +Name[cs]=GParted +Name[da]=GParted +Name[de]=GParted +Name[dz]=ཇི་པར་ཊེཊི། +Name[el]=GParted +Name[en_CA]=GParted +Name[en_GB]=GParted +Name[eo]=GParted +Name[es]=GParted +Name[et]=GParted +Name[eu]=GParted +Name[fa]=GParted +Name[fi]=GParted +Name[fr]=GParted +Name[fur]=GParted +Name[gd]=GParted +Name[gl]=GParted +Name[gu]=GParted +Name[he]=GParted +Name[hr]=GParted +Name[hu]=GParted +Name[id]=GParted +Name[is]=GParted +Name[it]=GParted +Name[ja]=GParted +Name[kk]=GParted +Name[ko]=GParted +Name[lt]=GParted +Name[lv]=GParted +Name[mk]=Гпартед +Name[ml]=ജീപാര്‍ട്ടട് +Name[nb]=GParted +Name[ne]=जिपार्टेड +Name[nl]=GParted +Name[nn]=GParted +Name[oc]=GParted +Name[pa]=GParted +Name[pl]=GParted +Name[pt]=GParted +Name[pt_BR]=GParted +Name[ro]=GParted +Name[ru]=GParted +Name[si]=GParted +Name[sk]=GParted +Name[sl]=GParted +Name[sr]=Гпартед +Name[sr@latin]=Gparted +Name[sv]=GParted +Name[te]=జిపార్టెడ్ +Name[th]=GParted +Name[tr]=GParted +Name[uk]=GParted +Name[vi]=GParted +Name[zh_CN]=GParted +Name[zh_HK]=GParted +Name[zh_TW]=GParted +GenericName=Partition Editor +GenericName[ar]=محرر الأقسام +GenericName[be]=Рэдактар раздзелаў +GenericName[bg]=Редактор на дялове +GenericName[br]=Embanner parzhad +GenericName[bs]=Uređivač particija +GenericName[ca]=Editor de particions +GenericName[ca@valencia]=Editor de particions +GenericName[cs]=Editor oddílů +GenericName[da]=Partitioneringsprogram +GenericName[de]=Partitionierungswerkzeug +GenericName[el]=Επεξεργαστής κατατμήσεων +GenericName[en_CA]=Partition Editor +GenericName[en_GB]=Partition Editor +GenericName[eo]=Subdiskoredaktilo +GenericName[es]=Editor de particiones +GenericName[et]=Partitsiooniredaktor +GenericName[eu]=Partizio-editorea +GenericName[fa]=ویرایشگر پارتیشن +GenericName[fi]=Levyosioiden muokkain +GenericName[fr]=Éditeur de partitions +GenericName[fur]=Editôr di partizions +GenericName[gd]=Deasaiche pàirteachaidh +GenericName[gl]=Editor de particións +GenericName[he]=עורך המחיצות +GenericName[hr]=Uređivač particija +GenericName[hu]=Partíciószerkesztő +GenericName[id]=Penyunting Partisi +GenericName[is]=Disksneiðastjóri +GenericName[it]=Editor di partizioni +GenericName[ja]=パーティション・エディター +GenericName[kk]=Қатты диск бөлімдерін басқару +GenericName[ko]=분할 영역 편집기 +GenericName[lt]=Skaidinių redaktorius +GenericName[lv]=Nodalījumu redaktors +GenericName[ml]=പാര്‍ട്ടീഷന്‍ സംശോധകന്‍ +GenericName[nb]=Partisjonsredigering +GenericName[nl]=Partitiebewerker +GenericName[nn]=Partisjonshandsaming +GenericName[oc]=Editor de particions de GNOME +GenericName[pa]=ਪਾਰਟੀਸ਼ਨ ਐਡੀਟਰ +GenericName[pl]=Edytor partycji +GenericName[pt]=Editor de partições +GenericName[pt_BR]=Editor de Partições +GenericName[ro]=Editor de partiții +GenericName[ru]=Редактор разделов +GenericName[sk]=Editor diskových oddielov +GenericName[sl]=Urejevalnik razdelkov +GenericName[sr]=Уређивач партиција +GenericName[sr@latin]=Uređivač particija +GenericName[sv]=Partitionsredigerare +GenericName[te]=విభజన కూర్పకము +GenericName[th]=เครื่องมือแก้ไขพาร์ทิชัน +GenericName[tr]=Disk Bölümü Düzenleyicisi +GenericName[uk]=Редактор розділів +GenericName[vi]=Ứng dụng sửa phân vùng +GenericName[zh_CN]=分区编辑器 +GenericName[zh_HK]=分割區編輯器 +GenericName[zh_TW]=分割區編輯器 +X-GNOME-FullName=GParted Partition Editor +X-GNOME-FullName[ar]=محرّر الأقسام مُقسِّم‌ج +X-GNOME-FullName[be]=Рэдактар раздзелаў GParted +X-GNOME-FullName[bg]=Редактор на дялове на дискове за GNOME +X-GNOME-FullName[bs]=GParted uređivač particija +X-GNOME-FullName[ca]=Editor de particions GParted +X-GNOME-FullName[ca@valencia]=Editor de particions GParted +X-GNOME-FullName[cs]=Editor oddílů GParted +X-GNOME-FullName[da]=GParted - partitioneringsprogram +X-GNOME-FullName[de]=GParted Partitionierungswerkzeug +X-GNOME-FullName[el]=Επεξεργαστής κατατμήσεων GParted +X-GNOME-FullName[en_CA]=GParted Partition Editor +X-GNOME-FullName[en_GB]=GParted Partition Editor +X-GNOME-FullName[eo]=GParted Subdiskoredaktilo +X-GNOME-FullName[es]=Editor de particiones GParted +X-GNOME-FullName[et]=GParted partitsioonihaldur +X-GNOME-FullName[eu]=GParted partizio-editorea +X-GNOME-FullName[fa]=ویرایشگر پارتیشن GParted +X-GNOME-FullName[fi]=GParted - levyosioiden muokkain +X-GNOME-FullName[fr]=Éditeur de partitions GParted +X-GNOME-FullName[fur]=Editôr di partizions GParted +X-GNOME-FullName[gd]=Deasaiche pàirteachaidh GParted +X-GNOME-FullName[gl]=Editor de particións GParted +X-GNOME-FullName[gu]=GParted પાર્ટીશન સંપાદક +X-GNOME-FullName[he]=עורך המחיצות GParted +X-GNOME-FullName[hr]=GParted uređivač particija +X-GNOME-FullName[hu]=GParted partíciószerkesztő +X-GNOME-FullName[id]=GParted Penyunting Partisi +X-GNOME-FullName[is]=GParted disksneiðastjórinn +X-GNOME-FullName[it]=Editor di partizioni GParted +X-GNOME-FullName[ja]=GParted パーティション編集ツール +X-GNOME-FullName[kk]=GParted бөлімдерді басқарушысы +X-GNOME-FullName[ko]=GParted 분할 영역 편집기 +X-GNOME-FullName[lt]=Skaidinių redaktorius „GParted“ +X-GNOME-FullName[lv]=GParted nodalījumu redaktors +X-GNOME-FullName[ml]=ജീപാര്‍ട്ടട് പാര്‍ട്ടീഷന്‍ സംശോധകന്‍ +X-GNOME-FullName[nb]=GParted partisjonsredigering +X-GNOME-FullName[nl]=GParted partitiebewerker +X-GNOME-FullName[nn]=GParted partisjonshandsaming +X-GNOME-FullName[oc]=Editor de particions de GNOME +X-GNOME-FullName[pa]=ਜੀਪਾਰਟਡ ਪਾਰਟੀਸ਼ਨ ਐਡੀਟਰ +X-GNOME-FullName[pl]=Edytor partycji GParted +X-GNOME-FullName[pt]=Editor de partições GParted +X-GNOME-FullName[pt_BR]=Editor de partições GParted +X-GNOME-FullName[ro]=GParted - Editor de partiții +X-GNOME-FullName[ru]=Редактор разделов GParted +X-GNOME-FullName[sk]=GParted - editor diskových oddielov +X-GNOME-FullName[sl]=GParted urejevalnik razdelkov +X-GNOME-FullName[sr]=Уређивач партиција Гпартед +X-GNOME-FullName[sr@latin]=Uređivač particija Gparted +X-GNOME-FullName[sv]=GParted partitionsredigerare +X-GNOME-FullName[te]=జిపార్టెడ్ విభజన కూర్పకము +X-GNOME-FullName[th]=เครื่องมือแก้ไขพาร์ทิชัน GParted +X-GNOME-FullName[tr]=GParted Disk Bölümü Düzenleyicisi +X-GNOME-FullName[uk]=Редактор розділів GParted +X-GNOME-FullName[vi]=Ứng dụng hiệu chỉnh phân vùng GParted +X-GNOME-FullName[zh_CN]=GParted 分区编辑器 +X-GNOME-FullName[zh_HK]=GParted 分割區編輯器 +X-GNOME-FullName[zh_TW]=GParted 分割區編輯器 +Comment=Create, reorganize, and delete partitions +Comment[ar]=أنشئ الأقسام ونظّمها واحذفها +Comment[be]=Стварыць, пераразмеркаваць альбо выдаліць раздзелы +Comment[bg]=Създаване, подреждане и изтриване на дялове +Comment[br]=Krouiñ, adaozañ ha dilemel ar parzhadoù +Comment[bs]=Kreiranje, reorganiziranje i brisanje particija +Comment[ca]=Creeu, reorganitzeu i suprimiu particions +Comment[ca@valencia]=Creeu, reorganitzeu i suprimiu particions +Comment[cs]=Vytvářejte, přeuspořádávejte a odstraňujte diskové oddíly +Comment[da]=Opret, omorganisér og slet partitioner +Comment[de]=Partitionen erzeugen, reorganisieren und löschen +Comment[el]=Δημιουργία, επεξεργασία και διαγραφή κατατμήσεων +Comment[en_CA]=Create, reorganise, and delete partitions +Comment[en_GB]=Create, reorganise, and delete partitions +Comment[eo]=Krei, reorganizi, kaj forigi subdiskojn +Comment[es]=Cree, reorganice y elimine particiones +Comment[et]=Partitsioonide loomine, muutmine ja kustutamine +Comment[eu]=Sortu, berrantolatu eta ezabatu partizioak +Comment[fa]=ساخت، بازسازی و حذف پارتیشن‌ها +Comment[fi]=Luo, järjestele ja poista osioita +Comment[fr]=Crée, réorganise et supprime des partitions +Comment[fur]=Cree, torne a organizâ e elimine lis partizions +Comment[gd]=Cruthaich no sguab pàirteachaidhean às no cuir rian ùr orra +Comment[gl]=Crear, reorganizar e eliminar particións +Comment[he]=יצירה, ארגון מחדש ומחיקה של מחיצות +Comment[hr]=Stvori, preuredi, i obriši particije +Comment[hu]=Partíciók létrehozása, újraszervezése és törlése +Comment[id]=Membuat, mengorganisasi ulang, serta menghapus partisi +Comment[is]=Búa til, raða og eyða disksneiðum +Comment[it]=Crea, riorganizza ed elimina partizioni +Comment[ja]=パーティションを作成/再構成/削除する +Comment[kk]=Бөлімдерді жасау, басқару және өшіру +Comment[ko]=분할 영역을 만들고, 재배치하고, 삭제합니다 +Comment[lt]=Kurkite, pertvarkykite ir trinkite skaidinius +Comment[lv]=Veido, pārkārto un dzēš disku nodalījumus +Comment[ml]=പാര്‍ട്ടിഷനുകള്‍ നിര്‍മ്മിക്കുകയും, അടുക്കിവയ്ക്കുകയും, കളയുകയും ചെയ്യുക +Comment[nb]=Lag, omorganiser og slett partisjoner +Comment[nl]=Partities aanmaken, ordenen en verwijderen +Comment[nn]=Lag, omorganiser og slett partisjonar +Comment[oc]=Crèa, reorganiza e suprimís de particions +Comment[pa]=ਪਾਰਟੀਸ਼ਨ ਬਣਾਓ, ਪਰਬੰਧ ਕਰੋ ਅਤੇ ਹਟਾਓ +Comment[pl]=Tworzenie, reorganizacja i usuwanie partycji +Comment[pt]=Criar, reorganizar e eliminar partições +Comment[pt_BR]=Crie, reorganize e exclua partições +Comment[ro]=Creează, reorganizează și șterge partiții +Comment[ru]=Создание, перераспределение и удаление разделов +Comment[sk]=Vytvára, reorganizuje a odstraňuje diskové oddiely +Comment[sl]=Ustvarjanje, urejanje in brisanje razdelkov +Comment[sr]=Стварајте, реорганизујте и бришите партиције +Comment[sr@latin]=Stvarajte, reorganizujte i brišite particije +Comment[sv]=Skapa, organisera om och ta bort partitioner +Comment[te]=విభజనలను సృష్టించు, పునర్వ్యవస్థీకరించు, మరియు తొలగించు +Comment[th]=สร้าง ปรับโครงสร้าง และลบพาร์ทิชัน +Comment[tr]=Bölümler oluştur, yeniden düzenle ve sil +Comment[uk]=Створення, переміщення або вилучення розділів +Comment[vi]=Tạo, tổ chức lại và xóa bỏ phân vùng +Comment[zh_CN]=创建、重新组织或删除分区 +Comment[zh_HK]=建立、編輯或刪除分割區 +Comment[zh_TW]=建立、編輯或刪除分割區 +Exec=/usr/sbin/gparted %f +Icon=gparted +Terminal=false +Type=Application +Categories=GNOME;System;Filesystem;System;Settings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings +Keywords=Partition; +Keywords[ar]=قسم; +Keywords[be]=Раздзел; +Keywords[bs]=particija; +Keywords[ca]=Partició; +Keywords[cs]=oddíl;disk; +Keywords[da]=Partition; +Keywords[de]=Partition; +Keywords[el]=Κατάτμηση;Partition; +Keywords[en_GB]=Partition; +Keywords[eo]=Subdisko; +Keywords[es]=Partición; +Keywords[eu]=Partizioa; +Keywords[fi]=Osio; +Keywords[fr]=Partition; +Keywords[fur]=Partizion; +Keywords[gd]=Partition;Pàirteachadh;Pàirtich; +Keywords[gl]=Partición; +Keywords[hr]=Particija; +Keywords[hu]=Partíció; +Keywords[id]=Partisi; +Keywords[is]=Disksneið; +Keywords[it]=Partizione; +Keywords[kk]=Бөлім; +Keywords[ko]=Partition;파티션;분할;영역; +Keywords[lt]=Skaidinys; +Keywords[lv]=Nodalījums; +Keywords[nb]=Partisjon; +Keywords[nl]=Partition;Partitie; +Keywords[oc]=Particion ; +Keywords[pa]=ਪਾਰਟੀਸ਼ਨ; +Keywords[pl]=Partycja;Partycje;Patrycja;Patrycje;Partycjonowanie;Patrycjonowanie;Dyski;twarde;twardy;HDD;SSD;Systemy;plików;Woluminy;Wolumeny;Napędy; +Keywords[pt]=Partição; +Keywords[pt_BR]=Partição;Partition; +Keywords[ro]=Partiție; +Keywords[ru]=Раздел; +Keywords[sk]=Oddiel; +Keywords[sl]=Razdelek; +Keywords[sr]=партиција; +Keywords[sr@latin]=particija; +Keywords[sv]=Partition; +Keywords[th]=พาร์ทิชัน; +Keywords[tr]=Bölüm; +Keywords[uk]=Розділ; +Keywords[vi]=Partition;Phân vùng;Phan vung; +Keywords[zh_CN]=Partition;分区; +Keywords[zh_TW]=分割區; +StartupNotify=true diff --git a/iso_configs/loaded-application/timeshift-gtk.desktop b/iso_configs/loaded-application/timeshift-gtk.desktop new file mode 100644 index 00000000..4cc9a6dd --- /dev/null +++ b/iso_configs/loaded-application/timeshift-gtk.desktop @@ -0,0 +1,32 @@ +[Desktop Entry] +Name=Timeshift +Exec=timeshift-launcher +Type=Application +GenericName=System Restore Utility +GenericName[ca]=Utilitat de restauració del sistema +GenericName[cs]=Nástroj pro obnovení systému +GenericName[da]=Værktøj til systemgendannelse +GenericName[fr]=Utilitaire de restauration système +GenericName[hr]=Alat obnove sustava +GenericName[ja]=システムの復元ユーティリティ +GenericName[ko]=시스템 복원 유틸리티 +GenericName[lt]=Sistemos atkūrimo paslaugų programa +GenericName[nl]=Hulpmiddel voor systeemherstel +GenericName[ru]=Программа для восстановления системы +Terminal=false +Icon=timeshift +Comment=System Restore Utility +Comment[ca]=Utilitat de restauració del sistema +Comment[cs]=Nástroj pro obnovení systému +Comment[da]=Værktøj til systemgendannelse +Comment[fr]=Utilitaire de restauration système +Comment[hr]=Alat obnove sustava +Comment[ja]=システムの復元ユーティリティ +Comment[ko]=시스템 복원 유틸리티 +Comment[lt]=Sistemos atkūrimo paslaugų programa +Comment[nl]=Hulpmiddel voor systeemherstel +Comment[ru]=Программа для восстановления системы +X-KDE-StartupNotify=false +Categories=System;System;Settings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings +X-GNOME-UsesNotifications=true +Keywords=backup;btrfs;rsync; diff --git a/iso_configs/loaded-application/xDaily.desktop b/iso_configs/loaded-application/xDaily.desktop new file mode 100644 index 00000000..76f4f07a --- /dev/null +++ b/iso_configs/loaded-application/xDaily.desktop @@ -0,0 +1,21 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=xDaily +Name[en]=xDaily +Name[es]=xDaily +Name[fr]=xDaily +Name[de]=xDaily +Name[it]=xDaily +Name[pt]=xDaily +Name[pt_BR]=xDaily +Name[ru]=xDaily +Name[zh_CN]=xDaily +Name[zh_TW]=xDaily +Name[ja]=xDaily +Name[ko]=xDaily +Exec=//usr/local/bin/xDaily +Icon=/usr/share/pixmaps/xd.png +Terminal=false +StartupNotify=false +Categories=Utility; diff --git a/iso_configs/pmostools/peptools/xDaily.py b/iso_configs/pmostools/peptools/xDaily.py new file mode 100644 index 00000000..152c1426 --- /dev/null +++ b/iso_configs/pmostools/peptools/xDaily.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python3 + +import subprocess +import os +import tkinter as tk +from tkinter import ttk +from tkinter.scrolledtext import ScrolledText +from ttkbootstrap import Style + +PROGNAME = "xDaily" + +class XDailyApp: + def __init__(self, root): + self.root = root + self.root.title("xDaily - Automated System Maintenance") + self.root.geometry("800x600") + self.root.grid_rowconfigure(0, weight=1) + self.root.grid_columnconfigure(0, weight=1) + + self.style = Style(theme="peppermint") + self.main_frame = ttk.Frame(self.root) + self.main_frame.grid(row=0, column=0, sticky="nsew", padx=10, pady=10) + + self.output_text = ScrolledText(self.main_frame, wrap=tk.WORD) + self.output_text.grid(row=0, column=1, sticky="nsew", padx=10, pady=10) + + self.execute_button = ttk.Button(self.main_frame, text="Execute All Tasks", command=self.execute_all_tasks, style="Danger.TButton") + self.execute_button.grid(row=1, column=1, pady=5, padx=(0, 10), sticky="e") + + self.task_buttons_frame = ttk.Frame(self.main_frame, borderwidth=2, relief="solid") + self.task_buttons_frame.grid(row=0, column=0, rowspan=2, sticky="nsw", padx=10, pady=5) + + self.create_task_buttons() + + self.main_frame.grid_rowconfigure(0, weight=1) + self.main_frame.grid_columnconfigure(1, weight=1) + self.output_text.grid_rowconfigure(0, weight=1) + self.output_text.grid_columnconfigure(0, weight=1) + + self.show_welcome_message() + + def create_task_buttons(self): + tasks = [ + "Check apt repositories for Updates", + "See upgradable packages", + "Install available updated packages", + "Remove unnecessary packages from APT cache", + "Remove unavailable entries from APT cache", + "Remove old dependencies not required by the system", + "Clear browser thumbnail caches", + "Clear the \"Recently Used\" list in FireFox", + "Reconfirm Peppermint Branding in os-release", + "For SSDs: trim eligible ext2/3/4 filesystems", + "Caching icons at /usr/share/icons/" + ] + + self.task_buttons = [] + + for task in tasks: + button = ttk.Button(self.task_buttons_frame, text=task, command=lambda t=task: self.execute_task(t), style="Danger.TButton", compound=tk.RIGHT) + button.pack(fill="x", padx=5, pady=5) + self.task_buttons.append(button) + + def execute_all_tasks(self): + self.clear_output() + + for button in self.task_buttons: + button.state(["disabled"]) + + for task_button in self.task_buttons: + task = task_button.cget("text") + result = self.execute_task(task) + if result is not None: + self.show_output(result) + + for button in self.task_buttons: + button.state(["!disabled"]) + + def execute_task(self, task): + self.clear_output() + self.show_output(f"Running task: {task}\n") + + try: + if task == "Check apt repositories for Updates": + output = subprocess.check_output(["apt", "update"], text=True) + elif task == "See upgradable packages": + output = subprocess.check_output(["apt", "list", "--upgradable"], text=True) + elif task == "Install available updated packages": + output = subprocess.check_output(["apt", "upgrade", "-y"], text=True) + elif task == "Remove unnecessary packages from APT cache": + output = subprocess.check_output(["apt", "clean"], text=True) + elif task == "Remove unavailable entries from APT cache": + output = subprocess.check_output(["apt", "autoclean"], text=True) + elif task == "Remove old dependencies not required by the system": + output = subprocess.check_output(["apt", "autoremove", "-y"], text=True) + elif task == "Clear browser thumbnail caches": + output = subprocess.check_output(["rm", "-v", "/home/" + os.getlogin() + "/.thumbnails/*/*.png"], text=True, stderr=subprocess.DEVNULL) + output += subprocess.check_output(["rm", "-v", "/home/" + os.getlogin() + "/.cache/thumbnails/*/*.png"], text=True, stderr=subprocess.DEVNULL) + elif task == "Clear the \"Recently Used\" list in FireFox": + output = subprocess.check_output(["dd", "bs=1", "count=1", "status=none", "if=/dev/null", "of=/home/" + os.getlogin() + "/.local/share/recently-used.xbel"], text=True, stderr=subprocess.DEVNULL) + output += subprocess.check_output(["chown", os.getlogin(), "/home/" + os.getlogin() + "/.local/share/recently-used.xbel"], text=True) + elif task == "Reconfirm Peppermint Branding in os-release": + output = subprocess.check_output(["diff", "-q", "/opt/pepconf/os-release", "/usr/lib/os-release"], text=True, stderr=subprocess.DEVNULL) + output += subprocess.check_output(["diff", "-q", "/opt/pepconf/os-release", "/etc/os-release"], text=True, stderr=subprocess.DEVNULL) + elif task == "For SSDs: trim eligible ext2/3/4 filesystems": + mounts = subprocess.check_output(["grep", "-E", "(ext2|ext3|ext4)", "/etc/mtab"], text=True) + mounts_list = mounts.splitlines() + for mount in mounts_list: + mount_path = mount.split()[1] + output = subprocess.check_output(["sudo", "fstrim", mount_path], text=True) + elif task == "Caching icons at /usr/share/icons/": + output = subprocess.check_output(["sudo", "update-icon-caches", "/usr/share/icons/*"], text=True) + self.show_output(output) + return output + except subprocess.CalledProcessError as e: + self.show_output(f"Error executing task: {e.output}\n") + + def clear_output(self): + self.output_text.delete(1.0, tk.END) + + def show_output(self, text): + self.output_text.insert(tk.END, text) + self.output_text.see(tk.END) + + def show_welcome_message(self): + welcome_message = "Welcome to xDaily!\n\nThis application allows you to perform automated system maintenance tasks.\nYou can either execute all tasks at once or choose individual tasks to execute.\n\nSelect individual tasks from the list below or click 'Execute All Tasks' to start.\n" + self.show_output(welcome_message) + +def main(): + root = tk.Tk() + app = XDailyApp(root) + app.root.configure(bg="#c0c0c0") # Set background color to grey + root.mainloop() + +if __name__ == "__main__": + main()