Launch a game, like Tetris, when apt-get installing an app larger than 50 Megabytes

APP=wine; if [ $(sudo apt-get --print-uris -y install $APP | sed -ne 's/^After this operation, \([0-9]\{1,\}\).*MB.*/\1/p') -gt 50 ]; then gnometris 2>/dev/null & sudo apt-get install $APP; else sudo apt-get install $APP; fi
Change the APP variable's value to whatever you want to install. Depending on how fast your machine is, you'll want to adjust the value 50 to something else. You might also want to play a different game than Gnometris - just make sure it's a GUI game.

By: rkulla
2010-04-18 19:32:26

What Others Think

It's a really great idea, how do I do it, and my thoughts are alive right now, thank you. basketball legends 2020
marvinathom · 42 weeks and 1 day ago
Programmeringen er god for alle. fordi det er meget vigtigt at lave en app og et websted og en anden type. Jeg vil give god information om dette, men før dette skal du prøve casino uden rofus. Det er meget vigtigt for dig, Ved hjælp af dette kan du kende god information om casino
nicolasconner · 5 weeks and 2 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: