Customisation Scripts: Is it possible to edit *everything* from bash, or are some things just out of bounds?

G'day Reddit,

I'm trying to write a script to customise my installation of ubuntu. I regularly reinstall the whole thing, as I tend to tinker, and I'm not very good at it, so to save time, I thought I'd make a script.

I don't really know that much code, only a few of the basics. Most of what is in the script so far is clobbered together from what I've read on various sites, and what I understand of it. I've got over half of what I want to do, but I can't find a way of editing the rest of the stuff from bash. Can you help?

This is the script so far: http://pastebin.com/m652ed696

What it does so far is:

  • Ask how many bits in the system (I have a 32 bit desktop, and 64 bit laptop. I'd like to be able to use this for both)
  • Ask the version name (Hardy, Intrepid, Jaunty, Karmic etc)
  • wget themes from websites
  • edit sources.list (using version name), then apt-get update
  • Install stuff I think I use regularly (Using bits information)
  • apt-get -y upgrade
  • customises terminal
  • copies across .face profile image
  • unpacks themes (Does not set as default... is this possible?)
  • Add programs to autostart list
  • Enable sudo insults

What I'd like to add

  • Importing & installing compiz file. I have a file I've exported from compiz, and I'd like to import it, but can't find anything on that.
  • Enabling any proprietary drivers on the system
  • Editing Keyboard preferences (Compose key position, Key sequence to kill X-server, Alt/Win key behaviour) Under system>prefs>Keyboard
  • Add System monitor to top right of pannel, (And loads of other taskbar applet stuff)
  • Set Ctrl + Alt + T to launch terminal under System>Prefs>Keyboard shortcuts (etc)
  • Rename one of System>prefs>Screensaver to XScreensaver (XScreensaver and Gnome Screensaver have the same name)
  • Enable Time synchronisation (NTP)
  • Edit power management settings (Screensaver, sleep time etc)

Thanks in advance!

Posted Jan 17, 2010, 3:50 AM UTC · edited

614
ideas-man•

Look into using gconf-tool to change things; I believe most of what you want to do is done there. But the drivers seems hard, unless there's a CLI for it. I mean, just copy your panel folder over, to make things easier.

6
netcoder•

You can enable what is listed under Hardware Drivers through command line:

$ jockey-gtk -l
kmod:wl - Broadcom STA wireless driver (Prioprietary, Disabled, Not in use)
$ sudo jockey-gtk -e kmod:wl
2
chevron_colon_3OP•

Panel folder, Genius! I never thought that'd be so easy!

I thought about going for gconf-editor, but I can't find the specific bits about keyboard in it. I've spent a while going through it, but to no avail. Even if I did find the right triggers, I wouldn't know how to edit them from bash.

1
enkiam•

Put your /home directory on its own filesystem, and don't blow it away when you reinstall. There, anything for your user account is now saved.

3
chevron_colon_3OP•

I thought about doing this, but a fresh install is kind of fun. And I'd prefer a script to a work-around. I've learnt quite a lot from the script so far!

1
Pfiffer•

The script seems more like a work-around to me. Having a separate /home is standard anyway.

7
johnpickens•

Keeping a separate partition for /home is par for the course for many Linux setups...

3
chevron_colon_3OP•

Ok, I note that I should probably but my /home in a separate partition, and I probably will do for my desktop, which will render this entire exercise academic for that computer, but i'm still quite curious.

I'm also dual-booting with Vista on a laptop which is covered by software warranty, assuming I don't mess with partitions. Bearing in mind how much vista throws a hissie fit if you try to do system restore with a differing partition system to what it is expecting, I have to completely remove all linux partitions before resetting vista, so I've had to go through this whole circus about twice.

I also take similar steps when installing ubuntu on someone else's computer, so this would speed up the whole proces.

1
aperson•

why not just backup/image everything?

2
chevron_colon_3OP•

Because I want to be able to use this on different computers, used for different things, and/ or other people's computers.

That... and it's a challenge.

Edit A challenge I don't appear to be succeeding at.

1
aperson•

What's stopping you from using an image? Image the system at where you like it and when you want to use it, dd the image on to the drive and use gparted to expand it. From there all you do is modify grub a bit and you're done.

2
chevron_colon_3OP•

Surely that would then restrict me to whatever version is installed at the time? I want to be able to customise a fresh install, instead of downloading a massive file, or carrying about a CD.

2
p_b_r•

Check out UbuntuOne as a means of backing up your home directory. So long as you stick to 'buntu installs you should be able to upload, reimage, download.

2
chevron_colon_3OP•

Yes, but I'm not trying to create a backup.

For that I'm following: http://wiki.archlinux.org/index.php/Full_System_Backup_with_rsync I'm not dead keen on Ubuntu one, as my coursework and other uni stuff covers more than the 2GB that Ubuntu one provides (Last time I checked)

This script is solely to mess with installed programs and compiz, etc.

1