Find'N'Run

Filemanagers, partitioning tools, etc.
Message
Author
User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#41 Post by LazY Puppy »

Try to change:

Code: Select all

${LOC1} ${LOC2} ${LOC3}
to:

Code: Select all

'${LOC1}' '${LOC2}' '${LOC3}'
I've done this in my hack of Find'N'Run and it works correctly.
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
recobayu
Posts: 387
Joined: Wed 15 Sep 2010, 22:48
Location: indonesia

#42 Post by recobayu »

FOI, we can open everythings file with

Code: Select all

rox /our/location/file
this trick also can be added in find n run, I think.. So not only bin application, but also file in some directory. Nah, we choose a directory that we want to search.
User avatar
SFR
Posts: 1799
Joined: Wed 26 Oct 2011, 21:52

#43 Post by SFR »

@Recobayu: F'N'R is for launching apps that you can normally find (only) in Menu. Other binaries (without menu entry) or normal files are rather out of scope of this app...
rules-hint="true" - well, I don't know...it makes more sense for multiple columns.
mukstart - yes, I've seen it before; nicely done!
___________

@Jamesbond: confirmed - I don't know why, but with --include="*.desktop" option mtpaint-snapshot gets found before mtpaint:

Code: Select all

# grep -h -r -C1000 "^Name.*=mtPaint" /usr/share/applications --include="*.desktop" | grep '^Exec='
Exec=mtpaintsnapshot.sh
Exec=mtpaint %F
# 
Before v1.0 it was like this (but recursion didn't work):

Code: Select all

# grep -h -r -C1000 "^Name.*=mtPaint" /usr/share/applications/*.desktop | grep '^Exec='
Exec=mtpaint %F
Exec=mtpaintsnapshot.sh
# 
Anyway, the $ fixed that:

Code: Select all

# grep -h -r -C1000 "^Name.*=mtPaint$" /usr/share/applications --include="*.desktop" | grep '^Exec='
Exec=mtpaint %F
# 
Thanks for reporting this.

Btw, there's another minor glitch in FD (dunno how to fix it gracefully, though) - if you type "trans", it finds only "Start Transmission Minimized", however it launches Transmission in a normal way.
That's because Transmission's .desktop file contains a second 'Name=' field, which gets picked up by F'N'R (due to 'tac').
___________

@RSH: Hmm, it works for me with or without single quotes (since these variables are exported), but if it works better for you, I changed it that way (and withdrew exporting).
___________

First post updated!

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]
User avatar
SFR
Posts: 1799
Joined: Wed 26 Oct 2011, 21:52

#44 Post by SFR »

Version 1.2 - small update:

X11VNC Server in Fatdog has "unusual" Exec line:

Code: Select all

Exec=x11vnc -gui tray=setpass -rfbport PROMPT -bg -o "%HOME/.x11vnc.log.%VNCDISPLAY"
It didn't work correctly when invoked via F'N'R, because all stuff after the first % got truncated.
Now fixed, first post updated.

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]
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#45 Post by musher0 »

No-no-no-no... This doesn't work as intended.

Find'N'Run only works if you double click on the name of the program in
the list. No other way.

The "tick" for "stay open" doesn't work. The window closes anyway when
the selected program is launched.

Finally, if you type anything in the top rectangle to narrow the search, the
entire window closes.

This script needs a serious re-fit... Good luck!

And as I told L18L earlier today, "if I may have the pleasure of tightening
the screw, [by comparison] dmenu2 [just] works."

Sorry for being so frank, but that's how it is, guys.
(Versions tested : 0.9 and 1.2)

Bye for now.

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

#46 Post by Jasper »

Hi musher0.

Find'N'Run v. 0.4 (as I wrote earlier in this thread) works perfectly here with Precise 5.6, but dmenu2 does not; so if you can PM me with a working version of dmenu2 I shall be pleased to try it and then comment.

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

#47 Post by LazY Puppy »

Seems to work here as expected.

Tested in Tahr 6.0.

Though it seems to have lost its capacity to handle symbolic links in /usr/share/applications.

But the Improvement seems to be exactly something I was looking for to "fix" a lower issue in my SFS P.L.U.S.
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:
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#48 Post by musher0 »

Jasper wrote:Hi musher0.

