"install and setup pc.sh" bashscript

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
motoryzen
Level 10
Level 10
Posts: 3497
Joined: Sun Dec 08, 2019 12:25 am

"install and setup pc.sh" bashscript

Post by motoryzen »

My Mission = a script that does as close to 100% of the setup work ( all the keyboard presses...mouse clicks. specific settings changing commands, copy/pasting back important stuff and to exact locations..etc ) I'd have to do the old fashion ways -manually.... automatically for me saving literally days to two weeks worth of work. This is for when it comes time to install either LM21.x or whatever ends up being the newest LM major version by the time I'm done with this script in the future.

It doesn't matter to me how I must launch/run it

From my immediate memory I keep encountered a few potholes I have to manually intervene ( such as something that says " Press enter to continue or ctrl+c to exit " with to keep the script going.

I know another odd temp dead-end I've encountered is trying to include the segoe-fonts-installer deal

Here's the file I have so far.

Code: Select all

#!/bin/bash

#1   😶️don't nuke LIBDRM-NOUVEAU2 package🤔️.  <<< THIS..IS ESSENTIAL for some games that rely on wine/lutris such as the Prince of Persia games, Medal of Honor L.E. and probably more ..confirmed 3-22-23 evening time!!  

#2 Copy the fstab backup file back to /etc folder

#3.  manually via gnome-disks or another thoroughly instructed method mount all other drives you plan to keep connected at all times...FIRST..before doing anything. 
# 16TB toshiba ( hdd )
# goPro 1TB Backup  ( 1 tb samsung ssd
# sdb1 rsyncbackup  ( it's a 4TB samsung ssd

sudo apt-get update -yy
sudo apt install xdotool -yy

#  In Disks application.  on each drive select the vertical 3 dots menu in upper right, then " Drive settings ' , and enable Write Caching.  This will prevent the stupid 16TB HDD from going to sleep also  #  do this manually/gui way

# xdotool,also let's keep clipboard and cutbuffer ( when mouse right clicks to select copy n paste cut n paste), and other useful little tools
apt install gedit -yy autocutsel dialog screenruler dconf-editor

# We need git and let's add solitaire as well
apt-get install git -yy aisleriot

# Now to install as much as all of the non-gaming software as software I can
apt-get install aptitude -yy brasero audacious audacity mediainfo-gui vlc obs-studio imwheel libvulkan1 libvulkan-dev hardinfo gimp gparted ffmpeg numlockx

# Next..nuke some bs
apt-get remove celluloid -yy xed evolution-common bluez samba-libs samba-common samba-common-bin evolution gnome-video-effects bluez-obexd bluez-cups neofetch openvpn

#Let's disable/remove some bs services
systemctl stop systemd-networkd.service
systemctl disable systemd-networkd.service
apt-get remove networkd-dispatcher -yy
systemctl stop ModemManager.service
systemctl disable ModemManager.service
apt-get remove ModemManager.service -yy
systemctl stop motd-news.timer
systemctl disable motd-news.timer
rfkill block bluetooth

# ==  Don'T Forget To Do Tune2fs -M 1 /Dev/Drivenameingnome-Disks ( For Example.  Tune2fs -M 1 /Dev/drivename that usually looks like sdb1 or sdc1 or sdd1
sudo tune2fs -m 1 /dev/nvme01p3

#  Let's get access to a lot of fonts
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true |  debconf-set-selections
apt-get install ttf-mscorefonts-installer -yy

#  Let's tell linux to use the BIOS's time which is local and NOT use UTC time
timedatectl set-local-rtc 1 --adjust-system-clock

# Sound " Pop and click " fix.  Set sound card to stay powered on all the time:
bash -c "echo 'options snd-hda-intel power_save=0 power_save_controller=N' \
>> /etc/modprobe.d/alsa-base.conf"

# Mkvtoolnix to edit in or out subtitles and audio files of movies
sh -c 'echo "deb http://mkvtoolnix.download/ubuntu/$(lsb_release -sc)/ ./" >> /etc/apt/sources.list.d/bunkus.org.list'
wget -q -O - https://mkvtoolnix.download/gpg-pub-moritzbunkus.txt |  apt-key add - OK
apt-get update -qq
apt-get install mkvtoolnix mkvtoolnix-gui -yy

# Google Chrome install time
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
gdebi -n google-chrome-stable_current_amd64.deb
rm -f google-chrome-stable_current_amd64.deb
apt-get update -yy

# Youtube dl- gui install time
wget http://ubuntu.mirrors.tds.net/ubuntu/pool/universe/t/twodict/python-twodict_1.2-1_all.deb
apt-get install ./python-twodict_1.2-1_all.deb -y
wget http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu/pool/main/y/youtube-dlg/youtube-dlg_0.4-1~webupd8~disco0_all.deb
apt-get install ./youtube-dlg_0.4-1~webupd8~disco0_all.deb -yy
apt-get install youtube-dl -yy
cd ~

fc-cache -fv

#  Let's ensure we have permisions editing access to all flatpak applications
flatpak install com.github.tchx84.Flatseal -yy

# Installs Makemkv
flatpak install flathub com.makemkv.MakeMKV -yy

# Time to install handbrake
apt install handbrake -yy

# Swappiness adjustment   the command at the line below simply ADDS that info in quotes to the /etc/sysctl.conf file to the absolutely last line in it
echo "vm.swappiness=5" >> "/etc/sysctl.conf"       
xdotool type "moto"
xdotool sleep 0.2 key Return
xdotool sleep 0.25 type "exit"
xdotool sleep 0.2 key Return

# Time to install openshot video editor
add-apt-repository ppa:openshot.developers/ppa
apt-get update
apt-get install openshot-qt -yy

# Time to install Teamviewer  which is a remote desktop software
wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
apt-get install ./teamviewer_amd64.deb -yy

# time to install wine
dpkg --add-architecture i386
mkdir -pm755 /etc/apt/keyrings
wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
apt update
apt install --install-recommends winehq-stable -yy
apt install --install-recommends winehq-staging -yy
apt install winetricks -yy

  #  ====   don't forget to run " winecfg" in terminal manually after this is all done and click Ok to close that little window if needs be

#  Now to install Lutris
add-apt-repository ppa:lutris-team/lutris
apt update
apt install lutris -yy

#  Let's install a few simple games and some emulators.... rpcs3 is a ps3 emulator, duckstation is ps1, pcsx2 is ps2, flycast is sega dreamcast, dolphin is nintendo gamecube and wii
apt-get update 
apt-get install neverputt -yy xboxdrv wesnoth supertuxkart steam aisleriot extremetuxracer beneath-a-steel-sky stella njam
apt-get update

# flatpak install flathub net.rpcs3.RPCS3 -yy
# flatpak install flathub org.mamedev.MAME -yy
# flatpak install flathub org.duckstation.DuckStation -yy
# flatpak install flathub com.retrodev.blastem -yy
# flatpak install flathub com.snes9x.Snes9x -yy
# flatpak install flathub app.xemu.xemu -yy
# flatpak install flathub net.pcsx2.PCSX2 -yy
# flatpak install flathub org.flycast.Flycast -yy
# flatpak install flathub org.DolphinEmu.dolphin-emu -yy

#   >>>    ONLY  run the above 9 lines of commands IF none or some of them aren't showing as installed when you run the rsync command at line 185  >>>>>>>>

# Let's give our mouse with side buttons some life
apt-get install ratbagd -yy piper

# Last I checked..My sight and my hearing were working fine.  Let's nuke some unneeded nonsense
apt-get remove orca speech-dispatcher -yy
xdotool sleep 5 key Return
apt autoclean

#   3rd party applcations' icons back to /usr/share/icons folder
chown -R taco:taco '/mnt/GoPro 1TB Backup/System file icons backup 4-9-23 that go into slash usr slash share slash icons/' && chmod 777 '/mnt/GoPro 1TB Backup/System file icons backup 4-9-23 that go into slash usr slash share slash icons/'
xdotool sleep 5 type "moto"
xdotool sleep 0.3 key Return
chown -R taco:taco  '/usr/share/icons' && chmod 777 '/usr/share/icons'
cp -a '/mnt/GoPro 1TB Backup/System file icons backup 4-9-23 that go into slash usr slash share slash icons/.' '/usr/share/icons/'

# Now let's paste over Bin Etc Sbin Usr and Var folders content
cp -a '/mnt/GoPro 1TB Backup/Bin Etc Sbin Usr and Var folder backup folders/slash Bin backup folder content 3-28-23/.' '/bin/'
cp -a '/mnt/GoPro 1TB Backup/Bin Etc Sbin Usr and Var folder backup folders/slash Etc backup folder contents 3-28-23/.' '/etc/'
cp -a '/mnt/GoPro 1TB Backup/Bin Etc Sbin Usr and Var folder backup folders/slash Lib64 backup folder contents 3-28-23/.' '/lib64/'
cp -a '/mnt/GoPro 1TB Backup/Bin Etc Sbin Usr and Var folder backup folders/slash Lib backup folder contents 3-28-23/.' '/lib/'
cp -a '/mnt/GoPro 1TB Backup/Bin Etc Sbin Usr and Var folder backup folders/slash Sbin backup folder contents 3-28-23/.' '/sbin/'
cp -a '/mnt/GoPro 1TB Backup/Bin Etc Sbin Usr and Var folder backup folders/slash Sys backup folder contents 3-28-23/.' '/sys/'
cp -a '/mnt/GoPro 1TB Backup/Bin Etc Sbin Usr and Var folder backup folders/slash usr backup folder contents 3-28-23/.' '/usr/'
cp -a '/mnt/GoPro 1TB Backup/Bin Etc Sbin Usr and Var folder backup folders/slash Var backup folder contents 3-28-23/.' '/var/'
cp -a '/mnt/GoPro 1TB Backup/Bin Etc Sbin Usr and Var folder backup folders/slash opt backup folder contents 3-28-23/.' '/opt/'

#  Now to run the game and movie icon restoration bashscripts and refresh the movie and game shortcuts folders
/home/taco/bashscripts/gameiconrestoration.sh
/home/taco/bashscripts/movieiconrstoration.sh

xdotool sleep 3 key super+e sleep 0.25 key g sleep 0.1 key a key m sleep 0.1 key e key space sleep 0.1 key s sleep 0.12 key Return sleep 0.75 key F5 sleep 1 key ctrl+w
xdotool sleep 12 key super+e keydown super sleep 0.15 key Left key Up sleep 0.2 keyup super sleep 0.15 key alt+b sleep 0.15 key End sleep 0.15 key Return sleep 0.75 key F5 sleep 12 key ctrl+w

# ...Time format fix
date -d 'TZ=America/Chicago' date
xdotool mousemove 3800 2140 sleep 0.18 click 3 sleep 0.1 key Down key Down sleep 0.15 key Return sleep 0.15 mousemove 2190 990 sleep 0.13 click 1 mousemove 2160 1045 sleep 0.15 click --repeat 3 1 key BackSpace sleep 0.15 key percent key A sleep 0.1 key comma sleep 0.1 key space key percent sleep 0.1 key b key space sleep 0.1 key percent sleep 0.1 key e key comma sleep 0.1 key space sleep 0.1 key percent key I sleep 0.1 key colon sleep 0.1 key percent key M
xdotool sleep 0.5 key alt+space sleep 0.2 key Shift+Tab sleep 0.18 key Return

#  Tweak PS2 emulator ( aka pcsx2 ) to where the main gui ends when the game ends as it should
xdotool sleep 0.25 key super sleep 0.3 key p sleep 0.15 key c sleep 0.1 key s sleep 0.13 key Return sleep 0.5 key alt+e sleep 0.12 key c key Return sleep 0.15 key End sleep 0.5 key --repeat 6 Tab sleep 0.25 key Page_Down sleep 0.2 mousemove 2400 850 sleep 0.15 click 3

#   Improve panel height size
xdotool key ctrl+super+q sleep 1 key Left key Left sleep 0.1 key--repeat 3 key Page_Down

#  launch thunderbird, but DON'T set it up and auto kill it in 4 seconds
timeout 4 /usr/lib/thunderbird/thunderbird

# Time finally time to copy stuff to /home/taco folder   the easy way with the rsync command  =  which includes the proper .thunderbird folder
rsync -avhu --info=progress2 '/mnt/sdb1 rsyncbackup/' '/home/taco/'

# Keyboard shortcuts ( as of 3-2023 ) restoration time... This will restore them to /home/taco folder
dconf dump /org/cinnamon/desktop/keybindings/ < ~/my_keybindings

#   Now to restore Startup Applications
cp -a "/media/taco/USB STICK/Startup applications backup  ... copy the contents of this folder to home taco .config autostart folder/" "/home/taco/.config/autostart/"

#  Handbrake setting correction
xdotool key alt+h sleep 2 key alt+f sleep 1 key p sleep .5 mousemove 1750 925 sleep 0.5 click 1 sleep 0.33 key Tab key space sleep 0.1 key Ctrl+Tab sleep 0.1 key Return
xdotool sleep 0.5 key alt+space sleep 0.2 key Shift+Tab sleep 0.18 key Return

# Screenshots default folder change to /home/taco/Pictures/Screenshots
dconf-editor &
xdotool sleep 1 key Tab sleep 0.25 key Space
xdotool sleep 1 key Tab sleep 0.2 key Return
sleep 1.75 xdotool type 'scr'
xdotool sleep 0.33 key Return
xdotool sleep 0.25 key Down sleep 0.2 key Return key End sleep 0.25 key space sleep 0.25 key End key Right
xdotool sleep 0.75 type '/home/taco/Pictures/Screenshots'
xdotool sleep 1 key Tab key Tab sleep 0.33 key Return
xdotool sleep 0.5 key alt+space sleep 0.2 key Shift+Tab sleep 0.25 key Return

# change power settings to not go to sleep
cinnamon-settings power
wmctrl -a Power Management
xdotool sleep 1 key Left key Up
xdotool mousemove 2150 1075 sleep 0.2 click 1 sleep 0.2 key End sleep 0.2 key Return
xdotool sleep 0.5 key alt+space sleep 0.2 key Shift+Tab sleep 0.18 key Return

#  screw screensaver
cinnamon-settings screensaver
xdotool sleep 1 mousemove 2180 1010 sleep 0.15 click 1
xdotool sleep 0.5 mousemove 2100 865 sleep 0.15 click 1 sleep 0.2 key Home sleep 0.15 key Return key Alt+F4 sleep 5 key Alt+F7
xdotool sleep 0.5 key alt+space sleep 0.2 key Shift+Tab sleep 0.18 key Return

# Need a firewall
ufw enable

# Let's be able to see astericks when we type a password in terminal
xdotool sleep 0.5 type 'gedit /etc/sudoers'
xdotool sleep 0.5 key Return
xdotool sleep 0.25 type 'moto'
xdotool sleep 0.25 key Return
xdotool sleep 0.25 key --repeat 8 Down sleep 0.2 key End
xdotool sleep 0.33 type ',pwfeedback'
xdotool sleep 0.33 key ctrl+s 
xdotool sleep 4.5 key alt+space sleep 0.2 key Shift+Tab sleep 0.2 key Return

#  Let's prevent the system from needing password when launching timeshift.  Navigate with root privileges to /etc/polkit-1/localauthority/50-local.d/ 
#,,,,  THEN  right click and create a document with the name of " admin.pkla.   Now paste the follow info below into it and save the file... === DON'T forget to remove the #'s
xdotool sleep 0.5 type "gedit '/etc/polkit-1/localauthority/50-local.d/admin.pkla'"
xdotool sleep 0.75 key Return
xdotool sleep 0.5 type "[Admin]"
xdotool sleep 0.33 key Return
xdotool sleep 0.25 type "Identity=unix-user:0;unix-group:;unix-group:admin"
xdotool sleep 0.75 key Return
xdotool sleep 0.25 type "Action=*"
xdotool sleep 0.5 key Return
xdotool sleep 0.25 type "ResultActive=yes"
xdotool sleep 1.25 key ctrl+s sleep 4 key ctrl+w sleep 0.25 key ctrl+w
xdotool sleep 0.75 type "chmod 440 /etc/polkit-1/localauthority/50-local.d/admin.pkla"
xdotool sleep 2 key Return
xdotool sleep 0.5 key Return

#  Make new windows launch at center of screen, Alt=Tab speed, and increase dragable border width of windows by 12 notches
xdotool sleep 0.25 type "cinnamon-settings windows"
xdotool sleep 0.25 key Return
xdotool sleep 0.75 key key Right sleep 0.25 key Return
xdotool sleep 0.2 mousemove 2160 1220 sleep 0.25 click 1 sleep 0.2 key End sleep 0.15 key Return
xdotool sleep 0.25 keydown ctrl sleep 0.15 key Tab sleep 0.15 keyup ctrl sleep 0.2 key Shift+Tab sleep 0.2 key --repeat 12 Right
xdotool sleep 0.25 keydown ctrl sleep 0.15 key Tab sleep 0.15 keyup ctrl sleep 0.2 key Right key Right sleep 0.2 key Return
xdotool sleep 0.25 mousemove 2150 1100 sleep 0.15 click 1 click 1
xdotool sleep 0.25 mousemove 2100 950 sleep 0.15 click 1 sleep 0.2 key Up sleep 0.2 key Return
xdotool sleep 0.5 key alt+space sleep 0.25 key Shift+Tab sleep 0.25 key Return

xdotool sleep 0.25 key Alt+F2
xdotool sleep 0.5 type "exit"
xdotool sleep 0.33 key Return
Another temp dead end I've encountered is trying to splice in the segoe fonts installer found in the code below

Code: Select all

#!/bin/bash
# mrbvrz - https://hasansuryaman.com
# this is part of my basic bash learning, there may be errors in writing this program.

# Colours Variables
RESTORE='\033[0m'
RED='\033[00;31m'
GREEN='\033[00;32m'
YELLOW='\033[00;33m'
BLUE='\033[00;34m'
PURPLE='\033[00;35m'
CYAN='\033[00;36m'
LIGHTGRAY='\033[00;37m'
LRED='\033[01;31m'
LGREEN='\033[01;32m'
LYELLOW='\033[01;33m'
LBLUE='\033[01;34m'
LPURPLE='\033[01;35m'
LCYAN='\033[01;36m'
WHITE='\033[01;37m'

# Destination directory
#ROOT_UID=0
DEST_DIR="$HOME/.local/share/fonts/Microsoft/TrueType/Segoe UI/"

#if [ "$UID" -eq "$ROOT_UID" ]; then
#  DEST_DIR="/usr/local/share/fonts/Microsoft/TrueType/Segoe UI/"
#else
#  DEST_DIR="$HOME/.local/share/fonts/Microsoft/TrueType/Segoe UI/"
#fi

# Check Internet Conection
function cekkoneksi(){
    echo -e "$BLUE [ * ] Checking for internet connection"
    sleep 1
    echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
    if [ $? -ne 0 ]; then
        echo -e "$RED [ X ]$BLUE Internet Connection ➜$RED OFFLINE!\n";
        echo -e "$RED Sorry, you really need an internet connection...."
        exit 0
    else
        echo -e "$GREEN [ ✔ ]$BLUE Internet Connection ➜$GREEN CONNECTED!\n";
        sleep 1
    fi
}

function cekwget(){
    echo -e "$BLUE [ * ] Checking for Wget"
    sleep 1
    which wget > /dev/null 2>&1
    if [ "$?" -eq "0" ]; then
    echo -e "$GREEN [ ✔ ]$BLUE Wget ➜$GREEN INSTALLED\n"
        sleep 1
    else
        echo -e "$RED [ X ]$BLUE Wget ➜$RED NOT INSTALLED\n"
        continueWget
    fi
}

function cekfont(){
    echo -e "$BLUE [ * ] Checking for Segoe-UI Font"
    sleep 1
    fc-list | grep -i "Segoe UI" >/dev/null 2>&1
    if [ "$?" -eq "0" ]; then
    echo -e "$GREEN [ ✔ ]$BLUE Segoe-UI Font ➜$GREEN INSTALLED\n"
        sleep 1
    else
        echo -e "$RED [ X ]$BLUE Segoe-UI Font ➜$RED NOT INSTALLED\n"
        continueFont
    fi
}

function continueFont(){
    echo -e "$LGREEN Do you want to install Segoe-UI Font? (y)es, (n)o :"
    read  -p ' ' INPUT
    case $INPUT in
    [Yy]* ) fontinstall;;
    [Nn]* ) end;;
    * ) echo -e "$RED\n Sorry, try again."; continueFont;;
  esac
}

