The Text-User Interface

Using applications, configuring, problems
Message
Author
User avatar
MrDurtal
Posts: 7
Joined: Sat 23 Apr 2011, 01:05

Excellent source of help!

#106 Post by MrDurtal »

Thanks very much for all of the effort.

MrDurtal

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#107 Post by rhadon »

Hi,

I have a general question. I can write

Code: Select all

if ...condition...;then
   do this...
fi
if not...condition...;then
   do that...
fi
or I can write

Code: Select all

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: Select all

#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: Select all

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.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#108 Post by 01micko »

Hi Rolf..
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: Select all

case $PUPMODE in
3|7|13)
(code for whatever goes here)
;;
*)echo
;;
esac
:)
Puppy Linux Blog - contact me for access

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#109 Post by rhadon »

Thanks Mick :D

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 :lol: ), 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. :lol:

Cheers
Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

SkullyRipz
Posts: 24
Joined: Fri 02 Mar 2012, 16:50

#110 Post by SkullyRipz »

Bruce...

... thank you. :D This is exactly what I needed. I appreciate all the time spent. Its very well put together and easy to follow.
[b]Lucid 5.2.8 Frugal[/b]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#111 Post by rufwoof »

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. ... 23#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'.

Image

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.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#112 Post by rufwoof »

Hi comfi
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.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

williams2
Posts: 337
Joined: Fri 14 Dec 2018, 22:18

#113 Post by williams2 »

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

User avatar
Makoto
Posts: 1665
Joined: Fri 04 Sep 2009, 01:30
Location: Out wandering... maybe.

#114 Post by Makoto »

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

User avatar
gcav
Posts: 104
Joined: Fri 25 May 2012, 04:12
Location: Ontario

telehack...

#115 Post by gcav »

for the tui/cli aficionados...

try telnet telehack.com

g

Post Reply