File: BuildXLockMenu

package info (click to toggle)
fvwm2 2.0.46-BETA-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 5,172 kB
  • ctags: 5,559
  • sloc: ansic: 52,902; cpp: 2,465; perl: 2,275; python: 779; sh: 604; makefile: 221
file content (37 lines) | stat: -rwxr-xr-x 618 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/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];
    shift @foo;
    printf "+ \"%-10s %-35s Exec xlock -mode $mode\n",$mode,"(@foo)\"";
  }
}

close XL;

#print "Beep\n";