Xfce

Subdomains
 

Digital cameras, libusb, permissions, hal, and other annoyances

  • January 18, 2007
  • Brian Tarricone

At some point in the near past, I stopped being able to access my Canon PowerShot S30 (yeah, it's an old non-PTP camera) as any user other than root. I poked around at the hotplug rules, and everything seemed ok. The device file in /proc/bus/usb was getting correct permissions, but still no good. I even tried setting permissions to rwxrwxrwx, and changing ownership to brian:brian, but still no luck.

So I googled, and googled, and googled. After reading through about 25 Gentoo forum posts, I came upon one thread with a post (at the bottom of page 1) that suggested something different: export USB_DEVFS_PATH=/proc/bus/usb. I thought that seemed somewhat redundant, but tried it anyway, and it worked. So, I thought, if /proc/bus/usb is no longer the default, what is? So I unset the env var, and ran gphoto2 through strace. I saw a bunch of attempts to open files in /dev/bus/usb. Wait... /dev? Sure enough, the device files in /proc/bus/usb are now duplicated as character devices in /dev/bus/usb, and of course the permissions weren't set properly there.

So I grepped through /etc/udev/rules.d for anything related to usb, and found the rule that was creating the entries in /dev/bus/usb. I modified it to set some of the stuff to 0664, with group plugdev owning (this group is specific to Gentoo). The final line, which goes in /etc/udev/rules.d/10-local.rules, looks like this:

SUBSYSTEM=="usb_device", DRIVER!="usbhid", DRIVER!="hub", DRIVER!="hci_usb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.} $${K#.}'", NAME="%c", GROUP="plugdev", MODE="0664"
The "DRIVER!=" bits are so it doesn't set the group and permissions on things like my mouse, keyboard, the USB hub itself, and Bluetooth. Since those "DRIVER!=" bits make that particular rule not match, udev will continue on until it hits the default rule in 50-udev.rules which will set it up for those devices.

Whew. Unplug the camera, plug it back in, and now gphoto2 works as my normal user.

Next I thought it would be cool if Benny's new Thunar volume manager would launch gtkam when I plug in the camera. So I enabled the option in the volume manager to launch something on camera connection, typed "gtkam" in the box, and plugged my camera in. Nothing. sigh

So, I know all of this uses HAL, so I opened up hal-device-manager to have a look. I found my camera in the tree, and, of course, there aren't any property strings in the device nodes that actually identify it as a camera. Great. Clearly, thunar-volman isn't going to know it's a camera if HAL doesn't identify it as such. But, I remembered a page out of the gphoto2 documentation that mentioned something about HAL. As it turns out, HAL ships with a .fdi file that identifies all PTP-type cameras properly (apparently they share common system, subsystem, class, etc. ids), but doesn't identify any older cameras such as mine. Fortunately, it told me what to do. First, run /usr/lib/libgphoto2/print-camera-list hal-fdi >90-camera-libgphoto2.fdi to generate a .fdi file. Then, move it to /usr/share/hal/fdi/information/90local/. Sweet. I unplug and replug my camera, and thunar-volman starts up gtkam. Finally.

Meh. So why was this so difficult? How come no one noticed that libusb changed its default device path to stuff under /dev/ instead of /proc/? I know this hasn't been working for months and months.

Anyway, it's done, and instead of going to bed more or less right when I got home, it's now 2am. Brilliant.

(On a side note, yeah, I know I haven't posted much in the past month. For those brave few of you who care, I'll get back to that soon.)

Xfce goodness

  • January 13, 2007
  • Josh Saddler

I added my new Xfce Configuration Guide to our documentation repository tonight. I hope it'll get some of you to try out the wonderful creamy goodness that is Xfce. ;)

http://www.gentoo.org/doc/en/xfce-config.xml

* It might take an hour or two to show up; the mirrors have to finish syncing first.

Xfce goodness

  • January 13, 2007
  • Josh Saddler - Category: Xfce

I added my new Xfce Configuration Guide to our documentation repository tonight. I hope it'll get some of you to try out the wonderful creamy goodness that is Xfce. ;)

http://www.gentoo.org/doc/en/xfce-config.xml

* It might take an hour or two to show up; the mirrors have to finish syncing first.

A new year means new things

  • January 9, 2007
  • Josh Saddler - Category: Xfce

...And part of those new things include:

Time for a status update from my last post!

I finished editing flameeyes' autoepatch documents, just before he sent in his retirement announcement (it's still a ways off, though), and before all his troubles with the stupid BSD-4 licence.

Added random bits and fixes to several docs, including a blurb about branding to the Gnome Guide, prompted this forum topic.

Only the first few items on my TODO list have changed from my previous post:

1) VDR guide updates and autoepatch: Done. Massively overhauled the provided patch (Englishification!), and finished Diego's stuff thus far.
2) Other assigned bugs: Much more progress. I got vivo to send in some patches for some ancient mysql docs bugs just before his retirement, so I closed those old bugs. Love closing old bugs! I've thought of a few more things to do on the pcmciautils migration guide, so I'll get those in and email brix for feedback.
3) Ebuilds: Got some help from Diego on this in exchange for the autoepatch docs. ) Some progress.
5) SwifT's alternative handbook: added some more tidbits. Ended up using some material I recently added for...

X) Forgot to add this to the last post, but one thing I suddenly decided to do a few days ago was write an Xfce Guide similar to the Gnome/KDE/Fluxbox guides already available. Something randomly clicked in my mind: we've a huge hole in the docs! I love and use Xfce (4.4-rc2, even) on my laptop! I should write something! Originally I'd meant to have it done over the next few months, to coincide with an upstream release, but...

So it took me all day today (since I was sidetracked for a good 7 hours), but I finally cranked out an Xfce Configuration Guide. It's the first all-new standalone guide I've written in awhile. It's much longer than what you'd expect for a guide on a lightweight desktop, because my approach was threefold.

First, I wanted to show how to install & configure a basic, minimal Xfce, and second, I wanted to show how to go beyond that and create a powerful, full-featured desktop environment that still adheres to the Xfce principles: fast, lightweight, configurable, and modular. Finally, I wanted to write a forward-thinking guide. Xfce-4.4 will hit final release sometime in the coming few months, and eventually the stable Portage tree. Therefore, I tried to write it in a way that's immediately accessible and practical to those who will be installing 4.2 (currently stable), as well as requiring minimal rewriting once 4.4 and all its huge changes hit Portage. To that end, I think I've succeeded. I'm hoping that this will be a real resource to all the folks that come to the forums asking "which one?" and "what should I run on this old hardware?"

I did quite a bit of research these subjects, examining not only the applications used on my (quite underpowered) old laptop, but also what the forumites were suggesting. Alas, many of the threads were quite old (2005), and most packages were no longer available -- a good example would be any gtk-1 apps, such as webbrowsers and email clients -- or too heavyweight to warrant consideration. Firefox and firefox-bin are the heaviest packages by far recommended in the guide, and even they run nicely on 128MB memory, a slow hard disk, and abysmal system I/O.

On a final note, my ISP has been completely sucking tonight. Internet availability has been terribly spotty. It's making it impossible to shop online for a headset for Skype. I got my first taste of Skype a few days ago, though it was only listening in to a few of my fellow devs; I had to use IRC to talk. That was pretty cumbersome, but now I feel the pull of Skype...must use it! It's so much more fun to hang out with the guys in #-dev via VoIP.

Back in Cali… Sorta

  • January 6, 2007
  • Brian Tarricone

After a minor ordeal of a travel day, I'm back in Cali, kinda. I'm heading out to Las Vegas to go to CES Saturday morning.

I surprisingly had a great time being back home. There ended up being plenty to do, I met some new people, and saw a few people I haven't seen in a very long time.

I need to pack, and get some sleep. Aside from some minor dozing on the plane, I've been up for 25 hours, with only a 1.5-hour nap before that. No good.

Linux and Wireless Config

  • December 18, 2006
  • Brian Tarricone

Configuring wireless on Linux is a pain. Gentoo doesn't make the situation any easier: there's a text file in /etc/conf.d that needs to be edited to include your SSID, keys, options, etc., and if you're using WPA/WPA2, you need to mess with /etc/wpa_supplicant/wpa_supplicant.conf as well. If I want to change networks (say, when I visit my dad's house), I have to edit these files and restart the interface.