function fontinstall(){
    mkdir -p "$DEST_DIR"
    wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/segoeui.ttf?raw=true -O "$DEST_DIR"/segoeui.ttf > /dev/null 2>&1 # regular
    wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/segoeuib.ttf?raw=true -O "$DEST_DIR"/segoeuib.ttf > /dev/null 2>&1 # bold
    wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/segoeuii.ttf?raw=true -O "$DEST_DIR"/segoeuii.ttf > /dev/null 2>&1 # italic
    wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/segoeuiz.ttf?raw=true -O "$DEST_DIR"/segoeuiz.ttf > /dev/null 2>&1 # bold italic
    wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/segoeuil.ttf?raw=true -O "$DEST_DIR"/segoeuil.ttf > /dev/null 2>&1 # light
    wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/seguili.ttf?raw=true -O "$DEST_DIR"/seguili.ttf > /dev/null 2>&1 # light italic
    wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/segoeuisl.ttf?raw=true -O "$DEST_DIR"/segoeuisl.ttf > /dev/null 2>&1 # semilight
    wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/seguisli.ttf?raw=true -O "$DEST_DIR"/seguisli.ttf > /dev/null 2>&1 # semilight italic
    wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/seguisb.ttf?raw=true -O "$DEST_DIR"/seguisb.ttf > /dev/null 2>&1 # semibold
    wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/seguisbi.ttf?raw=true -O "$DEST_DIR"/seguisbi.ttf > /dev/null 2>&1 # semibold italic
    fc-cache -f "$DEST_DIR"
    echo -e "$GREEN\n Font installed on $LBLUE'$DEST_DIR'"
}

