That audio I do!

posticon

When I looked at my audio files recently, I realized that that I wanted them organized in a consistent way. As it were naming standards varied, some tags were missing, different encoding types were used… I decided I was gonna Feng Shui my way out of it.

The reorganization department

I decided there should be consistent naming and it should be condensed as much as possible, yet still being understandable.

For the directory format I use $artist—$album. For many people the format is $artist/$album, however, I came to the term that I would have to have about 100 CDs in my collection before the list would get too cumbersome to navigate.

I decided also to do one directory per album. Before I had directory names like Fleetwood Mac — The Very Best of Fleetwood Mac (disc 1), but I discovered it was much tidier to use a base title: Fleetwood Mac — The Very Best of Fleetwood Mac then prepend the disc number to the audio files:

? ls Fleetwood Mac — The Very Best of Fleetwood Mac/
...
1-15 Songbird.m4a
1-16 Big Love (Live, 1997).m4a
1-17 Storms.m4a
2-01 The Chain.m4a
2-02 Don't Stop.m4a
2-03 What Makes You Think You're the One.m4a
...

There is another program that organizes multiple CDs in this fashion and I like the thought behind it.

Just the FAACs

I had been creating high-quality MP3s (256kbps) and just accidentally stumbled into trying MP4s—and was delighted by the difference. Similar bitrates of audio sounded fractionally, but for me, appreciatively better. So I encoded all CDs to .m4a (MPEG-4 audio extension). (I will probably go to loss-free audio format in the future if the gods favor.)

By the way, I think (clearly subjectively) that FAAC (Free Advanced Audio Coding encoder) is great. It mentions in the manual that “it is not up to par with the currently best AAC encoders” but from my semi-proficient audio setup it did well.

I tested encoding with a FAAC at a setting of 320 (~256kbps) versus the iTunes setting of 256kbps. I did find iTunes better. Audiophiles looking for every detail might talk but for me difference could be left alone.

Here is a partially non-scientific (but should be fairly representative) graph of FAAC’s quality settings compared to kilobytes per second:

I can verify for the first and fourth values as I have tested a number of times. The second and third values I got from hydrogen audio. The fifth value is a projected value based from the other values.

A FAAC setting of 150 has been recommended for “casual, non-critical listening”; however, I use FAAC 320 for my tunes and 55 for voice. Though similar bitrates to the iTunes encoder created slightly less quality, the file size reflected too: iTunes 8.4MB, FAAC 7.6MB.)

Softer player detritus

Software audio players that I have used tended to put a some extraneous files in my audio folders. I’ve seen album cover art put here, lyrics, some unnecessary metadata, and hidden folders. I did myself a favor and deleted them out. Nothing should be here but the audio files. If an audio player insists on putting stuff here, I would recommend to their users to file a bug so the developer can remedy it. Some may argue that album playlists should be put here but these I believe belong to saving along with the configuration files.

Book ’em, Danno!

I discovered a nice feature call the audiobook format. Instead of 100 tracks splayed over a directory, or directories, from a audiobook CD, I can reduce this to a reasonable amount (say, one file per disc or even less if I choose). These book formats can also contain chapter indexes so navigating a file is just like navigating a disc. The process isn’t incredibly difficult and I documented it here. If the audio player supports them, it is a nice feature.

Home directory organization

organizing-my-home-directory

Being a Type A personality, I’ve probably thought more about this than many. I have a certain organizational style and formatting schema that I consistently think about.

Folder layouts

I keep all my home directories about the same as everyone:

# cd ~; ls -1p
Audio/
Desktop/
Development/
Documents/
Downloads/
Pictures/
Public/
Videos/

One exception to the above is the “Audio” directory which I use for multiple audio types:

# tree -L 1 -d Audio/
Audio/
├── Audiobooks
├── Music
├── Other
└── Podcasts

The other exceptions is I also hide the Templates directory (.Templates) as I don’t use it often.

Desktop

Even though I use GNOME I’ve enabled the Desktop—this is my workspace. If I can see them, I can remember them.

# ls -1 Desktop/ | head -n 3
arch-install.md
arch-linux-wiki-css-box_00.svg
command-line-dictionary.md
...

Development

I’ve come to be a big fan of VCSs. If I build something that others can use on their computer, I’ll create a VCS for it. I’ve put all of these VCS directories in their own directory:

# tree -L 1 -F -i --dirsfirst Development/
_vault/
archpkgs/
armrr/
arpa/
ar-utils/
daeme/
dotfiles/
general-scripts/
rback/
wordnet-dict/
xuserrun/

Documents

I put all the Documents in one directory whether I wrote them or obtained them:

# ls -1p Documents/
Blog/
Guides/
Receipts/
_vault/
car-maintenance-schedule.ods
recipes.md
wish-list.md
work-schedule-weekly-two-person.xls

Pictures

I do the same with Pictures as I do my Documents; whether I designed, photographed, or obtained them, I put them here:

# ls -1p Pictures/ | head -n 7
Camera/
Designs/
Nostalgia/
_vault/
aqua pr09studios.png
arch-pseudo3d_PJ.svg
architectural-intent.svg

Naming conventions

For the major folders, I use single words with the first letter uppercase. For files and other folders, I try to keep to the somewhat-traditional Linux method of naming my files as lowercase. For spaces in files, I generally use a hyphen (-) which I see used a lot these days though I think an underscore was originally used. Underscores I will use if there is a category I would like separated in the name (portrait-of-bach_etching.svg).

Audio files

Read this post to learn how I organize my audio files.

Vaults

When I come across a file that I won’t use anymore, is outdated, a misdirection, I create a folder called _vault and I place them in it. I then always have them around as I find that sometimes I like to.

bashrc

The bash shell’s setting file is a really nice this to have detailed. Therefore I looked into it pretty good. For any that would like to use it, it can be found in the AUR.

DisplaySize in xorg.conf… uhgg!

Update: This turns out to be done by xrandr which the X.org server hands off to now for dynamic use of monitors. man xrandr even reports that it is trying to keepaconstant DPI. Not sure just why it is doing it, but found a good way to get it done.

I just got a new monitor to be able to use as an external monitor for my laptop. While I was setting it up I noticed that the monitors display size wasn’t correctly detected. The Xorg server does a good job auto-configuring however this caught my eye:

xdpyinfo | grep -B2 resolution
dimensions:    1920x1080 pixels (508x286 millimeters)
resolution:    96x96 dots per inch

The monitor I got is a 21.5″ monitor so I figured the DPI was off. I decided to calculate it myself (this is a square pixel monitor):

res_horz=1920
res_vert=1080
res_diag=$(echo "scale=5;sqrt($res_horz^2+$res_vert^2)" | bc)
siz_diag=21.5
siz_horz=$(echo "scale=5;($siz_diag/$res_diag)*$res_horz*25.4" | bc)
siz_vert=$(echo "scale=5;($siz_diag/$res_diag)*$res_vert*25.4" | bc)
echo "$siz_horz"x"$siz_vert"
475.48800x267.46200

Also there are online DPI Calculators conferred by doubt (1, 2,) and xrandr:

em_ds_h=$(xrandr | grep VGA-0 | rev | cut -d " " -f 3 | rev | sed 's/mm//')
em_ds_v=$(xrandr | grep VGA-0 | rev | cut -d " " -f 1 | rev | sed 's/mm//')
em_ds="$em_ds_h"x"$em_ds_v"
echo $em_ds
477x268

My discovered value and theirs are a couple millimeters off overall so I just used theirs. I created a configuration to define the display size to the the Xorg server. A basic configuration to define display size can be done like this:

cat /usr/share/X11/xorg.conf.d/90-monitor-disp-size.conf
Section "Monitor"
  Identifier "<default monitor>"
  DisplaySize 477 268
EndSection

Arch Linux and most distros use /etc/X11/xorg.conf.d/. However this won’t work on the external monitor. So I expanded on it (more than it probably needed to be) by defining both monitors and related sections:

Section "Monitor"
  Identifier    "Internal - Pavilion Laptop"
  DisplaySize    304.5 228.6
EndSection

Section "Monitor"
  Identifier    "External - Samsung Syncmaster SA350"
  VendorName    "Samsung"
  ModelName     "SA300/SA350"
  DisplaySize    476 267.7
EndSection

Section "Device"
  Identifier    "ATI Radeon Mobility IGP 330M"
  Option        "Monitor-VGA-0"  "External - Samsung Syncmaster SA350"
  Option        "Monitor-LVDS"   "Internal - Pavilion Laptop"
EndSection

Section "Screen"
  Identifier    "Default Screen"
  Monitor       "Internal - Pavilion Laptop"
EndSection

Section "ServerLayout"
  Identifier    "Default Layout"
  Screen        "Default Screen"
EndSection

I added VendorName and ModelName but I’m not sure they uniquely define the monitor so that the Xorg server acknowledges them. The VendorName I believe is just for reference, ModelName can usually be discovered by doing:

grep "Monitor name" /var/log/Xorg.0.log

Monitor-VGA-0 and Monitor-LVDS define the ports and hence by reference should uniquely define the monitor (xrandr -q shows them and both are found in the Xorg log).

After a bit of research I discovered that there is a good amount of history concerning the Xorg server having a bit of trouble in not being able to correctly discover the display size. I believe this may be related to some drivers. I’ve been told the open-source ATI driver have had problems and read in some other places of other people who have had similar issues. Defining the display size in the configuration and telling the Xorg server not to use the auto-detected value can be done by adding this to the Devices section (for Nvidia drivers use: Option "UseEDID" "FALSE"):

 Option        "NoDDC"

Unfortunately, this didn’t work either and left me completely at a loss. Unsure how to go further to define display size in the the Xorg server configuration I decided to define it through xrandr.

xrandr has an option to define the display size with the --fbmm option:

xrandr --output VGA-0 --auto -fbmm 476x267.7

--auto uses the default/preferred mode of the monitor.

A beautiful fstab

I know what partitions I have and like to know what is mounted and where. To do this, I keep a tidy static filesystem file (/etc/fstab).

I use labels instead of UUID’s just because they look nicer, but also because this allows me to resize them if need be. It’s hard to go wrong with UUID’s but since I know I likely won’t be putting a USB drive named ‘Windows’ or ‘DisrtoX’ in the USB port, I’m likely pretty safe. You may have noticed too that I choose not let HAL/DBUS (is it dbus that does mounting now?) handle my Windows and Storage partitions. I choose to do this for several reasons. One is because when I copy files I almost always find it much quicker from the command line (i.e. cp file1 file2 ... /mnt/Storage/backups/) rather than navigate through multiple directories in the file browser. The second reason is for security because sensitive data I don’t always want available. The third is to protect the Windows partition. If a crash were to happen, I find it a good inconvenience to have to boot Windows to be able to fix the NTFS volume.

Here it is:

# /etc/fstab: static file system information
#
# <file system>          <dir>        <type>  <options>           <dump/pass>
# Temporary file systems:
tmpfs                    /tmp         tmpfs   nodev,nosuid                0 0

# Internal hard disk (sda[2,3,5,6,7]): 
LABEL=SYSTEM\040RESERVED /mnt/SR      ntfs-3g noatime,noauto,user         0 0
LABEL=ACER               /mnt/Windows ntfs-3g noatime,noauto,user         0 0
LABEL=Arch               /            ext4    errors=remount-ro,noatime   0 1
LABEL=Home               /home        ext4    noatime                     0 2
LABEL=Swap               swap         none    defaults                    0 0

# External hard disk (sdb1)
LABEL=Backup             /mnt/Backup  ext4    noatime,noauto,user         0 3

noatime has been applied to save disk writes and unnecessary timestamps everytime the file is accessed, and the user option allows me to mount without superuser privileges.

Firefox touch-ups that might be desired

firefox-tuning

Firefox is a browser that works good for me. It is pretty much ready to go from installation but I find a few touch-ups help me out a bit.

Configuration edits

Below I will list the edits followed by the description. I use the configuration editor to make these which makes it a bit quicker for me. The editor can be reached by typing about:config in the URL bar.

browser.chrome.toolbar_tips             false  # pop-up tips for UI elements off
browser.sessionstore.restore_on_demand  false  # on browser startup tabs load
browser.startup.page                    3      # restore tabs from prev. session
browser.tabs.loadDivertedInBackground   true   # new tabs are background tabs
browser.zoom.full                       false  # zoom web page text only
layout.css.devPixelsPerPx               X.X    # non-96-DPI set (eg 102/96=1.06)
layout.spellcheckDefault                2      # spell check entry fields too
middlemouse.contentLoadURL              false  # middlemouseclick noautoload URL
middlemouse.openNewWindow               false  # middlemouseclick opens new tab
mousewheel.default.delta_multiplier_y   200    # mouse scroll speed
nglayout.enable_drag_images             false  # tabwindowpreviews on drag off
privacy.donottrackheader.enabled        true   # request websites not to track

Font type and size

Many sites define font size depended on CSS values; using these values can be helpful in define font size see Firefox font type and size for more.

Add-ons

Add-ons that are well designed can help the browser experience. Luckily I find Firefox to have most of what I need, but I do use:

  • Wired Marker — highlight text on a webpage and remember it.

Additional information

  • Firefox shortcut keys:
    • Ctrl+L—URL bar focus
    • Ctrl+K—search bar focus
    • Ctrl+F—Find
    • Ctrl+G—find aGain; Ctrl+Shift+G—find previous
  • A middle-mouse-click will close the tab.
  • For spell checking be sure to add the dictionary (e.g. hunspell-en package for English…), enable by right clicking in text-entry field.
  • Reset Firefox if problems begin (keeps bookmarks, passwords…).
  • Firefox Tips and Tweaks

Customize man page colors with ‘less’ definitions

Man pages by default use less for displaying. I’ve used vim before to for colored text in man pages but something got bjorked in an update. To have color with man pages termcap will need to be invoked. Thanks to nico for the tip.

All that needs to be done is to export bold and underline values of termcap. Adding the values to the ~/.bashrc will make sure that they are always used:

# Less Colors for Man Pages
export LESS_TERMCAP_mb=$'\e[01;31m'       # begin blinking
export LESS_TERMCAP_md=$'\e[01;38;5;74m'  # begin bold
export LESS_TERMCAP_me=$'\e[0m'           # end mode
export LESS_TERMCAP_se=$'\e[0m'           # end standout-mode
export LESS_TERMCAP_so=$'\e[38;5;246m'    # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\e[0m'           # end underline
export LESS_TERMCAP_us=$'\e[04;38;5;146m' # begin underline

And source the ~/.bashrc to have it work:

source ~/.bashrc

Some may notice I used Arch colors :) :