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 21 Oct 2019, 21:54
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
The Text-User Interface
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 8 of 8 [114 Posts]   Goto page: Previous 1, 2, 3, ..., 6, 7, 8
Author Message
MrDurtal


Joined: 22 Apr 2011
Posts: 7

PostPosted: Fri 02 Dec 2011, 09:03    Post subject: Excellent source of help!  

Thanks very much for all of the effort.

MrDurtal
Back to top
View user's profile Send private message 
rhadon


Joined: 27 Mar 2008
Posts: 1293
Location: Germany

PostPosted: Wed 08 Feb 2012, 05:05    Post subject:  

Hi,

I have a general question. I can write
Code:
if ...condition...;then
   do this...
fi
if not...condition...;then
   do that...
fi

or I can write
Code:
if ...condition...;then
   do this...
else
   do that...
fi


It looks to me that the last one is 'better style' but is it really better, maybe faster?

Concrete example, with slacko 5.3.2.1 in rcsysinit, ~line 754 is written:
Code:
#save button on desktop when booted from flash drive...
if [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ];then #pup_rw is tmpfs.
 if [ "`cat /root/Choices/ROX-Filer/PuppyPin | grep "save2flash"`" = "" ];then
  echo '<icon x="768" y="128" label="save">/usr/sbin/save2flash</icon>' >> /root/Choices/ROX-Filer/PuppyPin
  cat /root/Choices/ROX-Filer/PuppyPin | grep -v '/pinboard' > /tmp/PuppyPin-CPY
  sync
  cp -f /tmp/PuppyPin-CPY /root/Choices/ROX-Filer/PuppyPin
  echo '</pinboard>' >> /root/Choices/ROX-Filer/PuppyPin
 fi
fi

I added:
Code:
if ! [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ];then #pup_rw is tmpfs.
 if ! [ "`cat /root/Choices/ROX-Filer/PuppyPin | grep "save2flash"`" = "" ];then
   cat /root/Choices/ROX-Filer/PuppyPin | grep -v "^<icon x=\"768\" y=\"128\" label=\"save\"" >/tmp/PuppyPin-CPY
   cp -f /tmp/PuppyPin-CPY /root/Choices/ROX-Filer/PuppyPin
   echo '</pinboard>' >> /root/Choices/ROX-Filer/PuppyPin
 fi
fi


Is it worth to change?

Thanks,
Rolf

_________________
Ich verwende "frugal", und das ist gut so. Wink
Raspberry Pi without Puppy? No, thanks.
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8716
Location: qld

PostPosted: Wed 08 Feb 2012, 05:35    Post subject:  

Hi Rolf..
Quote:
Is it worth to change?

Probably yes!

But it's embedded in woof and getting upstream changes like that are difficult as there are always more pressing issues.

[One example is how gdk-pixbuf-query-loaders is run since gtk+2.20 , I tried to get Barry to change it to the correct call from what I researched but to no avail, I patch it every time I build slacko]

I would do it completely differently...
Code:
case $PUPMODE in
3|7|13)
(code for whatever goes here)
;;
*)echo
;;
esac


Smile

_________________
Puppy Linux Blog - contact me for access
Back to top
View user's profile Send private message Visit poster's website 
rhadon


Joined: 27 Mar 2008
Posts: 1293
Location: Germany

PostPosted: Wed 08 Feb 2012, 08:43    Post subject:  

Thanks Mick Very Happy

I wasn't aware about '*)' in case...esac. Will give it a try.

I also know that it's only for one special version. If woof changes (I know it does often Laughing ), everything must be done again and maybe it doesn't work in newer versions or at least it must be changed. Too annoying to do it everytime. But a good feeling to be able to do so and it works. That's the fun. Laughing

Cheers
Rolf

_________________
Ich verwende "frugal", und das ist gut so. Wink
Raspberry Pi without Puppy? No, thanks.
Back to top
View user's profile Send private message 
SkullyRipz

Joined: 02 Mar 2012
Posts: 24

PostPosted: Thu 29 Mar 2012, 23:35    Post subject:  

Bruce...

... thank you. Very Happy This is exactly what I needed. I appreciate all the time spent. Its very well put together and easy to follow.

_________________
Lucid 5.2.8 Frugal
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 3562

PostPosted: Wed 12 Jun 2019, 06:45    Post subject:  

Reviving this old but excellent thread

Text User Interface isn't just a # (root) or $ (user) prompt and having to type in commands, it also includes ncurses or similar 'screens' as well.

Here are some snapshots of some of mine for instance http://murga-linux.com/puppy/viewtopic.php?p=1029923#1029923. Where I use tilda as my preferred terminal, that is sized to near full screen (but leaves the bottom gui tray still visible), and where that tui shows/hides when toggled by pressing F1. Quick and easy access to both tui and gui.

