Find'N'Run

Filemanagers, partitioning tools, etc.
Message
Author
User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

Find'N'Run

#1 Post by SFR »

Note: this app has been forked, enhanced and is being currently developed by forum member step.
You can find it (along with native packages for Fatdog, Puppy and Debian (Lubuntu)) on GitHub:
https://github.com/step-/find-n-run
Also, new forum thread has been created:
http://www.murga-linux.com/puppy/viewtopic.php?t=102811

___________

Initiated here.
Screenshot says it all, I hope..?

NOTE: F'N'R requires Gtkdialog >= 0.8.3 in order to work properly!

Written by me, L18L and step (v1.10.0+).
___________

Changelog

Version 0.1:
- initial release

Version 0.2:
- gettext + help tooltips + using Names from within .desktop files (also in native language, if available) [thanks to L18L]

Version 0.3:
- code improvements [me]

Version 0.4:
- compatibility with Gtkdialog 0.7.21 [thanks to RSH/LazY Puppy]

Version 0.5 [L18L]:
- version in title
- help for --help and -h
- smaller input field after text
- tooltip for this field only
- no width-request for window
- TEXTDOMAIN changed

Version 0.6 [me]:
- escape key closes the window [thanks to RSH]
- added "Leave this window opened" checkbox
(both the above changes require Gtkdialog >= 0.8.3 now)

Version 0.7 [L18L]
- "About" & "Exit" buttons

