First, excuse me for my bad english
I've wrote my first script in bash and this is for archlinux.
This one install all necessary packages, check with hwd what are the sound cards modules that have to be probe, write the /etc/rc.d/alsamixer module and install dmix
It also modify /etc/rc.conf to had the modules and the deamon and add a user to the audio group.
The script works fine on my computer but i'd like to know if it really works well.
very nice script
it will really simplify arch instalation.
tanks, but it seems to still have some problems with it.
Well, it seems to work fine now.
I'll maybe add some fonctionality as for exemple, choice between alsaconf or manual install for the sound modules. And other one will be the choice between french and english language (In english for the moment)
This script is the first part of a project for a script that will do a big part of post install of archlinux. After alsa, i'm working now on a script that will write an optimised xorg.conf, install the graphic card (nvidia & ati) and install a window manager as fluxbox, with a nice configuration of it.
This work is designed to newbies on archlinux as we have seen that this kind of configuration seems difficult for some people.
nice script. i might consider adding something like that to Archie, so tnx.
my 2cents - instead of using "hwd -e" use "lshwd -a" which will modprobe the modules for u so u can remove your modrpobe's list.
Thanks a lot for creating this script, it makes installing sound on arhc simpler but also faster!
I testet it on my computer and it works great!
But I have a question, it also installed dmix this means that I can play multiple sounds at the same time doesn't it? I tried it on gnome but that doesn't work. I selected alsa as sound output for gnome and tried playing two sounds at one time but the second waits until the first is done? Do you know if it's possible and how?
Woops, stupid, it is already in english, I must have done something wrong..
Yes, the script is nice, one command and you got the sound set up...
Favorite systems: ArchLinux, OpenBSD
"Yes, I love UNIX"
I used this script on pretty much computers now, so it has already saved me pretty much time Thanks again!
May I give a few suggestions:
In the begin you check if the user is root with $USER, maybe it is better to use whoami instead. Because whoami will also see that you are root when you are root in su
Maybe clean up the output a bit, you probably know that you can pipe the output of a program to /dev/null, for instance instead of
amixer set Master 70 unmute
you could use
echo -n 'Setting Master volume to 70...' if amixer set Master 70 unmute > /dev/null then echo 'done' else echo 'failed' exit 1 fi
And maybe use the same layout of output pacman uses.
Also something goes wrong with the /etc/rc.d/aslamixer script. It keeps al the n signs in it instead of new lines. I think it is better to have a seperated file alsamixer and distribute you script in a tarball, so you can easiely copy the file to /etc/rc.d. But of course this is just my opinion.
You often add something to the rc.conf file, because this happens often and is nearly the same everytime you maybe could use a function where you send the parameters, file (in this case rc.conf) variable_name (here it is DAEMONS or MODULES) and of course the value. (for instance alsamixer)
On the end of the script you ask width users you want to add to the audio group. You can check if the user is already in the audio group (cat /etc/groups | grep audio etc) and don't show that user because he's already in it and maybe filter out groups as ftp, svn, etc
This is just a very rough idee but what about that every configuration script that's (going to be) written for arch uses the same file and output layout. For instance that every configuration script has:
1: A standart name, for instance arch-config-audio, arch-config-grub etc
2: As I already mention the same output to the users
3: Two scipts, one called configure, this script would do (if needed) some hardware detection and ask the user questions. The second called install, this would do the time consuming installation and would never ask a question to the user. This way one can do all the configuration of the 'install scripts' directly after each other and than install everything, where the user can leave the computer.
4: And of course add those script to the one of the ftp servers so you can install them with pacman
Don't take the last idee too serious, I often have a lot of stupid idees
The script destroyed my rc.conf, so the thing won't reboot anymore. It deleted an ) on the end of the daemons line, and this was it.
Frumpus ♥ addict