There's NetworkManager. It looks really cool. Unfortunately, it doesn't work on my PowerBook. It never scans for wireless networks (though it appears to detect my wireless interface ok), and its logging output isn't too useful. To be fair, I haven't had the time to look into it too deeply (after spending hours and hours getting it to build properly, I didn't have much patience for runtime issues), and I'm aware that the Gentoo 'backend' isn't one of the more mature ones. Also: it's ridiculously over-engineered. I do understand all the various cool things you can do with it because of how it's designed and integrated into the desktop, but all of that stuff isn't useful for my general usage.

Oh, and I still can't get NetworkManager to compile without gnome-panel present, which really pisses me off. It doesn't even build a GNOME panel applet, as far as I can tell. Regardless, I use Xfce, as we all should know by now. I've tried to keep the number of extraneous useless libraries and apps installed on my laptop to a minimum, so I don't really want to install most of GNOME just for a network control applet in my systray.

(I'd just like to point out that I think NetworkManager is a great piece of software. It obviously does work very well for some people. Just because it doesn't work for me, or doesn't meet my needs quite as well as I'd like, that doesn't mean I think it's crap. It most definitely isn't.)

I was thinking about what I care about for a wireless network manager. I realised that I don't need/want it to manage my wired ethernet interface. (That's a separate project: just a simple daemon, probably written in bash or perl, that configures/un-configures the interface when a cable is plugged in or removed.) For wireless, I'm thinking about the MacOS X model here. You get a little menu in the menu bar that lets you turn wireless on and off, pick networks, enter security info, and (I think, don't have the Mac in front of me right now) open up the networking settings panel. That's really all I need as well. I don't need fancy system services (I'll count on Gentoo's startup script to try to connect to my default already-defined networks on startup), I don't need it to take care of my ethernet interface, I don't need it integrated into my desktop so all my apps can know whether or not I have a network connection, I don't need a D-Bus service, and I don't need some weirdo 'dhcdbd' thing (I still have no idea what this does or why NetworkManager needs it, and I don't particularly care).

So, I think I'm going to blatantly rip off the Mac and write a little system tray icon (yes, I know, abuse of the systray; sue me) to handle my wireless connections. I was looking at wpa_supplicant, and it appears that it's freakin' awesome. You can use it for connections to unsecured, WEPed, and WPAed networks (among a bunch of other things most people aren't likely to have in their home), and it has a command-line tool to control a running instance of it (wpa_cli), which can add/remove networks, set parameters, force it to reassociate, etc. So I'm thinking I'll just require wpa_supplicant, and do network management through that. There are two things that require root access: 1) bringing the interface up and down, and 2) writing out a new wpa_supplicant.conf file so the system boot scripts can take advantage of any changes (this is optional). We don't need root for wpa_supplicant control, because it can be configured to allow normal users to control it based on their group membership (though on my laptop, the permissions on the control socket were messed up when I first tried it).

Bringing the interface up and down is annoying, since it's a very tiny (yet critical) action, and I need to pay attention to a bunch of security-related issues. One option is to use gksu or some other GUI method of prompting for the password. I like this from a development perspective, as it requires very little work on my part. It's a pain from the user's perspective, though, as I don't feel that a logged-in user should have to enter his/her password every time they want to turn wireless on or off. A lazy option is just to require the user to set up 'sudo' to let them run ifconfig with root privs with no password, but I don't really like that either. I think I'll end up writing a setuid helper app that validates the logged-in user in some other way (perhaps using pam_console).

I'm going to attempt to do it without depending on any Xfce libraries (though I might pull in libexo for the session client and a couple other things). I'd like to create a general-purpose desktop-neutral app here. It's certainly not going to cater to everyone, and probably won't work on all distros without some manual fudging. I just don't have the time or desire to spend that much time on it (yet), and I'll have to rely on contributors to submit patches for their setup of choice, if they care to do so.

