The Text-User Interface
Excellent source of help!
Thanks very much for all of the effort.
MrDurtal
MrDurtal
Hi,
I have a general question. I can write
or I can write
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:
I added:
Is it worth to change?
Thanks,
Rolf
I have a general question. I can write
Code: Select all
if ...condition...;then
do this...
fi
if not...condition...;then
do that...
fi
Code: Select all
if ...condition...;then
do this...
else
do that...
fi
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
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
Thanks,
Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.
Raspberry Pi without Puppy? No, thanks.
Hi Rolf..
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...
Probably yes!Is it worth to change?
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
Thanks Mick
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 ), 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.
Cheers
Rolf
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 ), 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.
Cheers
Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.
Raspberry Pi without Puppy? No, thanks.
-
- Posts: 24
- Joined: Fri 02 Mar 2012, 16:50
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'.
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.
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'.
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]
[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]
Hi comfi
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.
mc comes with its own text editor, that you can run with either 'mc -e' or 'mcedit'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.
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]
[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]
The home and end keys seem to work in a urxvt terminal using mp in bionicPup64-8.0Puppy 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.
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
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.rufwoof wrote:EDIT : Weird, comfi's post seems to have disappeared, so I've edited this post to quote it.
[ 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).
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).
telehack...
for the tui/cli aficionados...
try telnet telehack.com
g
try telnet telehack.com
g