Title: Create a launcher on Linux Post by: nicolas on October 19, 2009, 11:36:59 pm Hi ;D
If you want to create a launcher for Machinarium on Linux, it's a bit more complicated than we can think first. It's quite easy anyway. Here the problem : according to how and from where the game is launched, Flash doesn't put the saved game to the same place, or doesn't see the data (all which are in these 00-11 folders). ::) If you launch the game directly in double-clicking on the binary extracted from the tarball, it obviously work, and the saved game (if you have put the game in /opt/Machinarium/ for instance) is located here : Code: /home/-username-/.macromedia/Flash_Player/#SharedObjects/-strangething-/-localsomething-/opt/Machinarium/Machinarium/ If you make a launcher (in a menu, a panel, your desktop, whatever), the most simple command to put inside could have been (still with the game folder in /opt) : Code: /opt/Machinarium/Machinarium But it doesn't work (black screen in the Flash player), for the simple reason that the game is not launched from its own folder, and doesn't see its data. :-\So, you have to do a very little script, that you can put inside a single command in your launcher. :P Something like : Code: bash -c "cd /opt/Machinarium/ && ./Machinarium" In this way, it works, the game is launched, but it doesn't find your saved game from when you have launched it directly. Now, the saved game is located at : Code: /home/-username-/.macromedia/Flash_Player/#SharedObjects/-strangething-/-localsomething-/Machinarium/ So, if you want to use a launcher, more simple than an exploration through the folders each time you want to play, remember to move - with care - your saved game (Machinarium.sol) to its new location. ;)(http://img25.imageshack.us/img25/8978/machinariumlinuxlaunche.png) Title: Re: Create a launcher on Linux Post by: mikeypoo on May 19, 2010, 12:11:31 pm Hi Nicosmos, I tried to create your launcher in Ubuntu Karmic but had problems as it didn't actually active the program, but I suddenly remembered I often had to escape with slashes, so my new launcher is created this way and works fine:
sh -c "cd /home/$USER/machinarium/Machinarium\ Demo/ && ./Machinarium\ Demo" Just thought it might help someone. I have noticed in fullscreen the mouse was somewhat erratic, but this might be able to be fixed easily, I have downloaded the demo and will experiment with it some more, great little game and clever graphics. About as quirky as Myst3 Title: Re: Create a launcher on Linux Post by: AlwaysLearning on December 21, 2010, 07:56:48 am Like a lot of users I have a fairly large screen running at 1920x1200, which means that even running Machinarium in its "100% mode" half of the screen is black.
I got around this issue my causing my App Launcher script to change resolution before starting Machinarium, ala: Code: #!/bin/sh xrandr --size 1280x960 # A slight delay is recommended before starting Flash/Machinarium sleep 2 cd /opt/Machinarium ./Machinarium # Return to normal desktop resolution xrandr --size 1920x1200 Naturally you should choose a resolution that suits your video card/screen combination (I have a 16:10 screen). According to the Machinarium FAQ the two screen modes are this size:
Title: Re: Create a launcher on Linux Post by: federer on May 07, 2011, 12:53:06 pm Hi ;D If you want to create a launcher for Machinarium on Linux, it's a bit more complicated than we can think first. It's quite easy anyway. Here the problem : according to how and from where the game is launched, Flash doesn't put the saved game to the same place, or doesn't see the data (all which are in these 00-11 folders). ::) If you launch the game directly in double-clicking on the binary extracted from the tarball, it obviously work, and the saved game (if you have put the game in /opt/Machinarium/ for instance) is located here : Code: /home/-username-/.macromedia/Flash_Player/#SharedObjects/-strangething-/-localsomething-/opt/Machinarium/Machinarium/ If you make a launcher (in a menu, a panel, your desktop, whatever), the most simple command to put inside could have been (still with the game folder in /opt) : Code: /opt/Machinarium/Machinarium But it doesn't work (black screen in the Flash player), for the simple reason that the game is not launched from its own folder, and doesn't see its data. :-\So, you have to do a very little script, that you can put inside a single command in your launcher. :P Something like : Code: bash -c "cd /opt/Machinarium/ && ./Machinarium" In this way, it works, the game is launched, but it doesn't find your saved game from when you have launched it directly. Now, the saved game is located at : Code: /home/-username-/.macromedia/Flash_Player/#SharedObjects/-strangething-/-localsomething-/Machinarium/ So, if you want to use a launcher, more simple than an exploration through the folders each time you want to play, remember to move - with care - your saved game (Machinarium.sol) to its new location. ;)(http://img25.imageshack.us/img25/8978/machinariumlinuxlaunche.png) Its really a nice info which helps specially new users like me with the help of image is more usefull. Title: Re: Create a launcher on Linux ( ubuntu ) Post by: Alex on December 03, 2011, 06:13:41 am Full disclosure: I know nothing about Linux. But I found this thread about how to create a menu launcher for Machinarium in Ubuntu and thought it might help someone. link: http://ubuntuforums.org/showthread.php?p=11506818 (http://ubuntuforums.org/showthread.php?p=11506818) Title: Re: Create a launcher on Linux Post by: Nothor on January 04, 2014, 11:02:34 am To create a Launcher you can use the following script (copy-paste this code in a file located in the game folder). I use it for all the games I have, changing the names of the first 4 parameters.
For sure you need an icon (what you want) called Machinarium.png (look for it the internet) and place it in the game folder IMPORTANT: I think there is ONLY 1 limitation, the game Path must to he WITHOUT "spaces". Code: #!/bin/bash FILE="amanita-machinarium.desktop" NAME="Machinarium" EXEC="Machinarium" ICON="Machinarium.png" DIR="$( cd "$( dirname "$0" )" && pwd )" if [ ! -e $DIR/$FILE ]; then echo -e "[Desktop Entry]\nValue=1.0\nType=Application\nName=$NAME\nCategories=Game\nPath=\nExec=\nIcon=\nName[es]=$NAME" >> tmp; mv tmp $FILE fi sed "s;Path=.*;Path=$DIR;g" $FILE > tmp; mv tmp $FILE sed "s;Exec=.*;Exec=$DIR/$EXEC;g" $FILE > tmp; mv tmp $FILE sed "s;Icon=.*;Icon=$DIR/$ICON;g" $FILE > tmp; mv tmp $FILE TARGET_DIR=$(xdg-user-dir DESKTOP) if [ "$TARGET_DIR" == "" ]; then TARGET_DIR=$HOME/Desktop fi cp $FILE $TARGET_DIR/$FILE chmod +x $TARGET_DIR/$FILE xdg-desktop-menu install $FILE Then if you want to uninstall this launcher you can use this other script. Code: #!/bin/bash FILE="amanita-machinarium.desktop" xdg-desktop-menu uninstall $FILE TARGET=$(xdg-user-dir DESKTOP) if [ "$TARGET" == "" ]; then TARGET=$HOME/Desktop fi if [ -e $TARGET/$FILE ]; then rm $TARGET/$FILE fi I hope it will be useful. Title: Re: Create a launcher on Linux Post by: MestreLion on July 28, 2014, 10:34:28 am IMPORTANT: I think there is ONLY 1 limitation, the game Path must to he WITHOUT "spaces". Get rid of this limitation by quoting your vars! :) "$FILE" "$TARGET" etc... Also, this ECHO -e is ugly, and there is no need to save as tmp, then rename to "$FILE", then replace values with sed. This could all be done in a single step. May I propose this? Code: cat > "$FILE" <<-EOF [Desktop Entry] Value=1.0 Type=Application Name=$NAME Categories=Game; Path=$(printf '%q' "$DIR") Exec=$(printf '%q' "$DIR/$EXEC") Icon=$(printf '%q' "$DIR/$ICON") EOF Title: Re: Create a launcher on Linux Post by: MestreLion on July 28, 2014, 12:11:12 pm So, you have to do a very little script, that you can put inside a single command in your launcher. :P Something like : Code: bash -c "cd /opt/Machinarium/ && ./Machinarium" In this way, it works, the game is launched, but it doesn't find your saved game from when you have launched it directly. Now, the saved game is located at : Code: /home/-username-/.macromedia/Flash_Player/#SharedObjects/-strangething-/-localsomething-/Machinarium/ The save game location only changed because you changed the way the executable is invoked, from absolute to relative. If you always use the absolute path, "/opt/machinarium/Machinarium", then saved games would be in the same place. So the command should be: Code: bash -c "cd /opt/machinarium/ && /opt/machinarium/Machinarium" I know an absolute path is redundant after the `cd`, but this way the save game location never changes. Also, 2 remarks: - Game should preferably be installed to `/opt/machinarium`, not `/opt/Machinarium`. Note the lowercase M. This is the standard location used .DEB install from Humble Bundle and Ubuntu Software Center. - Why the "bash -c" single command thing? If this is a shell script, simply use "cd /opt/machinarium && /opt/machinarium/Machinarium". If this is a .desktop launcher, simply add a "Path=/opt/machinarium" line besides the "Exec=/opt/machinarium/Machinarium" line. Title: Re: Create a launcher on Linux Post by: RobotJosef on July 28, 2014, 12:18:12 pm Aaahhh, I'm lost in the tidal wave of code!
|