function wgetinstall(){   
    sleep 1
    sudo apt update > /dev/null 2>&1
    sudo apt install -y wget > /dev/null 2>&1
}

function end(){
    echo -e "$LPURPLE\n Bye..... ;)"
    exit 0
}

continueWget() {
  echo -e "$LGREEN Do you want to install Wget? (y)es, (n)o :"
  read  -p ' ' INPUT
  case $INPUT in
    [Yy]* ) wgetinstall;;
    [Nn]* ) end;;
    * ) echo -e "$RED\n Sorry, try again."; continueWget;;
  esac
}

function banner(){
    echo -e "$LYELLOW" ""
    echo -e "                                         _    __            _   "
    echo -e "                                        (_)  / _|          | |  "
    echo -e "  ___  ___  __ _  ___   ___        _   _ _  | |_ ___  _ __ | |_ "
    echo -e " / __|/ _ \/ _  |/ _ \ / _ \  __  | | | | | |  _/ _ \|  _ \| __|"
    echo -e " \__ \  __/ (_| | (_) |  __/ (__) | |_| | | | || (_) | | | | |_ "
    echo -e " |___/\___|\__, |\___/ \___|       \__,_|_| |_| \___/|_| |_|\__|"
    echo -e "            __/ |                                               "
    echo -e "           |___/             $LPURPLE mrbvrz$LCYAN -$RED https://hasansuryaman.com        "
    echo ""
    echo -e "$LYELLOW ---------------------------------------------------------------"
    echo ""
}

main(){
    clear
    banner
    cekkoneksi
    cekwget
    cekfont
}