Otherwise, it's not that hard. I'll store wireless config in my own format in the user's homedir. There can be an option to write out a system-wide wpa_supplicant.conf file to sync changes with the system so the interface can come up on boot with some default setup. All that's left is a lot of text output parsing (from wpa_cli, which hopefully doesn't change output formats between versions), and good CLI/GUI integration when setting wireless parameters and presenting feedback to the user. Since I'll be in MD for 2.5 weeks, I'll give it a shot, as I don't really have all that much planned while I'm at home.

(I think I'm going to name it 'airconfig'; when I make a website for it, it'll likely be here. If anyone has any thoughts for a more creative name, feel free to leave a comment.)

xfce eyecandy

  • December 16, 2006
  • Josh Saddler - Category: Xfce

All right, I finally did it. I went for the eyecandy. I've never set up any thing having to do with composite, transparency, etc., but I figured that since as long as I'm living on the p.masked Xfce edge anyway, I might as well use its built-in compositor. And...it's interesting. I don't particularly like how the panel automatically gets translucent whenever the mouse isn't on it, and it's actually distracting when I have a terminal superimposed on both Firefox and another terminal...I was surprised that the backgrounded Firefox itself becomes clear enough to see the other terminal underneath it.

And yet people dig this stuff? Or maybe they just dig the effects of more nifty compositing window managers like compiz. Anyway, I don't know if I'll stick with it or not. I'm pleased to say that after a little tweaking, it's a minimal resource hit even for my ancient integrated nVidia GeForce2 Go chip. (One of the very first dedicated mobile GPUs, a whole 16MB memory.)

Interestingly, I seem to be running only semi-hardware-accelerated, as I call it. running "glxinfo" gives a segfault, as it can't find the GLX extension to load, despite the visual results. Problem is, I can't enable "AllowGLXWithComposite", as that results in random hard lockups, which is the fault of being forced to use nvidia-legacy-drivers. These older 7xxx drivers are known to have such bugs, but the newer 8xxx drivers don't support my vintage 2001 hardware. Ah, well. At least adding "RenderAccel" to xorg.conf lets me run this stuff with very little noticeable slowdown. I suspect that I am getting hardware accel; it's just confused.

I think I'll bring along this composited laptop to SCALE and show off the wonders of unstable Xfce and the latest eyecandy. Which reminds me, now I need to see about getting all the effects of compiz, but without using that WM or unmerging yet more masked packages. I want to see what else this old graphics hardware is capable of. :)

moved on

  • December 15, 2006
  • Josh Saddler - Category: Xfce

...to Xfce4 4.4, that is. I've finally heeded the urgings of my fellow Xfce enthusiasts dostrow, nichoj, et al, and moved my laptop over to the latest Xfce 4.4 prerelease. Sometimes as a developer, you have to live somewhat on the bleeding edge, in this case, a couple of dozen entries in package.unmask. Yow! Hot stuff. The new Xfce has changed considerably since 4.2. It more resembles a traditional desktop environment, but it still retains the speed and ease of use that it had from the older days. That said, some configuration changes have been made. Configuring the panel is a little less intuitive; the same control works for both the icon strip at the bottom and the window list at the top. (So don't just kill the panel process entirely!) No more xftaskbar4 to kill. ;)

There are still a few outstanding bugs, such as missing icons from things like the main configuration window, missing panel plugin icons (none for cpu-freq), and missing icons for mail and webbrowser in the terminal Applications menu. Also missing is the old ability to change the icon spacing in thunar. Though a host of other features have been added, folder views take up way too much space. Need the icons to be spaced about half as far apart as they currently are.

Also, the new battery applet is not nearly as helpful as the old one. For example, even though lm_sensors doesn't work on this laptop whatsoever, the basic thermal zone info from ACPI was parsed by the battstatus applet (don't ask me why, I'm just glad it did). It displayed temperature, battery charge, and an indicator whenever the fan turned on. Handy, right? Well, the fan indicator is still there, but there's no provision for temperature display anymore. WEAK. Grr. I'd downgrade, but the stable version blocks the masked version. Anyone know a fix-it for this?

Speaking of WEAK, my back has taken a sudden turn for the worse over the last couple of days. Earlier this week (i.e. before I started my new schedule on Wednesday), I was almost back to normal. I could walk without limping, at least most of the day. And now...now I'm not doing so hot. Some excrutiating twinges, and constant pain every step. It's a little better than it was yesterday, but I for sure need to get to the doctor's office and get that x-ray done. The doc said it'd take a minimum of six weeks to heal, and at the end of that time, I can say that I'm definitely not recovered. %$^&# sciatica. And at my age, too. I'd hoped to be well by my wife's birthday and Christmas, but doesn't look like that will happen.

Maybe I'll be fully healed in time for SCALE in February?

wiping out, moving on

  • December 7, 2006
  • Josh Saddler - Category: Xfce

There were some good comments on my last journal entry, thanks to everyone who responded. I'm happy to say that some of the problems have been dealt with. I've been talking to several developers who are rather likeminded; just check Planet's entries for the last week or so.

