#!@pathperl@ use POSIX; my $name = "actions"; my $title = "actions"; my $menuwidthfactor = "1.5"; my $titlename = "title"; my $itemname = "item"; my $actionsdir = "@pkgdatadir@/actions"; my $homeactionsdir = "$ENV{HOME}/.waimea/actions"; @Actions = (); if (! $ARGV[0]) { print_directory($actionsdir); print_directory($homeactionsdir); } else { print_directory($ARGV[0]); } if (@Actions) { print "\n"; print "\n"; print "\n"; print " \n"; print " \n"; foreach $Action (@Actions) { print $Action; } print " \n"; print "\n"; } sub print_directory { my $mode; my $temp; my @dir_list; my $found_action = 0; my $found_logo = 0; $_ = $_[0]; /.*\/(.+)$/; my $dirname = $1; opendir(DIR, $_[0]) || return 0; @dir_list = grep { /^[^\.].*/ || /^\.\..*/} readdir(DIR); closedir DIR; while ($temp = shift @dir_list) { $mode = (stat("$_[0]\/$temp"))[2]; if (!($temp eq '..' || $temp eq '.')) { if (S_ISDIR($mode)) { print_directory("$_[0]\/$temp"); } else { if (S_ISREG($mode)) { $_ = $temp; if (/^action.conf$/) { $found_action = 1; } else { $_ = $temp; if (/^$dirname.png$/) { $found_logo = 1; } } } } } } if ($found_action == 1) { $Item = "