Find'N'Run v. 0.4 (as I wrote earlier in this thread) works perfectly here with Precise 5.6, but dmenu2 does not; so if you can PM me with a working version of dmenu2 I shall be pleased to try it and then comment.

My regards
Hello, Jasper.

Thanks for your kind offer.

I'll post another copy if necessary, but first:
how did you launch your dmenu2? It needs to be launched this way:

Code: Select all

dmenu_run
not directly with < dmenu >.

BFN.

musher0

~~~~~~~;
After-thought: Did you use the pet file at
http://murga-linux.com/puppy/viewtopic. ... 007#833246
or another package?
Last edited by musher0 on Sat 04 Apr 2015, 02:17, edited 1 time in total.
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

#49 Post by musher0 »

LazY Puppy wrote:Seems to work here as expected.
Tested in Tahr 6.0.
(...)
Weird... I ran my tests in Puppy Precise 5.4.3. Does FindNRun need a
special version of yad or gtk-dialog, etc., to run proprely?

In any case, I will not be using it any more, but if the above, maybe the
authors need to make that clear in the docs?

BFN.

~~~~~~~~~~
Note, April 4, 2015. Yeah, works ok in TahrPup 6.0.
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

#50 Post by musher0 »

@jasper:

dmenu2 needs a couple of runs to build its database, during which nothing
seems to happen. The 3rd time or so, it's functional.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
User avatar
SFR
Posts: 1799
Joined: Wed 26 Oct 2011, 21:52

#51 Post by SFR »

LazY Puppy wrote:Though it seems to have lost its capacity to handle symbolic links in /usr/share/applications.
Yep, that's another "unexpected" side effect caused by the use of '--include' option. :roll: Fixed now, thanks!
musher0 wrote:Find'N'Run only works if you double click on the name of the program in
the list. No other way.

The "tick" for "stay open" doesn't work. The window closes anyway when
the selected program is launched.

Finally, if you type anything in the top rectangle to narrow the search, the
entire window closes.

This script needs a serious re-fit... Good luck!
F'N'R requires Gtkdialog >= 0.8.3, which is a standard in Puppies released in the past 2 years.
Anyway, I made a clear note in the first post. Thanks for pointing this out.

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
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#52 Post by LazY Puppy »

Yep, that's another "unexpected" side effect caused by the use of '--include' option. :roll: Fixed now, thanks!
Yes, it's fixed!

Thank you very much! 8)
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

#53 Post by LazY Puppy »

At last

-I think-

it would be absolutely COOL (and useful too)-, to have the search field
(or the entry for the narrow search) working with wildcards ( * )!

Can such be done in GtkDialog ?
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
SFR
Posts: 1799
Joined: Wed 26 Oct 2011, 21:52

#54 Post by SFR »

If you remove -F from:

Code: Select all

grep -F -i -- "$varENTRY"
you'll be able to use wildcards like in grep (e.g.: . for a single char and .* for many).
I have used '-F|--fixed-strings' on purpose, because regexp requires some extra knowledge from users and disables ability to search for some of characters, unless you escape them.

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]
Les Kerf
Posts: 317
Joined: Sun 24 Jun 2012, 13:30

#55 Post by Les Kerf »

Just now found this. I LIKE it :D
Thanks!
Les
User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#56 Post by LazY Puppy »

SFR wrote:If you remove -F from:

Code: Select all

grep -F -i -- "$varENTRY"
you'll be able to use wildcards like in grep (e.g.: . for a single char and .* for many).
I have used '-F|--fixed-strings' on purpose, because regexp requires some extra knowledge from users and disables ability to search for some of characters, unless you escape them.

Greetings!
Thanks, this works.
Extra knowledge from users does mean to enter \.jpg for a search for .jpg files only?
That's Ok with me and my personal hack. :D

May I offer another issue where you may point me to an solution.

Here is a .desktop file example for the use of my external scripts.
[Desktop Entry]
Encoding=UTF-8
Name=Scripts - - Create-Symbolic-Links <--- just translated for SFR
Name[de]=Skripte - - Symbolische-Links-erzeugen
Exec=/mnt/sde1/Skripte/Symbolische-Links-erzeugen
Icon=/usr/share/pixmaps/rshavatar48.png
NoDisplay=true
I have a function that returns to me (to a bash script) current boot partition and directory.

- $LP2BPL
- $LP2BDL

