Posted: Mon 21 Jan 2019, 04:16
Ok. I will test Easy may be tomorrow or on Wednesday.
READ-ONLY Archive
https://oldforum.puppylinux.com/
And did I see a notice on one of the american pi sites around christmas about a pi notebook planned to come out this year. Don't know which pi chip or if crowd funded as I don't pi at present.BarryK wrote:Thanks for responding to my pm.rodin.s wrote:Barry.
Just got your messages. May be too late as you have already made a release. I guess I will look at it as soon as I get to a computer capabale of running it. I am posting this from Raspberry Pi.
There is an earlier Easy release for the Pi3. You are giving me some incentive to do a 1.0 build for the Pi!
Code: Select all
# set control key to backtick but also send it i.e. if hit twice then prints the backtick
unbind C-b
set-option -g prefix `
bind ` send-prefix
bind -T copy-mode-vi PageDown send-keys -X page-down
bind -T copy-mode-vi PageUp send-keys -X page-up
# mc uses F1 to F10, so moved up to F11 and F12
bind-key -n F12 next-window
bind-key -n F11 new-window
#bind-key -n F3 kill-window
# Console tmux and this has - and | instead of ? for borders
# UTF-8 must be off
set-option -g terminal-overrides ',*vt*:enacs@:smacs@:rmacs@:acsc@'
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
## switch panes using Alt-arrow without prefix
#bind -n M-Left select-pane -L
#bind -n M-Right select-pane -R
#bind -n M-Up select-pane -U
#bind -n M-Down select-pane -D
######################
### DESIGN CHANGES ###
######################
## loud or quiet?
#set-option -g visual-activity off
#set-option -g visual-bell off
#set-option -g visual-silence off
#set-window-option -g monitor-activity off
#set-option -g bell-action none
# modes
#setw -g clock-mode-colour colour2
setw -g clock-mode-colour yellow
setw -g mode-attr bold
setw -g mode-fg colour1
setw -g mode-bg colour18
# panes
set -g pane-border-bg colour0
set -g pane-border-fg colour19
set -g pane-active-border-bg colour0
set -g pane-active-border-fg colour9
# statusbar
set -g status-position top
set -g status-justify left
set -g status-bg colour4
#set -g status-fg colour137
set -g status-fg colour255
#set -g status-attr dim
set -g status-right ' #[bg=colour0] `#[bg=colour4,bold]Prefix #[bg=colour0] 11#[bg=colour4,bold]New #[bg=colour0] 12#[bg=colour4,bold]Next '
set -g status-left '#[fg=colour255,bg=colour4,bold] %H:%M#[fg=colour255,bg=colour4,bold] %a %d %b '
set -g status-left-length 50
set -g status-right-length 30
setw -g window-status-current-fg colour1
setw -g window-status-current-bg colour19
setw -g window-status-current-attr bold
setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F '
setw -g window-status-fg colour9
setw -g window-status-bg colour18
setw -g window-status-attr none
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
setw -g window-status-bell-attr bold
setw -g window-status-bell-fg colour255
setw -g window-status-bell-bg colour1
# messages
set -g message-attr bold
set -g message-fg colour232
set -g message-bg colour16
#hilite current window
set-window-option -g window-status-current-bg red
set-window-option -g window-status-current-fg yellow
Code: Select all
title Easy 1.0 (frugal install in sda1)
uuid 7e85c56f-88fa-4660-988e-ebccbd2f5d91
kernel /easy/1.0/vmlinuz video=640x480
initrd /easy/1.0/initrd
Didn't make it very clear Barry. I install tmux (and mc) outside of a container, in the main system (real/full root). Then use that for admin type activities, so no X (that otherwise a restricted userid X window could stuff commands/actions into). In effect I'm considering X and browser to be insecure, so running Xephyr (Easy container) and everything in that is in effect isolated. I only use the main/real root X session to do the admin tasks that cannot be run from cli (tmux), only doing so when the Easy container isn't running. cli versions of those admin tasks could be relatively easily added to the tput based cli menu that I create/maintain (such as container version controls etc.), but I haven't got around to doing that yet (current tput menu is more or less a duplicate of my OpenBSD tput menu as-is, but with reboot, shutdown ...etc. adjusted for EasyOS).BarryK wrote:@rufwoof,
The tmux thing inside container is interesting.
Code: Select all
su spot
DISPLAY=:0 galculator
Code: Select all
X &
Code: Select all
DISPLAY=:0 empty -f ec-chroot easy &
Code: Select all
#!/bin/sh
#
# /root/twin ... my tmux initialisation script to initialise tmux windows
#
# start a tmux session, detach
# then send commands to that before reattaching to it
# Note that C-m is carriage return (enter)
# create a tmux session called work, and deattach so we can send keys to it
# send keys to rename the first window to admin (my tput menu)
tmux new -s work -d
tmux rename-window -t work admin
tmux send-keys -t work 'su - root -c "/root/admin"' C-m
# Add another tmux window, rename it to xephyr and load Xephyr
tmux new-window -t work
tmux rename-window -t work xephyr
tmux send-keys -t work 'X &' C-m
tmux send-keys -t work 'DISPLAY=:0 empty -f ec-chroot easy &' C-m
# and finally select which window to show first and attach to the tmux work session
tmux select-window -t work:0
tmux attach -t work
Code: Select all
#!/bin/sh
# reasonable source for tput codes
# http://wiki.bash-hackers.org/scripting/terminalcodes
# \ chars are weird inside echo -n and echo, not required to be delimited in echo, excepting
# hen before a ", but in echo -n they have to be escaped/delimited (at least that is what
# seems to the case to me).
PIDofdatetime=""
_show_date_time () {
while :
do
tput sc
tput bold
tput setaf 3
# tput cup 32 11
tput cup 12 5
echo `date +" %R %a %d %b"`
tput rc
sleep 60
done &
PIDofdatetime=$!
}
_calmonday () {
# Maps a standard Su start of week cal to a Mo start of week
# Yes that is a cal command line option choice for most, but not all i.e. Puppy busybox cal
# Also I was having troubles with current date highlighting and for Sa 1 start months (i.e. 1 Dec 2018
# it wasn't being highlighted so I fixed that my remapping that month to a monday start (cal -m)
# but that meant all months except 1 sat months had Su start whilst 1 Sa months had Mo start.
# Remapping all other months also to Mo start makes things more consistent i.e. this function being called
# in all cases except if a 1 Sa month
IFS=
t1=`mktemp`;t2=`mktemp` # create the two temp files
# Load the files with default Su start of week cal, that we'll wrap Su around to end of the set
cal | sed -r 's/(...)(.*)/\1/' >$t1 # Sunday list
cal | sed -r 's/(...)(.*)/\2/' >$t2 # Rest
exec 7<$t1;exec 8<$t2 # open the two files
read month <&8;read empty <&7;echo " $month"
read weekdays1 <&8;read weekdays2 <&7;echo "$weekdays1" "$weekdays2"
read dates2 <&7
[[ ! -z `echo ${dates2} | tr -d " "` ]] && echo " " "$dates2"
for i in 1 2 3 4 5 6;do
read dates1 <&8;read dates2 <&7
[[ ! -z `echo "$dates1 $dates2" | tr -d " "` ]] && echo "$dates1" "$dates2"
done
exec 7</dev/null ;exec 8</dev/null # close the files
rm $t1;rm $t2 # clean up
}
_show_cal () {
tput bold
tput setaf 6
echo
echo
echo
B=$(tput setaf 5;tput setab 7;tput rev;tput bold)
U=$(tput sgr0;tput setaf 6;tput bold)
DAY=$(date +%e)
D=$(date +%e | tr -d " ")
if [[ $DAY -lt 10 ]]; then
DAY=$(date +%e)
if [[ `date +%a%d` == "Sat01" ]]; then
# use -m caledar as crude fix for sat 1st months not having 1st highlighted
cal -m | sed -E -e "s|($DAY)([^0-9].*)| $B$D$U\2|" | sed 's/^/ /g' # three spaces in, current day highlighted
else
_calmonday | sed -E -e "s|($DAY)([^0-9].*)| $B$D$U\2|" | sed 's/^/ /g' # three spaces in, current day highlighted
fi
else
if [[ `date +%a` == "Mon" ]]; then
_calmonday | sed -E -e "s|($DAY)([^0-9].*)|$B$D$U\2|" | sed 's/^/ /g' # three spaces in, current day highlighted
else
_calmonday | sed -E -e "s|(.*[^0-9])($DAY)([^0-9].*)|\1$B\2$U\3|" | sed 's/^/ /g' # three spaces in, current day highlighted
fi
fi
}
# Set script so reads only a single char (avoids having to press ENTER)
# but that does limit the menu options to single character selections only
# HAVING SOME PROBLEMS WITH THIS, IF DOWN ARROW FOR INSTANCE THEN CONTROL
# CODE ENDING IN B RESULTED IN THE B OPTION BEING RUN
read_char() {
stty -icanon -echo
eval "$1=\$(dd bs=1 count=1 2>/dev/null)"
stty icanon echo
}
# Support upper/lower case mix (more than I use here)
_yesno () {
echo -n "Are you sure? "
echo -n "[y/N] "
read_char response
case "$response" in
[yY][eE][sS]|[yY])
return 0
;;
*)
return 1
;;
esac
}
_shutdown () {
clear
echo "#!/bin/ksh" >/tmp/shutdown
echo "echo STARTING SHUTDOWN IN 5 SECONDS" >>/tmp/shutdown
echo "echo " >>/tmp/shutdown
echo "echo PRESS ENTER TO CANCEL SHUTDOWN " >>/tmp/shutdown
echo "echo -n \"5 \"" >>/tmp/shutdown
echo "sleep 1" >>/tmp/shutdown
echo "echo -n \"... 4 \"" >>/tmp/shutdown
echo "sleep 1" >>/tmp/shutdown
echo "echo -n \"... 3 \"" >>/tmp/shutdown
echo "sleep 1" >>/tmp/shutdown
echo "echo -n \"... 2 \"" >>/tmp/shutdown
echo "sleep 1" >>/tmp/shutdown
echo "echo -n \"... 1 \"" >>/tmp/shutdown
echo "sleep 1" >>/tmp/shutdown
clear
echo "echo Shutting Down" >>/tmp/shutdown
echo "shutdown -p now" >>/tmp/shutdown
chmod +x /tmp/shutdown
/tmp/shutdown &
PID=$!
read
kill -9 $PID
rm /tmp/shutdown
}
_reboot () {
clear
echo "#!/bin/ksh" >/tmp/reboot
echo "echo STARTING REBOOT IN 5 SECONDS" >>/tmp/reboot
echo "echo " >>/tmp/reboot
echo "echo PRESS ENTER TO CANCEL SHUTDOWN " >>/tmp/reboot
echo "echo -n \"5 \"" >>/tmp/reboot
echo "sleep 1" >>/tmp/reboot
echo "echo -n \"... 4 \"" >>/tmp/reboot
echo "sleep 1" >>/tmp/reboot
echo "echo -n \"... 3 \"" >>/tmp/reboot
echo "sleep 1" >>/tmp/reboot
echo "echo -n \"... 2 \"" >>/tmp/reboot
echo "sleep 1" >>/tmp/reboot
echo "echo -n \"... 1 \"" >>/tmp/reboot
echo "sleep 1" >>/tmp/reboot
clear
echo "echo Rebooting" >>/tmp/reboot
echo "shutdown -r now" >>/tmp/reboot
chmod +x /tmp/reboot
/tmp/reboot &
PID=$!
read
kill -9 $PID
rm /tmp/reboot
}
trap 'tput reset;exit 1' 1 2 3 9 15
while :
do
tput sgr0
clear
_show_cal
tput setaf 3
tput bold
tput setaf 7
tput setab 1
tput cup 1 27 ; echo -n " R O O T "
tput setab 0
tput cup 3 27 ; echo -n " x user/X "
tput cup 12 54 ; echo -n " m mc file manager "
# tput cup 4 27 ; echo -n " d diary - calcurse "
tput cup 4 27 ; echo -n " b Google block "
tput cup 4 54 ; echo -n " B Google unblock "
tput cup 5 27 ; echo -n " t top "
tput cup 5 54 ; echo -n " h help/tips "
tput cup 6 27 ; echo -n " p powerdown "
tput cup 6 54 ; echo -n " r reboot "
tput cup 7 27 ; echo -n " s scan setuids "
tput cup 7 54 ; echo -n " S set setuids "
tput cup 8 27 ; echo -n " e test lib checksums "
tput cup 8 54 ; echo -n " E gen lib checksums "
tput cup 9 27 ; echo -n " u mount usb "
tput cup 9 54 ; echo -n " U umount usb "
tput cup 14 27 ; echo -n " a mount phone (wireless)"
tput cup 10 27 ; echo -n " R user cron deny "
tput cup 14 54 ; echo -n " A mount android (usb) "
tput cup 10 54 ; echo -n " z max vol/boost "
tput cup 13 54 ; echo -n " v video record desktop "
tput cup 12 27 ; echo -n " c calcurse "
# tput cup 15 54 ; echo -n " 3 mp3 cmus (music) "
tput cup 3 54 ; echo -n " q quit "
tput cup 11 27 ; echo -n " l mount ext2 sda3 "
tput cup 11 54 ; echo -n " L umount ext2 sda3 "
tput cup 13 27 ; echo -n " f fsck ext2 sda3 "
tput sgr0
_show_date_time # if remove this also remove the kill command a few lines down
tput cup 2 25 # prompt location
tput sc
read_char y
echo $y
kill $PIDofdatetime
case "$y" in
x) chvt 4;;
m) mc /root /root;;
b) clear;echo "copying /etc/hosts-google-fb to /etc/hosts";cp /etc/hosts-google-fb /etc/hosts;sleep 1;;
B) clear;echo "copying /etc/hosts-normal to /etc/hosts";cp /etc/hosts-normal /etc/hosts;sleep 1;;
t) top;;
h) vi /root/tips;;
p) poweroff;; # clear;if _yesno;then clear;shutdown -p now;sleep5;fi;;
r) reboot;; # clear;if _yesno;then clear;shutdown -r now;sleep 5;fi;;
s) /root/scan-setuids;;
S) clear;if _yesno;then clear;/root/set-setuids;fi;;
e) clear;cd /root/mtree;./validate;echo;echo -n "Press Enter ";read;;
E) clear;if _yesno;then clear;cd /root/mtree;./generate;echo;echo -n "Press Enter ";read;fi;;
u) mkdir /root/u;mount /dev/sd5i /root/u;;
U) sync;umount /root/u;;
a) mkdir /android;sshfs -p 2222 192.168.1.12:/data/data/com.arachnoid.sshelper/home/SDCard/ /android;;
R) echo "user" >/var/cron/cron.deny;chown root:crontab /var/cron/cron.deny;chmod 660 /var/cron/cron.deny;;
A) mkdir /android;mtp-connect;simple-mtpfs /android;;
z) clear;mixerctl outputs.hp_boost=on;mixerctl outputs.master=255,255;sleep 1;;
# 3) tmux new-window;tmux send-keys "cmus;exit" C-m;tmux send-keys ":add /mnt/Music" C-m;;
v) clear;rm /root/rec/mkv;ffmpeg -f x11grab -r 30 -s 1440x900 -i :0 -c:v libx264 -preset ultrafast -acodec copy /root/rec.mkv;iclear echo convertingi mkv to mp4;rm /root/rec.mp4;ffmpeg -i /root/rec.mkv /root/rec.mp4;; # needs user in X having run xhost +
q) tput reset;tput sgr0;clear;exit;;
c) tmux new-window;tmux send-keys "calcurse -c /mnt/calcurse;exit" C-m;;
l) mount /dev/sd0k /mnt;;
L) umount /dev/sd0k;;
f) clear;umount /dev/sd0k;e2fsck -f /dev/sd0k;;
# *) clear;if [[ -n "$y" ]];then $y;sleep 1;fi;;
esac
done