Steam for Linux

Steam for Linux

Not enough ratings
Boost game hours without actually running it
By Mono
A dirty approach of AFK while consuming fewer resources.
   
Award
Favorite
Favorited
Unfavorite
Technical Overview
Two facts:
  1. On Linux we can assign any random file the 'Execute mode permission'.
  2. Steam counts playtime by monitoring the game process.

So, an intuitive thought comes that we can do something to prevent it from entering the real game process. Here is a handy approach that simply set the launch option:
sleep 99999; %command%

But the problem is, we can't gain control over how long it should suspend, and every time if we actually want to play the game, we need to modify the launch option. This sucks.
Solution
What we want is a GUI program that:
  • Runs before the real game process;
  • If we click a button, it will quit and launch the game for us;
  • If we simply close it, then the game will also not launch.

Here is the code I use:

#include <gtk/gtk.h> void destroy(GtkWidget* widget, gpointer data) { gtk_main_quit(); } void abnormal_exit(GtkWidget* widget, gpointer data) { exit(-1); } int main(int argc, char* argv[]) { GtkWidget* window; GtkWidget* button; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(window, "destroy", G_CALLBACK(destroy), NULL); gtk_container_set_border_width(GTK_CONTAINER(window), 20); button = gtk_button_new_with_label(argv[1]); g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(abnormal_exit), "button"); gtk_container_add(GTK_CONTAINER(window), button); gtk_widget_show_all(window); gtk_main(); return 0; }

Usage
Compile:
gcc main.c -o fake_run `pkg-config --cflags --libs gtk+-2.0`

Move to somewhere:
mv fake_run ~/.local/bin

Set the game launch option in Steam
~/.local/bin/fake_run "The msg you want to show" || %command%

The point here is the short-circuit evaluation. Note the difference of return code between clicking the button and normally exiting the program.

Showcase

Test on game Mount & Blade: With Fire and Sword:






Remember that as long as the fake_run is running, Steam will also count it into playtime.
If click the button, the game will launch;
If close the program, then nothing would happen.