So /mnt/sde1 in "Exec=" is created relative to from what boot partition the OS was booted up. When at my girlfriend's computer my boot partition is usually /mnt/sdf1, so I would need to create all the created .desktop files for my external scripts and stuff again and again. But this doesn't change really that much, so I just want to create them once and keeping them alive for later use.

Therefor I would need to create the .desktop files in a way, that they would come up with an "Exec=" like: MYBOOTPARTITION/Skripte/Symbolische-Links-erzeugen and then to replace string MYBOOTPARTITION actually with content of $LP2BPL.

I think this needs to be done in this line here:
<action>X="$(grep -h -r -C1000 "^Name.*=.*${varLIST}$" '${LOC1}' '${LOC2}' '${LOC3}' --include="*.desktop" 2>/dev/null | grep -m1 "^Exec=" | cut -f2- -d "=")"; eval ${X% \%*} &</action>
Need to use sed, no?

Any idea what I would need exactly to insert?

Thanks
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
SFR
Posts: 1799
Joined: Wed 26 Oct 2011, 21:52

#57 Post by SFR »

LazY Puppy wrote:Need to use sed, no?
Well, sed would be the easiest way, I guess:

Code: Select all

<action>X="$(grep -h -R -C1000 "^Name.*=${varLIST}$" '${LOC1}' '${LOC2}' '${LOC3}' --include="*.desktop" 2>/dev/null | grep -m1 "^Exec=" | cut -f2- -d "=" | sed "s|MYBOOTPARTITION|'${LP2BPL}'|")"; eval ${X% \%*} &</action>
Works ok? 8)

EDIT: updated to v1.4 - small bugfix.

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
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#58 Post by LazY Puppy »

SFR wrote:Works ok? 8)
YES! Thanks. :D

Edit:

My OS also knows its parallelpartition 1 + 2 (e.g.: sda1 - sda2 - sda3; sdb5 - sdb6 - sdb7 etc.pp.) So I do have also .desktop files for my external files in $LP2BPL/$mydirsdir and am sending these files to a defaulthandler script in $APPDIR of my hack of FNR (which is currently /mnt/sde2). Looks like this:

Code: Select all

Exec=/mnt/sde2/RoxApps/RSH/SearchAndExecute/defaulthandler /mnt/sde1/Dateien/Bilder/Antike-Karten/Antiquity.tar.gz
So it forced me to expand

Code: Select all

sed "s|MYBOOTPARTITION|'${LP2BPL}'|
for the use of $LP2PPL and $LP2PP2L and I was successful in doing so.

Thanks again!
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/

condition Name[lang]= is after Name=

#59 Post by L18L »

SFR wrote:... the ability to fallback to the default Name= if no lang, basing on the assumption that practically always Name[lang]= is after Name=.
and
L18L wrote:And the condition "Name[lang]= is after Name=" will have to be checked and fixed. No problem: just work!
Will need some more time.
Well, have had time now for check and fix.

Code: Select all

#!/bin/sh
# sort_translations
# check and fix order of translations of Comment, Name and GenericName 
# in *.desktop files; takes about 4 sec

DIR=/usr/share/applications
mv -f ${DIR} ${DIR}_ || exit 1
mkdir -p ${DIR}
cd ${DIR}_
for f in `ls *.desktop`; do 
 sed q $f > ${DIR}/${f} # first line: [Desktop Entry]
 sort $f | grep -v '^\[' >> ${DIR}/${f}
done
cd -
rm -rf ${DIR}_
exit 0
has done it for me.

How to integrate this into Find'N'Run?
- do it in pinstall.sh only?
- at every start of Find'N'Run?
- use a new button to launch it?
- right click to launch it?
User avatar
SFR
Posts: 1799
Joined: Wed 26 Oct 2011, 21:52

#60 Post by SFR »

Hey L18L, thanks for the script. I completely forgot about this. :roll:
But, to be frank, I have never encountered a .desktop file where 'Name[lang]=' is before 'Name=' (that's where my "assumption" came from ;)), have you?
I just checked in FD (where I have also 40+ additional apps that have .desktop files) and only one of them was wrong in this regard:

Code: Select all

# grep -H -E '^Name\[.*\]=|^Name=' /usr/share/applications/*.desktop | sort -t: -u -k1,1 | grep -v ':Name='
/usr/share/applications/Puppy-Podcast-Grabber.desktop:Name[bg]=Puppy
[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