20 May 2014

578. More Gnome issues -- semi-rant

I was able to get on with work in spite of transitioning to gnome 3 -- but only thanks to the frippery extensions:
http://verahill.blogspot.com.au/2011/11/debian-testing-64-bit-gnome-3gnome.html 
http://verahill.blogspot.com.au/2013/04/402-very-briefly-what-i-forgot-about.html

And then gnome-screenshot got crippled, but I managed to cope with that by patching it:
http://verahill.blogspot.com.au/2012/06/fixing-gnome-screenshot-341-in-debian.html

I'm using debian testing (jessie) on my laptop and since I normally don't do much on it other than occasionally log into work to check on jobs I have been able to ignore the issues that are so apparent in gnome 3.12, two of which are:

*  gnome-terminal doesn't have a transparent background option since ersion 3.8 -- instead of being able to read what's underneath (e.g. a blog post with a how-to), and thus making good use of the screen real estate, my laptop screen is now feeling very, very small.

[And the developer seems to have the usual gnome attitude issue: https://bugzilla.gnome.org/show_bug.cgi?id=698544 ]

gnome-terminal 3.12
 There's basically nothing that has forced me to stay with gnome-terminal, so switching terminals was a simple matter of installing xfce4-terminal instead, which looks pretty much like gnome-terminal used to. Besides, I use guake more of the time anyway.

xfce4-terminal

 * you can't resize 'native' gnome programs, such as nautilus, that are in full-screen mode. Well, you can -- by holiding super (i.e. windows button) + down arrow. But the icons in the top right corner are no longer, and I find that incredibly annoying.
Nautilus. Nautilus shows when dropbox is synced -- thunar doesn't.

Thunar -- like nautilus of days gone by
 There are two things that I need from nautilus (other than working as a filemanager, of course, and allowing me to open terminals where I want which is something thunar supports 'out of the box') -- the ability to batch resize images, and dropbox. Now, dropbox has nothing to do with nautilus and the dropbox server will run happily in the background whether you're using a file manager or not. It would be nice if thunar would show whether the dropbox folder is synced or not, but it's hardly crucial.

Image resizing is a different matter since we maintain our own little website with personal photos for overseas members of our families. Ergo, it's crucial.

Luckily, this is pretty easy:
sudo apt-get install simple-image-reducer

Go to Edit/Configure custom actions... and set command to simple-image-reducer %F, and scope to apply to images, as shown in the screenshots.





I'm sure there are lots of other small issues in gnome 3.12 that I either keep missing or wilfully ignore in the interest of maintaining a low blood pressure. The whole idea of removing features that are actually useful with no way of re-enabling them smacks of 'we know better than you', and that irks me.

15 May 2014

577. Skype and webcam on debian wheezy: black screen

This is another shameless re-posting of a solution published by others. See e.g. 
http://community.skype.com/t5/Linux/Webcam-is-not-working-on-skype-with-Ubuntu-12-04/td-p/858418
https://bbs.archlinux.org/viewtopic.php?id=95388
http://ubuntuforums.org/showthread.php?t=966882

Why am I doing this? Mostly because this blog doubles as a notebook where I can write down solutions that worked for me so that I don't find myself scouring the internet over and over again for the same solution.

I hope that I'm adding a bit of value by providing step-by-step solutions and snazzy screenshots though.

The issue:
even though the camera is working fine there's only a completely black picture in skype (not underexposed -- just plain black):






The solution:
Use LD_PRELOAD to load the 32 bit V4L library (which you need to have installed -- use apt-file to find out what package). You can either start skype from the command line, or make changes to the launcher, either via main menu  as shown in the screenshot or by editing ~/.local/share/applications/skype.desktop i.e. run skype with 
env LD_PRELOAD="/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so" skype


 At this point starting skype + webcam should be a happy marriage:
(aside from exposure, white balance etc. etc.)

13 May 2014

576. Shortening the bash prompt in debian

This is yet another post in which I'm (almost) simply reposting a solution that someone else has already posted online.

Let's say that my contribution is to put it in context of debian.

Either way, here's the problem that needed solving: the debian prompt by default lists all directories, which sometimes means that the prompt itself breaks across two lines.

Luckily, it's not difficult to chop the prompt down to a more manageable, yet still informative, length. The solution is here (we do like a descriptive URL): http://superuser.com/questions/387673/how-can-i-limit-the-number-of-directories-in-my-prompt

That particular solution also allows you to change the permissible length of the path that will be shown -- change the 50 in the argument to droppath to set the number of chars.

Edit your ~/.bashrc and add the bits in red:
# drops first portion of a path $1 if length is greater than $2 function __droppath { if [[ ${#1} -gt $2 ]]; then p=$1 while [ ${#p} -gt $2 ]; do p="/"$(echo "$p"|cut -d"/" -f3-) done echo "..."$p else echo $1 fi } if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]$(_droppath "\w" 50)\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h: $(__droppath "\w" 50)\$ ' fi

and here's an example using a length of 25 chars (which is a bit short).

Unmodified:
me@niobium: /usr/local/lib/python2.7/site-packages$\

Modified:
me@niobium: .../python2.7/site-packages$

You can always use pwd to figure out what the full path is if necessary:
me@niobium: .../python2.7/site-packages$ pwd
/usr/local/lib/python2.7/site-packages