main
Is there a way I can put this in to where it auto runs it as - if needs be - the very last action/step of the entire meal deal or does it even matter where in order of things I put it....without having to do a point to command ( such as if that segoefontsinstaller.sh script file is located in /home/taco/bashscripts the command would be something like sh '/home/taco/bashscripts/segoefontsinstaller.sh' and put that sh command somewhere inside the "install and setup pc.sh" bashscript ?

I've tested it in broken down portions ( not the parts involving copying over an entire /home rsync backup yet..but most of others work as it should

I don't know/recall the more advanced bashscripting commands off the top of my head as I have a feeling I can possibly condense this more and fix my 'potholes in which I have to manually intervene on some tasks to keep the program auto-running all of the commands ".

I'm all eyes for suggestions.

My system info below :

Code: Select all

nemo 5.6.4
System:
  Kernel: 6.1.0-1010-oem x86_64 bits: 64 compiler: N/A
    Desktop: Cinnamon 5.6.8 tk: GTK 3.24.33 wm: muffin dm: LightDM
    Distro: Linux Mint 21.1 Vera base: Ubuntu 22.04 jammy
Machine:
  Type: Desktop Mobo: ASRock model: X570 Taichi serial: <superuser required>
    BIOS: American Megatrends v: P5.00 date: 10/19/2022
Memory:
  RAM: total: 125.71 GiB used: 5.74 GiB (4.6%)
  RAM Report:
    permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: 12-core model: AMD Ryzen 9 5900X bits: 64 type: MT MCP arch: Zen 3
    rev: 0 cache: L1: 768 KiB L2: 6 MiB L3: 64 MiB
  Speed (MHz): avg: 2490 high: 3598 min/max: 2200/4950 boost: enabled
    cores: 1: 2199 2: 2196 3: 2200 4: 2199 5: 2199 6: 2200 7: 3589 8: 2200
    9: 2200 10: 2881 11: 2200 12: 2200 13: 2200 14: 2200 15: 2200 16: 2200
    17: 2199 18: 2200 19: 3598 20: 2872 21: 3598 22: 2955 23: 2879 24: 2200
    bogomips: 177593
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD driver: amdgpu v: kernel pcie: speed: 16 GT/s lanes: 16
    ports: active: DP-1 empty: DP-2,DP-3,HDMI-A-1 bus-ID: 0e:00.0
    chip-ID: 1002:744c
  Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: amdgpu
    gpu: amdgpu display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3840x2160 s-dpi: 96
  Monitor-1: DisplayPort-0 mapped: DP-1 model: ViewSonic VSC XG320U
    res: 3840x2160 dpi: 102 diag: 484mm (19.1")
  OpenGL: renderer: GFX1100 (gfx1100 LLVM 15.0.7 DRM 3.49 6.1.0-1010-oem)
    v: 4.6 Mesa 23.0.3 - kisak-mesa PPA direct render: Yes
Audio:
  Device-1: AMD driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s
    lanes: 16 bus-ID: 0e:00.1 chip-ID: 1002:ab30
  Device-2: AMD Starship/Matisse HD Audio vendor: ASRock
    driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s lanes: 16
    bus-ID: 10:00.4 chip-ID: 1022:1487
  Sound Server-1: ALSA v: k6.1.0-1010-oem running: yes
  Sound Server-2: PulseAudio v: 15.99.1 running: yes
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Intel I211 Gigabit Network vendor: ASRock driver: igb v: kernel
    pcie: speed: 2.5 GT/s lanes: 1 port: f000 bus-ID: 06:00.0
    chip-ID: 8086:1539
  IF: enp6s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:
  Local Storage: total: 22.74 TiB used: 15.81 TiB (69.5%)
  ID-1: /dev/nvme0n1 vendor: Corsair model: Corsair MP600 PRO XT
    size: 3.64 TiB speed: 63.2 Gb/s lanes: 4 serial: <filter> temp: 30.9 C
  ID-2: /dev/sda vendor: Samsung model: SSD 860 EVO 1TB size: 931.51 GiB
    speed: 6.0 Gb/s serial: <filter>
  ID-3: /dev/sdb vendor: Samsung model: SSD 860 EVO 4TB size: 3.64 TiB
    speed: 6.0 Gb/s serial: <filter>
  ID-4: /dev/sdc vendor: Toshiba model: HDWR31G size: 14.55 TiB
    speed: 6.0 Gb/s serial: <filter>
Partition:
  ID-1: / size: 97.87 GiB used: 37.93 GiB (38.8%) fs: ext4
    dev: /dev/nvme0n1p2
  ID-2: /boot/efi size: 510 MiB used: 31.4 MiB (6.2%) fs: vfat
    dev: /dev/nvme0n1p4
  ID-3: /home size: 3.48 TiB used: 1.09 TiB (31.4%) fs: ext4
    dev: /dev/nvme0n1p3
  ID-4: /mnt/16TB Toshiba hdd size: 14.44 TiB used: 13.24 TiB (91.7%)
    fs: ext4 dev: /dev/sdc
  ID-5: /mnt/GoPro 1TB Backup size: 915.82 GiB used: 357.2 GiB (39.0%)
    fs: ext4 dev: /dev/sda1
  ID-6: /mnt/sdb1 rsyncbackup size: 3.58 TiB used: 1.09 TiB (30.4%)
    fs: ext4 dev: /dev/sdb1
Swap:
  ID-1: swap-1 type: file size: 10 GiB used: 0 KiB (0.0%) priority: -2
    file: /swapfile
Sensors:
  System Temperatures: cpu: N/A mobo: N/A gpu: amdgpu temp: 54.0 C
    mem: 74.0 C
  Fan Speeds (RPM): N/A gpu: amdgpu fan: 518
Repos:
  Packages: 2944 apt: 2910 flatpak: 34
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/cappelikan-ppa-jammy.list
    1: deb [arch=amd64 signed-by=/etc/apt/keyrings/cappelikan-ppa-jammy.gpg] https://ppa.launchpadcontent.net/cappelikan/ppa/ubuntu jammy main
  Active apt repos in: /etc/apt/sources.list.d/ernstp-mesarc-jammy.list
    1: deb [arch=amd64 signed-by=/etc/apt/keyrings/ernstp-mesarc-jammy.gpg] https://ppa.launchpadcontent.net/ernstp/mesarc/ubuntu jammy main
  Active apt repos in: /etc/apt/sources.list.d/google-chrome.list
    1: deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/kisak-kisak-mesa-jammy.list
    1: deb [arch=amd64,i386 signed-by=/etc/apt/keyrings/kisak-kisak-mesa-jammy.gpg] https://ppa.launchpadcontent.net/kisak/kisak-mesa/ubuntu jammy main
  Active apt repos in: /etc/apt/sources.list.d/lunarg-vulkan-1.3.236-jammy.list
    1: deb https://packages.lunarg.com/vulkan/1.3.236 jammy main
    2: deb-src https://packages.lunarg.com/vulkan/1.3.236 jammy main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
    1: deb http://packages.linuxmint.com vera main upstream import backport
    2: deb http://mirror.brightridge.com/ubuntuarchive jammy main restricted universe multiverse
    3: deb http://mirror.brightridge.com/ubuntuarchive jammy-updates main restricted universe multiverse
    4: deb http://mirror.brightridge.com/ubuntuarchive jammy-backports main restricted universe multiverse
    5: deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
  Active apt repos in: /etc/apt/sources.list.d/openshot_developers-ppa-jammy.list
    1: deb [arch=amd64 signed-by=/etc/apt/keyrings/openshot_developers-ppa-jammy.gpg] https://ppa.launchpadcontent.net/openshot.developers/ppa/ubuntu jammy main
  Active apt repos in: /etc/apt/sources.list.d/pcsx2-team-pcsx2-daily-jammy.list
    1: deb [arch=amd64 signed-by=/etc/apt/keyrings/pcsx2-team-pcsx2-daily-jammy.gpg] https://ppa.launchpadcontent.net/pcsx2-team/pcsx2-daily/ubuntu jammy main
  Active apt repos in: /etc/apt/sources.list.d/teamviewer.list
    1: deb [signed-by=/usr/share/keyrings/teamviewer-keyring.gpg] https://linux.teamviewer.com/deb stable main
  Active apt repos in: /etc/apt/sources.list.d/teejee2008-ppa-jammy.list
    1: deb [arch=amd64 signed-by=/etc/apt/keyrings/teejee2008-ppa-jammy.gpg] https://ppa.launchpadcontent.net/teejee2008/ppa/ubuntu jammy main
  Active apt repos in: /etc/apt/sources.list.d/winehq-focal.sources
    1: deb [arch=amd64 i386] https://dl.winehq.org/wine-builds/ubuntu focal main
  Active apt repos in: /etc/apt/sources.list.d/winehq-jammy.sources
    1: deb [arch=amd64 i386] https://dl.winehq.org/wine-builds/ubuntu jammy main
Info:
  Processes: 505 Uptime: 13h 5m Init: systemd v: 249 runlevel: 5 Compilers:
  gcc: 11.3.0 alt: 11/12 Shell: Bash v: 5.1.16 running-in: gnome-terminal
  inxi: 3.3.13
Last edited by LockBot on Tue Nov 07, 2023 11:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Mint 21.2 Cinnamon 5.8.4
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: "install and setup pc.sh" bashscript

Post by Termy »

Hi. Some brief pointers to help improve what you have:
  • A shebang of #!/usr/bin/env bash is more portable.
    • Admittedly, this isn't needed here, as this is strictly for Linux Mint.
  • The lines trail off into oblivion.
    • It's a pain to traverse the file this way.
    • If you rely on wrapping, it's an issue with code.
  • apt-get(8) has no -yy functionality.
    • A surprisingly common mistake, even incorrectly taught by many.
    • Additional instances of -y is no more yes than not.
    • This can be found by checking the apt-get(8) documentation.
    • This confusion likely came from multiple -q flags being valid.
  • There's a lot of repetition.
    • Repetitious code often take longer to read.
    • Repetitious code can slow things down.
    • Repetitious code can be inconvenient to edit.
    • Repetitious code often leads to bugs.
    • This can be avoided with, for example, logic, loops, and variables.
  • systemctl(1) can stop/start and enable/disable services simultaneously.
    • IE: systemctl stop --disable motd-news.timer
    • This will reduce noise and make easier and quicker to read.
  • The script should be ran by 'root', yet you have sudo(8) within.
    • It winds up being noise, and it's confusing to the reader.
  • Unnecessarily calling shell executables to echo data to files.
    • Better written as, IE: echo 'Some text.' >> FILE
    • The `echo` builtin is already built into BASH.
  • You have flags like -y in odd places.
    • Program usage usually dictates that flags come first, as is standard.
    • Some programs are written in such a way as to allow your approach.
    • To avoid confusion, it's best to stick with the standard approach.
  • A lack of logic to verify things worked as they should — not robust.
    • Code written in this way can quickly become very problematic.
    • It's possible to wreck a system by not verifying anything.
  • Confusingly, you've changed into HOME, for seemingly no reason.
  • You've unnecessarily executed apt-get update an additional 4 times.
    • This is usually only suitable once in this kind of script, if at all.
    • Multiple instances of this can greatly slow things down.
  • You've given mkdir(1) -m755.
    • While valid, this approach to arguments can obfuscate intention.
    • Arguments for flags are usually necessarily separated by a whitespace.
    • Because this is non-standard, it can appear as a bug.
  • Flag --install-recommends given to apt-get(8).
    • Unless this has changed, this is by default the default, IIRC.
    • Suggested packages are those typically not installed by default.
    • Verify with: apt-config dump | grep -i APT::Install-Recommends
  • apt-get(8) is preferable for scripts, because apt(8) is a front-end.
  • Attempting to remove a non-existent (and invalid) package.
    • The package 'ModemManager.service' doesn't exist; this is presumably a typo.
  • Using gdebi(1) to install a package.
    • Redundant, because dpkg(1) is already being called by gdebi(1).
    • Calling for gdebi(1) in a script is almost always redundant.
Hope that helps.

Regarding including the font installer to your script: most of it isn't necessary, so you need only add the following, while also populating those variables.

Code: Select all

mkdir -p "$DEST_DIR"
wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/segoeui.ttf?raw=true -O "$DEST_DIR"/segoeui.ttf > /dev/null 2>&1 # regular
wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/segoeuib.ttf?raw=true -O "$DEST_DIR"/segoeuib.ttf > /dev/null 2>&1 # bold
wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/segoeuii.ttf?raw=true -O "$DEST_DIR"/segoeuii.ttf > /dev/null 2>&1 # italic
wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/segoeuiz.ttf?raw=true -O "$DEST_DIR"/segoeuiz.ttf > /dev/null 2>&1 # bold italic
wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/segoeuil.ttf?raw=true -O "$DEST_DIR"/segoeuil.ttf > /dev/null 2>&1 # light
wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/seguili.ttf?raw=true -O "$DEST_DIR"/seguili.ttf > /dev/null 2>&1 # light italic
wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/segoeuisl.ttf?raw=true -O "$DEST_DIR"/segoeuisl.ttf > /dev/null 2>&1 # semilight
wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/seguisli.ttf?raw=true -O "$DEST_DIR"/seguisli.ttf > /dev/null 2>&1 # semilight italic
wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/seguisb.ttf?raw=true -O "$DEST_DIR"/seguisb.ttf > /dev/null 2>&1 # semibold
wget -q https://github.com/mrbvrz/segoe-ui/raw/master/font/seguisbi.ttf?raw=true -O "$DEST_DIR"/seguisbi.ttf > /dev/null 2>&1 # semibold italic
fc-cache -f "$DEST_DIR"
echo -e "$GREEN\n Font installed on $LBLUE'$DEST_DIR'"
Which itself falls prey to several issues. My approach would be along the lines of:

Code: Select all

SegoeURL_Stub='https://github.com/mrbvrz/segoe-ui/raw/master/font'
SegoeDir='/usr/local/share/fonts/Microsoft/TrueType/Segoe UI'

mkdir -p "$SegoeDir"

SegoeErrs=0
for File in segoeu{i,ib,ii,iz,il,ili,isl,isli,isb,isbi}.ttf; {
	URL="$SegoeURL_Stub"/$File?raw=true

	wget -qO "$SegoeDir/$File" "$URL" || (( SegoeErrs++ ))
}

fc-cache -f "$SegoeDir" || (( SegoeErrs++ ))

if (( SegoeErrs > 0 )); then
	printf 'Err: Segoe UI installation failure(s) detected.\n' 1>&2
else
	printf 'Segoe UI successfully installed.\n'
fi
Overview:
  • More robust.
  • Clearer for the reader.
  • Clearer for the user.
  • Easily editable.
Granted, line 7 isn't so easy to edit, but I assume that's a static list of files. I haven't tested what I wrote, BTW, so please forgive any typos or oversights. It should work, though. I mainly just don't wish to install Microsoft fonts or download files I'm not familiar with.

For checking whether the script is actually executed with 'root' access, my typical approach varies depending on the task at hand, but it usually comes down to checking id -u for '/bin/sh' or $UID for BASH. In both cases, you're checking whether the current user's ID is 0, which is always 'root', unless you have some seriously bizarre installation. If 'root' access is required, I print an error and bail, otherwise continue. Since this script is just for you, I can understand you ignoring this part.

That part above about the invalid package is actually a great example of when repetitious code can cause bugs. It's the same reason why it's often best to store important things like file paths and other important strings within variables to avoid the risk of typos causing potentially destructive bugs. Imagine blasting an entire directory of all projects because you didn't bother using a variable — ouch! It's one thing to do that on your own system, but someone else's? Unacceptable.

If you have any further questions, by all means let loose. Spent too long on this post as it is. :oops:
Last edited by Termy on Sat May 13, 2023 6:55 pm, edited 1 time in total.
I'm also Terminalforlife on GitHub.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: "install and setup pc.sh" bashscript

Post by rene »

Termy wrote: Sat May 13, 2023 11:41 am

Code: Select all

for File in segoeu{i,ib,ii,iz,il,ili,isl,isli,isb,isbi}.ttf; {
        [ .... ]
)
Undoubtedly just talking among ourselves at that point, but...

Note that that closing ) wants to be a closing } -- but that even then for ...; { ...; } is shall we say "highly alternative" syntax at best, and as far as I can quickly find in fact undocumented. A for loop normally uses do ...; done as in