Version 0.8 [me]:
- now as a .pet
- reinstated ROX-App [originally by L18L]
- created icon for ROX-App (thanks to Vovchik's Pikona)
- asks to create a shortcut on the desktop after installation

Version 0.9:
- added 'x' (clear) button to entry field
- added new locations where *.desktop files can be found [thanks to jamesbond]

Version 1.0:
- removed 'Xdialog' dependency
- decreased dimensions of ROX-App icon (128x128 -> 48x48)
- fix: recursive search (grep -r) didn't work
- minor clean up of code

Version 1.1:
- fix for choosing wrong exec in some cases [thanks to jamesbond]

Version 1.2:
- fix: proper handling of "unusual" Exec= lines

Version 1.3:
- fix regression: follow symlinks [thanks to RSH]
- ROX-App dir renamed to "FindNRun" (no single quotes) to avoid problems in Momanager [thanks to L18L]

Version 1.4:
- fix: rare possibility of picking up wrong exec

Version 1.5:
- fix for .desktop files that have 'Name[lang]=' before 'Name=' [L18L, me]

Version 1.6:
- LOCations re-ordered [L18L]
- small correction in code [me]

Version 1.7:
- a bit different, but more fool-proof, approach of searching/filtering

Version 1.8:
- unset all Gtkdialog/exported variables before launching the chosen application (thanks to step)
- added displaying of comments, while browsing the list
- /bin/sh changed to /bin/ash - this is in case if target system has /bin/sh symlinked to dash (F'N'R won't work with dash)

Version 1.9:
- corrected a typo (thanks to step)

Version 1.9.1:
- can include raw *.desktop filenames to be searched, too
- can launch wine applications (they have a bit different Exec's structure)
- minor fixes, improvements and rearrangements

Enjoy &
Greetings!
Attachments
Screenshot.gif
(232.41 KiB) Downloaded 1140 times
findnrun-1.9.1.pet
MD5: 0ebd0e935d04f6187786e8a678231521 findnrun-1.9.1.pet
(7.11 KiB) Downloaded 910 times
Last edited by SFR on Wed 11 May 2016, 22:53, edited 25 times in total.
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#2 Post by LazY Puppy »

Thank you very much for Find'N'Run.

This is exactly what I'd needed to complete my Application Kiosk, a Dashboard-like Program, which offers all Applications of all .desktop Files in a gtkdialog GUI - categorized and sorted in Alphabetical Order related to Language-Setup.

It was inspired by an early version of Icon Finder.

Now my Application Kiosk has added find and run function! :D
Attachments
image-2.jpg
(67.86 KiB) Downloaded 2146 times
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:

User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#3 Post by LazY Puppy »

@RSH: actually, no need for gtkdialog4 - it turned out that Gtkdialog 0.7.21 gets pissed off if <tree> widget has no <label>, so it's enough to add one (<label>Name</label>); it's not visible anyway...
Yes, it works out of the box.

Though, I have made a little modification, to keep the GUI opened when executing an application. To close the GUI easily, I added code:

Code: Select all

<action signal="key-press-event" condition="command_is_true([ $KEY_SYM = Escape ] && echo true )">Exit:0</action>
above line:

Code: Select all

</window>' | gtkdialog -s >/dev/null
In this case it seems to need gtkdialog4.

Code: Select all

</window>' | gtkdialog4 -s >/dev/null
Otherwise the GUI is closing immediately when hitting any key.
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

0.5

#4 Post by L18L »

Changelog

version in title
help for --help and -h
smaller input field after text
tooltip for this field only
no width-request for window
TEXTDOMAIN changed
Attachments
findNrun-0.5.png
(9.17 KiB) Downloaded 2024 times
findnrun.gz
(892 Bytes) Downloaded 632 times

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#5 Post by SFR »

Thanks L18L & RSH, new version uploaded.
See the first post for changelog.

EDIT: quick reupload - added use-underline to the checkbox, so can be toggled via keyboard shortcut (Alt+first letter).

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

#6 Post by cimarron »

Very nice (and FAST)! Thank you!

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

0.7

#7 Post by L18L »

"About" added

also included:
SFR wrote: - added use-underline to the checkbox, so can be toggled via keyboard shortcut (Alt+first letter).
Attachments
findNrun-0.7.png
(23.74 KiB) Downloaded 1976 times
findnrun.gz
(1.4 KiB) Downloaded 563 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#8 Post by musher0 »

Hi, SFR.

Coming from you, I'm sure it is well done, but... dmenu2 already exists, no?

Why such a script ?

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#9 Post by musher0 »

Hello, again.

For those interested in a not-so-CLI interface, not so long ago, I've also
come up with a list of *.desktop executables by categories. Please see
http://www.murga-linux.com/puppy/viewto ... 025#833483
and ff.

Thanks for your time and best regards.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#10 Post by SFR »

@Musher0: What dmenu2 does? I tried to see what's that (using it along with your script), but it segfaults on me (FD64-700):

Code: Select all

# ./z: line 18: 30311 Segmentation fault      ./dmenu -t -name dmenu2-wmx -i -l 15 -p dmenu2-wmx -nb '#8B795E' -nf '#FFFFF0' -sb '#FFFFF0' -sf '#8B795E' -b -y 605 -x 515 -o 0.7 -h 24 -w 300 -fn 'Monaco-11:italic' "$@" < "$cache"
From what I found it's "a dynamic menu for X" and I'm not sure if it's exactly the same scope as F'N'R's...
Why such a script ?
Because I (we) can..? :wink:
___________

Thanks L18L, your changes included, although I threw out HELP1 & HELP2 lines from About, as they're in the main GUI anyway.

Ok, it's time for a break for me.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

retro 0.7 KISS

#11 Post by L18L »

Here the KISS version 0.7

Code: Select all

sit /usr/local/lib/X11/pixmaps/bigred48.png "find an app" findnrun "findnrun -" &
Dogs must sit.
technosaurus gave us sit.
Thus I was able to let Fatdog (use) sit.

bigred in panel
- hover : tooltip
- leftclick: find_N_run
- right click: About
Attachments
sit-findNrun-0.7.png
(37.99 KiB) Downloaded 1966 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#12 Post by musher0 »

SFR wrote:@Musher0: What dmenu2 does? I tried to see what's that (using it along with your script), but it segfaults on me (FD64-700):

Code: Select all

# ./z: line 18: 30311 Segmentation fault      ./dmenu -t -name dmenu2-wmx -i -l 15 -p dmenu2-wmx -nb '#8B795E' -nf '#FFFFF0' -sb '#FFFFF0' -sf '#8B795E' -b -y 605 -x 515 -o 0.7 -h 24 -w 300 -fn 'Monaco-11:italic' "$@" < "$cache"
From what I found it's "a dynamic menu for X" and I'm not sure if it's exactly the same scope as F'N'R's...
Why such a script ?
Because I (we) can..? :wink:
___________

Thanks L18L, your changes included, although I threw out HELP1 & HELP2 lines from About, as they're in the main GUI anyway.

Ok, it's time for a break for me.

Greetings!
Hello, SFR.

You do not know dmenu?
It started as the menu for the dwm window manager. Now it has
independent variants. You can adapt it to all kinds of needs.
https://bbs.archlinux.org/viewtopic.php?id=80145

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Moat
Posts: 955
Joined: Tue 16 Jul 2013, 06:04
Location: Mid-mitten

#13 Post by Moat »

Great little app, working in Precise 5.7.1 w/Openbox-LxPanel!

Would it be possible to incorporate this into the (first, main) menu window (like a 'category')? LxPanel's menu includes a similar 'Run' function (see screenshot), but it seems to look for commands, and misses many of the menu's normal application entries (.desktop files from /usr/share/applications). That would be killer!

Thanks,

Bob
Attachments
run in LxPanel_2015-03-24(1).jpg
LxPanel's 'Run' entry
(18.54 KiB) Downloaded 1868 times

User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#14 Post by LazY Puppy »

musher0 wrote:Hi, SFR.

Coming from you, I'm sure it is well done, but... dmenu2 already exists, no?

Why such a script ?

BFN.

musher0
musher0 wrote:Hello, SFR.

You do not know dmenu?
It started as the menu for the dwm window manager. Now it has
independent variants. You can adapt it to all kinds of needs.
https://bbs.archlinux.org/viewtopic.php?id=80145

BFN.

musher0
Moat wrote:Great little app, working in Precise 5.7.1 w/Openbox-LxPanel!
Yes, this is really the coolest Script I have seen since the invention of gnewpet.

I gave dmenu2 a quick shot, but wasn't that much impressed of. Of course it could not offer all its advantages by such a quick shot, but I'm just too lazy and/or too busy to read all the posts of musher0 to dmenu2 and also to search the Dmenu Hacking Thread.

Besides this, Find'N'Run seems to use dependencies only, that are already installed in a Puppy. It doesn't need to install anything else like it would be needed for dmenu/dmenu2. Saves me one remaster at least!

Since I'm now quite familiar with bash and gtkdialog it's also much easier for me to modify Find'N'Run (what I've already done) and I like also its use of the .desktop files to search for the applications.

To make it able to offer to me also my external Scripts and the SFS Modules in my Modules Directory, I wrote two little Scripts, that are creating .desktop Files from my external Scripts Directory, /mnt/$LP2BPL/Skripte and my external SFS Modules Directory, /mnt/$LP2BPL/Module.

By default it now offers .desktop files from /usr/share/applications and from /tmp/ScriptApplications (contains those created from external Scripts Directory). The left frame (/usr/share/applications) can switch to /tmp/SFSApplications (contains those created from external SFS Modules Directory) and back.

Starting my modifications from Find'N'Run version 0.4, I have made it a RoxApp Directory and placed it at my external RoxApps Directory and am starting it from a Menu Pipe (existing for Openbox, JWM, IceWm and Fluxbox) pointing to that directory.

Renamed it to Search-and-Execute to not to conflict with Find'N'Run.

Next step is to have only a single entry field for both of the lists.

So, Find'N'Run to me is the application of the month 03/2015! 8)
Attachments
image-1.jpg
(72.08 KiB) Downloaded 1834 times
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#15 Post by jamesbond »

Interesting development! I'm waiting for the development to stabilise a bit before incorporating this to Fatdog.
Just a note - 'sit' will work for all puppies. For Fatdog, I will probably just put it the quicklaunch section (the one that has web browser, control panel, etc) and perhaps assign a keyboard shortcut to it (Alt-F1 opens the openbox menu, Alt-F2 currently will launch gexec, perhaps this will get Alt-F3).

EDIT: Version 0.8 now merged to Fatdog.
Last edited by jamesbond on Wed 25 Mar 2015, 07:58, edited 1 time in total.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#16 Post by mavrothal »

Works nice in the puppies I tried it :D
Do you think that adding the icon, form the icon field, in every entry (for the "visual types") would be too much hassle or even confusing?
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
Moat
Posts: 955
Joined: Tue 16 Jul 2013, 06:04
Location: Mid-mitten

#17 Post by Moat »

Moat wrote:Would it be possible to incorporate this into the (first, main) menu window (like a 'category')?
Ha! Answered my own question...

In ~/root/.config/lxpanel/default/panels/panel I snuck in @ line 38...

Code: Select all

separator {
        }
        item {
           image=findnrun.png
           name=Find'N'Run
           action=findnrun
        }
... and it works!

Bob
Attachments
add findnrun to lxmenu.jpg
Precise571/OpenboxPlus
(82.79 KiB) Downloaded 439 times

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#18 Post by SFR »

musher0 wrote:You do not know dmenu?
I didn't. But from what I saw @Arch forum it must be a very flexible piece of code.
LazY Puppy wrote:application of the month 03/2015!
Thanks. :lol:
jamesbond wrote:quicklaunch
I came to the same idea - one click less to access it.
Thank you!
mavrothal wrote:Do you think that adding the icon, form the icon field, in every entry (for the "visual types") would be too much hassle or even confusing?
I think it would heavily overcomplicate already overcomplicated searching code.
I'm not saying no, though, because this also crossed my mind, but the code needs to be simplified first and maybe then.
Moath wrote:Ha! Answered my own question...
I'm glad you have resolved it.

Thanks all &
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#19 Post by jamesbond »

Suggestion: in addition to /usr/share/applications, how about searching /usr/local/share/applications and $HOME/.local/share/applications (or $XDG_DATA_HOME/applications) too (if they exists)? According to XDG these directories can also contain .destkop files.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#20 Post by SFR »

Yeah, I thought about it too, but the original code was able to handle only one location.
Now it makes no difference as the executing code is searching through Name fields (not filenames), so sure - will be added to the next version.
Although I'm not sure which location would be more fool-proof (especially in Puppyland) - $HOME or $XDG? Should I flip a coin? :wink:
Or maybe simply add both of them (duplicates will be filtered out anyway)..?

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

Post Reply