You are not logged in.
So i have this smal problem. In the menu that pops up you have the theme entry. When you move the mouse cursor over it doesnt pop up a submenu anymore. I have not changed it and i have double checked and copied the menu file from the pekwm website. I have also copied whats written in the .pl file into the menu file.
It works when i change the path in the config though. But getting the submenu working would be very nice, for convenience.
The menu file i tried that is found on the pekwm site:
# Menu config for pekwm
# Variables
$TERM = "xterm -fn fixed +sb -bg black -fg white"
RootMenu = "Pekwm" {
Entry = "Term" { Actions = "Exec $TERM &" }
Entry = "Emacs" { Actions = "Exec $TERM -title emacs -e emacs -nw &" }
Entry = "Vim" { Actions = "Exec $TERM -title vim -e vi &" }
Separator {}
Submenu = "Graphics" {
Entry = "Gimp" { Actions = "Exec gimp &" }
Entry = "Gv" { Actions = "Exec gv &" }
Entry = "Xpdf" { Actions = "Exec xpdf &" }
}
Submenu = "Mm" {
Entry = "Xmms" { Actions = "Exec xmms &" }
Entry = "MPlayer" { Actions = "Exec mplayer &" }
}
Submenu = "Utils" {
Entry = "XCalc" { Actions = "Exec xcalc &" }
Entry = "XMan" { Actions = "Exec xman &" }
}
Submenu = "WwW" {
Entry = "Dillo" { Actions = "Exec dillo &" }
Entry = "Konqueror" { Actions = "Exec konqueror www.google.com &" }
Entry = "Mozilla" { Actions = "Exec mozilla &" }
Entry = "Mutt" { Actions = "Exec $TERM -title mutt -e mutt &" }
}
Separator {}
Submenu = "Pekwm" {
Entry = "Reload" { Actions = "Reload" }
Entry = "Restart" { Actions = "Restart" }
Entry = "Exit" { Actions = "Exit" }
Submenu = "Others" {
Entry = "Xterm" { Actions = "RestartOther xterm" }
Entry = "Twm" { Actions = "RestartOther twm" }
}
Submenu = "Themes" {
Entry { Actions = "Dynamic ~/.pekwm/scripts/pekwm_themeset.pl" }
}
}
}
The code from the pekwm_themeset.pl file:
# SubMenu = "Themes" {
# Entry = "" { Actions = "Dynamic /path/to/this/file /path/to/themedir" }
# }
When i tried that one in the menu file i changed so that the path to the script and to the theme directory was correct.
EDIT: edited this box since i didnt explain it correct. My bad. Sorry.
here is the entry in the menu file i use atm. Everything else works as it should. Its just the theme entry i have problems with:
Separator {}
SubMenu = "Themes" {
Entry = "Themes" { Actions = "Dynamic ~/.pekwm/scripts/pekwm_themeset.pl" }
}
Submenu = "Configs" {
I included the line above and underneath the entry.
I have also googled and cant seem to find any more info. Any help will be greatly appreciated:)
EDIT2:
here is the pekwm_themeset.pl script.
#!/usr/bin/env perl
#
# Copyright 2003 by the pekwm development team
#
# Add this to your menu to use this script:
#
# SubMenu = "Themes" {
# Entry = "" { Actions = "Dynamic /path/to/this/file /path/to/themedir" }
# }
#
use warnings;
use strict;
sub menu {
my ( $dir ) = @_;
my @themes = (
sort
grep { !/^\./ and $_ ne 'CVS' and -d( "$dir/$_" ) }
do {
opendir my $dh, $dir
or die "Can't read directory $dir: $!\n";
readdir $dh;
},
);
print(
"Dynamic {\n",
map( qq(Entry = "$_" { Actions = "Exec $0 set $dir/$_" }\n), @themes ),
"}\n"
);
}
sub set_theme {
my ( $theme ) = @_;
my $cfg_file = $ENV{PEKWM_CONFIG_FILE};
my $config = do {
open my $fh, '<', $cfg_file
or die "Can't open $cfg_file for reading: $!\n";
local $/; # slurp file
<$fh>
};
$config =~ s/Theme\s*=\s*".*?"/Theme = "$theme"/i;
open my $fh, '>', $cfg_file
or die "Can't open $cfg_file for writing: $!\n";
syswrite $fh, $config;
close $fh
or die "Failed to write $cfg_file successfully: $!\n";
system 'pkill', -HUP => 'pekwm'; # tell pekwm to reread its config
}
if( @ARGV == 1 ) {
menu( $ARGV[ 0 ] );
}
elsif( @ARGV == 2 and $ARGV[ 0 ] eq 'set' ) {
set_theme( $ARGV[ 1 ] );
}
else {
print STDERR (
"usage:\n",
"\t$0 <themedir>\n",
"\t$0 set <themename>\n",
);
}
I have made it executable with this command:
chmod +x pekwm_themeset.pl
EDIT3: Marked the thread as "Solved".
Last edited by yama (2008-07-09 01:05:52)
Offline
Your second code box has # signs before all three lines. That would comment them out. Try removing those # marks from the pl file and see if that works.
Last edited by Inxsible (2008-07-08 18:48:22)
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
I have to remove the "#" in the pekwm_themeset.pl file also?
When i copied it into the menu file i removed the "#" and changed the path so it was the correct path to the script and theme directory.
Last edited by yama (2008-07-08 19:48:14)
Offline
I have to remove the "#" in the pekwm_themeset.pl file also?
When i copied it into the menu file i removed the "#" and changed the path so it was the correct path to the script and theme directory.
No not from the pekwm_themeset.pl file.
But I see what the problem is. You have set the path to the .pl file but you haven't set the path to your theme directory in the menu.
Assuming your themes are under ~/.pekwm/themes, your menu entry should look like this
Separator {}
SubMenu = "Themes" {
Entry = "Themes" { Actions = "Dynamic ~/.pekwm/scripts/pekwm_themeset.pl ~/.pekwm/themes" }
}
Submenu = "Configs" {
I have also included the line above and below it for your reference. Notice the additional ~/.pekwm/themes in the Entry line.
Last edited by Inxsible (2008-07-08 20:00:53)
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
Thanks for taking the time to help. But i copied it into the menu file but still wont work. I also wrote the whole path to the file and folder, didnt help. No submenu pops out. Not with mouseclick or with the mouse cursor just hovering over. But the with the other entries the submenu pops out with the mouse cursor hovering over.
Does it need to have any other files or something in either the scripts or themes folder or the .pekwm folder? I created the scripts folder and added the pekwm_themeset.pl file. I also created the themes folder and added the themes into it. So now i have two themes in the folder and both works (have tested them, so that shouldnt be it).
With the whole path it looks like this:
Separator {}
SubMenu = "Themes" {
Entry = "Themes" { Actions = "Dynamic /home/yama/.pekwm/scripts/pekwm_themeset.pl /home/yama/.pekwm/themes" }
}
Submenu = "Configs" {
In the .pekwm folder this is its content:
Folders: scripts, themes
Files: autoproperties, config, keys, menu, mouse, start, vars
In the scripts folder this is its content:
Files: pekwm_themeset.pl
In the themes folder this is its content:
Folders: Inda-B, Wobed
Last edited by yama (2008-07-08 21:21:51)
Offline
After making the change, did you restart or reconfigure Pekwm ?
Another thing would be to check if you have proper closing braces for each opening brace in the entire menu. Such simple things could cause havoc in xml and similar files in weird ways and would be tough to find.
Last edited by Inxsible (2008-07-08 21:41:10)
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
One more thing I noticed was in the pekwm_themeset.pl file they have empty quotes ("") on the Entry line, whereas you have "Themes". I am not sure if that makes a difference since I don't use PekWM.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
i did restart PekWM after changing the menu file.
Good idea. Didnt think about trying that. But unfortunantly it didnt help.
I didnt need to prowl through the whole file though. I did however, give it another shot looking through the pekwm-0.1.6.tar.bz2 found on the pekwm site. Figured out i could use the stuff in the menu.in, so i copied the Themes entry in that file into my menu file and i also copied the files in the Script folder into my .pekwm folder (which i also didnt think about the first time) and ofc made them executable. So now it all works as it should, even the themes submenu.
Stupid of me to not get that the first time. But i constantly learn new things.
Anywho. Here is the new entry in me menu file:
SubMenu = "Themes" {
Entry { Actions = "Dynamic /home/USERNAME/.pekwm/scripts/pekwm_themeset.pl /home/USERNAME/.pekwm/themes" }
Entry { Actions = "Dynamic ~/scripts/pekwm_themeset.pl ~/.pekwm/themes" }
}
BTW: Wether only one of the Entry lines are needed i dunno. I havent bothered checking. Call me lazy if you want;)
Thanks again Inxsible for taking the time to help me:)
Last edited by yama (2008-07-09 01:10:25)
Offline
One more thing I noticed was in the pekwm_themeset.pl file they have empty quotes ("") on the Entry line, whereas you have "Themes". I am not sure if that makes a difference since I don't use PekWM.
so I was corect here tht you had "Themes" defined instead of entry = Action
Glad you got it working
Last edited by Inxsible (2008-07-09 02:03:10)
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
Thanks. Spent hours trying to find a solution for it. So very happy i at last got it working as it should.
Atleast partially correct. As you see i had to remove the "" and = and it would probably work:)
Wrong: Entry = "Themes" {
Correct: Entry {
Offline