From owner-freebsd-questions@FreeBSD.ORG Tue May 31 23:02:00 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05959106566C for ; Tue, 31 May 2011 23:02:00 +0000 (UTC) (envelope-from olivares14031@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 816288FC12 for ; Tue, 31 May 2011 23:01:59 +0000 (UTC) Received: by bwz12 with SMTP id 12so6037841bwz.13 for ; Tue, 31 May 2011 16:01:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=AuRt4yTBUZGWh1WDjlLzdCQu9YizoQ2hgiNThc/Ewk4=; b=Rfbg+xrXrpyRMzgi1Q+Q1h6sDvlJUFvrXfXzhgT/mmFPRWAWcRMFGI1qfiGG+Aepc7 KX2oU8GmQe9q1Rl0hImZQleChuJgaQdjQLTMlDu2kYFiGE3UTNv1vUI3BwU+LUBRL1m/ +5zh8H86r2Pf2V3GDGc/meam/5oStOG4LjlSI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Czj593ADDWEMLxma0fLxFSjlnnvCu5d8HZyrJ1bw4+RGV3aooMSKcrEKpV/UMUTQ7y U9I6sHuFoL1hR6ATdZCpa8Ihn3mpg+srfpti4AiZcU1cegzGUOuwtEj2osqbO97tSWss x8pJtjgOVQ7IFJ5+IK85J4v4240Muw4iF8l4o= MIME-Version: 1.0 Received: by 10.204.170.193 with SMTP id e1mr5558972bkz.136.1306882918057; Tue, 31 May 2011 16:01:58 -0700 (PDT) Received: by 10.204.176.82 with HTTP; Tue, 31 May 2011 16:01:58 -0700 (PDT) In-Reply-To: References: Date: Tue, 31 May 2011 18:01:58 -0500 Message-ID: From: Antonio Olivares To: Xn Nooby Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Mailing List Subject: Re: A small script to customize FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2011 23:02:00 -0000 >> You could always have ${1:-theuser} instead to have a default of >> theuser, but take the value for username as the first argument. >> >> Chris >> > > That's a good idea. =A0The user was originally called "me", but I wanted > something that could be searched and replaced without breaking "gnome" > and "home". =A0Using a parameter would be even better, thanks!. > _______________________________________________ For the sound setup: loadSoundVBX() { echo loadsoundVBX... kldload snd_driver cat /dev/sndstat echo 'snd_ich_load=3D"YES"' >> /boot/loader.conf } kldload snd_driver will load the sound driver that it thinks would be the best, but then the driver is changed to ``snd_ich`` in the script. If a user has ``snd_hda``, then the script should output snd_hda and substitute in the loading statement. I see the following code could do the job, but it might need some testing := ( #!/bin/sh # # Detect sound driver for driver in /boot/kernel/snd_*; do driver=3D$(echo ${driver} | sed 's|/boot/kernel/snd_||') if [ ${driver} =3D "driver.ko" ]; then continue; fi kldload snd_${driver} if [ -c /dev/mixer0 ]; then echo "I'm smelling 'snd_${driver}'" echo "snd_${driver}_load=3D\"YES\"" >> /boot/loader.conf exit 0 fi kldunload snd_${driver} done This found in here: http://forums.freebsd.org/showthread.php?t=3D22726 The script looks very nice and it could be a valuable asset for the future. Still, there are some things that we(users) need to do by hand and get our hands dirty :) In my case, I could not determine my sound card, I did not get very nice information from cat /dev/sndstat [olivares@tricorehome ~]$ cat /dev/sndstat FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64) Installed devices: pcm0: (play/rec) default pcm1: (play) pcm2: (play) But thanks to list members and their experience, someone suggested to use snd_hda and it worked to perfection :) Regards, Antonio