Code: Select all

for File in segoeu{i,ib,ii,iz,il,ili,isl,isli,isb,isbi}.ttf; do
        [ .... ]
done
Even though moreover seemingly an historically valid alternative in the context of for it's not in that of e.g. while:

Code: Select all

rene@hp8k:~$ for ((i=0; i<2; i++)); { echo $i; }
0
1
rene@hp8k:~$ i=0; while ((i<2)); { echo $i; ((i++)); }
> ^C
rene@hp8k:~$ i=0; while ((i<2)); do echo $i; ((i++)); done
0
1
I'd then also in a consistency sense quite advise against using { ...; } in a for loop.

I expect you (Termy) would in fact agree, and due also to the mismatched closing brace in the original expect you just mixed a few languages there while writing but thanks for pointing out the odd issue that it works at all :?
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: "install and setup pc.sh" bashscript

Post by Termy »

rene wrote: Sat May 13, 2023 2:42 pm [...]
Yes, the closing `)` instead of a brace was a typo — I'm not a robot, so these things happen. I'll edit it accordingly. It's a standard bashism akin to syntax in languages like Perl. Saves keystrokes. By all means, someone can opt for the longer format. I couldn't find it documented either, which is strange, but it's been around for at least since BASH 1.14.7 (late 90s). I've used it for many years. There's certainly nothing to indicate that it's going away. It likely just went under the documentation radar.

I'm not sure why you mentioned `while` or a C-style `for` loop.
rene wrote: Sat May 13, 2023 2:42 pmEven though moreover seemingly an historically valid alternative in the context of for it's not in that of e.g. while:
I don't understand this. A `while` loop or C-style `for` loop is not the appropriate tool for iterating over a list of words. This is why we have the `for WORD in LIST` syntax at all. A C-style `for` loop is great for iterating through indices in an array, for example, and a `while` loop is good for continuing to iterate based upon a condition.
I'm also Terminalforlife on GitHub.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: "install and setup pc.sh" bashscript

Post by rene »

Okay, I take it then this is going to be an argument yet again, so never mind, because that was not the idea.

As mentioned the for vs. while thing is just a consistency argument; numeric or not is not relevant here. The important reason to not use for ...; { ...; } is that it is undocumented, seemingly both by bash and by POSIX, https://pubs.opengroup.org/onlinepubs/9 ... hap02.html, and therefore not necessarily stably present, even if history keeps it likely available in practice. It's not a good idea to willy-nilly use non-portable constructs, rare ones at that, and as such not a good idea to advise in a review/tutorial-type contribution such as your above one.

Anyone feel free to do or to not do with that information as they please. Out.
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: "install and setup pc.sh" bashscript

Post by Termy »

rene wrote: Sat May 13, 2023 7:19 pm [...]
I'm confused by your apparent frustration here. I replied factually. It is a valid feature that's been around since the 90s. I've already agreed that someone has the choice to choose the standard method. Remember, I did state that block of code is what I would do, not exactly what OP should learn and forever replicate.

I'm sure it's not posixly correct, but nowhere was the requirement for posixly correct code stipulated, and the script appears to be strictly for Linux Mint. I always use the posix shell option in an interactive session, yet this syntax is still valid. I'm not sure how strict the option is, but it is worth noting. It's so stably present, as you put it, that it's been sat in BASH since the 90s, to reiterate. I'm not sure there's even room for debate. If your opinion is that it should never be used, in favor of the more standard syntax, then, by all means, have at it, but it's simply one we don't share.

