Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 23 Oct 2019, 20:08
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Normal Linux commands to Locate your system files, INSTANTLY
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 10 of 13 [184 Posts]   Goto page: Previous 1, 2, 3, ..., 8, 9, 10, 11, 12, 13 Next
Author Message
stemsee

Joined: 27 Jun 2013
Posts: 2507
Location: In The Way

PostPosted: Tue 31 Mar 2015, 17:10    Post subject:  

??
are you being sarcastic musher0 ?
Back to top
View user's profile Send private message MSN Messenger 
musher0

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

PostPosted: Wed 01 Apr 2015, 00:41    Post subject:  

stemsee wrote:
??
are you being sarcastic musher0 ?


Not at all my intention. Please forgive me if it looks like that.

Simply, I looked at the posting time of your recent messages and deducted
logically that you must've spent many hours working on your script before
telling us about it.

Also, I didn't have time to comment further, I had to go out in a hurry after
supper tonight, and my short message came out badly. Again, sorry.

Now I owe you at least some thorough testing to earn your forgiveness. Smile

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2507
Location: In The Way

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

Well, it took ten minutes or so to come up with that script, after having the idea! It took longer to organise the screenshots. And none of it is what I would call hard work.

So, i hope you can develop this into something useful.
Back to top
View user's profile Send private message MSN Messenger 
stemsee

Joined: 27 Jun 2013
Posts: 2507
Location: In The Way

PostPosted: Wed 01 Apr 2015, 16:06    Post subject:  

test this. It also helps the user create a custom list of linked apps for use with slocategui.



