VLC: Control Clone Window With Devilspie

My basic use case: automatically output whatever video I’m playing in fullscreen on another monitor. If I were using Windows and an ATI card, I’d call it theater mode. nVidia cards also used to have a similar setting related to outputting pure overlay video on another screen, but it was removed from nVidia’s drivers around the time of the release of Vista (and had been made buggy aspect-ratio wise a few years prior to that). Long story short, nVidia’s drivers have really degraded an awful lot since 2006 and I don’t like it one bit.

My answer to this problem is the VLC clone filter coupled with Devilspie, but sadly it’s not quite as straightforward as I’d like. Devilspie is a wonderful daemon that can automatically do everything you can do to windows like pinning, moving around, resizing, moving to another workspace, et cetera. In order to do this you need to come up with matching rules for windows, and sadly it’s a tad more limited in that respect than I’d like. Anyway, you’ll want to grab gDevilspie with apt-get gdevilspie (or sudo apt-get gdevilspie, of course), which should automatically pull in devilspie as a dependency.

Since VLC is named VLC media player when it’s not playing anything, and clone video windows are also named VLC media player, I was having trouble coming up with a means of affecting clone windows without messing up my main window. Then I stumbled on the video-title setting in ~./config/vlc/vlcrc and changed it to VLC Clone Window (I couldn’t find this setting in the GUI). Now matching it in Devilspie was a piece of cake. The primary VLC window is still named VLC media player whereas the clone windows are now named VLC Clone Window.

# Video title (string)
video-title=VLC Clone Window

What follows is something I couldn’t have written as quickly without gDevilspie, but I had to switch some commands around (like putting geometry first instead of last) to obtain the precise situation I wanted, for otherwise VLC returns the window to the original monitor when exiting fullscreen.

( if
	( begin
		( is ( window_name ) "VLC Clone Window" )
	)
	( begin
		( geometry "+1280+0" )
		( maximize )
		( undecorate )
		( above )
		( pin )
	)
)

Now that I got the gist of the syntax I decided to also pin the smaller window on top and extended the configuration file. The official man page is rather lacking, so I recommend foosel’s unofficial documentation instead (via ruario). You can find the generated files, or make your own, in ~/.devilspie/.

( if
	( contains (application_name) "VLC")
	( begin
		(if
			( is ( window_name ) "VLC Clone Window" )
			( begin
				( geometry "+1280+0" )
				( maximize )
				( undecorate )
				( above )
				( pin )
			)
		)
		(if
			( contains ( window_name ) "VLC media player" )
			( begin
				( above )
				( pin )
			)
		)
	)
)

I think that’s fairly self-explanatory. My hope is that matching the application name to VLC will make sure that any other application with a window_name that contains VLC media player for some reason (or VLC Clone Window) will be unaffected.

If you didn’t find this quite as enlightening as you’d hoped, once you’re in gDevilspie everything’s pretty much explained in there, and otherwise the documentation I linked to should be of assistance. The only thing above I’d consider somewhat puzzling at a glance is the offset. The resolution of my monitor is 1280×1024, so the x offset of +1280 makes sure that everything’s on the correct monitor before maximizing. You can also set a window size, so then it’s xwidth x ywidth + xoffset + yoffset all mashed together (or instead of + I imagine you can also use -).

The only problem with this solution is that it’ll put all clone windows on the same monitor. Even though this satisfies my specific use case, I still want to match windows depending on the number of previous also-matched ones still active. For example I can imagine something akin to a tiling window manager on a particular workspace with terminal emulators, except driven by Devilspie and in just about any WM there is (although one might be able to work around that in this particular example with some bash scripting).

Comments

VLC: Make Clone Filter Default

VLC ignores some of its GUI settings. Luckily it has easy, plain text configuration.

Despite enabling the clone filter in advanced video settings, VLC doesn’t seem to want to start with the clone filter enabled. No problem, just open up ~/.config/vlc/vlcrc and look for:

# Video output filter module (string)
#vout-filter=

Replace it with:

# Video output filter module (string)
vout-filter=clone

That’s it. Now VLC will always start with a clone. If you want more clones than the default 2 and VLC ignores the GUI settings as well, or VLC is ignoring some other GUI configuration, now you know where to look for it.

Comments

On Balls

For some reason male genitalia came up a couple of times in the past week, so I might as well share what I learned about German balls and repeat my plea for not only the acceptance, but the embrace of the word ballsack.

On Wimpsthe Weak Balled

The author of some book claimed that German has no word for wimp. Someone else replied that Weichei carries the load perfectly, but that it’s not something you’d put on the cover of a children’s book. I wondered why, because “I always thought it referred to how easy it is to break an egg: a metaphorical reference to how easy it would be to break a Weichei’s confidence.” As it turns out, because Eier doubles as slang for testicles in German, it actually means as much as weak ball(s).

