summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/desktop.pl
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2016-11-20 15:16:41 -0500
committerFranklin Wei <frankhwei536@gmail.com>2016-11-24 16:23:09 -0500
commit56c9984511f016eab7e1278ba9e40d88bb59a162 (patch)
tree1bfa6d3aeb3bf2a6ffec71387ac073cd0b8b2a51 /apps/plugins/puzzles/desktop.pl
parent29648f817677b84c03c2bcfe89eb8cf53653e7db (diff)
downloadrockbox-puzzles.zip
rockbox-puzzles.tar.gz
rockbox-puzzles.tar.bz2
rockbox-puzzles.tar.xz
[WIP] Port of Simon Tatham's Puzzle Collectionpuzzles
Original revision: 5123b1bf68777ffa86e651f178046b26a87cf2d9 MIT Licensed. Some games still crash and others are unplayable due to issues with controls. Still need a "real" polygon filling algorithm. The following games are at least partially broken for various reasons: Cube: crash with certain settings Galaxies: crash Inertia: crash Keen: input issues Loopy: weird stuff happens Map: crash on input Mines: weird stuff happens on target Palisade: input issues Signpost: crash on input Solo: input issues Towers: input and drawing issues Train Tracks: drawing issues Twiddle: weird animation on target Undead: input and drawing issues Unequal: input and drawing issues Untangle: input issues All in all, about 40% of the games are at least partially broken. Change-Id: I7c69b6860ab115f973c8d76799502e9bb3d52368
Diffstat (limited to 'apps/plugins/puzzles/desktop.pl')
-rwxr-xr-xapps/plugins/puzzles/desktop.pl52
1 files changed, 52 insertions, 0 deletions
diff --git a/apps/plugins/puzzles/desktop.pl b/apps/plugins/puzzles/desktop.pl
new file mode 100755
index 0000000..204c0ce
--- /dev/null
+++ b/apps/plugins/puzzles/desktop.pl
@@ -0,0 +1,52 @@
+#!/usr/bin/perl
+
+# Make .desktop files for the puzzles.
+#
+# At present, this script is intended for developer usage: if you're
+# working on the puzzles and want to play your bleeding-edge locally
+# modified and compiled versions, run this script and it will create a
+# collection of desktop files in ~/.local/share/applications where
+# XFCE can pick them up and add them to its main menu. (Be sure to run
+# 'xfdesktop --reload' after running this.)
+#
+# (If you don't use XFCE, patches to support other desktop
+# environments are welcome :-)
+
+use strict;
+use warnings;
+use Cwd 'abs_path';
+
+die "usage: desktop.pl [<outdir> [<bindir> <icondir>]]\n"
+ unless @ARGV == 0 or @ARGV == 1 or @ARGV == 3;
+
+my ($outdir, $bindir, $icondir) = @ARGV;
+$outdir = $ENV{'HOME'}."/.local/share/applications" unless defined $outdir;
+$bindir = "." unless defined $bindir;
+$icondir = "./icons" unless defined $icondir;
+$bindir = abs_path($bindir);
+$icondir = abs_path($icondir);
+
+open my $desc, "<", "gamedesc.txt"
+ or die "gamedesc.txt: open: $!\n";
+
+while (<$desc>) {
+ chomp;
+ my ($id, $win, $displayname, $description, $summary) = split /:/, $_;
+
+ open my $desktop, ">", "$outdir/$id.desktop"
+ or die "$outdir/$id.desktop: open: $!\n";
+
+ print $desktop "[Desktop Entry]\n";
+ print $desktop "Version=1.0\n";
+ print $desktop "Type=Application\n";
+ print $desktop "Name=$displayname\n";
+ print $desktop "Comment=$description\n";
+ print $desktop "Exec=$bindir/$id\n";
+ print $desktop "Icon=$icondir/$id-48d24.png\n";
+ print $desktop "StartupNotify=false\n";
+ print $desktop "Categories=Game;\n";
+ print $desktop "Terminal=false\n";
+
+ close $desktop
+ or die "$outdir/$id.desktop: close: $!\n";
+}