summaryrefslogtreecommitdiff
path: root/app/fvwm/utils/BuildXLockMenu
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2006-11-26 10:53:58 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2006-11-26 10:53:58 +0000
commit1cb4778bcef21ea9015cfccdb99abb7a0e035d74 (patch)
treef164009397f9d3d5634c6f8a94b1542f793d9692 /app/fvwm/utils/BuildXLockMenu
parent841f8331c93ff96bd798e9a74ba10fab155da5c5 (diff)
Importing from XF4, plus BSD make infrastructure
Diffstat (limited to 'app/fvwm/utils/BuildXLockMenu')
-rw-r--r--app/fvwm/utils/BuildXLockMenu40
1 files changed, 40 insertions, 0 deletions
diff --git a/app/fvwm/utils/BuildXLockMenu b/app/fvwm/utils/BuildXLockMenu
new file mode 100644
index 000000000..6b58299be
--- /dev/null
+++ b/app/fvwm/utils/BuildXLockMenu
@@ -0,0 +1,40 @@
+#!/afs/eda/u/hines/bin/perl
+#!/bin/perl
+#
+# Author: Charles K. Hines
+#
+# Description:
+# A simple perl script which parses xlock's output to build an fvwm 2.xx
+# menu definition of all of xlock's modes.
+#
+
+$start = 0;
+
+open(XL,"xlock -h 2>&1 |") || die "couldn't run xlock";
+
+print "DestroyMenu XLockMenu\n";
+print "AddToMenu XLockMenu \"XLock Modes\" Title\n";
+
+while (<XL>)
+{
+ chomp;
+
+ /where mode is one of:/ && do
+ {
+ $start = 1;
+ next;
+ };
+ if ($start && $_)
+ {
+ @foo = split;
+ $mode = $foo[0];
+ $_ = $mode;
+ /^-.*/ && next;
+ shift @foo;
+ printf "+ \"%-10s %-35s Exec xlock -mode $mode\n",$mode,"(@foo)\"";
+ }
+}
+
+close XL;
+
+#print "Beep\n";