Anyway, I've decided to give my trusty ol' lappy das boot, by which I mean "the boot" rather than "the boat." p

It's had Gentoo (Jackass! 2005.1, yay for my old project) installed on it since August 31, 2005. And what with one thing or another, it's just been slowing down. It's got a strange partition layout on it, too. A whole unused 10GB ntfs partition (never got around to installing Windows), a smaller Linux test partition, and the main desktop stuff. Rather inefficient usage of the 60GB disk, considering its recent use. The slowness, combined with space issues, and the fact that I haven't updated it since before gcc-4.1.1 went stable on x86 means that I've decided to just reinstall. Why spend a week compiling when everything will likely break if I try to simultaneously migrate to modular Xorg and switch from gcc-3.4, as well as all the crazy kernel/udev/nvidia/madwifi updates?

Time to wipe the disk and move on to something more recent. I've spent today moving /home to my new USB key and dumping it to my AMD64 box. It really highlights the slow-as-molasses USB1.1 on the laptop, as well as the crappy I/0 and slow system bus. I'll be doing some smarter performance tuning this time around, as well as installing only Xfce. I've been running mostly in Gnome because of some weird Xfce/Fluxbox issues, but with only 128MB memory, any and all workloads are just about unbearable.

Of course, the simpler solution would have been to just plug the laptop drive straight into the IDE cables on the AMD64 box for the updates, but unfortunately, the drive uses some weird laptop-only ATA/power combo connector, not the standard IDE connector. Oh well. I don't mind trying out the Installer LiveCD, especially since I'll have nothing to lose.

Guess I have to go re-read all the changes I've been making to the installation handbooks. ;)

Sleep, Or a Lack Thereof

  • December 5, 2006
  • Brian Tarricone

I've been having trouble sleeping recently, more than usual. I hardly got any sleep Sunday night, which was probably more due to napping Sunday afternoon than anything else. But the end result was that I probably spent about 2 hours sleeping, but still got up at 8am to get ready for work.

So I figured Monday night I'd be exhausted and I'd sleep well. I went to bed around 10pm, and fell asleep very quickly. However, I woke up at 1am. I had a lot of trouble falling asleep after that, maybe getting another 2-3 hours of sleep in before finally getting up at 7:30am. I felt tired, and not really rested (and I still feel kinda tired).

I'm not really sure what it is. Is it physical or mental? Am I not comfortable in my bed anymore? Is it too noisy? Too warm/cold? Has there been a lot on my mind lately that's keeping me from sleeping?

I really don't know. There's been a decent amount on my mind lately, but it's mostly work stuff, and I tend to be pretty good about leaving work stuff at work. Life stuff... well, I guess there's been a bit on my mind there as well, but I don't think that's been keeping me awake.

I hope it's not my bed. A new mattress isn't cheap.

Temperature is a good question. My bedroom is a couple degrees hotter than my living room because of the computer equipment. Still, if anything I feel a little chilly in my bed (sans blankets). I think I feel relatively comfortable.

Noise is a possibility. A few months ago I added a small dedicated Linux box as my router. It has a single 80mm fan that's a bit noisy. I should replace that with a quieter fan. Also, the CPU fan in my desktop machine could stand to be replaced, as it's not the quietest thing in the world. THe other fans in my computer are all variable-speed and relatively quiet.

So I guess I'll try replacing some of my noisier computer fans and see if that helps. I also came upon these noise-absorbing blocks, though I'm a bit skeptical. They also carry noise-absorbing lining material, though that's a bit more pricey. Ideally, I'd like to just move my computer out of my bedroom, but I don't have another place for it. If I ever move into a larger apartment with a spare room, that would work, but until then I'm stuck. I've also thought about building a low-noise, low-power NAS box to move all my storage out of my desktop. With that, I could conceivably leave my desktop off a lot of the time, or maybe even think about moving to a laptop-only configuration. I think I'm a ways off from that, though (maybe after I buy an Intel-based Mac laptop in a couple years).

Finding a good heatsink/fan combo for an old Athlon Socket A/462 motherboard isn't as easy as I'd hoped. The board also has very little clearance around the sides of the CPU socket, so smaller is better. It would be nice to get away with just a tallish heatsink, but the older Athlons probably run too hot for that.