This misunderstanding might’ve occurred because “In Dutch there’s the expression een zacht eitje. Saying ‘he’s a soft egg’ means ‘he’s a wuss/wimp,’ and there’s another usage, ‘it’s a soft egg,’ meaning ‘it’s a piece of cake’ (as in ‘it’s easy,’ but translating an idiom with another certainly seems more appropriate).”

On Ballsacks

A few days later, someone remarked that they felt embarrassed because their kid used the word “ball sac [sic].” I replied,

Ballsack is a perfectly ordinary Germanic word for a part of the male anatomy. Some people seem to prefer the Latinate scrotum, but I disprefer it. In Dutch as well as German the respective words balzak and Hosensack (lit. pants bag or perhaps more appropriately, pants sack) are perfectly ordinary words, and indeed the standard words for referring to the ballsack. If anything, saying scrotum carries negative connotations in Dutch. As a fellow speaker of a Germanic language, I implore you not to continue this treachery and disrespect toward our ancestors and to proudly scream ballsack from the roofs!

While a humorous veil covers what I wrote, I’m hardly kidding.

Comments

Parcellite

A while ago I wrote about Glipper, but I seem to be affected by bug #213494, which means that about half the time Glipper crashes on startup; it didn’t use to do that.

There’s a proposed workaround on the linked bug report, namely to add a timeout to the beginning of the Glipper code. It seems to work alright for the most part, but Parcellite offers the same functionality without any of the downsides: it doesn’t depend on Gnome Panel and, of course, it doesn’t crash.

The easiest way to get it is, as always, sudo apt-get install parcellite. A more recent version can be obtained using the Web Upd8 PPA.

Comments

VNC Tunneling on Ubuntu for Safer VNC

ssh -L [local port]:localhost:[remote port] [user name]@[domain]

You can then run the VNC viewer like this:

vncviewer -LowColourLevel 1 localhost:[local port]

The color level setting here is what results in the best mix between speed and prettiness for me.

-LowColourLevel level
Selects the reduced colour level to use on slow links. level can range from 0 to 2, 0 meaning 8 colours, 1 meaning 64 colours (the default), 2 meaning 256 colours.

If you are connecting from Linux to Linux (as opposed to from Linux to XP), more efficient means may be available.

Comments

Hard to Find Translations: Burner Grate

Dutch pannendrager (pan carrier/support) is known as burner grate (primarily AmE) or pan support (primarily BrE) in English.

Comments

Please, Use HTTP Language Headers

I’ve got my HTTP header set up as “Accept-Language: en-US,en;q=0.9,nl;q=0.8″, but the number of sites that actually seem to use this (that I have encountered) can be counted on one hand. Especially on Belgian sites it’s ludicrous: I’m clearly saying that I don’t want French, so unless there is a choice between English, Dutch, and French (on a minority of sites, sometimes also German) there’s no rationale whatsoever to bug me with the option for French when the only options are French and Dutch.

Don’t get me wrong: I want the option to override this automatic detection system with a language selector in the top-right or some such, but it seems like I’m sending out these headers to waste bandwidth. I guess I should just be grateful that they don’t make their language-selection pages Flash-based, though they do typically come attached with gigantic pictures that aren’t reused on the actual site.

I don’t know what the best method would be to utilize this, but in the case of the aforementioned majority of Belgian sites they tend to be like domain.be/nl/etc and domain.be/fr/etc, so I’d say just quietly redirect me to domain.be/nl (all through HTTP) whereas if I go directly to /nl or /fr nothing should happen.

PS The few sites that initially seemed to utilize this method (like argenta.be) actually perform some IP-based shenanigans. It happens to work out for me in this particular case, but generally speaking I consider that far worse than the redundant language selection screens, although a lot of that depends on overridability as well. Which reminds me of software that insists on displaying itself in Dutch based on my location settings while it should really just align itself with my OS language.

Comments

A Decent Audio Player on Linux: Or How to Replace foobar2000

Short answer: you can’t. Slightly longer answer: there are only four applications (of the ginormous number I tried) capable of playing music well: Aqualung, Deadbeef, GogglesMM, and mpd. Anything else simply doesn’t do it for me. In this post I’ll explain my requirements for an audio player.

My most basic requirement for an audio player is, logically, playing audio well. While that sounds too obvious to mention, the primary reason I only came up with four audio players is because none of the other players I tried met what I mean by this, which is the following:

  • Good audio quality. It would seem that all players on Windows as well as Linux have reasonable output quality these days, and I remember that 10 years ago that wasn’t necessarily the case. What player you chose could significantly affect the output. Either way, I still list it because it’s probably the most important requirement.
  • Gapless playback. No fading in and out and no pauses. Fading might be alright between songs from different albums, though I feel that true gapless playback removes any need for silly fading practices. At any rate, even though this applies most strongly to only a minority of albums it’s a prerequisite.
  • ReplayGain. I don’t like to be surprised by overly loud music or some such. But perhaps most important, this means album gain, not just track gain. Many players that support some form of RG fail here because they only do it on a per-track basis.

