The Real Meaning Behind The XDG basedir config/data split

For the longest time, I wasn’t entirely sure why the XDG base directory specification split non-cache data into config and data. I knew there must be a difference which made it a useful thing to do, but I just couldn’t figure out why.

Then, as it tends to happen, while on a completely different topic, I ran across an entry in the Aquaria development mailing list which explained it simply and clearly.

Config files and data files are separated because config files are, in some ways, like cache files. If you lose them, it’ll be annoying, but they’re not too difficult to replace. On the other hand, I know I’d be pissed as hell if I lost a saved game that took me hours or days to build up.

It’s not as clear a distinction as something like “roaming vs. non-roaming” but given that config files are also more likely to be system-specific, that can play a part in it too.

Update: In my opinion, this blog post explains it even more effectively.

Posted in Web Wandering & Opinion | Leave a comment

Casual Sandboxing for Wine

For anyone who, like me, uses a variety of applications on Wine, it soon becomes obvious that Wine seems to trust Windows applications a little too much. Little or no support for automatically removing .desktop files created by a Windows installer, full access to the system via Z: without the application even having to try to be nefarious, and telling Windows applications to use places like ~/Documents may help to integrate Windows applications better into a Linux desktop, but they also allow Windows applications’ slothful, sloppy habits to run rampant in your nice, tidy user profile.

IMPORTANT: This will not improve your security. This is only to limit Windows applications’ ability to cause innocent mayhem because their developers didn’t think before they coded.

The hardest to discover (because, when I asked for it, Alexandre Julliard firmly declared it WONTFIX) but most useful trick (especially if you uninstall stuff more frequently than “never”)  is to kill off start menu icon generation so applications can’t leave cruft in your nice clean launcher menu. (Especially if you’re on a DE without a menu-editing GUI, which seemed to be everything but KDE 4 last I checked)

Simply set WINEDLLOVERRIDES="winemenubuilder.exe=d" as an environment variable. Wine will complain to stderr, but otherwise nothing bad will happen.

Next trick: Keeping your Wine applications from “helping” by adding new clutter to your profile. (eg. new folders inside My Documents, new samples in My Music, etc.)

This one is simply a matter of either going into your Wine profile and replacing the relevant symlinks or opening up winecfg and using the Desktop Integration tab.

If you’re really in a hurry, you can also brute-force it by turning all symlinks in your Wine prefix’s C: into folders with this command:

find ${WINEPREFIX:-~/.wine}/drive_c -type l -exec sh -c 'rm "{}"; mkdir "{}"' \;

Finally, while it’s not really a supported thing, I’ve had no problems with deleting the ~/.wine/dosdevices/z: symlink to give programs one less way to innocently mess up my files like some A.I. baby doodling on the wall in permanent marker.

If you really want security though (of the type that actually protects against certain types of exploits), research using cgroups to tie your filesystem in knots. It’s like chroot without the migraine.

Posted in Geek Stuff | Leave a comment

Minecraft + xkcd + Python = …

Just a little gag module to implement “import creeper” [1] [2]. Now you know what I do when I’ve got a moment with nothing better to do. 😛

Posted in Geek Stuff | Leave a comment

Making Tk applications a bit less ugly

Ever had that one application you found too useful to replace, but it looked like a refugee from 1989? Chances are the application is written using either Motif or Tk and, while I can’t help you poor souls with in-house Motif applications, I can help you beautify your Tk applications like git gui and idle.

As of Tk version 8.5, a new variation on the widget API known as Ttk (themed Tk, formerly Tile) has become available and every Tk-using application I’m aware of has been quick to adjust for compatibility.

Users of Ttk on Windows and MacOS X should already have the Ttk native theming engines enabled, but since they’ve had pretty native-looking theming even before Ttk, they’re not my concern.

Users of Linux, FreeBSD, and other non-Windows, non-OSX desktops will be running a Ttk theme named “default” which, while not as ugly as “classic”, still reeks of the old motif design aesthetic and, frustratingly, there is no “native theme” engine for X11 desktops. (The TkTable guy did write tile-gtk and tile-qt engines, but they haven’t been updated to build against current Ttk… at least on my system)

Thankfully, we’re not completely out of options. Ttk includes a theme named “clam” based on an older version of Xfce’s GTK+ theme. It’ll only get you to “refugee from 1999”, but a decade’s jump for one line of config file isn’t too bad.

Just add *TkTheme: clam to your ~/.Xresources and run xrdb -merge ~/.Xresources to apply it without logging out.

Also, if anyone knows what happened to the Plastik and Keramik themes shown on the Tile website, please let me know. They still wouldn’t fit with stuff like Canonical’s Human theme, but they’d be closer than clam.

UPDATE: I’ve found a Clearlooks pixmap theme that I’m now using instead.

Posted in Geek Stuff | 6 Comments

A Tip For “Unmet Dependencies” in Ubuntu

Just finished fixing some “unmet dependencies” that had removed some programs on my mother’s computer.

Interestingly, it wasn’t corruption like the Google results suspected. Well… not on our end. I ended up finding an interesting solution.

Install aptitude. Instead of apt-get’s “Can’t meet dependencies. We’ll just keep these uninstalled.”, you’ll get “Can’t meet dependencies. I propose we just keep these uninstalled. Ok?”

In our case, when I said “No, it’s not OK”, it then proposed downgrading half of KDE from the version provided by the maverick-security repo to the (insecure, I assume) version provided by the plain, ordinary maverick repo.

Now I finally know why some people prefer aptitude to apt-get. “Error?” is preferable to “error” any day.

Posted in Geek Stuff | Leave a comment

G15/LCDProc Hotplug

Another belated blog entry. This one for a little hack I did to get G15Daemon and LCDProc resetting nicely when, for whatever reason, I have to temporarily unplug my Logitech G15 keyboard.

If I ever find myself back on KDE 4, I’ll probably come up with some kind of amendment to these to also reset kded’s global keybindings since, last I checked, it got confused by g15daemon’s uinput proxy restarting.

Posted in Geek Stuff | 1 Comment

Modernizing XTerm’s Paste

If  you’ve ever tried to alter XTerm’s key/mouse bindings, you’ve probably noticed that the documentation is cryptic, pretty much only found in the manpage, and not supplemented by anything you’re likely to find on Google.

So, one day, when I decided I wanted yeahconsole to have some keybindings more similar to the modern ones I’d grown familiar with from Yakuake, I was in for quite a fight.

Here’s what I came up with should anyone else want them. (Sorry I couldn’t implement the Ctrl+Shift+X/C part too. I’m starting to doubt it’s actually possible without patching XTerm’s source)

If you want to modify or extend this, here’s a complete list of the resources I found useful in helping me to understand the darn thing: (Ordered roughly from most to least likely to help you)

If, while customizing, you find a better reference for the valid function mappings for Translations or if you figure out a way to implement Ctrl+Shift+X/C/V for cut/copy/paste, please let me know.

Update: If you insist on Ctrl+V pasting, urxvt is equivalent to xterm in every way you’re likely to care about and there’s a clipboard Perl extension for it.

Posted in Geek Stuff | 5 Comments