(OLD) (ARCHIVED) Puppy Linux Discussion Forum Forum Index (OLD) (ARCHIVED) Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

This forum can also be accessed as http://oldforum.puppylinux.com
It is now read-only and serves only as archives.

Please register over the NEW forum
https://forum.puppylinux.com
and continue your work there. Thank you.

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 23 Sep 2020, 02:30
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
Find'N'Run
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 4 of 7 [104 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Author Message
Jasper

Joined: 25 Apr 2010
Posts: 1350
Location: England

PostPosted: Fri 03 Apr 2015, 20:36    Post subject:  

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
Back to top
View user's profile Send private message 
LazY Puppy


Joined: 21 Nov 2014
Posts: 2007
Location: Germany

PostPosted: Fri 03 Apr 2015, 20:59    Post subject:  

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) Laughing

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! Wink
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 15041
Location: Gatineau (Qc), Canada

PostPosted: Fri 03 Apr 2015, 22:11    Post subject:  

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:
dmenu_run

not directly with < dmenu >.

BFN.

musher0

~~~~~~~;
After-thought: Did you use the pet file at
http://murga-linux.com/puppy/viewtopic.php?p=833246&sort=lastpost&search_id=205387007#833246
or another package?

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

Last edited by musher0 on Fri 03 Apr 2015, 22:17; edited 1 time in total
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 15041
Location: Gatineau (Qc), Canada

PostPosted: Fri 03 Apr 2015, 22:13    Post subject:  

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)
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 15041
Location: Gatineau (Qc), Canada

PostPosted: Sat 04 Apr 2015, 01:14    Post subject:  

@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)
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1802

PostPosted: Sat 04 Apr 2015, 05:02    Post subject:  

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. Rolling Eyes 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!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
LazY Puppy


Joined: 21 Nov 2014
Posts: 2007
Location: Germany

PostPosted: Sat 04 Apr 2015, 12:04    Post subject:  

Quote:
Yep, that's another "unexpected" side effect caused by the use of '--include' option. Rolling Eyes Fixed now, thanks!

Yes, it's fixed!

Thank you very much! Cool

_________________
RSH

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

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! Wink
Back to top
View user's profile Send private message 
LazY Puppy


Joined: 21 Nov 2014
Posts: 2007
Location: Germany

PostPosted: Sun 05 Apr 2015, 21:15    Post subject:  

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) Laughing

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! Wink
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1802

PostPosted: Mon 06 Apr 2015, 06:28    Post subject:  

If you remove -F from:
Code:
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!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Les Kerf

Joined: 24 Jun 2012
Posts: 317

PostPosted: Mon 06 Apr 2015, 08:42    Post subject:  

Just now found this. I LIKE it Very Happy
Thanks!
Les
Back to top
View user's profile Send private message 
LazY Puppy


Joined: 21 Nov 2014
Posts: 2007
Location: Germany

PostPosted: Mon 06 Apr 2015, 16:12    Post subject:  

SFR wrote:
If you remove -F from:
Code:
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. Very Happy

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.
Quote:
[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:

Quote:
<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) Laughing

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! Wink
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1802

PostPosted: Mon 06 Apr 2015, 16:57    Post subject:  

LazY Puppy wrote:
Need to use sed, no?

Well, sed would be the easiest way, I guess:
Code:
<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? Cool

EDIT: updated to v1.4 - small bugfix.

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
LazY Puppy


Joined: 21 Nov 2014
Posts: 2007
Location: Germany

PostPosted: Mon 06 Apr 2015, 17:26    Post subject:  

SFR wrote:
Works ok? Cool


YES! Thanks. Very Happy

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:
Exec=/mnt/sde2/RoxApps/RSH/SearchAndExecute/defaulthandler /mnt/sde1/Dateien/Bilder/Antike-Karten/Antiquity.tar.gz

So it forced me to expand
Code:
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) Laughing

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! Wink
Back to top
View user's profile Send private message 
L18L


Joined: 19 Jun 2010
Posts: 3493
Location: www.eussenheim.de/

PostPosted: Wed 08 Apr 2015, 09:13    Post subject: condition Name[lang]= is after Name=
Subject description: where launch script from?
 

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:
#!/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?
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1802

PostPosted: Wed 08 Apr 2015, 12:26    Post subject:  

Hey L18L, thanks for the script. I completely forgot about this. Rolling Eyes
But, to be frank, I have never encountered a .desktop file where 'Name[lang]=' is before 'Name=' (that's where my "assumption" came from Wink), 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:
# 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 сваляне на Подкаст
#

In fact, the above file doesn't have 'Name=' field at all (not to mention about 'Exec=' and others):
Code:
# cat /usr/share/applications/Puppy-Podcast-Grabber.desktop
Name[bg]=Puppy сваляне на Подкаст
Name[da]=Puppy-Podcast-Opfanger
Name[es]=Suscribirse a Podcasts
Name[fr]=Collecteur de Webcasts
Name[ja]=Puppyポッドキャストグラバ
Name[nl]=Puppy-Podcast-Grabber
Name[pl]=Puppy-Podcast-Łapacz
Name[pt]=Caçador de Podcasts do Puppy
Name[ru]=Загрузка подкастов
Name[zh_CN]=播客抓取工具
Name[de]=Puppy-Podcast-Grabber
#


Anyway, perhaps there won't be need for modifying .desktop entries directly - the searching line would look like this:
Code:
<input>grep -H -R -E "^Name(\['${LR}'\]|\['${L}'\])?=" '${LOC1}' '${LOC2}' '${LOC3}' --include="*.desktop" 2>/dev/null | sort -t= -k1,1 -d -r | sort -t: -u -k1,1 | cut -f2- -d "=" | sort -f -u | grep -F -i -- "$varENTRY"</input>

Quick test with a couple of purposely messed up .desktop files showed that it works, but of course needs some more testing.
Takes slightly more time, too, but still way below 0.100s (i3@2.13GHz).

Btw, side effect: it now picks up correct 'Name=' field from transmission-qt.desktop (an issue mentioned on previous page).

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 4 of 7 [104 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1549s ][ Queries: 12 (0.0375s) ][ GZIP on ]