Then there are some peripheral things I like that aren’t directly related to audio quality:

  • Must not freeze when adding a few files. Preferably it’ll be able to do it completely out of your sight, but I’ll take some kind of “busy” notice as long as it doesn’t interfere with the application’s ability to play music, be paused, go to the next track, and the like. It seems that any Python-based application utterly fails here, including Quod Libet, which says “Do other media libraries choke and die after a mere 10,000 songs?” Perhaps it doesn’t die, but it certainly chokes for enough time for me to stop caring if it will so I’ll kill it manually.
  • Shouldn’t lock out the interface or keyboard bindings while adding music. If the GUI doesn’t freeze, but does lock me out with a “nice” adding files dialog it isn’t really that much better than freezing, is it? Still, at least you’ve got a rough idea regarding what’s going on and whether it’ll take seconds, minutes, or hours before you regain control. Plus there’s usually a cancel button for instant control, whereas a frozen GUI requires killing and restarting for that.
  • Last.FM scrobbling. I just like it. All in all I suppose this is the least important feature.
  • Media library. foobar2000′s library contains a bunch of track metadata and it automatically monitors folders for updates. It’s quite neat.

Neither Aqualung, Deadbeef, GogglesMM, nor mpd quite succeeds at all of these requirements, while they are all part of foobar2000′s base package or easily added with plugins. I haven’t even touched on the wonderful things I can do in foobar2000 with the command line, keyboard bindings, and columns_ui, but I suppose can’t expect that.

Aqualung generally seems to succeed best at the requirements I listed, save for Last.FM submission. However, because I don’t use Ubuntu/Linux as my primary media playing OS (that’s still XP) I generally tend to vary a bit between Aqualung and Deadbeef as my music player of choice. Nevertheless I’m quite confident that Aqualung would be my primary choice if I played more than the occasional few tracks or podcasts.

Rather than explaining what Aqualung does right, which I think I already did while listing my requirements, I’ll explain what’s less optimal about the alternatives from the perspective of my second-favorite player, Deadbeef.

  • it does ReplayGain well, including on MP3 with ID3v2 tags — Aqualung: equivalent; Goggles: worse
  • it doesn’t choke when adding lots of files, but does lock out access to the interface while it’s adding files — Aqualung: superior; Goggles: equivalent to worse (since Goggles requires files to be added to the music library, which isn’t something I necessarily want just to play some random file or song)
  • it only does gapless playback on some filetypes — Aqualung: superior; Goggles: equivalent
  • it supports Last.FM scrobbling — Aqualung: worse; Goggles: equivalent

Aqualung is clearly superior on all accounts save Last.FM support, but I’m glad that Deadbeef, Goggles, and mpd are around to show other players how not to suck. I have to say that if mpd could play random files easily I’d probably be using that instead of anything else. Plus I don’t really want everything to be in a library before I can play it. Since I don’t typically use Linux for “real” music listening I sometimes pick Deadbeef’s or Goggles’ Last.FM submission over Aqualung’s technical superiority.

Basically, Deadbeef and Aqualung deliver what Quod Libet promises: “Are you sick of audio players that think they know how to organize your music for you? Do other media libraries choke and die after a mere 10,000 songs?” Goggles is a little too focused on its library for my taste, but it’s certainly not horrible. Still, the point is that I like Quod Libet’s philosophy better than Goggles’ philosophy. Quod Libet, meanwhile, does not deliver on its promise at all and it chokes horribly. I suspect it’s due to Python, because all Python-based players seem to suffer from the same defect.

Finally, I must admit that I haven’t properly investigated terminal-based players such as cmus and MOC because I only found out about them recently, after I tried tons and tons of music players in order to end up with the list at the top of this post.

If you know any other players that more or less meet these requirements, particularly the playing back music well part, I’d love to hear them.

Comments

Screen

If you’ve ever used SSH, you probably came across a situation where your connection got interrupted and you lost what you were doing, or maybe you simply wanted to carry over what you were doing remotely to your main computer. That’s what Screen is for, but it’s also useful on just one computer.

There are an awful lot of possibilities listed in man screen, but I only need a few.

  • screen starts screen, obviously
  • Ctrl + a, d to detach from a screen session
  • screen -r to reattach
  • Ctrl + a, c to create a new console (or type screen command to forgo on an essentially useless Bash session)
  • Ctrl + a, Ctrl + a switches to the last active window
  • Ctrl + a, n and Ctrl + a, p switches back and forth through windows
  • Ctrl + a, X, where X is a number
  • Ctrl + a, " gives you a list of windows to choose from; this isn’t very useful without naming the windows with Ctrl + a, A

I mostly learned this through a slightly more detailed guide, for the screen man page was a little too overwhelming to figure out what was useful and what wasn’t.

Comments

Mouse in TTY

To utilize the mouse in your tty, install gpm: sudo apt-get install gpm.

Comments

« Newer EntriesOlder Entries »