From 9bae17ae93c9c6cdb3e414c41edc084b961c4341 Mon Sep 17 00:00:00 2001 From: dingens Date: Wed, 17 Jul 2024 21:54:46 +0200 Subject: [PATCH] reset --- README.md | 26 + bHELPER.png | Bin 0 -> 7107 bytes bHELPER.sh | 1599 +++++++++++++++++++++++++++++++++++++++++++++++++++ install.sh | 6 + 4 files changed, 1631 insertions(+) create mode 100644 README.md create mode 100644 bHELPER.png create mode 100644 bHELPER.sh create mode 100644 install.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..6a359e2 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# bHELPER + +Der Grund für dieses Skript ist, dass ich immer mit Leuten die Probleme an ihrem Linux Rechner hatten sagen musste "Gib mal das ein ..." um an Informationen zu kommen. bHELPER.sh soll hier Abhilfe schaffen indem Leute sich das Skript installieren und mir einfach per copy&paste das Ergebnis schicken was ich brauche. +Dann kam noch der Grund hinzu, daß das Skript eine Art schweizer Taschenmesser im Alltag sein kann. + +## (Neu-)Installation + +Ihr müsst erst einmal ein Terminal öffnen. Das geht bei (fast) jedem Linux mit `Strg`+`Alt`+`T` oder in dem Programmmenü eurer Linux Distribution nach "Terminal" suchen. Dann den folgenden Inhalt des Codeblock dort einfügen: + +``` +[[ -d ${HOME}/.bHELPER/ ]] || mkdir ~/.bHELPER ; wget https://git.disroot.org/dingens/bHELPER/raw/branch/master/bHELPER.sh -O ~/.bHELPER/bHELPER.sh ; wget https://git.disroot.org/dingens/bHELPER/raw/branch/master/bHELPER.png -O ~/.bHELPER/bHELPER.png ; bash ${HOME}/.bHELPER/bHELPER.sh +``` + +## Das erste mal Starten + +### Via Icon auf dem Desktop + +Nach dem ersten Starten wird auf eurer Arbeitsfläche (Desktop) ein Icon angelegt. Darauf geklickt startet bHELPER. + +### Via Terminal + +Ihr könnt es auch direkt vom Terminal aus starten. Dazu ein Terminal öffnen mit `Strg`+`Alt`+`T` und dann folgenden Code dort einfügen: + +``` +bash ~/.bHELPER/bHELPER.sh +``` diff --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MD@l6@^3KuLitmKoG%Mm_LPgJMFQKqrjy7 zzCrsLcTO#E>1&P;@WF`sxhY!+RhvEFC$xFngw$`7pDY_2U*>zeuv0Ds?Q!B!IH+|l z*4IeH6uL|1ZpUS2A-+|<@i7cl?nf`o59}XL*`anU7P9On@RKB_JYa=~i77NweT>~g z*x$+&igIw>`*(L-c}yQ=ohBIKIQ|${-O&Z00=CNFj)knq?+pqq$?l;#E?fk-;qs90 zwIrak>w`O1|8ndt`s|$viKJMxzxOuF_F+6vX?{_fF%o=p)wJQ+m&Yq+EyP;k_YQqR z1Jj6n14*Dr69A%wS%&uE{Px|D<4eX^Qj>SWfAVR&alLxhdlB0d>P336iuSWS@IE28 z3e;X%1My3d6r&L_z`0sH{(aGTeFJqIxdYHGYEf89n$H3E-XejY&Ll_AGQ0!^vpcVQ zIr{OYS2*mMk&kpCseWo$Uw^|dGt{O*$Ei@bSSs1mEeRicAa}B-5RF2^IKqv9{ ${gl__nmcli_dev_status} + gl__config_folder="${HOME}/.config/bHELPER/" + gl__config_file="${HOME}/.config/bHELPER/bHELPER.conf" + gl__osname=$(grep "NAME=" /etc/os-release | sed "s/NAME=//" | sed "s/\"//") + gl__osprettyname=$(grep "^PRETTY_NAME" /etc/os-release | grep -o "\".*\"" | sed "s/^\"//" | sed "s/\"$//") + gl__ipv4_eth=$(ip addr list | sed -n '/^[0-9]: e/,/^[0-9]: [a-z]/p' | grep -o "inet [0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}" | grep -o "[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}") + gl__ipv4_wlan=$(ip addr list | grep -A2 ": wl[a-z0-9]\{3\}" | grep -o "inet [0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}" | grep -o "[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}") + gl__wlan_ssid=$(grep " wifi " ${gl__nmcli_dev_status} | awk '{print $NF}') + gl__wlandev=$(grep " wifi " ${gl__nmcli_dev_status} | awk '{print $1}') + gl__wlanactive=$(grep " wifi " ${gl__nmcli_dev_status} | grep -o "verbunden \|nicht verbunden\|nicht verfügbar\|wird verbunden" | sed "s/^[ \t]*//;s/[ \t]*$//") + gl__bat_charge=$(inxi --battery | grep -o "charge: .*condition" | sed "s/^.*Wh//" | grep -o "[0-9]\{1,3\}\.[0-9]%\|[0-9]\{1,3\}%" | sed ':a;N;$!ba;s/\n/ /g') + +rm "${gl__nmcli_dev_status}" + +[[ -d ${HOME}/Desktop/ ]] && gl__desktop_vz="Desktop/" +[[ -d ${HOME}/Schreibtisch/ ]] && gl__desktop_vz="Schreibtisch/" + +[[ -d "${gl__config_folder}" ]] || mkdir -p "${gl__config_folder}" ; touch "${gl__config_file}" + + + +################################################################################ +### Desktop Icon +################################################################################ + +if ! grep "^desktopiconautom=no" "${gl__config_file}" &> /dev/null ; then +cat <<_EOF_ > "${HOME}/${gl__desktop_vz}bHELPER.desktop" +#!/usr/bin/env xdg-open +[Desktop Entry] +Name=bHELPER +Icon=${HOME}/.bHELPER/bHELPER.png +Exec=bash '${HOME}/.bHELPER/bHELPER.sh' +Type=Application +Terminal=true +_EOF_ + +chmod 755 "${HOME}/${gl__desktop_vz}bHELPER.desktop" +fi + + + +################################################################################ +### Optik +################################################################################ + + gl__format_red=$(echo -e "\033[1;31m") + gl__format_green=$(echo -e "\033[1;32m") +gl__format_cyanlight=$(echo -e "\033[1;96m") + gl__format_off=$(echo -e "\033[0m") + gl__datei_anfang=$(echo "${gl__format_red}-------- "${datei}" (ANFANG) -----------------------------------------------------------------${gl__format_off}") + gl__datei_ende=$(echo "${gl__format_red}-------- "${datei}" (ENDE) -------------------------------------------------------------------${gl__format_off}") + gl__ausgabe_anfang=$(echo "${gl__format_red}---- Terminalausgabe (Anfang) --------------------------------------------------------------------------${gl__format_off}") + gl__ausgabe_ende=$(echo "${gl__format_red}---- Terminalausgabe (Ende) ----------------------------------------------------------------------------${gl__format_off}") + gl__true=$(echo -e "\U2705") + gl__false=$(echo -e "\U274C") + +function glf__blank_line_2 { + echo "" + echo "" +} + +function glf__please_choose { + glf__blank_line_2 + echo " ${gl__format_red}Bitte wählen und ENTER drücken!${gl__format_off}" +} + +function task_title { + echo -e "${gl__format_cyanlight}● ${1}${gl__format_off}" +} + +function task_title_syntax { + echo -e " ${gl__format_red}Ausgeführte Syntax:${gl__format_off} ${1}${gl__format_off}" +} + +function terminal_output_begin { + echo "" + echo "${gl__format_red}---- Terminalausgabe (Anfang) --------------------------------------------------------------------------${gl__format_off}" +} + +function terminal_output_end { + echo "${gl__format_red}---- Terminalausgabe (Ende) ----------------------------------------------------------------------------${gl__format_off}" + glf__blank_line_2 +} + + + +################################################################################ +### Favoriten +################################################################################ + +[[ -f /usr/bin/nautilus ]] && gl__favdateimanager="/usr/bin/nautilus" +[[ -f /usr/bin/thunar ]] && gl__favdateimanager="/usr/bin/thunar" +[[ -f /usr/bin/caja ]] && gl__favdateimanager="/usr/bin/caja" +[[ -f /usr/bin/dolphin ]] && gl__favdateimanager="/usr/bin/dolphin --split" + +[[ -f /usr/bin/vim ]] && gl__fav_editor="/usr/bin/vim" +[[ -f /usr/bin/nano ]] && gl__fav_editor="/usr/bin/nano" +[[ -f /usr/bin/kwrite ]] && gl__fav_editor="/usr/bin/kwrite" +[[ -f /usr/bin/gedit ]] && gl__fav_editor="/usr/bin/gedit" +[[ -f /usr/bin/kate ]] && gl__fav_editor="/usr/bin/kate" +[[ -f /usr/bin/geany ]] && gl__fav_editor="/usr/bin/geany" + +[[ -f /usr/bin/evince ]] && gl__favpdfviewer="/usr/bin/evince" +[[ -f /usr/bin/okular ]] && gl__favpdfviewer="/usr/bin/okular" + +[[ -f /usr/bin/texmaker ]] && gl_favtexeditor="/usr/bin/texmaker" +[[ -f /usr/bin/gnome-latex ]] && gl_favtexeditor="/usr/bin/gnome-latex" + +[[ -f /usr/bin/qupzilla ]] && gl__favbrowser="/usr/bin/qupzilla" +[[ -f /usr/bin/konqueror ]] && gl__favbrowser="/usr/bin/konqueror" +[[ -f /usr/bin/firefox ]] && gl__favbrowser="/usr/bin/firefox" + +[[ -f /usr/bin/clementine ]] && gl__fav_audioplayer="/usr/bin/clementine" + +[[ -f /usr/bin/vlc ]] && gl__fav_videoplayer="/usr/bin/vlc" + + + +################################################################################ +### STARTSEITE +################################################################################ + +### LÜFTERDREHZAHL +fanspeed=$(inxi --sensors | grep -o "fan-1.*$") + +### CPU TEMPERATUR +if [ -f /usr/bin/sensors ]; then +sensorsvar="${0}.sensors.tmp" +sensors > "${sensorsvar}" +core0temp=$(grep "Core 0" "${sensorsvar}" | awk '{print $3}') +core1temp=$(grep "Core 1" "${sensorsvar}" | awk '{print $3}') +core2temp=$(grep "Core 2" "${sensorsvar}" | awk '{print $3}') +core3temp=$(grep "Core 3" "${sensorsvar}" | awk '{print $3}') +rm "${sensorsvar}" +fi + +### LAUTSTÄRKE + gl__lautstaerke=$(amixer | grep -o "\[off\]\|\[on\]" | head -1 | sed "s/\[//g" | sed "s/\]//g") +gl__lautstaerkeprozent=$(amixer | grep "%" | head -1 | grep -o "\[[0-9]\{1,3\}%\]" | uniq | sed "s/\[//g" | sed "s/\]//g") + +if [ ${gl__lautstaerke} = "off" ] ; then + gl__lautstaerke="Ton: ${gl__format_red}AUS${gl__format_off} Lautstärke (Master): ${gl__format_red}${gl__lautstaerkeprozent}${gl__format_off}" + gl__ton_anaus="AUS" + else + gl__lautstaerke="Ton: ${gl__format_red}EIN${gl__format_off} Lautstärke (Master): ${gl__format_red}${gl__lautstaerkeprozent}${gl__format_off}" + gl__ton_anaus="EIN" + fi + +gl__lautstaerkeprozent=$(amixer | grep "%" | head -1 | grep -o "\[[0-9]\{1,3\}%\]" | sed "s/\[//g" | sed "s/\]//g") + +### MIKROFONE + +function mic_status { + gl__mic_mutestatus=$(amixer | grep -A 5 "Simple mixer control .Capture." | grep -o "\[on\]\|\[off\]" | head -n 1 | sed "s/\[//g" | sed "s/\]//g") +} +mic_status + +# Device Namen +pacmd_mic_list=$(pacmd list-sources | grep "alsa_input" | sed -e "s/name: //g" | sed "s/^[ \t]*//;s/[ \t]*$//") + + +function bannerstart { + echo -e "" + echo -e " ${gl__format_red}88 88 88 88888888 88 88888b. 88888888 888888b. ${gl__format_off}" + echo -e " ${gl__format_red}88 88 88 88 88 88 Y8b 88 88 Y8b ${gl__format_off}" + echo -e " ${gl__format_red}88 88 88 88 88 88 88 88 88 88 ${gl__format_off}" + echo -e " ${gl__format_red}88888b. 88888888 888888 88 88 d8P 888888 88 d8P ${gl__format_off}" + echo -e " ${gl__format_red}88 \"8b 88 88 88 88 88888P\" 88 88888P\" ${gl__format_off}" + echo -e " ${gl__format_red}88 88 88 88 88 88 88 88 88 T8b ${gl__format_off}" + echo -e " ${gl__format_red}88 d8P 88 88 88 88 88 88 88 T8b ${gl__format_off}" + echo -e " ${gl__format_red}8888P\" 88 88 88888888 8888888 88 88888888 88 T8b ${gl__format_off}" + echo -e "" + echo -e " ${gl__format_red}Version:${gl__format_off} ${SkriptVersion} ${gl__format_red}Ton:${gl__format_off} ${gl__ton_anaus} ${gl__format_red}Volume:${gl__format_off} ${gl__lautstaerkeprozent} ${gl__format_red}Mikros:${gl__format_off} ${gl__mic_mutestatus}" + echo -e " ${gl__format_red}EN:${gl__format_off} ${gl__ipv4_eth} ${gl__format_red}OS:${gl__format_off} ${gl__osprettyname} ${gl__format_red}Hostname:${gl__format_off} ${HOSTNAME}" + echo -e " ${gl__format_red}WLAN:${gl__format_off} ${gl__wlanactive} ${gl__format_red}WLAN IP:${gl__format_off} ${gl__ipv4_wlan} ${gl__format_red}WLAN SSID:${gl__format_off} ${gl__wlan_ssid}" + echo -e " ${gl__format_red}Akku:${gl__format_off} ${gl__bat_charge} ${gl__format_red}Lüfterdrehzahl:${gl__format_off} ${fanspeed} ${gl__format_red}CPU:${gl__format_off} ${core0temp} ${core1temp} ${core2temp} ${core3temp} ${core4temp} ${core5temp} ${core6temp} ${core7temp}" + } + +function banner { + clear + echo -e "" + echo -e " ${gl__format_red}88 88 88 88888888 88 88888b. 88888888 888888b. ${gl__format_off}" + echo -e " ${gl__format_red}88 88 88 88 88 88 Y8b 88 88 Y8b ${gl__format_off}" + echo -e " ${gl__format_red}88 88 88 88 88 88 88 88 88 88 ${gl__format_off}" + echo -e " ${gl__format_red}88888b. 88888888 888888 88 88 d8P 888888 88 d8P ${gl__format_off}" + echo -e " ${gl__format_red}88 \"8b 88 88 88 88 88888P\" 88 88888P\" ${gl__format_off}" + echo -e " ${gl__format_red}88 88 88 88 88 88 88 88 88 T8b ${gl__format_off}" + echo -e " ${gl__format_red}88 d8P 88 88 88 88 88 88 88 T8b ${gl__format_off}" + echo -e " ${gl__format_red}8888P\" 88 88 88888888 8888888 88 88888888 88 T8b ${gl__format_off}" + echo -e "" + echo -e "${gl__format_red} ${1} ${gl__format_off}" + glf__blank_line_2 + } + +function pause { + glf__blank_line_2 + read -p "${gl__format_red}Drücke ENTER um weiterzumachen${gl__format_off}" +} + +function ende { + glf__blank_line_2 + read -p "${gl__format_red}Drücke ENTER um weiterzumachen${gl__format_off}" +} + + +clear +bannerstart +glf__blank_line_2 +echo " ${gl__format_red}| H |${gl__format_off} Hardware ${gl__format_red}| S |${gl__format_off} Software" +echo " ${gl__format_red}| F |${gl__format_off} Dateien & Verzeichn. ${gl__format_red}| I |${gl__format_off} Netzwerk" +echo " ${gl__format_red}| R |${gl__format_off} Herunterf./Neustart ${gl__format_red}| L |${gl__format_off} Linux Distributionen" +if [[ ${XDG_CURRENT_DESKTOP} =~ .*KDE.* ]] +then +echo " ${gl__format_red}| K |${gl__format_off} KDE Plasma" +fi +glf__blank_line_2 +echo " ${gl__format_red}| E |${gl__format_off} Einstellungen ${gl__format_red}| U |${gl__format_off} bHELPER aktualisieren" +echo "" +echo " ${gl__format_red}| V |${gl__format_off} leiser ${gl__format_red}| B |${gl__format_off} TON ein/aus ${gl__format_red}| N |${gl__format_off} lauter" +echo " ${gl__format_red}| M |${gl__format_off} Mikro(s) ein/aus ${gl__format_red}| X |${gl__format_off} Monitor sperren ${gl__format_red}| W |${gl__format_off} WLAN ein/aus" + +glf__please_choose + +read hauptmenue + +case ${hauptmenue} in + + + +################################################################################ +### Bildschirm sperren +################################################################################ + +x|X) +if [[ ${XDG_CURRENT_DESKTOP} =~ .*KDE.* ]] +then + xdg-screensaver lock +fi + +if [[ ${WINDOWMANAGER} =~ .*xfce.* ]] +then + xdg-scrrensaver lock +fi + +if [[ ${XDG_CURRENT_DESKTOP} =~ .*Cinnamon.* ]] +then + cinnamon-screensaver-command --lock +fi + +if [[ ${XDG_CURRENT_DESKTOP} =~ .*MATE.* ]] +then + mate-screensaver-command --lock +fi +;; + + + +################################################################################ +### Hardware +################################################################################ + +h|H) +banner "Hauptmenü => Hardware" + +echo " ${gl__format_red}| 0 |${gl__format_off} Hardwareinformationen des Rechners (dmidecode)" +echo " ${gl__format_red}| 1 |${gl__format_off} Hardwareinformationen des Rechners (inxi)" +echo " ${gl__format_red}| B |${gl__format_off} Bluetooth" +echo " ${gl__format_red}| A |${gl__format_off} Laptopakkus (upower, inxi)" +echo " ${gl__format_red}| XK |${gl__format_off} xrandr - Bildschirmkonfiguration anzeigen lassen" + +glf__please_choose + +read hardware + + case ${hardware} in + + 0) + bannertitel="Hauptmenü => Hardware => Hardwareinformationen eures Rechners (dmidecode)" + banner + sudo /usr/sbin/dmidecode -s system-manufacturer + bannertitel="Hauptmenü => Hardware => Hardwareinformationen eures Rechners (dmidecode)" + banner + echo " ${gl__format_red}Hersteller des Systems:${gl__format_off} $(sudo /usr/sbin/dmidecode -s system-manufacturer)" + echo " ${gl__format_red}Produktname des Systems:${gl__format_off} $(sudo /usr/sbin/dmidecode -s system-product-name)" + echo " ${gl__format_red}Modell Nr. des Systems:${gl__format_off} $(sudo /usr/sbin/dmidecode -s system-version)" + echo " ${gl__format_red}Verwendete BIOS-Version:${gl__format_off} $(sudo /usr/sbin/dmidecode -s bios-version)" + echo " ${gl__format_red}Hersteller des Mainboards:${gl__format_off} $(sudo /usr/sbin/dmidecode -s baseboard-manufacturer)" + echo " ${gl__format_red}Produktname des Mainboards:${gl__format_off} $(sudo /usr/sbin/dmidecode -s baseboard-product-name)" + echo " ${gl__format_red}Versionsnummer des Mainboards:${gl__format_off} $(sudo /usr/sbin/dmidecode -s baseboard-version)" + ende + ;; + + 1) + banner "Hauptmenü => Hardware => Hardwareinformationen des Rechners (inxi)" + +task_title "Hardwareinformationen des Rechners (inxi)" +task_title_syntax "inxi -Fxz" +terminal_output_begin +inxi -Fxz +terminal_output_end + + ende + ;; + + b|B) + [[ -f /usr/sbin/rfkill ]] && rfkill_bin="/usr/sbin/rfkill" + [[ -f /usr/bin/rfkill ]] && rfkill_bin="/usr/bin/rfkill" + + banner "Hauptmenü => Hardware => Bluetooth" + +task_title "systemctl list-unit-files | grep -i "STATE\|blue"" +task_title_syntax "systemctl list-unit-files | grep -i "STATE\|blue"" +terminal_output_begin +systemctl list-unit-files | grep -i "STATE\|blue" +terminal_output_end + +task_title "systemctl status bluetooth.service" +task_title_syntax "systemctl status bluetooth.service" +terminal_output_begin +systemctl status bluetooth.service +terminal_output_end + +task_title "journalctl -o short-iso --no-pager -u bluetooth.service" +task_title_syntax "journalctl -o short-iso --no-pager -u bluetooth.service" +terminal_output_begin +journalctl -o short-iso --no-pager -u bluetooth.service +terminal_output_end + +"bluetask_title tooth --help" +task_title_syntax "bluetooth --help" +terminal_output_begin +bluetooth --help +terminal_output_end + +task_title "rfkill list bluetooth" +task_title_syntax "rfkill list bluetooth" +terminal_output_begin +${rfkill_bin} list bluetooth +terminal_output_end + +task_title "inxi --bluetooth" +task_title_syntax "inxi --bluetooth" +terminal_output_begin +inxi --bluetooth +terminal_output_end + + ende + ;; + + a|A) + banner "Hauptmenü => Hardware => Akkuinformationen eures Laptops (upower, inxi)" + +task_title_syntax "upower -i /org/freedesktop/UPower/devices/battery_BAT0" +echo "${gl__ausgabe_anfang}" +upower -i /org/freedesktop/UPower/devices/battery_BAT0 +echo "${gl__ausgabe_ende}" +glf__blank_line_2 +task_title_syntax "inxi --battery" +echo "${gl__ausgabe_anfang}" +inxi --battery +echo "${gl__ausgabe_ende}" + + ende + ;; + + xk|XK) + banner "Hauptmenü => Hardware => Bildschirmkonfigurieren (xrandr)" + +task_title "Alle aktiven Monitore" +task_title_syntax "xrandr --listactivemonitors" +terminal_output_begin +xrandr --listactivemonitors +terminal_output_end + +task_title "Alle vorhandene Monitoranschlüsse" +task_title_syntax "xrandr --listproviders" +terminal_output_begin +xrandr --listproviders +terminal_output_end + +task_title "Komplette Ausgabe" +task_title_syntax "xrandr" +terminal_output_begin +xrandr +terminal_output_end + + ende + ;; + + esac +;; + + + +################################################################################ +### Software +################################################################################ + +s|S) +banner "Hauptmenü => Software" + +echo " ${gl__format_red}Betriebssystem (${gl__osprettyname}):${gl__format_off}" +if grep -q "Tumbleweed\|Ubuntu\|Manjaro\|Arch Linux\|Mint" /etc/os-release ; then + echo " ${gl__format_red}| U |${gl__format_off} Aktualisieren" +fi + +echo "" +echo " ${gl__format_red}Paketverwaltungen:${gl__format_off}" +[[ -f /usr/bin/flatpak ]] && echo " ${gl__format_red}| F |${gl__format_off} Flatpak" +[[ -f /usr/bin/snap ]] && echo " ${gl__format_red}| S |${gl__format_off} Snap" +echo "" +echo " ${gl__format_red}Programme:${gl__format_off}" +echo " ${gl__format_red}| P |${gl__format_off} Informationen ausgeben lassen, ..." + +glf__please_choose + +read software + + case ${software} in + + u|U) + banner "Hauptmenü => Software => Paketverwaltung => Linux Distribution aktualisieren" + +if test -f "/usr/bin/zypper"; then + task_title "Daten der Reporitories aktualisieren" + task_title_syntax "sudo zypper refresh" + terminal_output_begin + sudo zypper refresh + terminal_output_end + + task_title "Anstehende Aktualisierungen anzeigen" + task_title_syntax "sudo zypper list-updates" + terminal_output_begin + sudo zypper list-updates + terminal_output_end + + task_title "Aktualisierungen installieren" + task_title_syntax "sudo zypper dup --auto-agree-with-licenses" + terminal_output_begin + sudo zypper dup --auto-agree-with-licenses + terminal_output_end +fi + +if [[ -f "/usr/bin/apt" || -f "/usr/local/bin/apt" ]]; then + task_title "Daten der Reporitories aktualisieren" + task_title_syntax "sudo apt update" + terminal_output_begin + sudo apt update + terminal_output_end + + task_title "Anstehende Aktualisierungen anzeigen" + task_title_syntax "apt list --upgradable -a" + terminal_output_begin + apt list --upgradable -a + terminal_output_end + + task_title "Aktualisierungen installieren" + task_title_syntax "sudo apt upgrade" + terminal_output_begin + sudo apt upgrade + terminal_output_end +fi + +if test -f "/usr/bin/pacman"; then + task_title "Daten der Reporitories aktualisieren" + task_title_syntax "sudo pacman -Sy" + terminal_output_begin + sudo pacman -Sy + terminal_output_end + + task_title "Anstehende Aktualisierungen anzeigen" + task_title_syntax "sudo pacman -Qu" + terminal_output_begin + sudo pacman -Qu + terminal_output_end + + task_title "Aktualisierungen installieren" + task_title_syntax "sudo pacman -Su" + terminal_output_begin + sudo pacman -Su + terminal_output_end +fi + ende + ;; + + + + f|F) + banner "Hauptmenü => Software => Flatpak" + +echo " ${gl__format_red}| U |${gl__format_off} Installierte Flatpak Pakete aktualisieren" +echo " ${gl__format_red}| L |${gl__format_off} Installierte Flatpak Pakete auflisten" +echo " ${gl__format_red}| S |${gl__format_off} Flatpak Programme suchen" +echo " ${gl__format_red}| I |${gl__format_off} Flatpak Programme installieren" +echo " ${gl__format_red}| R |${gl__format_off} Flatpak Programme deinstallieren" +echo " ${gl__format_red}| G |${gl__format_off} Ungenutzte Flatpak Pakete deinstallieren" + +glf__please_choose + + read flatpak + + case ${flatpak} in + + u|U) + banner "Hauptmenü => Software => Flatpak => Installierte Flatpak Pakete aktualisieren" + +task_title "Installierte Pakete aktualisieren" +task_title_syntax "sudo flatpak update" + +terminal_output_begin +sudo /usr/bin/flatpak update +terminal_output_end + + ende + ;; + + l|L) + banner "Hauptmenü => Software => Flatpak => Installierte Flatpak Pakete auflisten" + +task_title "Detaillierte Liste aller installierten Flatpak Pakete" +task_title_syntax "flatpak list --show-details" +echo "${gl__ausgabe_anfang}" +/usr/bin/flatpak list --show-details +echo "${gl__ausgabe_ende}" +glf__blank_line_2 + +task_title "Liste aller installierten Flatpak Pakete" +task_title_syntax "flatpak list" +echo "${gl__ausgabe_anfang}" +/usr/bin/flatpak list +echo "${gl__ausgabe_ende}" +glf__blank_line_2 + +task_title "Detaillierte Liste aller installierten Flatpak Programme" +task_title_syntax "flatpak list --app --show-details" +echo "${gl__ausgabe_anfang}" +/usr/bin/flatpak list --app --show-details +echo "${gl__ausgabe_ende}" +glf__blank_line_2 + +task_title "Liste aller installierten Flatpak Programme" +task_title_syntax "flatpak list --app" +echo "${gl__ausgabe_anfang}" +/usr/bin/flatpak list --app +echo "${gl__ausgabe_ende}" + + ende + ;; + + g|G) + banner "Hauptmenü => Software => Flatpak => Ungenutzte Flatpak Pakete deinstallieren" + +task_title "Ungenutzte Flatpak Pakete deinstallieren" +task_title_syntax "sudo flatpak uninstall --unused" +terminal_output_begin +sudo flatpak uninstall --unused +terminal_output_end + + ende + ;; + + s|S) + banner "Hauptmenü => Software => Flatpak => Flatpak Programme suchen" + +read -p "${gl__format_red}Suchtext eigeben: ${gl__format_off}" search + banner + +task_title "Flatpak Programme suchen" +task_title_syntax "flatpak search ${search}" +terminal_output_begin +flatpak search ${search} +terminal_output_end + + ende + ;; + + i|I) + banner "Hauptmenü => Software => Flatpak => Flatpak Programme installieren" + +read -p "${gl__format_red}Suchtext eigeben: ${gl__format_off}" search + banner + +task_title "Flatpak Programm installieren" +task_title_syntax "flatpak search ${search}" +terminal_output_begin +flatpak search ${search} +terminal_output_end + +read -p "${gl__format_red}Application ID eigeben: ${gl__format_off}" applicationid + banner + +task_title "Programme installieren" +task_title_syntax "sudo flatpak install ${applicationid}" +terminal_output_begin +sudo flatpak install ${applicationid} +terminal_output_end + + ende + ;; + + r|R) + banner "Hauptmenü => Software => Flatpak => Flatpak Pakete deinstallieren" + +task_title "Detaillierte Liste aller installierten Flatpak Pakete" +task_title_syntax "flatpak list --app --show-details" +terminal_output_begin +flatpak list --app --show-details +terminal_output_end + +read -p "${gl__format_red}Application ID eigeben: ${gl__format_off}" applicationid + banner "Hauptmenü => Software => Flatpak => Flatpak Programme deinstallieren" + +task_title "Programme deinstallieren" +task_title_syntax "sudo flatpak uninstall ${applicationid}" +terminal_output_begin +sudo flatpak uninstall ${applicationid} +terminal_output_end + + ende + ;; + + g|G) + banner "Hauptmenü => Software => Flatpak => Ungenutzter Flatpak Pakete deinstallieren" + +task_title "Ungenutzter Pakete deinstallieren" +task_title_syntax "sudo flatpak uninstall --unused" +terminal_output_begin +sudo /usr/bin/flatpak uninstall --unused +terminal_output_end + + ende + ;; + + esac +;; + + s|S) + banner "Hauptmenü => Software => Snap" + +echo " ${gl__format_red}| U |${gl__format_off} Installierte Snap Pakete aktualisieren" +echo " ${gl__format_red}| I |${gl__format_off} Informationen über ein Snap Paket" +echo " ${gl__format_red}| L |${gl__format_off} Installierte Snap Pakete auflisten" +echo " ${gl__format_red}| S |${gl__format_off} Nach Snap Paketen suchen" +echo " ${gl__format_red}| D |${gl__format_off} Nicht aktive (disabled) Snap Pakete deinstallieren" + +glf__please_choose + + read snap + + case ${snap} in + + u|U) + banner "Hauptmenü => Software => Flatpak => Installierte Snap Pakete aktualisieren" + +task_title "Installierte Snap Pakete aktualisieren" +task_title_syntax "sudo snap refresh" +echo "${gl__ausgabe_anfang}" +sudo snap refresh +echo "${gl__ausgabe_ende}" + + ende + ;; + + i|I) + banner "Hauptmenü => Software => Snap => Informationen über ein Snap Paket" + +read -p "${gl__format_red}Suchtext eigeben: ${gl__format_off}" search + banner + +task_title "Informationen über ein Snap Paket" +task_title_syntax "snap info ${search}" +terminal_output_begin +snap info ${search} +terminal_output_end + + ende + ;; + + l|L) + banner "Hauptmenü => Software => Snap => Alle installierten Snap Pakete auflisten" + +task_title "Alle installierten Snap Pakete auflisten" +task_title_syntax "snap list --all" +echo "${gl__ausgabe_anfang}" +snap list --all +echo "${gl__ausgabe_ende}" + + ende + ;; + + s|S) + banner "Hauptmenü => Software => Snap => Nach Snap Paketen suchen" + +read -p "${gl__format_red}Suchtext eigeben: ${gl__format_off}" search + banner + +task_title "Nach Snap Paketen suchen" +task_title_syntax "snap search ${search}" +terminal_output_begin +snap search ${search} +terminal_output_end + + ende + ;; + + d|D) + banner "Hauptmenü => Software => Snap => Nicht aktive (disabled) Snap Pakete deinstallieren" + +task_title "Nicht aktive (disabled) Snap Pakete deinstallieren" +task_title_syntax "snap list --all | awk '/disabled/{system(\"sudo snap remove \" \$1 \" --revision=\" \$3)}'" +terminal_output_begin +snap list --all | awk '/disabled/{system("sudo snap remove " $1 " --revision=" $3)}' +terminal_output_end + + ende + ;; + + esac +;; + + + + p|P) + banner "Hauptmenü => Software => Programme" + +echo " ${gl__format_cyanlight}●${gl__format_off} Mozilla Thunderbird ${gl__format_red}| T0 |${gl__format_off} Informationen" + +glf__please_choose + + read programme + + case ${programme} in + + t0|T0) + banner "Hauptmenü => Software => Programme => Mozilla Thunderbird" + +task_title_syntax "thunderbird --version" +echo "${gl__ausgabe_anfang}" +[[ -f /usr/bin/thunderbird ]] && thunderbird --version +echo "${gl__ausgabe_ende}" + +if [ -f "/usr/bin/zypper" ]; then +echo "" +task_title_syntax "zypper info MozillaThunderbird" +echo "${gl__ausgabe_anfang}" +[[ -f /usr/bin/zypper ]] && zypper info MozillaThunderbird +echo "${gl__ausgabe_ende}" +fi + +if [ -f "/usr/bin/pacman" ]; then +echo "" +task_title_syntax "pacman -Qii thunderbird" +echo "${gl__ausgabe_anfang}" +[[ -f /usr/bin/pacman ]] && pacman -Qii thunderbird +echo "${gl__ausgabe_ende}" +fi + + ende + ;; + + + esac + + ;; + +esac + +;; + + + +################################################################################ +### Netzwerk +################################################################################ + +i|I) +banner "Hauptmenü => Netzwerk" + +echo " ${gl__format_red}| A |${gl__format_off} Allgemeine Informationen" +echo " ${gl__format_red}| W |${gl__format_off} WLAN Informationen" + +glf__please_choose + +read netzwerk + + case ${netzwerk} in + + a|A) + banner "Hauptmenü => Netzwerk => WLAN Informationen" + +task_title_syntax "ip address show" +echo "${gl__ausgabe_anfang}" +ip address show +echo "${gl__ausgabe_ende}" +echo "" +task_title_syntax "ip route list" +echo "${gl__ausgabe_anfang}" +ip route list +echo "${gl__ausgabe_ende}" + ende + ;; + + w|W) +[[ -f /usr/sbin/rfkill ]] && rfkill_bin="/usr/sbin/rfkill" +[[ -f /usr/bin/rfkill ]] && rfkill_bin="/usr/bin/rfkill" + + banner "Hauptmenü => Netzwerk => WLAN Informationen" + +task_title_syntax "rfkill list wifi" +echo "${gl__ausgabe_anfang}" +${rfkill_bin} list wifi +echo "${gl__ausgabe_ende}" +echo "" +task_title_syntax "inxi --network" +echo "${gl__ausgabe_anfang}" +inxi --network +echo "${gl__ausgabe_ende}" + + ende + ;; + + esac + +;; + + + +################################################################################ +### Dateien & Verzeichnisse +################################################################################ + +f|F) +banner "Hauptmenü => Dateien & Verzeichnisse" + +echo " ${gl__format_red}| F |${gl__format_off} Nach Dateien und Verzeichnissen suchen" +echo " ${gl__format_red}| G |${gl__format_off} Die zehn größten Dateien in deinem ${HOME}" +echo " ${gl__format_red}| D |${gl__format_off} Duplikate von Dateien in deinem ${HOME} Verzeichnis finden" + +glf__please_choose + +read software + + case ${software} in + + g|G) + banner "Hauptmenü => Dateien & Verzeichnisse => Die 10 größten Dateien" + +find ${HOME} -type f -print0 | xargs -0 du -h | sort -hr | head -10 + + ende + ;; + + f|F) + banner "Hauptmenü => Dateien & Verzeichnisse => Nach Dateien und Verzeichnissen suchen" + +read -p "${gl__format_red}Zeichenfolge: ${gl__format_off}" zeichenfolge +echo -e "" +echo "${gl__format_red}---- Verzeichnisse die${gl__format_off} "${zeichenfolge}" ${gl__format_red}enthalten -------${gl__format_off}" +find "${HOME}" -iname "*${zeichenfolge}*" -type d +echo -e "${gl__format_red}----------------------------------------------------------${gl__format_off}" +echo -e "" +echo "${gl__format_red}---- Dateien die${gl__format_off} "${zeichenfolge}" ${gl__format_red}enthalten -------${gl__format_off}" +find "${HOME}" -iname "*${zeichenfolge}*" -type f -exec ls -alt --color=auto --time-style=long-iso {} + | sort -k 8 +echo -e "${gl__format_red}----------------------------------------------------------${gl__format_off}" + + ende + ;; + + d|D) + banner "Hauptmenü => Dateien & Verzeichnisse => Duplikate von Dateien in deinem ${HOME} Verzeichnis finden" + +task_title "Duplikate von Dateien in deinem ${HOME} Verzeichnis finden" +task_title_syntax "find ${HOME} ! -empty -type f -exec md5sum {} + | sort | uniq -w32 -dD" +terminal_output_begin +find ${HOME} ! -empty -type f -exec md5sum {} + | sort | uniq -w32 -dD +terminal_output_end + + ende + ;; + + esac + +;; + + + +######################################################################## +### KDE +######################################################################## + +k|K) + +[[ -f /usr/bin/kcmshell5 ]] && kcmshell_bin="/usr/bin/kcmshell5" +[[ -f /usr/bin/kcmshell6 ]] && kcmshell_bin="/usr/bin/kcmshell6" + +banner "Hauptmenü => KDE" + +echo " ${gl__format_red}Installierte KDE Plasma Version: ${gl__format_off}`plasmashell --version | sed "s/plasmashell //"`" +echo "" +echo " ${gl__format_red}| EN |${gl__format_off} Energieprofile" +echo " ${gl__format_red}| AE |${gl__format_off} Anzeigeeinstellung" +echo " ${gl__format_red}| SL |${gl__format_off} Bildschirmsperre" +echo " ${gl__format_red}| SI |${gl__format_off} Sitzung" +echo " ${gl__format_red}| KW |${gl__format_off} KWin Regeln" +echo " ${gl__format_red}| EK |${gl__format_off} Eigene Kurzbefehle" +echo " ${gl__format_red}| MA |${gl__format_off} Maus" +echo " ${gl__format_red}| SP |${gl__format_off} Standardanwendungen" + +glf__please_choose + +read kde + + case ${kde} in + + en|EN) nohup ${kcmshell_bin} powerdevilprofilesconfig & ;; + ae|AE) nohup ${kcmshell_bin} kscreen & ;; + sl|SL) nohup ${kcmshell_bin} screenlocker & ;; + si|SI) nohup ${kcmshell_bin} kcm_smserver & ;; + kw|KW) nohup ${kcmshell_bin} kwinrules & ;; + ek|EK) nohup ${kcmshell_bin} khotkeys & ;; + ma|MA) nohup ${kcmshell_bin} kcm_mouse & ;; + sp|SP) nohup ${kcmshell_bin} componentchooser & ;; + + esac + +;; + + + +######################################################################## +### Linux Distributionen +######################################################################## + +l|L) + +iso_folder="/home/${USER}/" +[[ -d /run/media/${USER}/Ventoy/ ]] && ventoy_part="/run/media/${USER}/Ventoy/" +[[ -d /media/${USER}/Ventoy/ ]] && ventoy_part="/media/${USER}/Ventoy/" + +function iso_dwnld { + rm "${iso_filename_local}" &> /dev/null ; wget ${iso_url} -N -P "${iso_folder}" + rm "${iso_checksum_local}" &> /dev/null ; wget ${iso_checksum_url} -N -O "${iso_checksum_local}" +} + +function checksum_sha256sum { + checksum_image=$(sha256sum "${iso_filename_local}" | awk '{print $1}') + checksum_chksumfile=$(awk '{print $1}' "${iso_checksum_local}") +} + +banner "Hauptmenü => Linux Distributionen" + +echo " ${gl__format_red}| LM |${gl__format_off} Linux Mint" + +glf__please_choose + +read linux + + case ${linux} in + + lm|LM) +linux_dist_name="Linux Mint" +version=$(curl https://ftp.fau.de/mint/iso/stable/ | grep 202.-..-.. | sort -k 2 | tail -n 1 | grep -o "href=\".*\"" | sed "s|href=\"||" | sed "s|/\"||") +linuxmint_iso_folder="/home/${USER}/" + + banner "Hauptmenü => Linux Distributionen => ${linux_dist_name}" + +echo " Aktuellste Version: ${gl__format_red}${version}${gl__format_off}" +echo "" +echo " ${gl__format_red}| U0 |${gl__format_off} ${linux_dist_name} Webseite öffnen" +echo " ${gl__format_red}| U1 |${gl__format_off} Offizielle ${linux_dist_name} Dokumentation öffnen" +echo "" +echo " ${gl__format_red}| X0 |${gl__format_off} XFCE herunterladen" +echo " ${gl__format_red}| X1 |${gl__format_off} XFCE auf USB-Stick schreiben" +echo " ${gl__format_red}| X2 |${gl__format_off} XFCE auf Ventoy Mulitboot USB-Stick kopieren" +echo "" +echo " ${gl__format_red}| M0 |${gl__format_off} Mate herunterladen" +echo " ${gl__format_red}| M1 |${gl__format_off} Mate auf USB-Stick schreiben" +echo " ${gl__format_red}| M2 |${gl__format_off} Mate auf Ventoy Mulitboot USB-Stick kopieren" +echo "" +echo " ${gl__format_red}| C0 |${gl__format_off} Cinnamon herunterladen" +echo " ${gl__format_red}| C1 |${gl__format_off} Cinnamon auf USB-Stick schreiben" +echo " ${gl__format_red}| C2 |${gl__format_off} Cinnamon Edge herunterladen" +echo " ${gl__format_red}| C3 |${gl__format_off} Cinnamon Edge auf USB-Stick schreiben" +echo " ${gl__format_red}| C4 |${gl__format_off} Cinnamon auf Ventoy Mulitboot USB-Stick kopieren" + +glf__please_choose + + read linuxmint + + case ${linuxmint} in + + u0|U0) + banner "Hauptmenü => Linux Distributionen => ${linux_dist_name} => Offizielle Website öffnen" + +xdg-open https://linuxmint.com + ;; + + u1|U1) + banner "Hauptmenü => Linux Distributionen => ${linux_dist_name} => Offizielle ${linux_dist_name} Dokumentation öffnen" + +xdg-open https://linuxmint-installation-guide.readthedocs.io/de/latest/ + ;; + + + + x0|X0) + banner "Hauptmenü => Linux Distributionen => ${linux_dist_name} => XFCE ${version} herunterladen" + +flavour="xfce" +checksum_bin="/usr/bin/sha256sum" +iso_url="https://ftp.fau.de/mint/iso/stable/${version}/linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_url="https://ftp.heanet.ie/mirrors/linuxmint.com/stable/${version}/sha${sha}sum.txt" +iso_file="linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_file="linuxmint-${version}-${flavour}-64bit.iso.sha${sha}" + +[[ -f "${linuxmint_iso_folder}linuxmint-${version}-${flavour}-64bit.iso" ]] || wget "https://ftp.fau.de/mint/iso/stable/${version}/linuxmint-${version}-${flavour}-64bit.iso" -P "${linuxmint_iso_folder}" +[[ -f "${linuxmint_iso_folder}linuxmint-${version}-${flavour}-64bit.iso.sha256" ]] || wget "https://ftp.heanet.ie/mirrors/linuxmint.com/stable/${version}/sha256sum.txt" -P "${linuxmint_iso_folder}" -O "linuxmint-${version}-${flavour}-64bit.iso.sha256" + +checksum_image=$(${checksum_bin} "${linuxmint_iso_folder}${iso_file}" | awk '{print $1}') +checksum_chksumfile=$(grep "${flavour}" "${linuxmint_iso_folder}${iso_file}.sha256" | grep -o "[a-z0-9]\{64\}") + +if [[ "${checksum_image}" == "${checksum_chksumfile}" ]] +then + echo "Die Prüfsumme des Abbildes ist korrekt." +else + echo "Irgendetwas stimmt mit der Prüfsumme nicht!" +fi + ende + ;; + + x1|X1) + banner "Hauptmenü => Linux Distributionen => ${linux_dist_name} => XFCE ${version} auf USB-Stick schreiben" + +flavour="xfce" +checksum_bin="/usr/bin/sha256sum" +iso_file="linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_file="linuxmint-${version}-${flavour}-64bit.iso.sha${sha}" + +checksum_image=$(${checksum_bin} "${linuxmint_iso_folder}${iso_file}" | awk '{print $1}') +checksum_chksumfile=$(grep "${flavour}" "${linuxmint_iso_folder}${iso_file}.sha256" | grep -o "[a-z0-9]\{64\}") + +if test -f "${linuxmint_iso_folder}${iso_file}" +then + echo "Datei existiert" +else + echo "Datei existiert nicht" +fi + +if [[ "${checksum_image}" == "${checksum_chksumfile}" ]] +then + echo "Die Prüfsumme des Abbildes ist korrekt." + echo "" + lsblk + read -p "${format_red}Zielspeicher (z.B.: /dev/sdx): ${format_off}" device + sudo dd if="${iso_folder}${iso_file}" of=${device} bs=4M status=progress && sync +else + echo "Irgendwas ist schief gelaufen" +fi + ende + ;; + + x2|X2) + banner "Hauptmenü => Linux Distributionen => Linux Mint => XFCE ${version} auf Ventoy Multiboot USB-Stick schreiben" + +flavour="xfce" +checksum_bin="/usr/bin/sha256sum" +iso_file="linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_file="${iso_file}.sha256" + +checksum_image=$(${checksum_bin} "${linuxmint_iso_folder}${iso_file}" | awk '{print $1}') +checksum_chksumfile=$(grep "${iso_file}" "${linuxmint_iso_folder}${iso_file}.sha256" | grep -o "[a-z0-9]\{64\}") + +if test -f "${linuxmint_iso_folder}${iso_file}.sha256" -a "${linuxmint_iso_folder}${iso_file}" +then + file_exist_ok="true" +else + file_exist_ok="false" +fi + +if test "${checksum_image}" -a "${checksum_chksumfile}" +then + checksum_ok="true" +else + checksum_ok="false" +fi + +if test -d "${ventoy_part}" +then + ventoy_part_ok="true" +else + ventoy_part_ok="false" +fi + +if test "${checksum_ok}" = "true" -a "${ventoy_part_ok}" = "true" +then + rsync -a -t -p -o -g -v --progress -u -s "${iso_folder}${iso_file}" "${ventoy_part}""${iso_file}" +else + echo "Ventoy USB-Stick ist nicht eingehangen oder die Prüsumme des Linux Mint Abbildes stimmt nicht!" +fi + + ende + ;; + + + + m0|M0) + banner "Hauptmenü => Linux Distributionen => ${linux_dist_name} => Mate ${version} herunterladen" + +flavour="mate" +checksum_bin="/usr/bin/sha256sum" +iso_url="https://ftp.fau.de/mint/iso/stable/${version}/linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_url="https://ftp.heanet.ie/mirrors/linuxmint.com/stable/${version}/sha${sha}sum.txt" +iso_file="linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_file="linuxmint-${version}-${flavour}-64bit.iso.sha${sha}" + +[[ -f "${linuxmint_iso_folder}linuxmint-${version}-${flavour}-64bit.iso" ]] || wget "https://ftp.fau.de/mint/iso/stable/${version}/linuxmint-${version}-${flavour}-64bit.iso" -P "${linuxmint_iso_folder}" +[[ -f "${linuxmint_iso_folder}linuxmint-${version}-${flavour}-64bit.iso.sha256" ]] || wget "https://ftp.heanet.ie/mirrors/linuxmint.com/stable/${version}/sha256sum.txt" -P "${linuxmint_iso_folder}" -O "linuxmint-${version}-${flavour}-64bit.iso.sha256" + +checksum_image=$(${checksum_bin} "${linuxmint_iso_folder}${iso_file}" | awk '{print $1}') +checksum_chksumfile=$(grep "${iso_file}" "${linuxmint_iso_folder}${iso_file}.sha256" | grep -o "[a-z0-9]\{64\}") + +if [[ "${checksum_image}" == "${checksum_chksumfile}" ]] +then + echo "Die Prüfsumme des Abbildes ist korrekt." +else + echo "Irgendetwas stimmt mit der Prüfsumme nicht!" +fi + ende + ;; + + m1|M1) + banner "Hauptmenü => Linux Distributionen => ${linux_dist_name} => Mate ${version} auf USB-Stick schreiben" + +flavour="mate" +checksum_bin="/usr/bin/sha256sum" +iso_file="linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_file="linuxmint-${version}-${flavour}-64bit.iso.sha${sha}" + +checksum_image=$(${checksum_bin} "${linuxmint_iso_folder}${iso_file}" | awk '{print $1}') +checksum_chksumfile=$(grep "${iso_file}" "${linuxmint_iso_folder}${iso_file}.sha256" | grep -o "[a-z0-9]\{64\}") + +if [[ "${checksum_image}" == "${checksum_chksumfile}" ]] +then + echo "Die Prüfsumme des Abbildes ist korrekt." + echo "" + lsblk + read -p "${format_red}Zielspeicher (z.B.: /dev/sdx): ${format_off}" device + sudo dd if="${iso_folder}${iso_file}" of=${device} bs=4M status=progress && sync +else + echo "Irgendwas ist schief gelaufen" +fi + ende + ;; + + m2|M2) + banner "Hauptmenü => Linux Distributionen => Linux Mint => Mate ${version} auf Ventoy Multiboot USB-Stick schreiben" +flavour="mate" +checksum_bin="/usr/bin/sha256sum" +iso_file="linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_file="linuxmint-${version}-${flavour}-64bit.iso.sha${sha}" + +checksum_image=$(${checksum_bin} "${linuxmint_iso_folder}${iso_file}" | awk '{print $1}') +checksum_chksumfile=$(grep "${iso_file}" "${linuxmint_iso_folder}${iso_file}.sha256" | grep -o "[a-z0-9]\{64\}") + +if test "${checksum_image}" -a "${checksum_chksumfile}" +then + checksum_ok="true" +else + checksum_ok="false" +fi + +if test -d "${ventoy_part}" +then + ventoy_part_ok="true" +else + ventoy_part_ok="false" +fi + +if test "${checksum_ok}" = "true" -a "${ventoy_part_ok}" = "true" +then + rsync -a -t -p -o -g -v --progress -u -s "${iso_folder}${iso_file}" "${ventoy_part}""${iso_file}" +else + echo "Ventoy USB-Stick ist nicht eingehangen oder die Prüsumme des Linux Mint Abbildes stimmt nicht!" +fi + ende + ;; + + + + c0|C0) + banner "Hauptmenü => Linux Distributionen => Linux Mint => Cinnamon ${version} herunterladen" +flavour="cinnamon" +checksum_bin="/usr/bin/sha256sum" +iso_url="https://ftp.fau.de/mint/iso/stable/${version}/linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_url="https://ftp.heanet.ie/mirrors/linuxmint.com/stable/${version}/sha${sha}sum.txt" +iso_file="linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_file="linuxmint-${version}-${flavour}-64bit.iso.sha${sha}" + +[[ -f "${linuxmint_iso_folder}linuxmint-${version}-${flavour}-64bit.iso" ]] || wget "https://ftp.fau.de/mint/iso/stable/${version}/linuxmint-${version}-${flavour}-64bit.iso" -P "${linuxmint_iso_folder}" +[[ -f "${linuxmint_iso_folder}linuxmint-${version}-${flavour}-64bit.iso.sha256" ]] || wget "https://ftp.heanet.ie/mirrors/linuxmint.com/stable/${version}/sha256sum.txt" -P "${linuxmint_iso_folder}" -O "linuxmint-${version}-${flavour}-64bit.iso.sha256" + +checksum_image=$(${checksum_bin} "${linuxmint_iso_folder}${iso_file}" | awk '{print $1}') +checksum_chksumfile=$(grep "${iso_file}" "${linuxmint_iso_folder}${iso_file}.sha256" | grep -o "[a-z0-9]\{64\}") + +if [[ "${checksum_image}" == "${checksum_chksumfile}" ]] +then + echo "Die Prüfsumme des Abbildes ist korrekt." +else + echo "Irgendetwas stimmt mit der Prüfsumme nicht!" +fi + ende + ;; + + c1|C1) + banner "Hauptmenü => Linux Distributionen => Linux Mint => Cinnamon ${version} auf USB-Stick schreiben" +flavour="cinnamon" +sha="256" +iso_url="https://ftp.fau.de/mint/iso/stable/${version}/linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_url="https://ftp.heanet.ie/mirrors/linuxmint.com/stable/${version}/sha${sha}sum.txt" +iso_file="linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_file="linuxmint-${version}-${flavour}-64bit.iso.sha${sha}" + +[[ -f "${iso_folder}""${iso_file}" ]] || wget "${iso_url}" -P "${iso_folder}" +[[ -f "${iso_folder}""${iso_checksum_file}" ]] || wget "${iso_checksum_url}" -P "${iso_folder}" -O "${iso_file}.sha${sha}" + +checksum_image=$(${checksum_bin} "${linuxmint_iso_folder}${iso_file}" | awk '{print $1}') +checksum_chksumfile=$(grep "${iso_file}" "${linuxmint_iso_folder}${iso_file}.sha256" | grep -o "[a-z0-9]\{64\}") + +if [[ "${checksum_image}" == "${checksum_chksumfile}" ]] +then + lsblk + read -p "${format_red}Zielspeicher (z.B.: /dev/sdx): ${format_off}" device + sudo dd if="${iso_folder}${iso_file}" of=${device} bs=4M status=progress && sync +else + echo "Irgendwas ist schief gelaufen" +fi + ende + ;; + + + + c2|C2) + banner "Hauptmenü => Linux Distributionen => Linux Mint => Cinnamon Edge ${version} herunterladen" +flavour="cinnamon" +chksm_alg="sha256" +iso_url="https://ftp.fau.de/mint/iso/stable/${version}/linuxmint-${version}-${flavour}-64bit-edge.iso" +iso_checksum_url="https://ftp.heanet.ie/mirrors/linuxmint.com/stable/${version}/${chksm_alg}sum.txt" +iso_file="linuxmint-${version}-${flavour}-64bit-edge.iso" +iso_checksum_file="${iso_file}.sha${sha}" + +[[ -f "${iso_folder}""${iso_file}" ]] || wget "${iso_url}" -P "${iso_folder}" +[[ -f "${iso_folder}""${iso_checksum_file}" ]] || wget "${iso_checksum_url}" -O "${iso_file}.sha${sha}" + +checksum_image=$(${checksum_bin} "${linuxmint_iso_folder}${iso_file}" | awk '{print $1}') +checksum_chksumfile=$(grep "${iso_file}" "${linuxmint_iso_folder}${iso_file}.sha256" | grep -o "[a-z0-9]\{64\}") + +if [[ "${checksum_image}" == "${checksum_chksumfile}" ]] +then + echo "Checksumme ist OK!" +else + echo "Irgendwas ist schief gelaufen" +fi + ende + ;; + + c3|C3) + banner "Hauptmenü => Linux Distributionen => Linux Mint => Cinnamon Edge ${version} auf USB-Stick schreiben" +flavour="cinnamon" +sha="256" +iso_url="https://ftp.fau.de/mint/iso/stable/${version}/linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_url="https://ftp.heanet.ie/mirrors/linuxmint.com/stable/${version}/sha${sha}sum.txt" +iso_file="linuxmint-${version}-${flavour}-64bit-edge.iso" +iso_checksum_file="linuxmint-${version}-${flavour}-64bit.iso.sha${sha}" + +checksum_image=$(sha${sha}sum "${iso_folder}"${iso_file} | awk '{print $1}') +checksum_chksumfile=$(grep "${flavour}" "${iso_folder}"${iso_checksum_file} | grep -o "[a-z0-9]\{64\}") + +if [[ "${checksum_image}" == "${checksum_chksumfile}" ]] +then + lsblk + read -p "${format_red}Zielspeicher (z.B.: /dev/sdx): ${format_off}" device + sudo dd if="${iso_folder}${iso_file}" of=${device} bs=4M status=progress && sync +else + echo "Irgendwas ist schief gelaufen" +fi + ende + ;; + + + + c4|C4) + banner "Hauptmenü => Linux Distributionen => Linux Mint => Cinnamon ${version} auf Ventoy Multiboot USB-Stick schreiben" +flavour="cinnamon" +checksum_bin="/usr/bin/sha256sum" +iso_file="linuxmint-${version}-${flavour}-64bit.iso" +iso_checksum_file="linuxmint-${version}-${flavour}-64bit.iso.sha${sha}" + +checksum_image=$(${checksum_bin} "${linuxmint_iso_folder}linuxmint-${version}-${flavour}-64bit.iso" | awk '{print $1}') +checksum_chksumfile=$(grep "${flavour}" "${linuxmint_iso_folder}linuxmint-${version}-${flavour}-64bit.iso.sha256" | grep -o "[a-z0-9]\{64\}") + +if test "${checksum_image}" -a "${checksum_chksumfile}" +then + checksum_ok="true" +else + checksum_ok="false" +fi + +if test -d "${ventoy_part}" +then + ventoy_part_ok="true" +else + ventoy_part_ok="false" +fi + +if test "${checksum_ok}" = "true" -a "${ventoy_part_ok}" = "true" +then + rsync -a -t -p -o -g -v --progress -u -s "${iso_folder}${iso_file}" "${ventoy_part}""${iso_file}" +else + echo "Ventoy USB-Stick ist nicht eingehangen oder die Prüsumme des Linux Mint Abbildes stimmt nicht!" +fi + + ende + ;; + + esac + ;; + +esac +;; + + + +################################################################################ +### WLAN ein-/ausschalten +################################################################################ + +w|W) +banner "Hauptmenü => WLAN ein-/ausschalten" + +if echo "${gl__wlanactive}" | grep "nicht verfügbar" &> /dev/null ; then + bannertitel="Hauptmenü => WLAN ein-/ausschalten => WLAN wird eingeschaltet" + banner + echo -e "WLAN ist ausgeschaltet und wird jetzt eingeschaltet. Das kann ein paar Sekunden dauern: \n" + nmcli radio wifi on + sleep 5 + nmcli device status | grep "DEVICE\|wifi" +else + bannertitel="Hauptmenü => WLAN ein-/ausschalten => WLAN wird ausgeschaltet" + banner + echo -e "WLAN ist eingeschaltet und wird jetzt ausgeschaltet. Das kann ein paar Sekunden dauern: \n" + nmcli radio wifi off + sleep 5 + nmcli device status | grep "DEVICE\|wifi" +fi + +ende +;; + + + +######################################################################## +### TON an/aus/leiser/lauter +######################################################################## + +b|B) +gl__lautstaerke=$(amixer | grep -o "\[off\]\|\[on\]" | head -1 | sed "s/\[//g" | sed "s/\]//g") +if [ ${gl__lautstaerke} = "off" ] ; then + amixer sset Master unmute +else + amixer sset Master mute +fi +export gl__lautstaerke +;; + +n|N) +amixer set Master 10%+ +;; + +v|V) +amixer set Master 10%- +;; + + + +################################################################################ +### Mikrofone ein-/ausschalten +################################################################################ + +m|M) +amixer set Capture toggle +;; + + + +################################################################################ +### Herunterfahren/Neustarten +################################################################################ + +r|R) +[[ -f /usr/sbin/shutdown ]] && shutdown_bin="/usr/sbin/shutdown" +[[ -f /usr/bin/shutdown ]] && shutdown_bin="/usr/bin/shutdown" + +banner "Hauptmenü => Herunterfahren/Neustarten" + +echo " ${gl__format_red}HERUNTERFAHREN${gl__format_off}" +echo " ${gl__format_red}==============${gl__format_off}" +echo " ${gl__format_red}| H1 |${gl__format_off} Sofort herunterfahren" +echo " ${gl__format_red}| H2 |${gl__format_off} In x Minuten herunterfahren" +echo " ${gl__format_red}| H3 |${gl__format_off} Um exakt xx:xx Uhr herunterfahren" +echo "" +echo " ${gl__format_red}NEUSTARTEN${gl__format_off}" +echo " ${gl__format_red}==========${gl__format_off}" +echo " ${gl__format_red}| N1 |${gl__format_off} Sofort neustarten" +echo " ${gl__format_red}| N2 |${gl__format_off} In x Minuten neustarten" +echo " ${gl__format_red}| N3 |${gl__format_off} Um exakt xx:xx Uhr neustarten" +echo "" +echo " ${gl__format_red}| C |${gl__format_off} Herunterfahren/Neustarten abbrechen" + +glf__please_choose + +read shutdownreboot + + case ${shutdownreboot} in + + h1|H1) + banner "Hauptmenü => Sofort Herunterfahren" + +${shutdown_bin} -P now + + ende + ;; + + + h2|H2) + banner "Hauptmenü => In x Minuten Herunterfahren" + +read -p "${gl__format_red}Bitte eine Ganzzahl eingeben (60 oder 65 oder ...) und ENTER drücken: ${gl__format_off}" minuten + +${shutdown_bin} -h ${minuten} + + ende + ;; + + + h3|H3) + banner "Hauptmenü => Um exakt xx:xx Herunterfahren" + +read -p "${gl__format_red}Bitte eine Ganzzahl eingeben (20:31 oder 23:59 oder...) und ENTER drücken: ${gl__format_off}" ssmm + +${shutdown_bin} -h ${ssmm} + + ende + ;; + + + n1|N1) + banner "Hauptmenü => Sofort Neustarten" + +${shutdown_bin} --reboot now + + ende + ;; + + + n2|N2) + banner "Hauptmenü => In x Minuten Neustarten" + +read -p "${gl__format_red}Bitte eine Ganzzahl eingeben (60 oder 65 oder ...) und ENTER drücken: ${gl__format_off}" minuten + +${shutdown_bin} -r +${minuten} + + ende + ;; + + + n3|N3) + banner "Hauptmenü => Um exakt xx:xx Neustarten" + +read -p "${gl__format_red}Bitte eine Ganzzahl eingeben (20:31 oder 23:59 oder...) und ENTER drücken: ${gl__format_off}" ssmm + +${shutdown_bin} -r ${ssmm} + + ende + ;; + + + c|C) + banner "Hauptmenü => Das geplante Herunterfahren/Neustarten abbrechen" + +${shutdown_bin} -c + + ende + ;; + + esac + +;; + + + +################################################################################ +### bHELPER aktualisieren +################################################################################ + +u|U) +banner "Hauptmenü => bHELPER aktualisieren" + +wget https://git.disroot.org/dingens/bHELPER/raw/branch/master/bHELPER.sh -O ~/.bHELPER/bHELPER.sh +wget https://git.disroot.org/dingens/bHELPER/raw/branch/master/bHELPER.png -O ~/.bHELPER/bHELPER.png +wget https://git.disroot.org/dingens/bHELPER/raw/branch/master/README.md -O ~/.bHELPER/README.md + +ende +;; + + + +################################################################################ +### Debug +################################################################################ + +debug) +banner "Hauptmenü => Debug" + +bash + +;; + + + +################################################################################ +### Einstellungen +################################################################################ + +e|E) +[[ -d "${gl__config_folder}" ]] || mkdir -p "${gl__config_folder}" +[[ -f "${gl__config_file}" ]] || touch "${gl__config_file}" + +banner "Hauptmenü => Einstellungen" + +unset desktopiconautom_status +grep -q "desktopiconautom=no" "${gl__config_file}" && desktopiconautom_status="$(echo "${gl__format_red}[ausgeschaltet]${gl__format_off}")" +grep -q "desktopiconautom=no" "${gl__config_file}" || desktopiconautom_status="$(echo "${gl__format_green}[eingeschaltet]${gl__format_off}")" +echo " ${gl__format_red}| 0 |${gl__format_off} Automatische Erstellung des Desktop Icons ${desktopiconautom_status}" + +echo " ${gl__format_red}| E |${gl__format_off} Dieses Skript editieren" + +glf__please_choose + +read einstellungen + + case ${einstellungen} in + + 0) + banner "Hauptmenü => Einstellungen => Automatisches Erstellung des Desktop Icons" + +if [[ "${desktopiconautom_status}" =~ .*eingeschaltet.* ]] ; then +grep -q "desktopiconautom=" "${gl__config_file}" &>/dev/null || echo "desktopiconautom=no" >> "${gl__config_file}" +sed -i "s/^desktopiconautom=.*$/desktopiconautom=no/" "${gl__config_file}" +fi + +if [[ "${desktopiconautom_status}" =~ .*ausgeschaltet.* ]] ; then +grep -q "desktopiconautom=" "${gl__config_file}" &>/dev/null || echo "desktopiconautom=yes" >> "${gl__config_file}" +sed -i "s/^desktopiconautom=.*$/desktopiconautom=yes/" "${gl__config_file}" +fi + + banner "Hauptmenü => Einstellungen => Automatisches Erstellung des Desktop Icons" +grep -q "desktopiconautom=no" "${gl__config_file}" &>/dev/null && echo "Die Automatische Erstellung des Desktop Icons wurde ${gl__format_red}[ausgeschaltet]${gl__format_off}" +grep -q "desktopiconautom=yes" "${gl__config_file}" &>/dev/null && echo "Die Automatische Erstellung des Desktop Icons wurde ${gl__format_green}[eingeschaltet]${gl__format_off}" + ende + ;; + + e|E) +rm "${0}".dasi10 2> /dev/null +cp "${0}".dasi09 "${0}".dasi10 2> /dev/null +cp "${0}".dasi08 "${0}".dasi09 2> /dev/null +cp "${0}".dasi07 "${0}".dasi08 2> /dev/null +cp "${0}".dasi06 "${0}".dasi07 2> /dev/null +cp "${0}".dasi05 "${0}".dasi06 2> /dev/null +cp "${0}".dasi04 "${0}".dasi05 2> /dev/null +cp "${0}".dasi03 "${0}".dasi04 2> /dev/null +cp "${0}".dasi02 "${0}".dasi03 2> /dev/null +cp "${0}".dasi01 "${0}".dasi02 2> /dev/null +cp "${0}" "${0}".dasi01 2> /dev/null +nohup ${gl__fav_editor} "${0}" & + ;; + + esac + +;; + +esac + +. "${gl__SkriptPfadName}" && exit 0 diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..96e0c4b --- /dev/null +++ b/install.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# Version: 2022-09-16 00:35 + +[[ -d ${HOME}/.bHELPER/ ]] || mkdir ~/.bHELPER +wget https://git.disroot.org/dingens/bHELPER/raw/branch/master/bHELPER.sh -O ~/.bHELPER/bHELPER.sh +wget https://git.disroot.org/dingens/bHELPER/raw/branch/master/bHELPER.png -O ~/.bHELPER/bHELPER.png