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 30 Jul 2014, 19:48
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Right click options for lupu-525 , lupu-520 , Wary , Slacko
Post new topic   Reply to topic View previous topic :: View next topic
Page 7 of 15 [224 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, 9, ..., 13, 14, 15 Next
Author Message
SFR


Joined: 26 Oct 2011
Posts: 1044

PostPosted: Sun 11 Mar 2012, 07:48    Post subject:  

don570 wrote:
For instance does anybody know where there's a script to rename
files in a given folder according to modification date

fileX fileY fileZ to fileX000 fileY001 fileZ003

(the sorting depends on modification date of the file
rather than alphabetical)

It'd be very useful, I'm using it sometimes under Windowze ("FileMenu Tools" application).
Could be something like this?
Code:
#!/bin/bash

# batchaddnum by SFR'2012
# Usage: batchaddnum <folderpath> (DO NOT USE ENDING / PLEASE!)

FOLDERPATH=$1

# Dump all filenames from FOLDERPATH into temporary file
# 'ls -t' option sorts filenames in date order ('-tr' for reversed date order)
# 'tail -n +2' removes "Total..." line
# 'egrep -v '^d' removes directories and '^l' removes links
# next 'cut's to leave only filename

ls "$FOLDERPATH" -A -o -t | tail -n +2 | egrep -v '^d' | egrep -v '^l' | cut -f2- -d ':' | cut -b 4- > /tmp/batchfileslist

# And finally rename all files adding numeric suffix

CNT=1
while read LINE; do
  OLDNAME=$FOLDERPATH"/"$LINE
  if [ ${#CNT} -eq 1 ]; then CNT="00"$CNT; fi
  if [ ${#CNT} -eq 2 ]; then CNT="0"$CNT; fi 
  NEWNAME=$OLDNAME$CNT
  mv "$OLDNAME" "$NEWNAME"
  let CNT=10#$CNT+10#1
done < /tmp/batchfileslist

rm -f /tmp/batchfileslist
exit

It's just an example, not optimized nor extensively tested, but works with hidden files as well as spaces in file- and foldernames, excludes folders and symlinks, and should be easy to expand.

Also, I've been thinking about using find FOLDERNAME -maxdepth 1 -type f, then stat -c %Y FILENAME and then join times and filenames and use sort...

Hope I saved you some time.
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 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Sat 17 Mar 2012, 16:08    Post subject:  

Thanks for the info. I didn't see it in time so I used
my own crude method. Embarassed

You can test it here.



http://murga-linux.com/puppy/viewtopic.php?p=612812#612812

I have prepared a nice right click option package
to do renaming of filenames with lots of features
but I found a nasty bug so I can't release it!!
I'll continue to work on it.

___________________________
Back to top
View user's profile Send private message 
aarf

Joined: 30 Aug 2007
Posts: 3620
Location: around the bend

PostPosted: Mon 19 Mar 2012, 02:15    Post subject:  

can we have fsck in right click?
_________________

ASUS EeePC Flare series 1025C 4x Intel Atom N2800 @ 1.86GHz RAM 2063MB 800x600p ATA 320G
_-¤-_

<º))))><.¸¸.•´¯`•.#.•´¯`•.¸¸. ><((((º>
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Tue 20 Mar 2012, 13:28    Post subject: New version 5.9.1  

New version 5.9.1 of right-click

I added or changed three apps

1) Baconrecorder 2.7 - just cosmetic changes

2) Rename-files 1.3 - I wrote this to make some simple changes
to filenames when the files are in a folder

3) dependency check by RSH - version .3 -- uses ldd command

It is still being improved by RSH. There is a better version that will
check libraries.
http://murga-linux.com/puppy/viewtopic.php?p=610649&sid=5d1e3d6c13bd0e73eba0f4ca7aaaa650
________________________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Thu 22 Mar 2012, 19:19    Post subject: new Version 5.9.2  

Version 5.9.2 (march 22) dependency check and rename-files upgraded again

The numbering of files in a folder works correctly now

file_000 is the oldest Wink

___________________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Sat 24 Mar 2012, 16:33    Post subject:  

version 5.9.3

Update:
I'm continuing to work on Rename-files.
The warning messages (about similar file names)
still need improvement. Embarassed

_________________________________________
Back to top
View user's profile Send private message 
pemasu


Joined: 08 Jul 2009
Posts: 5463
Location: Finland

PostPosted: Wed 28 Mar 2012, 13:19    Post subject:  

http://www.murga-linux.com/puppy/viewtopic.php?p=615451#615451

Not sure if postscript viewer rox right click has been included. The above url provides small pet to do it. It has just small script and rox right click stuff. It should work with epdf and evince.
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Sat 31 Mar 2012, 16:27    Post subject:  

To Pemasu:
I'll look into how PDF files are opened.
I don't think I assumed that evince was installed.

__________________________________________

new version of right click 5.9.4

I am continuing to work on rename-files.

I think I have any nasty bugs fixed but I will still changea couple of
summary windows in the next week.

_______________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Mon 02 Apr 2012, 17:05    Post subject: new version 5.9.5  

new version 5.9.5

New features:

1) rename-files fixed (yet again) Embarassed
2 empty-files added ---- this right click option creates empty files
-very useful for a programmer or databases Laughing
3 added pemasu right click for postscript files
Back to top
View user's profile Send private message 
Pete22


Joined: 08 May 2009
Posts: 239
Location: Utah, USA

PostPosted: Thu 19 Apr 2012, 13:10    Post subject: Saluki  

Does this program work with Saluki?

Pete
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Sat 21 Apr 2012, 12:56    Post subject:  

Quote:
Does this program work with Saluki?


No I don't know the method to put options on the
right click menu.

I tried here with rename-files

http://www.murga-linux.com/puppy/viewtopic.php?p=618004#618004

but it shows on the 'Send to' menu for all files when
what I want is for rename files to show only for folders.
Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 1327
Location: Queensland Australia ɹǝpu∩uʍop

PostPosted: Sun 29 Apr 2012, 03:53    Post subject: Yad right click file search  

I came across a zenity search script meant for Thunar custom actions, I have modified it for yad and changed some of the code so it now works as it supposed to.

I won't make a pet of it, as it won't uninstall correctly, maybe someone will find some use for it.

It is a basic search, type in the name click ok, then double click the result to open the containing directory.

Code:
#!/bin/bash
#search-for-files

maxresults=500

window_icon="mini-zoom"

# this script will work for any environment that has bash and yad, so the filemanager is entirely down to you! you can add extra arguments to the string as long as the last argument is the path of the folder you open
filemanager="rox"

window_title="Search for Files"

srcPath="$*"

if ! [ -d "$srcPath" ] ; then
cd ~/
srcPath=`yad --file-selection --directory --title="$window_title - Look in folder" --window-icon="$window_icon"`
fi

if [ -d "$srcPath" ] ; then

fragment=`yad --entry --title="$window_title - Name contains:" --window-icon="$window_icon" --text="Search strings less than 2 characters are ignored"`
if ! [ ${#fragment} -lt 2 ] ; then

(

echo 10
O=$IFS IFS=$'\n' files=( `find "$srcPath" -iname "*$fragment*" -printf \"%Y\"\ \"%f\"\ \"%k\ KB\"\ \"%t\"\ \"%h\"\\\n | head -n $maxresults` ) IFS=$O
echo 100

selected=`eval yad --list --title=\"${#files[@]} Files Found - $window_title\" --window-icon="$window_icon" --width="600" --height="400" --text=\"Search results:\" --print-column=5 --column \"Type\" --column \"Name\" --column \"Size\" --column \"Date modified\" --column \"Path\" ${files[@]}`

if [ -e "${selected%|}" ] ; then "$filemanager" "${selected%|}" ; fi

) | yad --progress --auto-close --pulsate --title="Searching..." --window-icon="$window_icon" --text="Searching for \"$fragment\""

fi

fi

exit 0
Screenshot-2.png
 Description   
 Filesize   13.13 KB
 Viewed   614 Time(s)

Screenshot-2.png

Screenshot-3.png
 Description   
 Filesize   84.17 KB
 Viewed   619 Time(s)

Screenshot-3.png

Right-click-yad-file-search.tar.gz
Description 
gz

 Download 
Filename  Right-click-yad-file-search.tar.gz 
Filesize  1.26 KB 
Downloaded  320 Time(s) 
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Mon 30 Apr 2012, 12:34    Post subject:  

Note to Geoffrey : You should read the script by SFR called
Large file finder which also makes a list of files that
can be double clicked. It doesn't use YAD

http://murga-linux.com/puppy/viewtopic.php?t=77779


Actually what I want is a simple utility to find a file based on date.

For instance I want to find all documents written in past week.

I can't get pfind to work correctly doing this even though it
appears to have this functionality.

_______________________________________________

_________________________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Mon 30 Apr 2012, 12:40    Post subject: New version 5.9.  

New version 5.9.6

Added split-file to split up mp3 or txt files in smaller chunks
that might be more manageable.

Upgraded rename-files 4.8

Added in SFR's Large file finder
which can be useful to track down larger files.

_______________________________________________
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Thu 03 May 2012, 20:07    Post subject: fast find  

I made another right click app to find a file fast
but it needs YAD to be installed
so I won't put it in this pet package

http://murga-linux.com/puppy/viewtopic.php?p=624963#624963

_____________________________________________________
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 7 of 15 [224 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, 9, ..., 13, 14, 15 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
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.0943s ][ Queries: 13 (0.0073s) ][ GZIP on ]