Finn's Tweak Script

Share here your personal tips or creations: desktop, conky, docks, widgets or tweaks are welcomed here!
User avatar
FinnFann
Posts: 109
Joined: 02 Feb 2015 10:47
Location: North Carolina, USA
Contact:

Finn's Tweak Script

Postby FinnFann » 08 Feb 2015 18:08

UPDATED FEB 16, 2015
Just a small script I made to ease my customization after solydk installation, as I tend to do a number of small things. Note that I run this AFTER ensuring I'm fully upgraded, and that I've installed the multimedia and home programs from the welcome screen.

What this does, in order:
  • Performs apt-get update
  • Performs dist-upgrade just in case
  • Installs xinput. I use this for mapping my touch screen to the monitor. Otherwise it acts on all monitors.
  • Installs Krita and Mypaint, good extra paint apps (Krita is a photoshop-alike and mypaint is completely brush-based)
  • Installs extra screensavers (should be installed, but might not be. XFCE doesn't have them)
  • Installs Audacity for recording/manipulating audio
  • Installs KDE-Telepathy for any libpurple messenger needs. It's the "replacement" for the now-discontinued kopete
  • Installs Skype because we all know someone who won't use anything else
  • Install libavcodec-extra-56 again, as skype removes it initially in favor of the normal library (as well as libjack0, but you can't reinstall libjack0 that I know of without skype going away).
  • Installs Steam. Because.
  • Replace Firefox ESR with the normal Firefox and Firefox-Solydk-Adjustments
  • Install chromium and pepperflash because while I don't prefer it...Firefox is without full HTML5 video support until FFMPEG makes it's way back down to debian stable
  • Adds a bunch of Gstreamer 0.10 and 32-bit libraries needed for running Secondlife. I couldn't install bad or ugly 32-bit, however
  • Purges playonlinux, wine, wine32, and wine64 as I install liquorix kernel, and these will make the initial upgrade a bit bumpy (can install playonlinux and wine afterwards, just use the liquorix ones)
  • Purge leftovers with apt-get --purge autoremove
  • Includes a large comment section quick-reference for liquorix install by hand (I'm not trying to automate it as, unlike the previous steps, there might be issues that need hand combing)

It also prints each call to "log.txt" in the script's directory for your convenience using tee. And clear the terminal each command. Note the clears aren't just there for prettiness. I've noted Konsole will freak out a bit if a command gets too long and start appending all output to one line (rather ugly).

PREVIEW OF SCRIPT:

Code: Select all

#!/bin/bash
#NOTE: I use "clear" in here a lot as some console apps
#like Konsole will freak out if commands go on too long, apparently.
sudo apt-get update | tee log.txt &&\
sudo apt-get dist-upgrade | tee -a log.txt &&\

#Make sure Xinput is installed so I can fix my QUANTA touchscreen
sudo apt-get install xinput | tee -a log.txt &&\
echo "------------------------------------------------" | tee -a log.txt &&\
read -p "Click enter to continue..." &&\

clear &&\

#Install Krita and mypaint, some useful additional paint apps
sudo apt-get install krita mypaint | tee -a log.txt &&\
echo "------------------------------------------------" | tee -a log.txt &&\
read -p "Click enter to continue..." &&\

clear &&\

#Install extra screensavers if not present
sudo apt-get install xscreensaver-gl xscreensaver-gl-extra xscreensaver-data-extra xscreensaver-screensaver-bsod | tee -a log.txt &&\
echo "------------------------------------------------" | tee -a log.txt &&\
read -p "Click enter to continue..." &&\

clear &&\

#Audacity is a good audio recorder/modifier
sudo apt-get install audacity | tee -a log.txt &&\
echo "------------------------------------------------" | tee -a log.txt &&\
read -p "Click enter to continue..." &&\

clear &&\

#Install pidgin or kde-telepathy for instant messaging
sudo apt-get install kde-telepathy | tee -a log.txt &&\
echo "------------------------------------------------" | tee -a log.txt &&\
read -p "Click enter to continue..." &&\

clear &&\

#Install skype, because it sucks but we gotta have it... Including the gtk2 murrine i386 engine so it obeys most themes
sudo apt-get install skype gtk2-engines-murrine:i386 | tee -a log.txt &&\
echo "------------------------------------------------" | tee -a log.txt &&\
read -p "Click enter to continue..." &&\

clear &&\

#Skype removes this library for some reason. We can grab it back and it'll grab the one skype can use too.
sudo apt-get install libavcodec-extra-56 | tee -a log.txt &&\
echo "------------------------------------------------" | tee -a log.txt &&\
read -p "Click enter to continue..." &&\

clear &&\

#Install steam for gaming
sudo apt-get install steam | tee -a log.txt &&\
echo "------------------------------------------------" | tee -a log.txt &&\
read -p "Click enter to continue..." &&\

clear &&\

#Replace Firefox ESR with normal firefox.
sudo apt-get purge firefox-esr firefox-esr-solydxk-adjustments | tee -a log.txt && sudo apt-get install firefox firefox-solydxk-adjustments | tee -a log.txt &&\
echo "------------------------------------------------" | tee -a log.txt &&\
read -p "Click enter to continue..." &&\

clear &&\

#Add Chromium. This is good for watching HTML5 videos as firefox is currently missing html5 x.264 support in debian stable. Adding pepperflash just in case as well
sudo apt-get install chromium chromium-l10n pepperflashplugin-nonfree | tee -a log.txt &&\
echo "------------------------------------------------" | tee -a log.txt &&\
read -p "Click enter to continue..." &&\

clear &&\

#Add some libraries for secondlife
#http://wiki.phoenixviewer.com/32-bit_firestorm_in_64-bit_ubuntu
#Ugly and Bad for i386 did not work correctly due to dependencies, so I've excluded those.
sudo apt-get install libglu1-mesa:i386 libgtk2.0-0:i386 libidn11:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libqtwebkit4:i386 gstreamer0.10-pulseaudio:i386 gstreamer0.10-plugins-base:i386 gstreamer0.10-plugins-good:i386 gstreamer0.10-pulseaudio gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly | tee -a log.txt &&\
echo "------------------------------------------------" | tee -a log.txt &&\
read -p "Click enter to continue..." &&\

clear &&\

#Prepare for liquorix by removing wine and conflicting stuff I found.
sudo apt-get purge wine32 wine64 wine playonlinux | tee -a log.txt &&\
echo "------------------------------------------------" | tee -a log.txt &&\
read -p "Click enter to continue..." &&\

clear &&\

#Clean up leftovers
sudo apt-get --purge autoremove | tee -a log.txt &&\
echo "------------------------------------------------" | tee -a log.txt &&\
read -p "Click any key to exit..." && clear

<<'LARGENOTE1'
ADDITIONAL NOTES:
Afterwards you can add liquorix kernel at the following location:
http://liquorix.net/

By making a .list file with the following...To quote their page:
--------------------------------------------------
# /etc/apt/sources.list.d/liquorix.list
deb http://liquorix.net/debian sid main
deb-src http://liquorix.net/debian sid main

# Mirrors:
#
# Unit193 - France
# deb http://mirror.unit193.net/liquorix sid main
# deb-src http://mirror.unit193.net/liquorix sid main
#
# Liquorix - Cloudfront Global CDN
# deb http://cdn.liquorix.net/debian sid main
# deb-src http://cdn.liquorix.net/debian sid main
--------------------------------------------------

Then perform an apt-get update, install the keyring, perform another update, then dist-upgrade AFTER READING THE FOLLOWING NOTES...

NOTE: When you update there will be an issue with wine. To solve this remove playonlinux, wine, wine64, and wine32 before installation.
Or, optionally, use dpkg to purge wine64/32 after the failed upgrade. Then perform apt-get -f install to complete the wine 1.7 installation from liquorix.

Then go nuts and install the kernel you want...to quote their page (remember to use sudo or something):
--------------------------------------------------
#32-bit without PAE (HIGHMEM4G):
apt-get install linux-image-liquorix-686 linux-headers-liquorix-686

#32-bit with PAE (HIGHMEM64G):
apt-get install linux-image-liquorix-686-pae linux-headers-liquorix-686-pae

#64-bit:
apt-get install linux-image-liquorix-amd64 linux-headers-liquorix-amd64
--------------------------------------------------
LARGENOTE1
#END
Attachments
Solyd_Post.sh.zip
(1.83 KiB) Downloaded 60 times
ImageLemonade

User avatar
FinnFann
Posts: 109
Joined: 02 Feb 2015 10:47
Location: North Carolina, USA
Contact:

Re: Finn's Tweak Script

Postby FinnFann » 08 Feb 2015 18:14

:C Just learned through a Karbon alert that it's now unmaintained. That makes me sad face, but krita is still good. So I removed the karbon replaces inkscape lines. As much as it pained me.
ImageLemonade

kurotsugi
Posts: 1952
Joined: 09 Jan 2014 00:17

Re: Finn's Tweak Script

Postby kurotsugi » 08 Feb 2015 18:58

you can use something like this to handle the log files

Code: Select all

#log files handling. automatically deleted if filesize greater than 1MB.
LOG=/path/to/log1.log
LOG1=/path/to/log2.log
log_size=" $( stat $LOG |grep Size |awk '{print $2}' )"
if [ "$log_size" -gt 1000000 ]
then
   mv $LOG $LOG1;
fi

we can user this pattern to distinguish between the script executions.

Code: Select all

echo "$( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG
the usage of test case might be interesting to use

Code: Select all

#do nothing if the program already installed
if test -e /path/to/flag_file; then
     echo "program x already installed. " | tee -a $LOG
else
    command1
    echo  "command1 executed" | tee -a $LOG
fi
#this pattern do the same.
if [ -e /path/to/flag_file]; then
     echo "program x already installed." | tee -a $LOG
else
    command1
    echo  "command1 executed" | tee -a $LOG
fi
#we could use the binary file of certain package as the flag_file.
else, we could add some interactivity for user.

Code: Select all

read -r -p "do you want to install X? [y/n]" choice
case "$choice" in
     [yY][eE][sS]|[yY]
          command1
          ;;
     *)
          command2
          ;;
esac
#similar pattern
read -r -p "do you want to install X? [y/n]" choice
if [[ $choice =~ ^([yY][eE][sS]|[yY])$ ]]; then
     command1
else
     command2
fi

User avatar
FinnFann
Posts: 109
Joined: 02 Feb 2015 10:47
Location: North Carolina, USA
Contact:

Re: Finn's Tweak Script

Postby FinnFann » 08 Feb 2015 19:36

kurotsugi wrote:you can use something like this to handle the log files

Code: Select all

#log files handling. automatically deleted if filesize greater than 1MB.
LOG=/path/to/log1.log
LOG1=/path/to/log2.log
log_size=" $( stat $LOG |grep Size |awk '{print $2}' )"
if [ "$log_size" -gt 1000000 ]
then
   mv $LOG $LOG1;
fi

we can user this pattern to distinguish between the script executions.

Code: Select all

echo "$( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG
the usage of test case might be interesting to use

Code: Select all

#do nothing if the program already installed
if test -e /path/to/flag_file; then
     echo "program x already installed. " | tee -a $LOG
else
    command1
    echo  "command1 executed" | tee -a $LOG
fi
#this pattern do the same.
if [ -e /path/to/flag_file]; then
     echo "program x already installed." | tee -a $LOG
else
    command1
    echo  "command1 executed" | tee -a $LOG
fi
#we could use the binary file of certain package as the flag_file.
else, we could add some interactivity for user.

Code: Select all

read -r -p "do you want to install X? [y/n]" choice
case "$choice" in
     [yY][eE][sS]|[yY]
          command1
          ;;
     *)
          command2
          ;;
esac
#similar pattern
read -r -p "do you want to install X? [y/n]" choice
if [[ $choice =~ ^([yY][eE][sS]|[yY])$ ]]; then
     command1
else
     command2
fi


Oh my that's a little intense for how simple this aimed to be X3 Might look into this, but this is really just me sharing something I personally use out of laziness rather than a supported tool.
ImageLemonade

User avatar
Snap
Posts: 1244
Joined: 25 Aug 2013 20:01
Location: Spain

Re: Finn's Tweak Script

Postby Snap » 09 Feb 2015 10:37

Very interesting post install script, FinnFann. Thanks for sharing. I would use parts of it but not all. :mrgreen:

About Gimp and Krita. From my point of view, Gimp and Krita are not equivalent or even close. I use both. Gimp for Photo editing and Krita for Drawing. Both can be used for both tasks, but IMHO, they are aimed and better suited for these two different roles. About Karbon and Inkscape I find them more "the same thing", thus more interchangeable than Gimp and Krita could be.
This likely means that your installation is broken. -Mr Pixbuf.

Image

User avatar
FinnFann
Posts: 109
Joined: 02 Feb 2015 10:47
Location: North Carolina, USA
Contact:

Re: Finn's Tweak Script

Postby FinnFann » 11 Feb 2015 03:04

Snap wrote:Very interesting post install script, FinnFann. Thanks for sharing. I would use parts of it but not all. :mrgreen:

About Gimp and Krita. From my point of view, Gimp and Krita are not equivalent or even close. I use both. Gimp for Photo editing and Krita for Drawing. Both can be used for both tasks, but IMHO, they are aimed and better suited for these two different roles. About Karbon and Inkscape I find them more "the same thing", thus more interchangeable than Gimp and Krita could be.


:3 I like to think of it as a nice start point for anyone here who hasn't used bash scripts to simplify their post installs. And good points. I might leave both installed on my own script, and update it here. That being said I might also add an app too and install mypaint. If you haven't used it, it's an amazing brush-based paint tool >> Lacks some tools of other paint editors, but the brush support is epic.
ImageLemonade

User avatar
Snap
Posts: 1244
Joined: 25 Aug 2013 20:01
Location: Spain

Re: Finn's Tweak Script

Postby Snap » 11 Feb 2015 07:10

I read very good things about Mypaint. Some distros are replacing Gimp with it. I only gave it a fast go for a few hours. But you know, once you are used to Gimp and Krita, it's hard to switch to something else even if it's great on its own. :lol:

Anyway. As you said, the great thing about this post install script is that it's a good base to edit and tweak for personal or specific needs. Add or remove the apps and tools to suit your togo programs and you're done. Once again, great job and thanks for sharing.
This likely means that your installation is broken. -Mr Pixbuf.

Image

User avatar
FinnFann
Posts: 109
Joined: 02 Feb 2015 10:47
Location: North Carolina, USA
Contact:

Re: Finn's Tweak Script

Postby FinnFann » 17 Feb 2015 04:34

Updated it as I've made a lot of changes. Still simplistic as I can make it, yet should be powerful enough. Includes some extra stuff others may want to remove before running (purging playonlinux for example).
ImageLemonade

User avatar
Snap
Posts: 1244
Joined: 25 Aug 2013 20:01
Location: Spain

Re: Finn's Tweak Script

Postby Snap » 17 Feb 2015 08:47

Cool. Thank you.
This likely means that your installation is broken. -Mr Pixbuf.

Image


Return to “Customizations”

Who is online

Users browsing this forum: No registered users and 1 guest