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 Mon 25 Sep 2017, 07:36
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Building a universal file viewer
Post new topic   Reply to topic View previous topic :: View next topic
Page 12 of 12 [166 Posts]   Goto page: Previous 1, 2, 3, ..., 10, 11, 12
Author Message

Joined: 26 Jan 2011
Posts: 1351
Location: Japan

PostPosted: Wed 13 Sep 2017, 09:03    Post subject:  

Update 2017-09-13 (see also initial post)

Command line should now work with every Puppy. VTE support has been removed.
This has some advantages:
- Command output in normal text viewer pane often easier to read
- No cutting of output when maximum history lines reached
- Copy & Paste works with familiar shortcuts

Open with last command
That's an option I miss in ROX-Filer. Opens the Commandbox with the last used command instead the default ' $@ '

Command history
ROX-Filer (and every terminal) lets the user scroll through the command history with the Up arrow key.
Theoretically this could be implemented in MMview but would require elaborate code as gtkdialog does not support such behavior. Instead I opted for a lighter and IMO better solution: When the commandbox has focus, pressing Up arrow key will display the command history in the viewer pane. Picking a command from the history involves
- Triple click on command (selects whole line)
- Clean commandbox (by clicking on Clean button at right end of commandbox)
- Middle click in commandbox (pasting selection)

Command templates
I tried to create a user configurable "Frequently Used Commands" menu. Can be done but lacks simplicity. Instead I recommend to create a text file with useful commands, put this file into its own directory and then bookmark this directory. The screenshot shows my oneliners directory as first in the bookmarks list. Clicking on the bookmark will show the contents of the first (= only) file of this directory in the viewer pane. From there I can pick a command just like picking from the command history. Very low-tech but efficient.

As an example the screenshot shows the output of the command
stat -c $'CHANGED:\t%z\nMODIFIED:\t%y\nACCESSED:\t%x\n' "$@" | sed "s/\..*$//; s/$(date +%Y-%m-%d)/today_____/"
Executing this command with F4 key allows to view comprehensive filedate info for any selected file/directory, much better than chooser's dismal "Modified" column.
Many more oneliners and of course scripts are possible, eventually turning MMview into a customized file manager.

Of course the commandbox can execute any command, not just those related to the selected file. It's very useful for testing and fine-tuning commands since the commands don't scroll away in a convoluted mix of command input and output like in a conventional terminal emulator.

Next steps
I think I've reached the end of the line. I may throw in some convenience buttons and some tooltips, but basically that's it. Version 1.0 is near. And a pet. Until then I'm waiting for bug reports...
 Filesize   80.22 KB
 Viewed   73 Time(s)


Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 12 of 12 [166 Posts]   Goto page: Previous 1, 2, 3, ..., 10, 11, 12
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0588s ][ Queries: 15 (0.0208s) ][ GZIP on ]