#!/usr/bin/env bash SkriptVersion="2021-05-18 00:00" gl_SkriptName=$(basename "${0}") gl__SkriptPfadName=$(cd "$(dirname "${0}")"; pwd -P)/$(basename "${0}") gl_SkriptOrdner=$(cd "$(dirname "${0}")"; pwd -P)/ gl__nmcli_dev_status="${0}.nmcli_dev_status.tmp" && nmcli dev status > ${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') [[ -d ${HOME}/Desktop/ ]] && gl__desktop_vz=Desktop/ [[ -d ${HOME}/Schreibtisch/ ]] && gl__desktop_vz=Schreibtisch/ ################################################################################ ### Desktop Icon ################################################################################ if grep "^desktopiconautom=yes" "${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__bittewaehlen=$(echo " ${gl__format_red}Bitte wählen und ENTER drücken!${gl__format_off}") function ausgefuehrte_syntax { echo -e "${gl__format_red}► Ausgeführte Syntax:${gl__format_off} \n ${1}" } ################################################################################ ### 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 "RPM.*$" | awk '{print $5}') ### 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}') 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 pacmd_mic_mute { pacmd list-sources | grep "alsa_input" | sed -e "s/name: //g" -e "s/^[ \t]*//;s/[ \t]*$//" | xargs -I{} pactl set-source-mute {} yes } function pacmd_mic_unmute { pacmd list-sources | grep "alsa_input" | sed -e "s/name: //g" -e "s/^[ \t]*//;s/[ \t]*$//" | xargs -I{} pactl set-source-mute {} no } function pacmd_mic_status { pacmd list-sources | grep "index:\|device.string\|name:\|muted" | grep -B1 -A1 "alsa_input" | grep -o "muted: .*$" | uniq | sed "s/muted: //g" | grep yes &> /dev/null && gl__pacmd_mic_mutestatus="aus" || gl__pacmd_mic_mutestatus="an" } pacmd_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__pacmd_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}888(8b. 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} ${bannertitel} ${gl__format_off}" echo ""; echo "" } function pause { echo -e "" echo -e "" read -p "${gl__format_red}Drücke ENTER um weiterzumachen${gl__format_off}" } function ende { echo -e "" echo -e "" read -p "${gl__format_red}Drücke ENTER um weiterzumachen${gl__format_off}" } function endedasi { echo -e "" echo -e "" read -p "${gl__format_red}Das Verzeichnis existiert nicht. Tschüss!${gl__format_off}" exit } clear bannerstart echo "" echo "" 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" if [[ ${XDG_CURRENT_DESKTOP} =~ .*KDE.* ]] then echo " ${gl__format_red}| K |${gl__format_off} KDE Plasma" fi echo "" echo "" 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" echo "" echo "${gl__bittewaehlen}" read hauptmenue case ${hauptmenue} in ################################################################################ ### Bildschirm sperren ################################################################################ x|X) if [[ ${XDG_CURRENT_DESKTOP} =~ .*KDE.* ]] then dbus-send --type=method_call --dest=org.kde.screensaver /ScreenSaver org.freedesktop.ScreenSaver.Lock fi if [[ ${WINDOWMANAGER} =~ .*xfce.* ]] then xscreensaver-command -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) bannertitel="Hauptmenü => Hardware" banner echo " ${gl__format_red}| 0 |${gl__format_off} Hardwareinformationen eures Rechners (dmidecode)" echo " ${gl__format_red}| 1 |${gl__format_off} Hardwareinformationen eures 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" echo " ${gl__format_red}| X1 |${gl__format_off} xrandr - Externer Bildschirm (HDMI-1) EIN und Laptop Bildschirm (LVDS-1) AUS" echo "" echo "${gl__bittewaehlen}" 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) bannertitel="Hauptmenü => Hardware => Hardwareinformationen eures Rechners (inxi)" banner inxi -Fxz ende ;; b|B) [[ -f /usr/sbin/rfkill ]] && rfkill_bin="/usr/sbin/rfkill" [[ -f /usr/bin/rfkill ]] && rfkill_bin="/usr/bin/rfkill" bannertitel="Hauptmenü => Hardware => Bluetooth" banner ausgefuehrte_syntax " systemctl status bluetooth.service" echo "${gl__ausgabe_anfang}" systemctl status bluetooth.service echo "${gl__ausgabe_ende}" echo "" echo "" ausgefuehrte_syntax " journalctl -o short-iso --no-pager -u bluetooth.service" echo "${gl__ausgabe_anfang}" journalctl -o short-iso --no-pager -u bluetooth.service echo "${gl__ausgabe_ende}" echo "" echo "" ausgefuehrte_syntax " bluetooth --help" echo "${gl__ausgabe_anfang}" bluetooth --help echo "${gl__ausgabe_ende}" echo "" echo "" ausgefuehrte_syntax " rfkill list bluetooth" echo "${gl__ausgabe_anfang}" ${rfkill_bin} list bluetooth echo "${gl__ausgabe_ende}" echo "" echo "" ausgefuehrte_syntax " inxi --bluetooth" echo "${gl__ausgabe_anfang}" inxi --bluetooth echo "${gl__ausgabe_ende}" ende ;; a|A) bannertitel="Hauptmenü => Hardware => Akkuinformationen eures Laptops (upower, inxi)" banner ausgefuehrte_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}" echo "" echo "" ausgefuehrte_syntax " inxi --battery" echo "${gl__ausgabe_anfang}" inxi --battery echo "${gl__ausgabe_ende}" ende ;; xk|XK) bannertitel="Hauptmenü => Hardware => Bildschirmkonfigurieren (xrandr)" banner echo "${gl__format_red}► Alle aktiven Monitoranschlüsse:${gl__format_off}" echo "${gl__ausgabe_anfang}" xrandr --listactivemonitors echo "${gl__ausgabe_ende}" echo "" echo "${gl__format_red}► Alle vorhandene Monitoranschlüsse:${gl__format_off}" echo "${gl__ausgabe_anfang}" xrandr --listproviders echo "${gl__ausgabe_ende}" echo "" echo "${gl__format_red}► Komplette Ausgabe:${gl__format_off}" echo "${gl__ausgabe_anfang}" xrandr echo "${gl__ausgabe_ende}" ende ;; esac ;; ################################################################################ ### Software ################################################################################ s|S) bannertitel="Hauptmenü => Software" banner echo " ${gl__format_red}Paketverwaltungen:${gl__format_off}" grep "Tumbleweed\|Ubuntu\|Manjaro" /etc/os-release &> /dev/null && echo " ${gl__format_red}| L |${gl__format_off} Linux Distribution aktualisieren" [[ -f /usr/bin/flatpak ]] && echo " ${gl__format_red}| F |${gl__format_off} Flatpak" [[ -f /usr/bin/zypper ]] && echo " ${gl__format_red}| C |${gl__format_off} Alle nicht gepatchten CVEs auflisten" echo "" echo " ${gl__format_red}Programme:${gl__format_off}" echo " ${gl__format_red}| P |${gl__format_off} Software installieren, Informationen ausgeben lassen, ..." echo "" echo "${gl__bittewaehlen}" read software case ${software} in l|L) bannertitel="Hauptmenü => Software => Paketverwaltung => Linux Distribution aktualisieren" banner if grep "openSUSE Tumbleweed" /etc/os-release &> /dev/null ; then echo "${gl__format_cyanlight}●【Daten der Reporitories aktualisieren】${gl__format_off}" ausgefuehrte_syntax " sudo zypper refresh" echo "${gl__ausgabe_anfang}" sudo zypper refresh echo "${gl__ausgabe_ende}" echo "" echo "" echo "${gl__format_cyanlight}●【Anstehende Aktualisierungen anzeigen】${gl__format_off}" ausgefuehrte_syntax " zypper list-updates" echo "${gl__ausgabe_anfang}" zypper list-updates echo "${gl__ausgabe_ende}" echo "" echo "" echo "${gl__format_cyanlight}●【Aktualisierungen installieren】${gl__format_off}" ausgefuehrte_syntax " sudo zypper dup" echo "${gl__ausgabe_anfang}" sudo zypper dup echo "${gl__ausgabe_ende}" echo "" fi if grep -i "ubuntu" /etc/os-release &> /dev/null ; then echo "${gl__ausgabe_anfang}" sudo apt update sudo apt upgrade -y echo "${gl__ausgabe_ende}" echo "" ausgefuehrte_syntax " sudo apt update \n sudo apt upgrade -y" fi if grep -i "Manjaro" /etc/os-release &> /dev/null ; then echo "${gl__ausgabe_anfang}" sudo pacman -Suy echo "${gl__ausgabe_ende}" echo "" ausgefuehrte_syntax " sudo pacman -Suy" fi ende ;; f|F) bannertitel="Hauptmenü => Software => Flatpak" banner echo " ${gl__format_red}| U |${gl__format_off} Installierte Pakete aktualisieren" echo " ${gl__format_red}| L |${gl__format_off} Installierte Pakete auflisten" echo " ${gl__format_red}| S |${gl__format_off} Programme suchen" echo " ${gl__format_red}| I |${gl__format_off} Programme installieren" echo " ${gl__format_red}| R |${gl__format_off} Programme deinstallieren" echo " ${gl__format_red}| G |${gl__format_off} Ungenutzter Pakete deinstallieren" echo "" echo "${gl__bittewaehlen}" read flatpak case ${flatpak} in u|U) bannertitel="Hauptmenü => Software => Flatpak => Installierte Pakete aktualisieren" banner echo "${gl__ausgabe_anfang}" sudo /usr/bin/flatpak update echo "${gl__ausgabe_ende}" echo "" ausgefuehrte_syntax " sudo flatpak update" ende ;; l|L) bannertitel="Hauptmenü => Software => Flatpak => Installierte Pakete auflisten" banner echo "${gl__format_cyanlight}●【${gl__format_off}${gl__format_red}Detaillierte Liste aller installierten Pakete${gl__format_off}${gl__format_cyanlight}】${gl__format_off}" echo "${gl__ausgabe_anfang}" /usr/bin/flatpak list --show-details echo "${gl__ausgabe_ende}" ausgefuehrte_syntax " flatpak list --show-details" echo "" echo "" echo "${gl__format_cyanlight}●【${gl__format_off}${gl__format_red}Liste aller installierten Pakete${gl__format_off}${gl__format_cyanlight}】${gl__format_off}" echo "${gl__ausgabe_anfang}" /usr/bin/flatpak list echo "${gl__ausgabe_ende}" ausgefuehrte_syntax " flatpak list" echo "" echo "" echo "${gl__format_cyanlight}●【${gl__format_off}${gl__format_red}Detaillierte Liste aller installierten Programme${gl__format_off}${gl__format_cyanlight}】${gl__format_off}" echo "${gl__ausgabe_anfang}" /usr/bin/flatpak list --app --show-details echo "${gl__ausgabe_ende}" ausgefuehrte_syntax " flatpak list --app --show-details" echo "" echo "" echo "${gl__format_cyanlight}●【${gl__format_off}${gl__format_red}Liste aller installierten Programme${gl__format_off}${gl__format_cyanlight}】${gl__format_off}" echo "${gl__ausgabe_anfang}" /usr/bin/flatpak list --app echo "${gl__ausgabe_ende}" ausgefuehrte_syntax " flatpak list --app" ende ;; g|G) bannertitel="Hauptmenü => Software => Flatpak => Ungenutzter Pakete deinstallieren auflisten" banner echo "${gl__ausgabe_anfang}" sudo /usr/bin/flatpak uninstall --unused echo "${gl__ausgabe_ende}" echo "" ausgefuehrte_syntax " sudo flatpak uninstall --unused" ende ;; s|S) bannertitel="Hauptmenü => Software => Flatpak => Programme suchen" banner read -p "${gl__format_red}Suchtext eigeben: ${gl__format_off}" search banner echo "${gl__format_cyanlight}●【${gl__format_off}${gl__format_red}Programme suchen${gl__format_off}${gl__format_cyanlight}】${gl__format_off}" echo "${gl__ausgabe_anfang}" /usr/bin/flatpak search ${search} echo "${gl__ausgabe_ende}" ausgefuehrte_syntax " flatpak search ${search}" ende ;; i|I) bannertitel="Hauptmenü => Software => Flatpak => Programme installieren" banner read -p "${gl__format_red}Suchtext eigeben: ${gl__format_off}" search banner echo "${gl__format_cyanlight}●【${gl__format_off}${gl__format_red}Programme installieren${gl__format_off}${gl__format_cyanlight}】${gl__format_off}" echo "${gl__ausgabe_anfang}" /usr/bin/flatpak search ${search} echo "${gl__ausgabe_ende}" ausgefuehrte_syntax " flatpak search ${search}" echo "" echo "" read -p "${gl__format_red}Application ID eigeben: ${gl__format_off}" applicationid banner echo "${gl__format_cyanlight}●【${gl__format_off}${gl__format_red}Programme installieren${gl__format_off}${gl__format_cyanlight}】${gl__format_off}" echo "${gl__ausgabe_anfang}" sudo /usr/bin/flatpak install ${applicationid} echo "${gl__ausgabe_ende}" ausgefuehrte_syntax " sudo flatpak install ${applicationid}" ende ;; r|R) bannertitel="Hauptmenü => Software => Flatpak => Programme deinstallieren" banner echo "${gl__format_cyanlight}●【${gl__format_off}${gl__format_red}Detaillierte Liste aller installierten Programme${gl__format_off}${gl__format_cyanlight}】${gl__format_off}" echo "${gl__ausgabe_anfang}" /usr/bin/flatpak list --app --show-details echo "${gl__ausgabe_ende}" ausgefuehrte_syntax " flatpak list --app --show-details" echo "" echo "" read -p "${gl__format_red}Application ID eigeben: ${gl__format_off}" applicationid banner echo "${gl__format_cyanlight}●【${gl__format_off}${gl__format_red}Programme deinstallieren${gl__format_off}${gl__format_cyanlight}】${gl__format_off}" echo "${gl__ausgabe_anfang}" sudo /usr/bin/flatpak uninstall ${applicationid} echo "${gl__ausgabe_ende}" ausgefuehrte_syntax " sudo flatpak uninstall ${applicationid}" ende ;; g|G) bannertitel="Hauptmenü => Software => Flatpak => Ungenutzter Pakete deinstallieren auflisten" banner echo "${gl__ausgabe_anfang}" sudo /usr/bin/flatpak uninstall --unused echo "${gl__ausgabe_ende}" echo "" ausgefuehrte_syntax " sudo flatpak uninstall --unused" ende ;; esac ;; c|C) bannertitel="Hauptmenü => Software => Paketverwaltung => Alle nicht gepatchten CVEs auflisten" banner if [ -f /usr/bin/zypper ] ; then echo "${gl__ausgabe_anfang}" sudo zypper refresh zypper list-patches --cve echo "${gl__ausgabe_ende}" echo "" ausgefuehrte_syntax " sudo zypper refresh \n zypper list-patches --cve" fi ende ;; p|P) bannertitel="Hauptmenü => Software => Programme" banner echo " ${gl__format_cyanlight}●${gl__format_off} Mozilla Thunderbird ${gl__format_red}| T0 |${gl__format_off} Informationen ${gl__format_red}| TI |${gl__format_off} Installation" echo "" ; echo "" echo "${gl__bittewaehlen}" read programme case ${programme} in t0|T0) bannertitel="Hauptmenü => Software => Programme => Mozilla Thunderbird (Infos)" banner ausgefuehrte_syntax " thunderbird --version" echo "${gl__ausgabe_anfang}" [[ -f /usr/bin/thunderbird ]] && thunderbird --version echo "${gl__ausgabe_ende}" if [ -f "/usr/bin/zypper" ]; then echo "" ausgefuehrte_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 "" ausgefuehrte_syntax " pacman -Q | grep thunderbird" echo "${gl__ausgabe_anfang}" [[ -f /usr/bin/pacman ]] && pacman -Q | grep thunderbird echo "${gl__ausgabe_ende}" fi ende ;; ti|TI) bannertitel="Hauptmenü => Software => Programme => Mozilla Thunderbird installieren" banner if [ -f "/usr/bin/zypper" ]; then echo "" ausgefuehrte_syntax " sudo zypper in MozillaThunderbird" echo "${gl__ausgabe_anfang}" sudo zypper in MozillaThunderbird echo "${gl__ausgabe_ende}" fi if grep -i "ubuntu\|mint" /etc/os-release &> /dev/null ; then echo "${gl__ausgabe_anfang}" sudo apt install thunderbird sudo apt upgrade -y echo "${gl__ausgabe_ende}" echo "" ausgefuehrte_syntax " sudo apt update \n sudo apt upgrade -y" fi ende ;; esac ;; esac ;; ################################################################################ ### Netzwerk ################################################################################ i|I) bannertitel="Hauptmenü => Netzwerk" banner echo " ${gl__format_red}| A |${gl__format_off} Allgemeine Informationen" echo " ${gl__format_red}| W |${gl__format_off} WLAN Informationen" echo "" echo "${gl__bittewaehlen}" read netzwerk case ${netzwerk} in a|A) bannertitel="Hauptmenü => Netzwerk => WLAN Informationen" banner ausgefuehrte_syntax " ip address show" echo "${gl__ausgabe_anfang}" ip address show echo "${gl__ausgabe_ende}" echo "" echo "" ausgefuehrte_syntax " route -n" echo "${gl__ausgabe_anfang}" route -n echo "${gl__ausgabe_ende}" echo "" ausgefuehrte_syntax " route" echo "${gl__ausgabe_anfang}" route 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" bannertitel="Hauptmenü => Netzwerk => WLAN Informationen" banner ausgefuehrte_syntax " rfkill list wifi" echo "${gl__ausgabe_anfang}" ${rfkill_bin} list wifi echo "${gl__ausgabe_ende}" echo "" ausgefuehrte_syntax " inxi --network" echo "${gl__ausgabe_anfang}" inxi --network echo "${gl__ausgabe_ende}" ende ;; esac ;; ################################################################################ ### Dateien & Verzeichnisse ################################################################################ f|F) bannertitel="Hauptmenü => Dateien & Verzeichnisse" banner 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 "" echo "${gl__bittewaehlen}" read software case ${software} in g|G) bannertitel="Hauptmenü => Dateien & Verzeichnisse => Die 10 größten Dateien" banner find ${HOME} -type f -print0 | xargs -0 du -h | sort -hr | head -10 ende ;; f|F) bannertitel="Hauptmenü => Dateien & Verzeichnisse => Nach Dateien und Verzeichnissen suchen" banner 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 ;; esac ;; ######################################################################## ### KDE ######################################################################## k|K) bannertitel="Hauptmenü => KDE" banner 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 "" echo "${gl__bittewaehlen}" read -n 2 kde case ${kde} in en|EN) nohup kcmshell5 powerdevilprofilesconfig & ;; ae|AE) nohup kcmshell5 kscreen & ;; sl|SL) nohup kcmshell5 screenlocker & ;; si|SI) nohup kcmshell5 kcm_smserver & ;; kw|KW) nohup kcmshell5 kwinrules & ;; ek|EK) nohup kcmshell5 khotkeys & ;; esac ;; ################################################################################ ### WLAN ein-/ausschalten ################################################################################ w|W) bannertitel="Hauptmenü => WLAN ein-/ausschalten" banner 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) pacmd_mic_status if [ "${gl__pacmd_mic_mutestatus}" == "an" ]; then pacmd_mic_mute else pacmd_mic_unmute fi ;; ################################################################################ ### bHELPER aktualisieren ################################################################################ u|U) bannertitel="Hauptmenü => bHELPER aktualisieren" banner rm /tmp/bHELPER-*.zip bHELPER_zip=$(mktemp /tmp/bHELPER-XXXXXXXXX.zip) cd ~ rm -rf ~/.bHELPER/ wget -O ${bHELPER_zip} https://git.disroot.org/dingens/bHELPER/archive/master.zip unzip -d ~/ ${bHELPER_zip} mv ~/bhelper/ ~/.bHELPER/ ende ;; ################################################################################ ### Einstellungen ################################################################################ e|E) [[ -d "${gl__config_folder}" ]] || mkdir -p "${gl__config_folder}" [[ -f "${gl__config_file}" ]] || touch "${gl__config_file}" bannertitel="Hauptmenü => Einstellungen" banner unset desktopiconautom_status grep "desktopiconautom=no" "${gl__config_file}" &> /dev/null && desktopiconautom_status="$(echo "${gl__format_red}[ausgeschaltet]${gl__format_off}")" grep "desktopiconautom=no" "${gl__config_file}" &> /dev/null || 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" echo "" echo "" echo "${gl__bittewaehlen}" read einstellungen case ${einstellungen} in 0) bannertitel="Hauptmenü => Einstellungen => Automatisches Erstellung des Desktop Icons" banner if [[ "${desktopiconautom_status}" =~ .*eingeschaltet.* ]] ; then grep "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 "desktopiconautom=" "${gl__config_file}" &> /dev/null || echo "desktopiconautom=yes" >> "${gl__config_file}" sed -i "s/^desktopiconautom=.*$/desktopiconautom=yes/" "${gl__config_file}" fi banner grep "desktopiconautom=no" "${gl__config_file}" &> /dev/null && echo "Die Automatische Erstellung des Desktop Icons wurde ${gl__format_red}[ausgeschaltet]${gl__format_off}" grep "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 rm /home/${USER}/nohup.out 2> /dev/null rm "${0}".*.tmp 2> /dev/null . "${gl__SkriptPfadName}" && exit 0