196: Command Line Fu

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
Command Line Fu
When designing an interface, imagine that your program is all that stands between the user and hot, sweaty, tangled-bedsheets-fingertips-digging-into-the-back sex.
Title text: When designing an interface, imagine that your program is all that stands between the user and hot, sweaty, tangled-bedsheets-fingertips-digging-into-the-back sex.


The Linux command line allows users to make their computer do nearly anything. In this comic, Cueball recounts how he used a command line hack to solve a problem with his monitors turning off during a movie, something that an attempt to change settings (possibly via a standard GUI configuration dialogue) has failed to resolve adequately. The scripted get-around appears to have worked, as far as it has been used.

However, in an attempt to apply his dedication toward best programming practices to the solution, Cueball also became absorbed in fully documenting the mini-project. This could have been either alongside the project, keeping pace with the structured plan (e.g. the Waterfall model's conception, initiation, analysis, design, construction, testing, deployment, and maintenance phases), or as a 'necessary' final step to summarise the realized solution.

In either case, the sheer simplicity of the solution (for someone as technically minded as Cueball) suggests that the documentation writing has become the bulk of the effort. In the time that he spends trying to complete the issue to his satisfaction, the woman he had brought home had already left and the current opportunity to enjoy the movie (and company) was gone. Although at least it is likely that the next opportunity to enjoy a movie in company, with the same companion or another, will now run flawlessly. Or at least probably without this particular problem, if there is no problem with its implementation.

The title text applies this story's narrative in reverse. Whereas for Cueball to have a successful evening, he should have hastened the design process to the bare minimum required to provide a workable solution, it forces any designer of an interface (which would include the unsuccessful 'inbuilt' configuration wizard) to ensure that it at least does what it purports to do. If that had been done thoroughly enough, originally, someone like Cueball (and his date) would not have had this reason to be prevented from fully enjoying the evening as originally anticipated.

Software that jiggles the mouse exists, as well as instructions for Linux scripting (although installing the necessary libraries might take longer).


[Two men talking.]
Cueball: Last night I was watching videos with this girl and my monitors kept turning off - even though I had disabled power save.
Friend: Odd.
Cueball: However! I wrote a command to jiggle the mouse pointer every couple minutes to keep it from going idle.
Friend: Not the first hack I'd try, but see? Linux has problems, but it gives you the tools to deal with them - and save your date!
Cueball: Actually, I was half an hour into the pointer scripting documentation when she got dressed and left.

comment.png add a comment! ⋅ comment.png add a topic (use sparingly)! ⋅ Icons-mini-action refresh blue.gif refresh comments!


Disagree with the "in the time that he spends trying to solve the issue" bit. Problem solved, it was the further time taken to write up the documentation (man pages?) that ruined the day(/night).

Also: "if your user interface takes as long to operate as a command line". Inconsistent with the fact that the explanation starts off by assuming it is a command-line script. Also command-lines can be very quick (when not dealing with anything more complex than the stated problem) as long as you know what you want to do, which the given Cueball obviously did. I find that most window-based analogues take far more studying, for something as simple as the original problem. But YMMV on that one. 00:45, 22 June 2013 (UTC)

Sounds more like Cueball was still reading the documentation on HOW to script the pointer at the half hour mark. In other words, he was still researching what to do (not solved the problem yet) when she left. We don't know how long it took to actually solve the problem. 19:04, 4 September 2013 (UTC)

The actual problem in the strip doesn't require the hack suggested to solve. Instead you can simply use the xset command to disable DPMS and the screensaver: xset -dpms s reset P.S. I didn't waste time figuring that out because of the strip, I discovered it out of necessity when building a display cluster. --Lokno (talk) 20:04, 9 January 2014 (UTC)

If he was smart he could have used some simple hardware fix. Assuming the wire is too short to just bring the mouse close to you (wireless mouses also have a range) you could use anything that moves a bit/vibrate to solve the issue. A smart guy would use their two phones, putting the mouse over one of the phones and using the second one to call it when the screen turns dark again. This is completely not overkill.Meneldal (talk) 06:31, 11 March 2015 (UTC)meneldal

The title "Command Line Fu" deserves an explanation, re: Google Fu. (talk) (please sign your comments with ~~~~)

Agree! The joke there is the double meaning of powerful expertise with the command line (by analogy to kung fu), and his interrupted fuck (can I say that word here?) 23:46, 30 April 2024 (UTC)

Only a hard core geek, would be researching hacks with an already naked date next to him... Mountain Hikes (talk) 04:39, 21 September 2015 (UTC)

I just wanted to mention that in ubuntu, the xdotools package makes mouse and keyboard scripting much easier than the comic depicts. 22:28, 11 April 2016 (UTC)

Yeah, a simple `sh -c "while true; do xdotool mousemove_relative 0 1; sleep 200; done"` will do the trick. 18:46, 12 June 2016 (UTC)

Why does this say "The only hitch is that the interface is entirely text-based"? Unfortunately, that's not true. I first installed X on Linux when it was about a dozen raw-written floppies, in 1992. At that time it had nothing but Tiny Window Manager, and so you could argue that it was still text-based only, in a sense. But Nowadays many users stick almost purely to some X-based GUI. I, personally, prefer something like Arch Linux (I used Slackware for many years) running solely on the command line, no X except in extremis. But that's not the norm. — Kazvorpal (talk) 19:45, 10 October 2019 (UTC)