I'm using a perl script kindly provided by a user on stackoverflow, it creates a menu with entries from ~/.kde4/share/apps/RecentDocuments/. By launching it from konsole, it works perfectly, but it is not updated when clicking on the menu(that...should be the new dinamic menus feature, right? Or maybe i've misunderstood). I've spoke with Lars about it, he said that it doesn't work, therefore you released BE::Watched.
So, do dinamic menus work?
P.s. This noob would like to ask for your help(but if any good samaritan is reading this and wants to be useful...) for a menu that generates entries for apps, splitted by categories ( gnome2/xfce alike) in case this feature works ;)
Last edit: Hombremaledicto 2013-06-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No, BE::Watched was written because i ever wanted to be able to link dbus signals via bash and also to have a generic inode watcher.
Do you have the menu in the global menu or attached to a button?
A button needs an entry like:
MenuUpdater=/home/hombre/bin/dynamic_menu_test.sh
while the globalmenu entry needs an attribute "preExec" like
preExec="/path/to/my/great/script"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No, BE::Watched was written because i ever wanted to be able to link dbus signals via bash and also to have a generic inode watcher.
I see. So Lars was wrong, or my brain is really messed up(confusing what people tell me).
Let's pretend Lars was wrong :P
Do you have the menu in the global menu or attached to a button?
It's in the global menu. I was using:
menu="/Menu/Recent" preExec="/scripts/Menu/recent.perl" preExecTimeout="250"
And you can see it was linking to a subdir(i know i know. In the wiki it's clearly written absolute path. My bad).
Anyway, the value 250 is there just for test. As you said - correctly - the script takes its time.
I'm not sure whether the perl shebang is interpreted correctly, so you might need "perl /path/to/script.pl" instead.
Thanks, i'll try it tomorrow :D
Yeah...i was trying to do it in a very unconvenient way: taking Name, Type, Icon & Exec values from the desktop files in /usr/share/applications/.
Btw: binary cache?
You're aware that the runner can be run as popup?
Sure! But i think you can easily guess my reasons (beyond being a dumb, annoying drunkard): since sometimes happens that i release a theme, i liked the idea of a MainMenu linking to dinamic menus. So users have only to give the right permissions. No needs to edit anything/removing lines/changing icons, etc...
All updated automagically.
Thank you for the reply!
Last edit: Hombremaledicto 2013-06-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
menu="/Menu/Recent"
The leading slash is not required here.
the script takes its time.
Humm? Converting the few files from a flat path into a menu structure should not be very expensive - i added a short bash script. Have
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Humm? Converting the few files from a flat path into a menu structure should not be very expensive - i added a short bash script. Have Runs in 135ms here. Has even space for improvement.
Might be is something i edited. And also i increased RecentDocuments limit to 50 elements, dunno it this affects performances in a sensible way(50 files, but always in the same folder).
Oh-ho! Great addition today. Your script could work as a template for future ones i'd like to create :D
sycoca - not binary tree, but the required data is collected, filtered and stored in a fast readable cache.
Then i have to apologize to Lars(or maybe not): my brain is really messed up. I thought about that - i "know" that the kbuildsycoca command is used to refresh the cache - but was not sure about.
"dynamic"
I wrote the message at 3am. After a heavy-drinking-night with friends. Consider a miracle that i wrote it in the right language (after 6 beers, each one @ 8%, i begin to speak sumerian) ;P
Though, my english sucks.
I'm not entirely sure what you mean by this.
This seems to be a "please support at least "$HOME" in pre-exec strings (what's doable) but i really don't see the relation to the application menu in a more qmenu popup style (unfolding)
Not really, it was not a feature request, it was just a thought, but i appreciate the $HOME support you added.
Hmm, i'll try to explain it better: i noticed that many users tend to put an "application" menu in the MainMenu(as i do). Must be some sort of gnome2 nostalgia ( IMO, somehow seems convenient, despite the Runner supports shortcuts).
However, this is far understandable for italian users. Most of them followed the tutorials i pulished on forums/blogs (tutorials by Hombre = toilet paper), or make use of my MainMenu file directly. So the whish was to make a standard GMenu, with the right entries(just the apps installed), without editing.
Whatever, i'll make a reason this can not be done w/ scripts.
Fallback question: Is there a way to customize a menu label from the theme.css?
Let's say i have a "Places" label in the Globalmenu, and i want it to be embolden - like the first entry of an application's menubar.
Thank you for the reply!
That's what the forum is there for...
Believe me, i know i'm a huge pain in the ass with all the questions & requests, hehe.
Last edit: Hombremaledicto 2013-06-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
dunno it this affects performances in a sensible way
Probably - it will increase the amount of launched subprocesses and evals.
It might make sense to unroll the loop by sed'ing all files into a /tmp helper that can be sourced. Run the script with "time ./recent_files.sh" and check the output. If the number is too high feel free to improve it or cal back.
Also this might very well be a task for be.watched then (which would allow to monitor the directory for changes and schedule an update for 5 seconds or so)
Though, my english sucks.
Not really and would be no problem either - nor would it be very kind from my side to let you go on with misspelling this term of ancient greek origin ;-)
Hmm, i'll try to explain it better: i noticed that many users tend to put an "application" menu in the MainMenu(as i do).
Like
<action label="Apps" dbus="session;org.kde.be.shell;/Runner;org.kde.be.shell;togglePopup;-1;-1"/>
(-1,-1 to be near cursor is brand new, but the popup always was available)
Whatever, i'll make a reason this can not be done w/ scripts.
"Not in a sane way", no.
Since the data is collected anyway (in a thread to not block be.shell startup - it's slow even from sycoca and c++ ...) one could make a QMenu structure out of that relatively simple (i think) - I just don't believe in that kind of menu =)
Fallback question: Is there a way to customize a menu label from the theme.css?
=) Now, how's that related?
The answer is no - QStyleSheetStyle doesn't interpret that and only very few styles (bespin) honor the action font when painting a menu at all.
I could add a key to emphasize an entry, ie. embolden it, but i don't think that would work with random styles either.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Probably - it will increase the amount of launched subprocesses and evals.
It might make sense to unroll the loop by sed'ing all files into a /tmp helper that can be sourced. Run the script with "time ./recent_files.sh" and check the output. If the number is too high feel free to improve it or cal back.
Also this might very well be a task for be.watched then (which would allow to monitor the directory for changes and schedule an update for 5 seconds or so)
I see. I learned from Rob it's a wise idea to use a tmp helper. Good to know there's a "time" command. I was ignoring this!
I'm about to write a config for be.watched anyway, so i'll try it ;)
By the way i decreased the limit to 25 elements for RecentDocuments. Otherwise the menu would be too messy.
Not really and would be no problem either - nor would it be very kind from my side to let you go on with misspelling this term of ancient greek origin ;-)
Hehehe, i can understand that. And you can say whatever you want about me(but i do not guarantee i will not reply with insults ;P ).
I'm that way about latin. Must be i'm italian.
Though, my latin sucks.
P.s. Check Catullo, Carmen XVI ;)
"Not in a sane way", no.
Since the data is collected anyway (in a thread to not block be.shell startup - it's slow even from sycoca and c++ ...) one could make a QMenu structure out of that relatively simple (i think) - I just don't believe in that kind of menu =)
Oh yes. I'm pretty sure out there there's a "classic menu" for plasma-desktop(now that i'm thinking, i have to try it on be.shell to see if it works) nothing beyond a QMenu with entries generated by code.
How about a gen_applications_menu.sh? In case, the user could launch it manually (ok, this is a request: i'm too noob and lazy to do it. Feel free to say "F*ck you Hombre").
The answer is no - QStyleSheetStyle doesn't interpret that and only very few styles (bespin) honor the action font when painting a menu at all.
I could add a key to emphasize an entry, ie. embolden it, but i don't think that would work with random styles either.
Good to know it. I've spent some time trying to achieve this, without results. It feels like i removed a huge weight from my stomach.
Last edit: Hombremaledicto 2013-07-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using a perl script kindly provided by a user on stackoverflow, it creates a menu with entries from ~/.kde4/share/apps/RecentDocuments/. By launching it from konsole, it works perfectly, but it is not updated when clicking on the menu(that...should be the new dinamic menus feature, right? Or maybe i've misunderstood). I've spoke with Lars about it, he said that it doesn't work, therefore you released BE::Watched.
So, do dinamic menus work?
P.s. This noob would like to ask for your help(but if any good samaritan is reading this and wants to be useful...) for a menu that generates entries for apps, splitted by categories ( gnome2/xfce alike) in case this feature works ;)
Last edit: Hombremaledicto 2013-06-29
No, BE::Watched was written because i ever wanted to be able to link dbus signals via bash and also to have a generic inode watcher.
Do you have the menu in the global menu or attached to a button?
A button needs an entry like:
MenuUpdater=/home/hombre/bin/dynamic_menu_test.sh
while the globalmenu entry needs an attribute "preExec" like
preExec="/path/to/my/great/script"
I see. So Lars was wrong, or my brain is really messed up(confusing what people tell me).
Let's pretend Lars was wrong :P
It's in the global menu. I was using:
menu="/Menu/Recent" preExec="/scripts/Menu/recent.perl" preExecTimeout="250"
And you can see it was linking to a subdir(i know i know. In the wiki it's clearly written absolute path. My bad).
Anyway, the value 250 is there just for test. As you said - correctly - the script takes its time.
Thanks, i'll try it tomorrow :D
Yeah...i was trying to do it in a very unconvenient way: taking Name, Type, Icon & Exec values from the desktop files in /usr/share/applications/.
Btw: binary cache?
Sure! But i think you can easily guess my reasons (beyond being a dumb, annoying drunkard): since sometimes happens that i release a theme, i liked the idea of a MainMenu linking to dinamic menus. So users have only to give the right permissions. No needs to edit anything/removing lines/changing icons, etc...
All updated automagically.
Thank you for the reply!
Last edit: Hombremaledicto 2013-06-30
Might be is something i edited. And also i increased RecentDocuments limit to 50 elements, dunno it this affects performances in a sensible way(50 files, but always in the same folder).
Oh-ho! Great addition today. Your script could work as a template for future ones i'd like to create :D
Then i have to apologize to Lars(or maybe not): my brain is really messed up. I thought about that - i "know" that the kbuildsycoca command is used to refresh the cache - but was not sure about.
I wrote the message at 3am. After a heavy-drinking-night with friends. Consider a miracle that i wrote it in the right language (after 6 beers, each one @ 8%, i begin to speak sumerian) ;P
Though, my english sucks.
Not really, it was not a feature request, it was just a thought, but i appreciate the $HOME support you added.
Hmm, i'll try to explain it better: i noticed that many users tend to put an "application" menu in the MainMenu(as i do). Must be some sort of gnome2 nostalgia ( IMO, somehow seems convenient, despite the Runner supports shortcuts).
However, this is far understandable for italian users. Most of them followed the tutorials i pulished on forums/blogs (tutorials by Hombre = toilet paper), or make use of my MainMenu file directly. So the whish was to make a standard GMenu, with the right entries(just the apps installed), without editing.
Whatever, i'll make a reason this can not be done w/ scripts.
Fallback question: Is there a way to customize a menu label from the theme.css?
Let's say i have a "Places" label in the Globalmenu, and i want it to be embolden - like the first entry of an application's menubar.
Believe me, i know i'm a huge pain in the ass with all the questions & requests, hehe.
Last edit: Hombremaledicto 2013-06-30
Like
<action label="Apps" dbus="session;org.kde.be.shell;/Runner;org.kde.be.shell;togglePopup;-1;-1"/>
(-1,-1 to be near cursor is brand new, but the popup always was available)
I see. I learned from Rob it's a wise idea to use a tmp helper. Good to know there's a "time" command. I was ignoring this!
I'm about to write a config for be.watched anyway, so i'll try it ;)
By the way i decreased the limit to 25 elements for RecentDocuments. Otherwise the menu would be too messy.
Hehehe, i can understand that. And you can say whatever you want about me(but i do not guarantee i will not reply with insults ;P ).
I'm that way about latin. Must be i'm italian.
Though, my latin sucks.
P.s. Check Catullo, Carmen XVI ;)
Oh yes. I'm pretty sure out there there's a "classic menu" for plasma-desktop(now that i'm thinking, i have to try it on be.shell to see if it works) nothing beyond a QMenu with entries generated by code.
How about a gen_applications_menu.sh? In case, the user could launch it manually (ok, this is a request: i'm too noob and lazy to do it. Feel free to say "F*ck you Hombre").
Good to know it. I've spent some time trying to achieve this, without results. It feels like i removed a huge weight from my stomach.
Last edit: Hombremaledicto 2013-07-01