aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2016-06-12 22:00:33 -0400
committerbnewbold <bnewbold@robocracy.org>2016-06-12 22:00:33 -0400
commitdd600a1852e57a7a7297e573891a6e4aa5805d6c (patch)
treefa07ff71de699a2836818534a139ccf1b8c7b748
parentb0ffd78e6ec79d8749066eb176766a443fd63fca (diff)
downloadexuberant-hacks-dd600a1852e57a7a7297e573891a6e4aa5805d6c.tar.gz
exuberant-hacks-dd600a1852e57a7a7297e573891a6e4aa5805d6c.zip
tweaks towards xscreensaver integration
-rw-r--r--Cargo.toml4
-rw-r--r--extra/exuberantbovines.xml30
-rw-r--r--src/main.rs9
3 files changed, 43 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index b04a2f6..603f4c5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,3 +11,7 @@ authors = ["bnewbold <bnewbold@robocracy.org>"]
glium = "0.*"
image = "0.*"
getopts = "^0.2"
+
+[[bin]]
+name = "exuberantbovines"
+path = "src/main.rs"
diff --git a/extra/exuberantbovines.xml b/extra/exuberantbovines.xml
new file mode 100644
index 0000000..49bc7d6
--- /dev/null
+++ b/extra/exuberantbovines.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<screensaver name="exuberantbovines" _label="ExuberantBovines" gl="yes">
+
+ <command arg="--root"/>
+
+ <video href="http://www.youtube.com/watch?v=O_b5UWhv49w"/>
+
+ <number id="delay" type="slider" arg="--delay %"
+ _label="Frame rate" _low-label="Low" _high-label="High"
+ low="0" high="100000" default="30000"
+ convert="invert"/>
+
+ <number id="speed" type="slider" arg="--speed %"
+ _label="Bovine velocity" _low-label="Slow" _high-label="Fast"
+ low="0.05" high="2.0" default="1.0"/>
+
+ <number id="count" type="slider" arg="--count %"
+ _label="Number of 'vines" _low-label="Moo" _high-label="Herd"
+ low="1" high="9" default="3"/>
+
+ <boolean id="wire" _label="Wireframe" arg-set="--wireframe"/>
+ <boolean id="showfps" _label="Show frame rate" arg-set="--fps"/>
+
+ <xscreensaver-updater />
+
+ <_description>
+A port of jwz's BouncingCow to Rust.
+ </_description>
+</screensaver>
diff --git a/src/main.rs b/src/main.rs
index e07c972..af0a37f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -199,11 +199,20 @@ fn main() {
let args = util::convert_xscreensaver_args(args);
let mut opts = Options::new();
+
+ // Common Args (all screensavers)
opts.optflag("h", "help", "print this help menu");
opts.optflag("", "window", "run in a window (IGNORED)");
opts.optflag("", "root", "run in root window (IGNORED)");
+ opts.optflag("", "fps", "show frames per second (IGNORED)");
opts.optopt("", "window-id", "X window id number", "NUM");
+ // Bovine-specific args
+ opts.optflag("", "wire", "wireframe mode (IGNORED)");
+ opts.optopt("c", "count", "how many cows? (1 to 9) (IGNORED)", "NUM");
+ opts.optopt("", "delay", "inter-frame delay (0 to 100000) (IGNORED)", "NUM");
+ opts.optopt("s", "speed", "how fast? ratio, with 1.0 as normal (IGNORED)", "NUM");
+
let matches = match opts.parse(&args[1..]) {
Ok(m) => { m }
Err(f) => {