Update: Fixed a few things
- Calamares Branding - Hooks to run correcty - exe for xdailygui - exe for min Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
parent
c5f3f18838
commit
6f9346c2d7
|
@ -1,3 +1,210 @@
|
|||
#!/bin/bash
|
||||
|
||||
pkexec python3 ~/.local/share/pmostools/peptools/xdaily.py
|
||||
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
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
[Desktop Entry]
|
||||
Name=xDaily
|
||||
GenericName=xDaily
|
||||
Comment=A GUI for the xDaily Update Tool
|
||||
Categories=System;
|
||||
Type=Application
|
||||
Exec=xdaily-gui
|
||||
Icon=/usr/share/pixmaps/xd.png
|
||||
Terminal=false
|
||||
NoDisplay=false
|
Binary file not shown.
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 47 KiB |
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 14 KiB |
|
@ -71,13 +71,13 @@ def config():
|
|||
# Write configuration to temporary file
|
||||
with open("/tmp/live-config.cfg", "w") as f:
|
||||
f.write(f"""user-setup passwd/make-user boolean true
|
||||
user-setup passwd/root-password-crypted string *
|
||||
user-setup passwd/user-password-crypted string {_PASSWORD}
|
||||
user-setup passwd/user-default-groups string {LIVE_USER_DEFAULT_GROUPS}
|
||||
user-setup passwd/user-fullname string {LIVE_USER_FULLNAME}
|
||||
user-setup passwd/username string {LIVE_USERNAME}
|
||||
user-setup passwd/user-uid string 1000
|
||||
""")
|
||||
user-setup passwd/root-password-crypted string *
|
||||
user-setup passwd/user-password-crypted string {_PASSWORD}
|
||||
user-setup passwd/user-default-groups string {LIVE_USER_DEFAULT_GROUPS}
|
||||
user-setup passwd/user-fullname string {LIVE_USER_FULLNAME}
|
||||
user-setup passwd/username string {LIVE_USERNAME}
|
||||
user-setup passwd/user-uid string 1000
|
||||
""")
|
||||
|
||||
# Apply configuration
|
||||
subprocess.run(['debconf-set-selections', '<', '/tmp/live-config.cfg'],
|
||||
|
|
Loading…
Reference in New Issue