So for instance pressing F1 with my tui (tput based) MENU being shown, that includes a range of options such as 'r' to reboot - then F1, r, Enter and the system starts to reboot.

I have that tui arrangement all auto-load at startup, so they're all accessible from the get-go. Two/three keypresses typically to get to a wide range of programs. In addition to the images in the link above I do also have wordgrinder and sc for tui based word processing and spreadsheet, but tend to prefer gui based versions of those myself (libreoffice). Although sc can be handy as a form of more advanced 'calculator'.



A nice feature with tilda as the terminal is that it supports right click context cut/paste options and also simple clicking (later versions, with Fatdog (older version of tilda) you have to use ctrl click) of url links to open the link in whichever browser you have set by default (I like chrome). Which means you can have a simple text file of your bookmarks/links, perhaps with that text file being displayed using mc editor, for quick and easy access/launch of those bookmarks. Keeping your bookmarks outside of the browser also means that you can start each session (reboot), with a brand new/fresh version of the system and browser (less cookies/tracking).

I love being able to boot Fatdog using a usb, and have everything loaded into ram, including multi-session saves, such that the usb can be unplugged after bootup. No risk whatsoever of the mbr, vmlinuz, initrd, main sfs or saves being compromised due to being physically disconnected. cli/tui has advantages in some cases/usage, disadvantage in other cases/usage. Quick and easy access to both tui and gui opens up the benefits of being able to select which to use at any one time that best meets your needs/objectives.

_________________
( ͡° ͜ʖ ͡°) :wq
Fatdog multi-session usb

echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 3562

PostPosted: Fri 05 Jul 2019, 14:50    Post subject:  

Hi comfi

Quote:
Enhancing our TUI

This chapter is for the purpose of improving your Text User Interface, making it an easier, more pleasant and powerful working environment.

We will install two applications from Puppy's official repository

Add the terminal emulator mrxvt

mrxvt-0.5.2.pet

The reason why is, because its better than rxvt, in a number of areas. Of particular importance to me is the handling of F keys and the eol (end of line) and bol (beginning of line).

Puppy includes a great TUI text editor 'mp' ( Minimum Profit ), but rxvt doesn't handle the bol and eol as it should for some reason, thus making working with mp quite difficult.

Add Midnight Commander

mc-4.6.1.pet
If mc doesn't run - maybe you need gpm-1.20.1.pet

Run Midnight Commander by typing mc in terminal emulator. It is a very powerful, extensible and time honored file manager for the TUI.


mc comes with its own text editor, that you can run with either 'mc -e' or 'mcedit'

Within the options for that is a 'learn keys' function. Takes a lot of tabbing (around 38 tabs on mine to reach the HOME choice, and then another 8 to get to the Save button), but you can set it so that the likes of HOME, END ...etc. match your actual choice of terminal keys.

mcedit also supports multiple files open at the same time and where you can cut to clipfile, paste from clipfile between files. The function keys aren't well defined for that however (would be nice to have a 'in house' variant that was compiled with better Fn key definitions).

mp doesn't work well on the console in my experience. And if/when you start ssh'ing around, more often mc will be available on linux servers.

EDIT : Weird, comfi's post seems to have disappeared, so I've edited this post to quote it.

_________________
( ͡° ͜ʖ ͡°) :wq
Fatdog multi-session usb

echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh
Back to top
View user's profile Send private message 
williams2

Joined: 14 Dec 2018
Posts: 185

PostPosted: Fri 05 Jul 2019, 17:30    Post subject:  

Quote:

Puppy includes a great TUI text editor 'mp' ( Minimum Profit ), but rxvt doesn't handle the bol and eol as it should for some reason, thus making working with mp quite difficult.


The home and end keys seem to work in a urxvt terminal using mp in bionicPup64-8.0

Home and End do not seem to work using mp in the console (no X).
But it does work properly if you set

TERM=linux
Back to top
View user's profile Send private message 
Makoto


Joined: 03 Sep 2009
Posts: 2215
Location: Out wandering... maybe.

PostPosted: Fri 05 Jul 2019, 17:47    Post subject:  

rufwoof wrote:
EDIT : Weird, comfi's post seems to have disappeared, so I've edited this post to quote it.


comfi was a spambot. Its post in this thread was ripped from Bruce B's post at the beginning of the thread, without style formatting and links.

_________________
[ Puppy 4.3.1 JP, Frugal install ] * [ XenialPup 7.5, Frugal install ] * [XenialPup 64 7.5, Frugal install] * [ 4GB RAM | 512MB swap ]
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 8 of 8 [114 Posts]   Goto page: Previous 1, 2, 3, ..., 6, 7, 8
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.0693s ][ Queries: 13 (0.0233s) ][ GZIP on ]