I'm not sure this discussion of ours serves a purpose, other than to apparently spark your frustration, so I'll leave you to it as well.
I'm also Terminalforlife on GitHub.
motoryzen
Level 10
Level 10
Posts: 3497
Joined: Sun Dec 08, 2019 12:25 am

Re: "install and setup pc.sh" bashscript

Post by motoryzen »

Wow, there is much here I can learn from. I appreciate all the input good peeps.

I've trimmed down a good bit of it and had to change a few things ( mkvtoolnix for some reason keeps giving me a deprecated apt key warning and in the end I never see a gui button launch of it and it won't launch via gnome-terminal - thus I've to use the appimage version for now ..)

There are a few others..but no time to go into detail about it just yet. It's mother's day, and I gotta freshen up and visit her and see what she'd like to do together.

I'll report back later. :)
Mint 21.2 Cinnamon 5.8.4
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
User avatar
majpooper
Level 8
Level 8
Posts: 2087
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: "install and setup pc.sh" bashscript

Post by majpooper »

I have been doing something similar in that I have written a series of bash scripts that are run from a master script that do my Linux Mint install. I am in the process of updating it for 21.x. In doing so I have been trying to improve it converting some of the bash scripts to python3 scripts and with exception handling so I can output to the terminal and to a log file indicating success or failure. I am about half way through this conversion project.

You may have no interest in my approach which I would understand as this is tailored strictly for me. Also I am a hack I cannot even sit at the grownup's table with you, rene and Termy when it comes to writing code.

But I am glad to share a few of my scripts and you can see if you are interested.

Before I begin I do download a dir contain the sub directories with the scripts and some of the other things that I will need (like dconf dumps of my settings like power manager, custom icons I want to use etc.) - I can share that with in detail if it turns out you are interested.

Since I run this set of scripts as the current user I config /etc/sudoers with NOPASSWD so I can run the scripts without being prompted for a sudo password - I turn the password back on after all the scripts have been run.

Here are a few examples to give you an idea of what I am doing and if you are interested, again I am more than willing to share. Also rene and Termy your critique is more than welcome as I am way over my head here to be honest. rene you have helped with several things so you know what you are dealing with.

For full disclosure - I used AI to get help with my new scripts ( the original bash scripts I wrote myself). It typically take several iterations to get them to work perfectly but it is very helpful for those like me who are code challenged and also instructional. Anyway I want to be honest about how they have been created.

Allow running sudo without a password

Code: Select all

#!/usr/bin/env python3

import os
from datetime import datetime

# Set log file path and timestamp
LOG_FILE = f"/home/{os.getlogin()}/install.log"
TIMESTAMP = datetime.now().strftime("%H:%M:%S")

# Function to log successful commands
def log_success(command):
    print("SUCCESSFUL: Removed passwd required for sudo")
    with open(LOG_FILE, "a") as f:
        f.write(f"{TIMESTAMP} SUCCESSFUL: {command}\n")

# Function to log failed commands
def log_failure(command):
    print("FAILED: To remove passwd required in sudoers")
    with open(LOG_FILE, "a") as f:
        f.write(f"{TIMESTAMP} FAILED: {command}\n")

# Edit sudoers to not require sudo password
command = "sudo sed -i '50s/.*/%sudo   ALL=(ALL:ALL) NOPASSWD:ALL/' /etc/sudoers"
result = os.system(command)

if result == 0:
    log_success("Removed passwd required in sudoers")
else:
    log_failure("To Remove passwd required in sudoers")
    exit(1)

# Exit with success status
exit(0)
Purge softeware packages I don't use:

Code: Select all

#!/usr/bin/env python3

import subprocess
import datetime

# Set up logging
log_path = f"/home/{subprocess.check_output(['whoami']).decode('utf-8').strip()}/install.log"

def log_message(msg):
    timestamp = datetime.datetime.now().strftime("%H:%M:%S")
    with open(log_path, "a") as f:
        f.write(f"[{timestamp}] {msg}\n")

def log_error(msg):
    log_message(f"FAILED TO PURGE: {msg}")
    print(f"FAILED TO PURGE: {msg}")

def log_success(msg):
    log_message(f"SUCCESSFULLY PURGED: {msg}")
    print(f"SUCCESSFULLY PURGED: {msg}")

# List of packages to purge
packages = [
    "gnome-calculator",
    "gucharmap",
    "gnome-font-viewer",
    "sticky",
    "onboard",
    "seahorse",
    "redshift-gtk",
    "warpinator",
    "xreader-dbg",
    "xreader",
    "bulky",
    "nemo-fileroller",
    "xed-*",
    "drawing",
    "pix",
    "hexchat",
    "virt-viewer",
    "transmission-gtk",
    "webapp-manager",
    "thunderbird",
    "gnome-calendar",
    "thingy",
    "libreoffice-*",
    "mythes-*",
    "hunspell-*",
    "celluloid",
    "hypnotix",
    "speech-dispatcher",
    "gnome-logs",
    "gnome-power-manager",
    "gnome-system-monitor",
    "mint-meta-core",
    "mintbackup",
    "mintinstall",
    "mintreport",
    "mintdrivers"
]

# Purge packages
for package in packages:
    cmd = f"sudo apt purge -y {package}"
    try:
        output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT).decode('utf-8')
        log_success(package)
    except subprocess.CalledProcessError as e:
        log_error(package)
    
# Autoremove
cmd = "sudo apt autoremove -y"
try:
    output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT).decode('utf-8')
    print("AUTOREMOVE SUCCESSFUL")
    log_message("SUCCESSFULLY EXECUTED AUTOREMOVE")
except subprocess.CalledProcessError as e:
    print("AUTOREMOVE FAILED")
    log_message(" FAILED TO EXECUTE AUTOREMOVE")
Adjust system settings using dconf ( note: an install script runs prior to this installing the packages that I want/need dconf editor being one)

Code: Select all

#!/usr/bin/env python3

import subprocess
import datetime
import os

log_file = "/home/{}/install.log".format(subprocess.check_output(['whoami']).decode().strip())

def log(msg):
    now = datetime.datetime.now().strftime("%H:%M:%S")
    with open(log_file, "a") as f:
        f.write("{} {}\n".format(now, msg))
    print("{} {}".format(now, msg))

def run_command(args, input_str=None):
    try:
        output = subprocess.check_output(args, input=input_str.encode())
        output = output.decode().strip()
        log("SUCCESSFUL: {}".format(" ".join(args)))
        log(output)
        return output
    except subprocess.CalledProcessError as e:
        log("FAILED TO EXECUTE: {}".format(" ".join(args)))
        log(e.output.decode().strip())
        return None

# get the user's home directory path
home_dir = os.path.expanduser("~")

with open(os.path.join(home_dir, 'LM21/dconf/lm21_dconf'), 'r') as f:
    lm21_dconf_contents = f.read()
run_command(["dconf", "load", "-f", "/",], input_str=lm21_dconf_contents)

with open(os.path.join(home_dir, 'LM21/dconf/trash_dconf'), 'r') as f:
    trash_dconf_contents = f.read()
run_command(["dconf", "load", "-f", "/org/nemo/desktop/",], input_str=trash_dconf_contents)

with open(os.path.join(home_dir, 'LM21/dconf/terminal_dconf'), 'r') as f:
    terminal_dconf_contents = f.read()
run_command(["dconf", "load", "-f", "/org/gnome/terminal/legacy/profiles:/",], input_str=terminal_dconf_contents)

try:
    # dbus command may return non-zero status, but still be successful
    subprocess.run(["dbus-send", "--type=method_call", "--dest=org.Cinnamon", "/org/Cinnamon", "org.Cinnamon.RestartCinnamon", "boolean:false"], check=False)
    log("SUCCESSFUL: dbus-send --type=method_call --dest=org.Cinnamon /org/Cinnamon org.Cinnamon.RestartCinnamon boolean:false")
except subprocess.CalledProcessError as e:
    log("FAILED TO EXECUTE: dbus-send --type=method_call --dest=org.Cinnamon /org/Cinnamon org.Cinnamon.RestartCinnamon boolean:false")
    log(e.output.decode().strip())
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: "install and setup pc.sh" bashscript

Post by rene »

majpooper wrote: Sun May 14, 2023 7:40 pm
Only a comment on the sudo password thing since I think that's not a great setup: you in-place edit with sed the main /etc/sudoers and I feel it'd be better to use /etc/sudoers.d/ instead.

I.e., you'd have standard in place a file say /etc/sudoers.d/nopasswd.disabled and rename it by removing the ".disabled" part to enable the file, i.e., disable the password, and vice versa to enable the password again.

/etc/sudoers.d/nopasswd.disabled:

Code: Select all