Code:
#!/bin/sh
if [ ! -f /root/.slocateguiflag ]; then
mkdir /usr/share/slgapps
yad --text "Now select the apps you regularly use to open files.\nThese will be linked to their own special directory \n to speed up slocategui."
lapps=$(for f in `ls /usr/share/applications`; do echo $f | cut -f1 -d '.' ; done | yad --list --multiple --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
for file in $lapps
do
ls /usr/share/applications | grep -e $file | ln -s $file /usr/share/slgapps/$file
done
touch /root/.slocateguiflag
filext=`yad --title="Find files" --text="What are you looking for?:
e.g. *.mp3" --form --field="Type file name or extension:" `
filext=`echo "$filext" | cut -f1 -d '|'`
select=$(for f in `slocate "$filext"`; do echo $f ; done | yad --list --multiple --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
[[ $ret -eq 1 ]] && exit 0
if [[ $ret -eq 0 ]]; then
app=$(for f in `ls /usr/share/slgapps`; do echo $f | cut -f1 -d '.' ; done | yad --list --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
$app $select &
fi
else
filext=`yad --title="Find files" --text="What are you looking for?:
e.g. *.mp3" --form --field="Type file name or extension:" `
filext=`echo "$filext" | cut -f1 -d '|'`
select=$(for f in `slocate "$filext"`; do echo $f ; done | yad --list --multiple --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
[[ $ret -eq 1 ]] && exit 0
if [[ $ret -eq 0 ]]; then
app=$(for f in `ls /usr/share/slgapps`; do echo $f | cut -f1 -d '.' ; done | yad --list --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
$app $select &
fi
fi
Back to top
View user's profile Send private message MSN Messenger 
musher0

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

PostPosted: Wed 01 Apr 2015, 17:06    Post subject:  

Hi, stemsee.

Feedback (un-finished !) with some code formatting and a couple of
comments :

Code:
#!/bin/sh
# gui for slocate searches
# by stemsee,
# murga-linux.com/puppy/viewtopic.php?p=837640&sort=lastpost#837640
# Retrieved 01.04.2015 16:54
####
 if [ ! -f /root/.slocateguiflag ]; then
   mkdir /usr/share/slgapps
   yad --text "Now select the apps you regularly use to open files.\nThese will be linked to their own special directory \n to speed up slocategui."
   lapps=$(for f in `ls /usr/share/applications`; do echo $f | cut -f1 -d '.' ; done | yad --list --multiple --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
   ret=$?
   for file in $lapps
      do
      ls /usr/share/applications | grep -e $file | ln -s $file /usr/share/slgapps/$file
      done
   touch /root/.slocateguiflag
   filext=`yad --title="Find files" --text="What are you looking for?:
   e.g. *.mp3" --form --field="Type file name or extension:" `
   filext=`echo "$filext" | cut -f1 -d '|'`
   select=$(for f in `slocate "$filext"`; do echo $f ; done | yad --list --multiple --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
# -=> In which slocate db should we be looking? <=-
   ret=$?
   [[ $ret -eq 1 ]] && exit 0
   if [[ $ret -eq 0 ]]; then
      app=$(for f in `ls /usr/share/slgapps`; do echo $f | cut -f1 -d '.' ; done | yad --list --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
      ret=$?
      $app $select &
   fi
else
   filext=`yad --title="Find files" --text="What are you looking for?:
   e.g. *.mp3" --form --field="Type file name or extension:" `
   filext=`echo "$filext" | cut -f1 -d '|'`
   select=$(for f in `slocate "$filext"`; do echo $f ; done | yad --list --multiple --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
   ret=$?
   [[ $ret -eq 1 ]] && exit 0
   
   if [[ $ret -eq 0 ]]; then
      app=$(for f in `ls /usr/share/slgapps`; do echo $f | cut -f1 -d '.' ; done | yad --list --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
      ret=$?
      $app $select &
   fi
 fi


Of course, re-format / re-edit at will, it's your code.

Questions:
As to the "document" file: I get empty fields because -- I think -- the
slocate db is not specified. My implementation is here:
http://murga-linux.com/puppy/viewtopic.php?t=97862&sort=lastpost&search_id=736391601
It creates one slocate db per partition. Example:



As to the "executable" : why can we not use the mime-types and ROX to
launch for ex. so-and-so.mp3 ?

Still on it. BFN.

musher0

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Wed 01 Apr 2015, 17:25    Post subject:  

... or copy and paste with the good old middle button...


_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
gcmartin

Joined: 14 Oct 2005
Posts: 6730
Location: Earth

PostPosted: Thu 02 Apr 2015, 04:25    Post subject:  

Would there be 2 PETs required or 1 for this work efforts to show up in WOOFCE? Is there a PET that is available that would allow this as an installable/replaceable to existing (current) apps in distro(s)?

I current have EmSee (64bit), JustLightHouse, LxPUP64, and ... to test and report, if need.

_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engines or use DogPile
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2507
Location: In The Way

PostPosted: Thu 02 Apr 2015, 12:38    Post subject:  

No pet yet.

@Musher0
Your pet and scripts are pretty comprehensive and sophisticated.

I don't know how to call Rox to use its mime types, but that would be ideal.

I need to add the capability to create databases. Or to call your scripts.
For now this can work: enter 'path' for specific db. '/mnt/sda1/var/slocate2.db'
or '/' for example

Also added exit on cancel

Code:
#!/bin/sh
if [ ! -f /root/.slocateguiflag ]; then
slocate -u
mkdir /usr/share/slgapps
yad --text " Now select the apps you regularly use to open files.\n These will be linked to their own special directory \n to speed up slocategui."
lapps=$(for f in `ls /usr/share/applications`; do echo $f | cut -f1 -d '.' ; done | yad --list --multiple --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
for file in $lapps
do
ls /usr/share/applications | grep -e $file | ln -s $file /usr/share/slgapps/$file
done
touch /root/.slocateguiflag
filext=`yad --title="Find files" --text="What are you looking for?:
e.g. *.mp3" --form --field="Type file name or extension:" `
filext=`echo "$filext" | cut -f1 -d '|'`
   if [[ -z "$filext" ]]; then
   exit 1
   fi
path=`yad --title="Find files in" --text="Which drive to search?:
e.g. / or /mnt/sda2" --form --field="Type path:"
`path=`echo "$path" | cut -f1 -d '|'`
   if [[ -z "$path" ]]; then
   exit 1
   fi
select=$(for f in `slocate --database=$path "$filext"`; do echo $f ; done | yad --list --multiple --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
[[ $ret -eq 1 ]] && exit 0
if [[ $ret -eq 0 ]]; then
app=$(for f in `ls /usr/share/slgapps`; do echo $f | cut -f1 -d '.' ; done | yad --list --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
   if [[ -z "$app" ]]; then
   exit 1
   fi
$app $select &
fi
sleep 3
exec "$0"
else
filext=`yad --title="Find files" --text="What are you looking for?:
e.g. *.mp3" --form --field="Type file name or extension:" `
filext=`echo "$filext" | cut -f1 -d '|'`
   if [[ -z "$filext" ]]; then
   exit 1
   fi
path=`yad --title="Find files in" --text="Which drive to search?:
e.g. / or /mnt/sda2" --form --field="Type path:" `
path=`echo "$path" | cut -f1 -d '|'`
   if [[ -z "$path" ]]; then
   exit 1
   fi
select=$(for f in `slocate --database=$path "$filext"`; do echo $f ; done | yad --list --multiple --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
[[ $ret -eq 1 ]] && exit 0
if [[ $ret -eq 0 ]]; then
app=$(for f in `ls /usr/share/slgapps`; do echo $f | cut -f1 -d '.' ; done | yad --list --center --height="400" --column="$filext:" --print-column="1" --separator=" ")
ret=$?
   if [[ -z "$app" ]]; then
   exit 1
   fi
$app $select &
fi
fi
sleep 3
exec "$0" &
slocate -u
Back to top
View user's profile Send private message MSN Messenger 
musher0

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

PostPosted: Thu 02 Apr 2015, 12:42    Post subject:  

gcmartin wrote:
Would there be 2 PETs required or 1 for this work efforts to show up in WOOFCE? Is there a PET that is available that would allow this as an installable/replaceable to existing (current) apps in distro(s)?

I current have EmSee (64bit), JustLightHouse, LxPUP64, and ... to test and report, if need.


All in due time, gc, all in due time! Smile This needs to mature first! Smile
I'll take your last sentence as a "rain-check". Smile BFN.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)

Last edited by musher0 on Thu 02 Apr 2015, 13:01; edited 1 time in total
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Thu 02 Apr 2015, 12:43    Post subject:  

Thanks, stemsee. Back to the workbench with your new thing.

You wrote:
> I don't know how to call Rox to use its mime types, but that would be ideal.

That's as easy as typing : rox "silly song.mp3"
ROX "passes the hand" to the default mp3 player, and the player starts
playing the song.

My understanding is that ROX does the preliminary file type recognition
and then calls the proper executable for that file type.

The quotes are needed because a lot of mp3's have titles with spaces in
them.

TWYL.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2507
Location: In The Way

PostPosted: Fri 03 Apr 2015, 04:38    Post subject:  

I guess my rox Mime types are only partially configured as it doesn't open the file type with any app. Which could mean other users might experience a similar problem, unless the script also configures their rox mime type associations. I usually right click a file and open with. Inefficient habit , but there it is. So a check box to use rox, or app list ... choice!
Back to top
View user's profile Send private message MSN Messenger 
musher0

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

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

stemsee wrote:
I guess my rox Mime types are only partially configured as it doesn't open the file type with any app. Which could mean other users might experience a similar problem, unless the script also configures their rox mime type associations. I usually right click a file and open with. Inefficient habit , but there it is. So a check box to use rox, or app list ... choice!


Hi stemsee.

1st answer: Well, no, it's not an inefficient habit if it works for you. Just
train yourself opening various file types with
rox "blabla.docx" or
rox "blabla.txt",
etc., and see what happens, if only for a test.

2nd answer: That sounds impossible. Here's why:

I did not add any mime-types to my Puppy and I have:

497 lines in file /etc/mime.types
123 objects in dir. /usr/local/apps/ROX-Filer/ROX/MIME
100 objects in dir. /root/Choices/MIME-types
all the OpenOffice mime-types in /usr/share/icons/gnome/NxN
(actually those were added when I installed my OpenOffice 4.1.)
a few in /usr/share/icons/hicolor/NxN/mimetypes
one for cups, one for opera scattered here and there...

and all this in PuppyPrecise 5.4.3 which is 3 years old...

How many mime-types do you have? in what dir's ? In what Puppy ? Smile

If you're in need, I'll e-mail you my copies! Smile

3rd answer: You don't need to configure anything, they should work OOTB.

BFN.

musher0

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
musher0

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

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

Stemsee?

I finally decided not to go with a GUI but rather this route:
http://murga-linux.com/puppy/viewtopic.php?p=838307&sort=lastpost#838307

But many thanks for your useful ideas and incentive.

BFN.

musher0

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2507
Location: In The Way

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

withdrawn
Last edited by stemsee on Tue 21 Apr 2015, 17:05; edited 2 times in total
Back to top
View user's profile Send private message MSN Messenger 
musher0

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

PostPosted: Mon 06 Apr 2015, 21:53    Post subject:  

Did you include a "Thanks to musher0" comment somewhere? Wink
I don't see any!!! Smile

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 10 of 13 [184 Posts]   Goto page: Previous 1, 2, 3, ..., 8, 9, 10, 11, 12, 13 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
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.0851s ][ Queries: 13 (0.0307s) ][ GZIP on ]