%sudo	ALL=(ALL:ALL) NOPASSWD:ALL
with permission set correctly as sudo chmod 440 /etc/sudoers.d/nopasswd.disabled. Renaming easiest from shell I suppose but using Python you'd (without the logging) use something like

~/bin/nopasswd:

Code: Select all

#!/usr/bin/env python3

import argparse
import os

dst = '/etc/sudoers.d/nopasswd'
src = dst + '.disabled'

parser = argparse.ArgumentParser()
parser.add_argument('-d', '--disable', action='store_true')
args = parser.parse_args()

if args.disable:
    src, dst = dst, src

os.rename(src, dst)
Calling sudo nopasswd would disable the sudo password (for members of UNIX-group "sudo", i.e., such as you did) and calling sudo nopassw -d would enable it again; feel of course free to reverse that name and that logic if you like that better.

An additional comment might be that it'd be better to dis/enable password for the specific scripts rather than for ALL but that might change the setup; I didn't really look at your actual functional script(s) to see if that was okay. Did quickly notice you used three different methods of obtaining the home-directory:

1. f"/home/{os.getlogin()}"
2. f"/home/{subprocess.check_output(['whoami']).decode('utf-8').strip()}"
3. os.path.expanduser("~")

I'd personally settle on one of them, and would then use 3 everywhere.

Somewhat similar comment as to os.system() in your /etc/sudoers editing script vs subprocess.check_output() elsewhere. Former is "more shell than Python" I generally feel; would tend to prefer latter, and in any case am a sucker for consistency.

Anyways. As said didn't otherwise look at the scripts themselves really and need to run, but FWIW. Hope it's useful.
Last edited by rene on Mon May 15, 2023 7:35 am, edited 1 time in total.
motoryzen
Level 10
Level 10
Posts: 3497
Joined: Sun Dec 08, 2019 12:25 am

Re: "install and setup pc.sh" bashscript

Post by motoryzen »

Flag --install-recommends given to apt-get(8).
Unless this has changed, this is by default the default, IIRC.
Suggested packages are those typically not installed by default.
Verify with: apt-config dump | grep -i APT::Install-Recommends
*shrugs* :) . From what I've double check on my 2nd copy/rough draft the only one I have used --install-recommends on is involving installing wine. So is what you said there meaning that I must ( or you recommend via valid reasoning ) change those apt-get commands or any apt-get commands to apt instead?

I'm just doing it the precise way as explain on winehq.org and that method has never failed me and it never gives me any errors or oddities .

I have more look into. Thanks
The script should be ran by 'root', yet you have sudo(8) within.
Does that mean I should launch a terminal window, sudo su ( and of course it requires me typing my password ...no prob), and then leftclick drag that ' install and setup pc.sh" script into it and press enter?

I ask because ( after I've added many gsettings set and dconf write commands that instantly change certain things I normally do..such as all the selections within the Themes application ( mouse cursor icon style..etc ..four or three total choices) my gsettings set and dconf write commands won't work under root in terminal. I have to always be in regular user aka taco:taco:~$ aka fresh terminal launch mode for them to work unless..there is something I'm misunderstanding here.

I accomplish that part with the following below in one or more places in that script so far:

Code: Select all

xdotool sleep 1 type "exit"
xdotool sleep 0.33 key Return
So in that way I'm having to separate all those commands that won't work while I'm under root ( aka sudo su ) from those that I know work via root without hassling me for typing a root password such as the
Mint 21.2 Cinnamon 5.8.4
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
motoryzen
Level 10
Level 10
Posts: 3497
Joined: Sun Dec 08, 2019 12:25 am

Re: "install and setup pc.sh" bashscript

Post by motoryzen »

rene
Only a comment on the sudo password thing since I think that's not a great setup: you in-place edit with sed the main /etc/sudoers and I feel it'd be better to use /etc/sudoers.d/ instead
''

/etc/sudoers.d is a folder ..i just double check this via

sudo gedit /etc/sudoers in a terminal window *shrugs* :D

The actual separate file involved in that particular goal or mission of seeing astericks when I type a password in a terminal window is :

/etc/sudoers which ends up being 1.7KBs in size in the end once editing correctly.
Mint 21.2 Cinnamon 5.8.4
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: "install and setup pc.sh" bashscript

Post by rene »

motoryzen wrote: Sun May 14, 2023 11:50 pm
Only a comment on the sudo password thing since I think that's not a great setup: you in-place edit with sed the main /etc/sudoers and I feel it'd be better to use /etc/sudoers.d/ instead
/etc/sudoers.d is a folder ..i just double check this [ ... ]
Certainly. What majpooper does is in-place edit the file /etc/sudoers while "I feel it'd be better to use [the directory] /etc/sudoers.d/ instead.", i.e., as detailed in the next sentence and by the script (and, oh, yes, I was specifically replying to majpooper's above contribution; sorry if that wasn't clear; just edited in a quote).

/etc/sudoers.d/ is a directory in which you can place small sudoers fragments such as here that "nopasswd" fragment, which are then included from the main /etc/sudoers file (my suggested setup with the ".disabled" suffix works by only files without a dot in their filename being included; check the standard README in that directory). This then is to say you don't have to edit the main file /etc/sudoers (and back) from a script; /etc/sudoers.d/ exists to make precisely these kinds of manipulations of /etc/sudoers easier/better.
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: "install and setup pc.sh" bashscript

Post by Termy »

motoryzen wrote: Sun May 14, 2023 11:34 pm So is what you said there meaning that I must ( or you recommend via valid reasoning ) change those apt-get commands or any apt-get commands to apt instead?
Adding --install-recommends is redundant on systems which by default install recommended packages. Unless this has bizarrely changed in recent Linux Mint versions, this should include Linux Mint. I imagine that flag is included in the WINE instructions to ensure those recommended (likely quite important) packages are installed, particularly on systems configured to not install recommended packages.

Including that flag, BTW, isn't going to cause any problems, and in-fact might be useful if ever Linux Mint for some weird reason decides to disable the automatic installation of recommended packages.

While sometimes it can be useful to disable this for certain packages, using --no-install-recommends, it's usually far better to allow these packages to be installed. An example of when it's good to disable this feature for a given package is with 'lightdm', when all you need is LightDM but not the entire desktop environment it recommends. They might have changed this at some point, because it was a bit silly, but it bugged me for years. :roll:

If you're curious: I can filter apt-config dump for APT::Install-Recommends, which is the configuration parameter for this feature being enabled or disabled by default. I could then enable or disable this in '/etc/apt/apt.conf' or one of the files in the '/etc/apt/apt.conf.d' directory. By setting that parameter to 0 or false, I would disable the automatic installation of recommended packages. By default, this is set to 1 or true.

Regarding your question of apt vs. apt-get, in scripts, it's generally best to avoid front-ends like apt in scripts. This is actually mentioned in the apt(8) man page. To clarify, when I refer to apt(8), I'm not referring to Linux Mint's '/usr/local/bin/apt' wrapper. It's extra confusing in Linux Mint, because of the wrapper and how it's handled. :roll:

In-case you're confused about package management in Debian and Ubuntu, I'll briefly sum it up:

You have tools like apt-cache(8), apt-get(8), and apt-config(8), which are core utilities for APT. You have apt(8), which is the official front-end (that the aforementioned wrapper uses) that is these days bundled along with APT. APT is the name of the suite of these and other utilities, and is responsible for awesome things like repository management. The apt(8) front-end is much more generalized, with very basic functionality compared to the core utilities. Many people probably associate 'front-end' with strictly GUIs, but it's incorrect.

Repository management includes things like maintaining a local database of remote packages, watching repositories (e.g., 'main'), downloading packages from repositories, providing repository information to the user (e.g., to list available packages), etc. Without APT, we would have a lot of work on our hands, given the 1000s of packages a typical installation has. Even my very minimal installation has 1429 packages installed, many of which are just for programming, building Debian packages, and compilation reasons. We would need to manually do things like seek out correct and up-to-date packages and manually verify their authenticity.

APT itself ultimately uses dpkg, which is the heart of Debian and Ubuntu package management. Like APT, dpkg also consists of a series of core utilities, like dpkg(1), dpkg-query(1), and dpkg-reconfigure(8). Dpkg is responsible for things like installing, unpacking, configuring, removing, and purging packages, as well as keeping track of the current status of these packages (e.g., installed).

If you're confused, it's OK. Package management can IMO be a really confusing topic in the Debian and Ubuntu ecosystem. It took me years to discover and understand all of this, if I'm honest.
motoryzen wrote: Sun May 14, 2023 11:34 pm Does that mean I should launch a terminal window, sudo su ( and of course it requires me typing my password ...no prob), and then leftclick drag that ' install and setup pc.sh" script into it and press enter?
Aaaah, you've brought something important to my attention that I honestly didn't see — my bad. I assume adjusting GSettings (or explicitly dconf) stuff as 'root' would therefore change those settings for 'root'. In this case, you definitely don't want to run the entire script as 'root' without addressing this. I had assumed you needed to run the script as 'root', because you have many commands that require 'root' access, like installing packages and enabling UFW.

What you could try, is to sudo -u $SUDO_USER ..., where the ellipsis would be the gsettings(1) command. This does require that you run the script with sudo(8) in order to populate that variable ($SUDO_USER), however. I'm not sure if using sudo(8) to sudo(8) changes things, though. :lol: Sudoception!

Remember, when you use sudo(8) to run a command you are by default executing the proceeding command as that user, which by default is 'root'. There are some nuanced gotchas, such as in Debian, environment variables for the user who called sudo(8) are not retained, meaning you'd then need to add -E to preserve these variables. This is actually the standard for sudo(8), but Ubuntu changed this, because it was usually very inconvenient to constantly add -E. :lol:

Hope all of that helps! Seems like you're on the right path. As funny as it is to see all those long xdotool(1) commands, I'm impressed, because you've well demonstrated how useful xdotool(1) can be for automation.
I'm also Terminalforlife on GitHub.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: "install and setup pc.sh" bashscript

Post by rene »

Termy wrote: Mon May 15, 2023 10:44 am Adding --install-recommends is redundant on systems which by default install recommended packages. Unless this has bizarrely changed in recent Linux Mint versions, this should include Linux Mint.
Only since Mint 20 though; it used to not be and if not mistaken motoryzen is of older Mint-vintage: https://www.linuxmint.com/rel_ulyana_ci ... atsnew.php, Ctrl+F, "recommends"
User avatar
majpooper
Level 8
Level 8
Posts: 2087
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: "install and setup pc.sh" bashscript

Post by majpooper »

THX rene - appreciate the suggestions.
I don't want to hi-jack motoryzen's thread so I will show myself out.
motoryzen
Level 10
Level 10
Posts: 3497
Joined: Sun Dec 08, 2019 12:25 am

Re: "install and setup pc.sh" bashscript

Post by motoryzen »

Yeah..I can see if I sat down in person with Termy and Rene, either my head would get inflated like the villain ( not in a morally bad way just comedy way) of the Green Lantern movie with Ryan Reynolds diving into new commands and learning how to spin new webs of their neighborhoods into a city xD

Rene- I've been using LM Cinnamon since Late 2010, but mostly an on and off thing as in previous years I've had not enough patience or the hands on practice enough through better guidance to progress as much as I have in the recent almost 5 years. Switched to LM 20 cinnamon late July 2020 full time leaving winturd to rot finally and couldn't be happier.

It's really for me been just a fine wine refining process in what I've tried and learned and what all things I've been able to do to improve my computing experience as well as backup and restore lessons learned the hard way ( just nuked the more improved "install and setup pc.sh" bashscript I had the only a copy of on my 1TB ssd forgetting to create a sub folder for a test rsync backup from a laptop *facepalms hard * :lol:

So needless to say because of many cases of cerebral flatulence...I've had much hands on manual practice on some things and I'm slow to wrap my brain around many others.

Also seems that guy with the military picture on here majpooper has more bashscripting experience than I do to. So regardless...seems like I'm in good hands here one way or another :D . I'm chipping away at it. Almost there.

*** AT the moment, I'm trying to remember if backing up and restoring any of the other / directories would mean I wouldn't need to include the ( gsettings set ) or ( dconf write ) commands in terms of auto setting certain things.

These include but aren't limited to ( and I'm talking the gui included stock applications btw):

1. Themes - Mouse Pointer, Applications, Icons, Desktop gui setting adjustments
2. Screensaver to disable it completely as well as disable locking the PC and disable display sleeping
3. Display - (setting the hz refresh rate)
4. gnome-terminal - auto setting a custom background color and regular font color, font style, and highlighted font color as well as keybindings/keyboard shortcuts away from stock.
5. Windows- setting the custom "Draggable border width" to 22 ish " which is wider than stock, " Location of newly opened Windows" to ' Center ', and Alt-Tab button/tab selection= 'Delay before display the alt-tab switcher.

I need to really make notes one item at a time and really make a full list. *scratches head giggling embarrassed *
Mint 21.2 Cinnamon 5.8.4
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: "install and setup pc.sh" bashscript

Post by Termy »

motoryzen wrote: Mon May 15, 2023 5:35 pm cerebral flatulence
:lol:
motoryzen wrote: Mon May 15, 2023 5:35 pm *** AT the moment, I'm trying to remember if backing up and restoring any of the other / directories would mean I wouldn't need to include the ( gsettings set ) or ( dconf write ) commands in terms of auto setting certain things.
I'm almost certain they're stored in HOME, if you're talking about user-specific GSettings stuff.
rene wrote: Mon May 15, 2023 11:03 am [...]
Since at least Ubuntu 16.04, APT has always installed recommended packages by default, as I believe it has in other Ubuntu-based distribution I've used since, including Linux Mint. It's entirely why I've needed to use --no-install-recommends with things like LightDM. I remember using that flag when trying to install VirtualBox without the Qt stuff; fairly sure that was back in 16.04. I'm still on an Ubuntu 18.04 base, which is used in Linux Mint 19, and before that I had an Ubuntu 16.04 base, both of which installed recommended packages by default. I know this because I've had to at least once install things like LightDM myself, in both.

The only thing I can think of, with all that in mind, is that someone made a mistake on that Linux Mint page. I even had an installation of Linux Mint 19 in a virtual machine for ages and I'm fairly sure — although not 100% certain — that I still had recommended packages automatically getting installed. Perhaps what they actually mean is that they're installed when you use Synaptic or something like the Software Center? Neither of which are APT but are using APT, in the same way APT is not dpkg but APT is using dpkg.

Another thing that comes to mind is that possibly apt(8) or the Linux Mint wrapper, '/usr/local/bin/apt', is bypassing the APT::Install-Recommends parameter, since a lot of people nowadays use apt rather than the core apt-* utilities.

Beyond that, I'm baffled by this one. If you have access to a virtual machine and some old ISOs, it'd be helpful if you can verify this with apt-config dump | grep APT::Install-Recommends in their live environments or an install in which you know you've not adjusted this behavior. I'd do it, but I don't have access to virtual machines ATM. If it's '1' or 'true', then recommended packages are installed by default, and if it's '0' or 'false', it's the opposite. Boolean values, basically.

I wonder if they meant suggested packages. :roll:
Last edited by Termy on Mon May 15, 2023 6:46 pm, edited 1 time in total.
I'm also Terminalforlife on GitHub.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: "install and setup pc.sh" bashscript

Post by rene »

motoryzen wrote: Mon May 15, 2023 5:35 pm *** AT the moment, I'm trying to remember if backing up and restoring any of the other / directories would mean I wouldn't need to include the ( gsettings set ) or ( dconf write ) commands in terms of auto setting certain things.
That would not normally be the case, no. The dconf database (and gsettings is just a programatic interface to, usually, said dconf database) stores user-specific settings in a Windows' registry-like binary database which itself lives in ~/.config/dconf/user. That is, sits at the same level as the (other) dot-files/directories in your home-directory; would configure programs in "any of the other / directories" but with said programs themselves not changing, i.e., with backing them up not being a substitute for backing up/restoring their settings in the dconf database.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: "install and setup pc.sh" bashscript

Post by rene »

Termy wrote: Mon May 15, 2023 6:36 pm Since at least Ubuntu 16.04, APT has always installed recommended packages by default, as I believe it has in other Ubuntu-based distribution I've used since, including Linux Mint.
Indeed Ubuntu always did, but Mint did not historically. Old, but see e.g. here: viewtopic.php?f=42&t=185770

I don't have the time right now to go mess around with Mint 19 but I certainly also remember this changing for Mint 20 and installs all of a sudden pulling in a lot more than they used to. Pjotr may have on his site somewhere the information as to this changing at the time, also as per e.g. his answer in viewtopic.php?t=323111

[EDIT] Oh, hey, reading xenopeek's above linked old thread further gets us the information that indeed Mint still did not auto-install recommends in 19.3: viewtopic.php?p=1736228#p1736228
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: "install and setup pc.sh" bashscript

Post by Termy »

rene wrote: Mon May 15, 2023 6:55 pm [...]
Wow! How bizarre. I'm glad they finally aligned it with how things are in Ubuntu. Thanks for finding out and solving the mystery. :lol:
motoryzen wrote: Mon May 15, 2023 5:35 pm I need to really make notes
This alone is powerful. I've taken an inordinate amount of notes over the last few years. Notes make the world go around. The act of writing down or typing something, and putting things in your own words is important for learning, and it gives you a fresh reference you can check when you inevitably forget everything. :lol:
I'm also Terminalforlife on GitHub.
Locked

Return to “Scripts & Bash”