Re: Running Browser in a Container with LXC
This is a fuller version. Save it as container.sh in /root and run it from there with fd64.sfs loaded into memory.
It's what I'm running presently so does have specific tweaks, such as lockstate having been installed from gslapt, my own choice of wallpaper.png in /usr/share/backgrounds/wallpaper.png, google chrome installed ..etc.
In the .jwmrc config near the end the key bindings are different to usual, a new set for me that I'm trying where ctrl-space launches the main menu, alt-space launches the bookmark menu and where WIN-space pressed when a window is active shows the window menu. WIN+ ... keys are also being used to control windows such as WIN+f to fullscreen the window, WIN+tab to step between windows. Those keybindings do require that the Xephyr hostgrab is in the locked state, otherwise keybindings from the main session apply. In the tray I have a L and U icon to show the hostgrab state, alongside capslock and the CPU temperature icons. Battery level and xload are also shown.
In the tray a right click of the date/time also shows the menu, like a menu button, Right click toggles show/hide desktop.
For closure, the script waits for it to end and tidies up things, so each/any way that its closed results in clean closure.
No rox pinboard in that, just jwm. Contains additional scripts for playing youtubes where the url has been copied to the clipboard (avoids ads), and another for screen recording. Various config files are also contained within the script and are 'sed' out of the file as it runs, a caution there is that if a later version of those programs is installed, then the config files may be of a different format.
Basically works for me but isn't generic, your mileage will likely differ.
Also just uses solely DISPLAY=:2, a single container only use.
Code: Select all
#!/bin/bash
########################## Change these as appropriate ##########################
MAIN_SFS=/aufs/pup_ro # Often will be able to use this, but can also use ...
#MAIN_SFS=/mnt/sda1/FATDOG811-FINAL/fd64.sfs # Where our main fd64.sfs is stored
ROUTER_IP=192.168.100.1 # We iptables block access to our router admin IP
SHARED=/root/shared # Main systems shared folder (/root/shared in Xephyr)
CONTAINER_LOC=/container # Empty or non-existent folder (as it's removed on exit)
CHANGES=/changes # Where aufs layered 'changes' are recorded
USE_RAM=1
# Locked/unlocked host-grab (ctrl-shift) state icon
TRAYICON=notball # "ball" = ball tray icon, anything else = button icon
# I have dissenter browser installed into fd64.sfs, more
# usually seamonkey is the fd64.sfs default
BROWSER="/opt/google/chrome/chrome --test-type --no-sandbox"
REDTHRESHOLD=66 # Threshhold at which tray cpu temperature turns red
# My E 7010 AMD laptop typically runs at around 55 at
# idle during winter months. Rises to around 65 degrees
# under higher load. In its specs it indicates 90 max.
#################################################################################
# We include a number of 'files' appended at the end of the script that we sed
# extract to where they're needed, this stores where this script is located
SCRIPTPATH=$( cd $(dirname "$0") >/dev/null 2>&1 ; pwd -P )
# We bind both sound/mixer and video so can use the likes of guvcview but
# you may prefer to not include those for secure sound and video isolation
XEPHYR="-fullscreen -name Xephyr2 -dpi 144 -nolisten tcp"
MOUNTS="--mount=bind:${SHARED}:/root/shared \
--mount=bind:/dev/video:/dev/video \
--mount=bind:/dev/video:/dev/video0 \
--mount=bind:/dev/video:/dev/video1 \
--mount=bind:/dev/snd:/dev/snd \
--mount=bind:/dev/mixer:/dev/mixer"
CAPS="--caps=all,-sys_admin,-sys_boot,-sys_chroot,-sys_ptrace,-sys_time,\
-sys_tty_config,-chown,-kill,-dac_override,-dac_read_search,-fowner,-setfcap,\
-setpcap,-net_admin,-mknod,-sys_module,-sys_nice,-sys_resource"
PFLASK="--keepenv --no-ipcns --no-netns ${MOUNTS} ${CAPS} \
--chroot=${CONTAINER_LOC}/top"
# Originally used straight ball blue and green colours for the tray .svg
# Now updated to use a more button like tray .svg ... used in _trayicon()
SVG_PREFIX="<svg height=\"32\" width=\"32\"><circle cx=\"16\" cy=\"16\" \
r=\"16\" stroke=\"black\" stroke-width=\"3\""
SVG_SUFFIX="/></svg>"
BLUESVG="${SVG_PREFIX} fill=\"#54F3FF\" ${SVG_SUFFIX}"
GREENSVG="${SVG_PREFIX} fill=\"#4FF40A\" ${SVG_SUFFIX}"
HOST_GRAB_TIP="Xephyr Ctrl Shift mouse/keyboard \
focus toggle. Green=(U)nlocked, Blue=(L)ocked"
HOST_GRAB_IMG="/tmp/.container-img.svg"
HG="top/tmp/.hostgrab"
CLICKMSG="Use Ctrl-shift key combination to toggle the Xephyr (containers)
mouse and keyboard focus between locked (blue) and unlocked (green)
Note that locked or unlocked makes no difference to actual security its just a
operational function - such as if 'locked' (blue) then alt-tab will step between
windows within the Xephyr container or if 'unlocked' (green) alt-tab will step
through the main sessions windows of which the Xephyr 'window' will be just one"
CLICK="Xdialog --title 'keyboard/mouse focus information ' \
--msgbox '${CLICKMSG}' 0 0"
REQUIRES="This script requires a number of additional programs
to have been installed (gslapt) : xclip, xdotool and wmctrl"
_screenrecorder() {
# Not required, but useful screen recorder command
cat <<EOF >top/usr/bin/screenrecord
#!/bin/bash
DISPLAY=2 # Usually 0 but I run a container on :2
X=1366 # Display X width
Y=768 # Display Y height
FRAMERATE=20 # Min of 20, 30 is a good choice
ffmpeg -video_size \${X}X\${Y} -framerate \${FRAMERATE} \\
-f x11grab -i :\${DISPLAY}.0+0,0 -c:v libx264rgb -crf 0 \\
-preset ultrafast /root/screencap.mkv
EOF
chmod +x top/usr/bin/screenrecord
}
_ytplayer() { # Again not required, but nice
cat <<EOF >top/usr/bin/ytplayer
#!/bin/sh
# MochiMoppel's youtube without ads
# https://forum.puppylinux.com/viewtopic.php?p=11388#p11388
# youtube ... right mouse to copy link location (to clipboard)
# and this script reads/plays that
BROWSER="/opt/google/chrome/chrome --no-sandbox"
YTURL=\$(xclip -o -sel clip) || YTURL=\$(xsel -b)
((\$?)) && exec Xdialog -msg "xclip or xsel not installed" x
case \$YTURL in
*youtube.com*v%3D*) VIDID=\${YTURL#*v%3D};;
*youtube.com*v=*) VIDID=\${YTURL#*v=};;
*youtu.be* ) VIDID=\${YTURL#*.be/};;
* ) exec Xdialog -msg "Add a YouTube URL to clipboard first\n\nNot a recognized YouTube URL:\n\n\${YTURL::50}" x;;
esac
VIDID=\${VIDID::11}
exec \$BROWSER "https://www.youtube.com/embed/\$VIDID?autoplay=1"
EOF
chmod +x top/usr/bin/ytplayer
}
_locked_svg() { # Locked host-grab .svg icon for tray
cat <<EOF >$HOST_GRAB_IMG
<svg height='32' width='32' viewBox='0 0 16 16'>
<radialGradient id='rg' fx='50%' fy='50%' cx='50%' cy='50%' r='50%'>
<stop offset='60%' stop-color='white' stop-opacity='1'/>
<stop offset='100%' stop-color='#00A5FF' stop-opacity='1' />
</radialGradient>
<rect width='14' height='13' x='1' y='1' rx='2' ry='3' fill='url(#rg)'/>
<g font-size='11' font-style='normal' font-variant='normal' font-weight='bold'
font-stretch='normal' text-align='center' line-height='125%' letter-spacing='0'
word-spacing='0' text-anchor='middle' fill='darkblue' fill-opacity='1'
stroke='none' font-family='sans' dominant-baseline='central'>
<text x='50%' dy='12'>L</text>
</g>
</svg>
EOF
}
_unlocked_svg() { # Unlocked .svg icon for tray
cat <<EOF >$HOST_GRAB_IMG
<svg height='32' width='32' viewBox='0 0 16 16'>
<radialGradient id='rg' fx='50%' fy='50%' cx='50%' cy='50%' r='50%'>
<stop offset='60%' stop-color='#04FA17' stop-opacity='1'/>
<stop offset='100%' stop-color='white' stop-opacity='1' />
</radialGradient>
<rect width='14' height='13' x='1' y='1' rx='2' ry='3' fill='url(#rg)'/>
<g font-size='11' font-style='normal' font-variant='normal' font-weight='bold'
font-stretch='normal' text-align='center' line-height='125%' letter-spacing='0'
word-spacing='0' text-anchor='middle' fill='black' fill-opacity='1'
stroke='none' font-family='sans' dominant-baseline='central'>
<text x='51%' dy='12'>U</text>
</g>
</svg>
EOF
}
_tempsvg() { # cpu temperature .svg
cat <<EOF >/tmp/.temperature.svg
<svg height='32' width='32' viewBox='0 0 16 16'>
<radialGradient id='rg' fx='50%' fy='50%' cx='50%' cy='50%' r='50%'>
<stop offset='80%' stop-color='white' stop-opacity='1'/>
<stop offset='100%' stop-color='$2' stop-opacity='1' />
</radialGradient>
<rect width='14' height='13' x='1' y='1' rx='2' ry='3' fill='url(#rg)'/>
<g font-size='8' font-style='normal' font-variant='normal' font-weight='bold'
font-stretch='normal' text-align='center' line-height='125%' letter-spacing='0'
word-spacing='0' text-anchor='middle' fill='$3' fill-opacity='1' stroke='none'
font-family='sans' dominant-baseline='central'>
<text x='52%' dy='11'>$1</text>
</g>
</svg>
EOF
}
_error_exit() {
Xdialog --title "Error" --infobox "$1" 0 0 5000
exit 1
}
###
_find_func() { # find function for Locate where to read cpu temperature from
FILES="$1"
for n in `echo $FILES`; do
read p < $n
if [ $? = 0 ];then
FILE=$n # found it
break
else
continue # didn't find, search again
fi
done
# if we get here we didn't find anything useful
}
# Scan for where to read cpu temperature from
for a in `find /sys/devices/platform -type f -name 'temp*_input'|sort` \
`find /sys/devices/pci* -type f -name 'temp*_input'|sort` \
`find /sys/devices/virtual -type f -name 'temp'|sort`
do _find_func "$a"
[ -z "$FILE" ] && continue || break # if we found data break
done
CPU_TEMP=$FILE
###
_temperature() { # Container (DISPLAY=:2) temperature tray icon
if [ -f $CPU_TEMP ]; then
last=55
_tempsvg 55 cyan black
sit /tmp/.temperature.svg "cpu temperature" &
PIDsittemp=$!
while :; do
x=$(cat $CPU_TEMP)
x=$((x/1000))
if [ $x -gt 1 ]; then
if [ $x -ne $last ];then
last=$x
[[ $x -ge $REDTHRESHOLD ]] && colour=red || colour=cyan
[[ $colour = "red" ]] && textcol=red || textcol=black
_tempsvg $x $colour $textcol
fi
fi
sleep 10
done
else
Xdialog --msgbox "cpu temperature not found" 0 0
fi
}
_startclip() { # Clipboard manager to enable copy/paste between main & container
cat <<EOF >/tmp/.clip
#!/bin/sh
b=\$(Xdialog --title "Container Clipboard" --radiolist "After using shift-drag \
to select text
run this dialog and select where to send that clip
Then use Middle Mouse to Paste the clip" 20 80 0 TO "send main session clip to \
containers clip" on FROM "send containers clip to main sessions clip" off 2>&1)
if [ "\$b" = "TO" ]; then
xclip -o | DISPLAY=:2 xclip -i
else
DISPLAY=:2 xclip -o | xclip -i
fi
EOF
chmod +x /tmp/.clip
sit /usr/share/pixmaps/themes/puppy48/clipboard48.png \
'Container clipboard Manager' /tmp/.clip &
PIDsit=$!
}
_check_environment() { # NOTE THAT DEFAULT FATDOG NEEDS OTHER THINGS INSTALLED
# FROM GSLAPT (REPO) FOR THIS SCRIPT TO WORK CORRECTLY
fail=0
printf "Checking required programs are available\n\n"
for C in xclip xdotool wmctrl; do
[[ -z $(command -v "$C") ]] && echo $C no && fail=1 || echo $C yes
done
printf "\n"
if [ $fail -ne 0 ]; then
Xdialog --title Error --msgbox "$REQUIRES" 0 0
printf "\nunable to continue, exiting\n"
_error_exit "One or more required files are missing"
fi
[[ "$MAIN_SFS" != "/aufs/pup_ro" ]] && [[ ! -f $MAIN_SFS ]] && \
_error_exit "Main sfs\n${MAIN_SFS}\nnot found"
}
_prepfolders() {
[[ ! -d $SHARED ]] && mkdir $SHARED
[[ ! -d $CONTAINER_LOC ]] && mkdir $CONTAINER_LOC
cd $CONTAINER_LOC
if [ -d top -o -d sfs ]; then
umount -f top sfs;rmdir top sfs
fi
mkdir top sfs
[[ ! -d $CHANGES ]] && mkdir $CHANGES
[[ $USE_RAM -eq 1 ]] && \
[[ $(mount | grep 'tmpfs on $CHANGES type tmpfs' | wc -l) -eq 0 ]] && \
mount -t tmpfs tmpfs $CHANGES
if [ "$MAIN_SFS" != "/aufs/pup_ro" ]; then
mount -r -t squashfs $MAIN_SFS sfs
[[ $? -ne 0 ]] && _error_exit "Failed to mount sfs
maybe the container is already running?"
mount -t aufs -o br=$CHANGES:sfs none top
else
mount -t aufs -o br=$CHANGES:/aufs/pup_ro none top
fi
[[ $? -ne 0 ]] && _error_exit "aufs layering mount failed"
if [ $(ps -ef | grep 'Xephyr :2' | wc -l) -ne 2 ];then
Xephyr :2 $XEPHYR &
XEPHYR_PID=$!
else
_error_exit "Start Xephyr on :2 failed"
fi
_screenrecorder
_ytplayer
}
_fix_environment() { # re-configure/fix the container to work better
cp /var/lib/dbus/machine-id top/var/lib/dbus/machine-id
cp /etc/resolv.conf top/etc/resolv.conf
ln -s top/var/lib/dbus/machine-id top/etc/machine-id
printf "#!/bin/sh\n\n" >top/init
printf "rm /root/.Xresources \n" >>top/init
printf "ln -s /root/.Xdefaults /root/.Xresources\n" >>top/init
printf "Xdialog --no-buttons --title \"Please Wait\" \
--infobox \"Initialising Container ... Please wait\" 0 0 2000 &\n" >>top/init
printf "export PATH=$PATH:/usr/local/bin\n" >>top/init
printf "touch /root/shared/.flag\n" >>top/init
modprobe battery
if [ -d /proc/acpi/battery ]; then
results="`find /proc/acpi/battery -mindepth 1 -type d`"
if [ ! -z "$results" ]; then # it's a laptop
printf "vattery &\n" >>top/init
else
rmmod battery
fi
fi
# Best not to include container script within the container
printf "rm $0\n" >>top/init
# and init
printf "rm /init\n" >>top/init
printf "jwm\n" >>top/init
chmod +x top/init
rm top/usr/local/bin/defaultbrowser
printf "#!/bin/sh\n" > top/usr/local/bin/defaultbrowser
printf "Xdialog --no-buttons --infobox \
\"chrome loading\" 0 0 3000 &\n" >> top/usr/local/bin/defaultbrowser
printf "/opt/google/chrome/chrome --no-sandbox \"\$@\"" \
>> top/usr/local/bin/defaultbrowser
chmod +x top/usr/local/bin/defaultbrowser
# Extract out of this file the .jwmrc/urxvt config, rox ...etc.
# Uses sed to do that, where we have to delimit the search term here so
# that this code isn't 'seen as the start of text' tag
SCRIPT=$SCRIPTPATH/`basename $0`
sed -n '/<!-- \jwm-start -->/{:a;n;/<!-- \jwm-end -->/b;p;ba}' \
$SCRIPT >top/root/.jwmrc
sed -n '/<!-- ur\xvt-start -->/{:a;n;/<!-- ur\xvt-end -->/b;p;ba}' \
$SCRIPT >top/etc/X11/app-defaults/URxvt
sed -n '/<!-- Xdefaults\S -->/{:a;n;/<!-- Xdefaults\E -->/b;p;ba}' \
$SCRIPT >top/root/.Xdefaults
sed -n '/<!-- l\ockstateS -->/{:a;n;/<!-- l\ockstateE -->/b;p;ba}' \
$SCRIPT >top/root/.config/lockstate.conf
sed -n '/<!-- t\oprcS -->/{:a;n;/<!-- t\oprcE -->/b;p;ba}' \
$SCRIPT >top/root/.toprc
# Set xvkbd to use UK as default layout
printf "#include \"XVkbd-uk\"/n" >>top/etc/X11/app-defaults/XVkbd
sync
}
_hostgrabstate() { # We background this function
# hostgrab task in main system to report when the Xephyr
# windows title (that is otherwise unseen due to being
# full screened) changes
sleep 1
while [ -z "$WID" ]; do
sleep 1 # time for container to start
WID=$(wmctrl -lp | grep "Xephyr on :2" | cut -d ' ' -f 1)
done
xprop -id $WID -spy WM_NAME >/tmp/.host-grab # Start 'spying' the Xephyr
# window title (we use inotifywait to pick up on the changes)
}
_hostgrabmon() { # ctrl-shift locked/unlocked toggle indicator in Xephyr's tray
[[ "$TRAYICON" = "ball" ]] && echo $BLUESVG>$HOST_GRAB_IMG || _locked_svg
touch /tmp/.host-grab # sit & inotifywait modify require pre-exist files
_hostgrabstate & # Start monitoring of Xephyr window title changes
PIDhostgrab=$!
while [ $ACTIVE -eq 1 ]; do
{
inotifywait -qe 'modify' /tmp/.host-grab || exit 1
} >/dev/null 2>&1
C=$(tail -1 /tmp/.host-grab | grep "grabs")
if [ ! -z "${C}" ]; then # if no 'release' Xephyr window in title
[[ "$TRAYICON" = "ball" ]] && printf "%s\n" "$GREENSVG" \
>$HOST_GRAB_IMG || _unlocked_svg # alternative to green ball icon
else
[[ "$TRAYICON" = "ball" ]] && printf "%s\n" "$BLUESVG" \
>$HOST_GRAB_IMG || _locked_svg # alternative to blue ball icon
fi
done
}
_trayicons() {
DISPLAY=:2 sit $HOST_GRAB_IMG "${HOST_GRAB_TIP}" "${CLICK}" &
DISPLAY=:2 lockstate & # caps lock state tray icon
PIDlockstate=$!
_startclip # Start container clipboard manager
DISPLAY=:2 _temperature & # Containers tray cpu temperature icon
PIDtemp=$!
}
## MAIN ##
ACTIVE=1;_check_environment;_prepfolders;_fix_environment # Prepare
#DISPLAY=:2 taskset -c 0 empty -f unshare -m pflask $PFLASK -- /init # 1 core
DISPLAY=:2 empty -f unshare -m pflask $PFLASK -- /init # The big chroot
CONTAINER_PID=$!
while [ ! -f $SHARED/.flag ]; do # Wait until container ready
sleep 1
done
rm $SHARED/.flag
_hostgrabmon & # Prepare hostgrab monitoring
PIDhostgrabicon=$!
xdotool keydown ctrl key shift keyup ctrl # Toggle container to 'locked'
_trayicons # Add tray icons
iptables -A INPUT -s $ROUTER_IP -j DROP # Drop router admin access
wait $CONTAINER_PID # Wait for container to end
umount top sfs >/dev/null 2>&1 # HOUSEKEEPING
rmdir top sfs >/dev/null 2>&1
rm -rf $CONTAINER_LOC;umount $CHANGES
ACTIVE=0 # To trigger and kill off
echo >>/tmp/.host-grab # backgrounded inotifywait
sleep 1
kill $PIDtemp $PIDlockstate $PIDhostgrabicon $PIDhostgrab $PIDsit $PIDminimize \
>/dev/null 2>&1
rm /tmp/.clip /tmp/.container-img.svg /tmp/.host-grab /tmp/.temperature.svg \
>/dev/null 2>&1
#################################################################################
exit 0
#################################################################################
# From below the exit 0 above nothing will be interpreted (bash just ignores it)
# So we're storing some of our config files here that we use, and that we extract
# out and into where they're required as part of the scripts processing/tasks
# For each such file there's a start and end 'token' that is searched for/used
# as part of that sed based extraction. For instance .jwmrc ... etc.
#################################################################################
<!-- urxvt-start -->
!warning, needs about 500 bytes per line for scrollback buffer...
URxvt.saveLines: 1000
URxvt.font: xft:mono:pixelsize=24:autohint=true
URxvt.boldFont: xft:mono:bold:pixelsize=24:autohint=true
URxvt.italicFont: xft:mono:italic:pixelsize=24:autohint=true
URxvt.letterSpace: -1
! URxvt.background: "gray"
URxvt*scrollBar_right: true
URxvt*background: black
URxvt*foreground: white
URxvt*visualBell: true
! These next two disable ctrl shift Xephyr and urxvt conflict
URxvt.iso14755: false
URxvt.iso14755_52: false
<!-- urxvt-end -->
#################################################################################
<!-- lockstateS -->
CapsLock=true
NumLock=false
ScrollLock=false
ReversedOrder=false
Fg_Active=#ff0000
Fg_Inactive=#ff0000
Bg_Active_Beg=#f0f0f0
Bg_Active_End=#ffffff
Bg_Inactive_Beg=#888888
Bg_Inactive_End=#ffffff
CapsLock_Active=A
CapsLock_Inactive=a
NumLock_Active=1
NumLock_Inactive=0
ScrollLock_Active=â
ScrollLock_Inactive=â£
<!-- lockstateE -->
#################################################################################
<!-- toprcS -->
top's Config File (Linux processes with windows)
Id:i, Mode_altscr=0, Mode_irixps=1, Delay_time=1.500, Curwin=0
Def fieldscur=¥&K¨³´»½@·º¹56ÄFÅ')*+,-./0128<>?ABCGHIJLMNOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=162102, sortindx=18, maxtasks=0, graph_cpus=1, graph_mems=2
summclr=2, msgsclr=1, headclr=7, taskclr=7
Job fieldscur=¥¦¹·º(³´Ä»½@<§Å)*+,-./012568>?ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=163124, sortindx=0, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=6, msgsclr=6, headclr=7, taskclr=6
Mem fieldscur=¥º»<½¾¿ÀÁMBNÃD34·Å&'()*+,-./0125689FGHIJKLOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=163124, sortindx=21, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=5, msgsclr=5, headclr=4, taskclr=5
Usr fieldscur=¥¦§¨ª°¹·ºÄÅ)+,-./1234568;<=>?@ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=163124, sortindx=3, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=3, msgsclr=3, headclr=2, taskclr=3
Fixed_widest=0, Summ_mscale=2, Task_mscale=1, Zero_suppress=0
Def fieldscur=Â¥&K¨³´»½@·º¹56ÃFÃ
')*+,-./0128<>?ABCGHIJLMNOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=162102, sortindx=18, maxtasks=0, graph_cpus=1, graph_mems=2
summclr=2, msgsclr=6, headclr=7, taskclr=7
Job fieldscur=¥¦¹·º(³´Ã»½@<§Ã
)*+,-./012568>?ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=163124, sortindx=0, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=6, msgsclr=6, headclr=7, taskclr=6
Mem fieldscur=¥º»<½¾¿ÃÃMBNÃD34·Ã
&'()*+,-./0125689FGHIJKLOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=163124, sortindx=21, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=5, msgsclr=5, headclr=4, taskclr=5
Usr fieldscur=¥¦§¨ª°¹·ºÃÃ
)+,-./1234568;<=>?@ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=163124, sortindx=3, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=3, msgsclr=3, headclr=2, taskclr=3
Fixed_widest=0, Summ_mscale=2, Task_mscale=1, Zero_suppress=0
<!-- toprcE -->
#################################################################################
.Xdefaults ... in particular we want xvkbd to use a larger default size and font
<!-- XdefaultsS -->
XTerm*VT100.Translations: #override \
Shift Ctrl<Key>V: insert-selection(CLIPBOARD) \n\
Shift Ctrl<Key>V: insert-selection(PRIMARY) \n\
Shift<Btn1Down>: select-start() \n\
Shift<Btn1Motion>: select-extend() \n\
Shift<Btn1Up>: select-end(C) \n\
! so drag highlight copies to clipboard
XTerm*selectToClipboard: true
XClipboard.form.text.textSink.font: -b&h-lucida-medium-r-*-*-24-*-*-*-*-*-iso8859-14
! stop output to terminal from jumping down to bottom of scroll again
xterm*scrollTtyOutput: false
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Blink instead of beeping
*visualBell: false
! To reload ...
! xrdb ~/.Xdefaults
!OpenBSD running an X Windows session has hinting and sub-pixel rendering
!available by default as the patent issues have been resolved. I have
! added extra symlinks in my /etc/fonts/conf.d directory as follows...
!foo$ ls -l /etc/fonts/conf.d | cut -c 45-
!10-autohint.conf -> /etc/fonts/conf.avail/10-autohint.conf
!10-sub-pixel-rgb.conf -> /etc/fonts/conf.avail/10-sub-pixel-rgb.conf
!11-lcdfilter-default.conf -> /etc/fonts/conf.avail/11-lcdfilter-default.conf
Xft.dpi: 144
Xft.autohint: 0
Xft.antialias: true
Xft.hinting: true
Xft.hintstyle: hintnone
Xft.rgba: rgb
Xft.lcdfilter: lcdedefault
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
xvkbd.windowGeometry: 900x300
xvkbd*Font: 10x20
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
XLoad*showLabel: false
XLoad*geometry: 80x80+0+81
XLoad*borderWidth: 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*font: -b&h-lucida-medium-r-*-*-24-*-*-*-*-*-iso8859-14
*foreground: white
*background: black
*SimpleMenu*font: -b&h-lucida-medium-r-*-*-24-*-*-*-*-*-iso8859-14
<!-- XdefaultsE -->
#################################################################################
<!-- jwm-start -->
<?xml version="1.0"?><JWM>
<!-- Note this jwmrc was generated within container.sh
Xephyr container launch script -->
<StartupCommand>
<!-- set the desktop wallpaper -->
/usr/bin/feh --bg-scale /usr/share/backgrounds/wallpaper.jpg
</StartupCommand>
<!-- I set key binding of alt spacebar (below) to show root:4 ... this menu -->
<RootMenu label="BookMarks" labeled="false" height="26" onroot="4">
<Program label="PuppyLinux">/opt/google/chrome/chrome --no-sandbox -d https://forum.puppylinux.com</Program>
<Program label="Yahoo">/opt/google/chrome/chrome --no-sandbox -d https://uk.finance.yahoo.com</Program>
<Program label="News">/opt/google/chrome/chrome --no-sandbox -d https://news.bbc.co.uk</Program>
<Program label="Draughts">/opt/google/chrome/chrome --no-sandbox -d https://draughts.github.io</Program>
</RootMenu>
<RootMenu label="Menu" labeled="false" height="26" onroot="3">
<Program icon="folder.png" label="rox">rox</Program>
<Program icon="galculator.png" label="galculator">galculator</Program>
<Program icon="video-display.png" label="urxvt">urxvt</Program>
<Program icon="mtpaint.png" label="mtpaint">mtpaint</Program>
<Program icon="gimp.png" label="gimp">gimp</Program>
<Program icon="viewnior.png" label="viewnior">viewnior</Program>
<Program icon="/usr/share/pixmaps/guvcview/guvcview.png" label="guvcview">guvcview</Program>
<Program icon="libreoffice-writer.png" label="libreoffice Writer">libreoffice --writer</Program>
<Program icon="libreoffice-calc.png" label="libreoffice Calc">libreoffice --calc</Program>
<Program icon="tigervnc.png" label="tigervnc viewer">vncviewer</Program>
<Program icon="vlc.png" label="vlc">vlc</Program>
<Program icon="mini-colors.xpm" label="tetris">gtktetris</Program>
<Program icon="mini-keyboard.xpm" label="xvkbd">xvkbd -secure</Program>
<!-- <Program icon="mini-keyboard.xpm" label="florence">florence</Program> -->
<Program icon="mini-perf.xpm" label="Net Activity">xterm -e bmon -p wlan0</Program>
<Program icon="htop.png" label="htop">xterm -e htop</Program>
<Program icon="xterm16.xpm" label="screen recorder">xterm -e screenrecord</Program>
<Program icon="multimedia48.png" label="ytplayer">ytplayer</Program>
<Separator/>
<Program icon="process-stop.png" label="Exit">Xdialog --title 'Exit (or minimise) Container' --msgbox 'First use Ctrl-Shift to toggle the tray icon to green/unlocked
and then use Ctrl-Alt-x (or Alt-F4) to exit/end the container session
OR
to leave it running and minimise the container session use Ctrl-Alt-d
' 0 0</Program>
</RootMenu>
<IconPath>/usr/share/pixmaps/midi-icons</IconPath>
<IconPath>/usr/share/pixmaps/mini-icons</IconPath>
<IconPath>/usr/share/pixmaps</IconPath>
<IconPath>/usr/share/icons</IconPath>
<IconPath>/usr/local/share/pixmaps</IconPath>
<IconPath>/usr/share/icons/hicolor/48x48/apps</IconPath>
<IconPath>/usr/share/icons/hicolor/24x24/apps</IconPath>
<IconPath>/usr/share/icons/hicolor/scalable/apps</IconPath>
<IconPath>/usr/share/pixmaps/pidgin/dialogs/scalable</IconPath>
<WindowStyle>
<Font>DejaVu Sans-11:bold</Font>
<Width>5</Width>
<Height>26</Height>
<Foreground>#b2b2b2</Foreground>
<Background>#3C3636:#5E5151</Background>
<!--
<Corner>4</Corner>
<Outline>black</Outline>
-->
<Active>
<Foreground>white</Foreground>
<Background>#180356:#1304F4</Background>
<Outline>black</Outline>
</Active>
</WindowStyle>
<TaskListStyle>
<Font>DejaVu Sans-11</Font>
<Foreground>#929292</Foreground>
<Background>#04061B</Background>
<Active>
<Foreground>white</Foreground>
<Background>#3C3636:#5E5151</Background>
</Active>
</TaskListStyle>
<TrayStyle>
<Font>DejaVu Sans-12:bold</Font>
<Foreground>white</Foreground>
<Background>#04061B</Background>
</TrayStyle>
<PagerStyle>
<Outline>black</Outline>
<Foreground>#8899AA</Foreground>
<Background>#3A4956</Background>
<Active>
<Foreground>#DCDAD5</Foreground>
<Background>#888888</Background>
</Active>
</PagerStyle>
<PopupStyle>
<Font>DejaVu Sans-12</Font>
<Outline>black</Outline>
<Foreground>black</Foreground>
<Background>#EEEEEE</Background>
</PopupStyle>
<MenuStyle>
<Font>DejaVu Sans-11:bold</Font>
<Foreground>white</Foreground>
<Background>black</Background>
<!--
<Active>
<Foreground>black</Foreground>
<Background>#B6B6B6:#DBDBDB</Background>
</Active>
-->
</MenuStyle>
<ClockStyle>
<Font>DejaVu Sans-10:bold</Font>
<Foreground>white</Foreground>
<Background>#04061B</Background>
</ClockStyle>
<Desktops count="2" width="2" height="1">
<Background type="solid">#000011</Background>
<!-- <Background type="image">/root/wp.jpg</Background> -->
</Desktops>
<Group>
<Name>Xdialog</Name>
<Option>notitle</Option>
<Option>nolist</Option>
</Group>
<Group>
<Name>xmessage</Name>
<Option>notitle</Option>
<Option>nolist</Option>
</Group>
<Group>
<Class>gtkdialog-splash</Class>
<Option>nolist</Option>
<Option>nofocus</Option>
</Group>
<!-- urxvt terminal windows do not fully maximize, this iignore fixes that -->
<Group>
<Class>URxvt</Class>
<Option>iignore</Option>
</Group>
<!-- misc. parameters -->
<DoubleClickSpeed>400</DoubleClickSpeed>
<DoubleClickDelta>3</DoubleClickDelta>
<FocusModel>click</FocusModel>
<SnapMode distance="10">none</SnapMode>
<MoveMode>opaque</MoveMode>
<ResizeMode>opaque</ResizeMode>
<!-- key bindings (set to similar to cwm) -->
<Key key="Up">up</Key>
<Key key="Down">down</Key>
<Key key="Right">right</Key>
<Key key="Left">left</Key>
<Key key="h">left</Key>
<Key key="j">down</Key>
<Key key="k">up</Key>
<Key key="l">right</Key>
<Key key="Return">select</Key>
<Key key="Escape">escape</Key>
<Key mask="CAS" key="q">exit</Key>
<Key mask="CAS" key="r">restart</Key>
<Key mask="A" key="#">desktop#</Key>
<Key mask="C" key="space">root:3</Key> <!-- Ctrl-space main jwm menu -->
<Key mask="A" key="space">root:4</Key> <!-- ALT-space URL bookmarks -->
<Key mask="4" key="space">window</Key> <!-- WIN-Space Window title bar menu -->
<Key mask="C" key="Down">exec:amixer -c 1 set Master 2%-</Key>
<Key mask="C" key="Up">exec:amixer set -c 1 Master 2%+</Key>
<Key mask="4" key="Tab">next</Key>
<Key mask="4" key="Return">exec:urxvt</Key>
<Key mask="4" key="Up">maximize</Key>
<Key mask="4" key="x">close</Key>
<Key mask="4" key="f">fullscreen</Key>
<Key mask="4" key="Down">minimize</Key>
<!-- additional stuff -->
<!-- <Include>$HOME/.jwmrc-tray</Include> -->
<Tray autohide="off" insert="right" x="0" y="-1" border="1" height="34" >
<Clock format="%H:%M %a %d %b">
<Button mask="1">root:3</Button>
<Button mask="3">showdesktop</Button>
</Clock>
<!-- Additional TrayButton attribute: label -->
<!-- <TrayButton label="" icon="/usr/share/icons/fatdog32.png">root:3</TrayButton> -->
<TrayButton popup="browse" icon="/usr/local/lib/X11/pixmaps/www48.png">
exec:/opt/google/chrome/chrome --no-sandbox --test-type
</TrayButton>
<TrayButton popup="xterm" icon="/usr/share/pixmaps/video-display.png">
exec:urxvt
</TrayButton>
<TrayButton popup="rox" icon="folder.png">exec:rox</TrayButton>
<TrayButton popup="geany" icon="geany.png">
exec:geany /root/shared/clip.txt
</TrayButton>
<TrayButton popup="galculator" icon="galculator.png">
exec:galculator
</TrayButton>
<TrayButton popup="alsamixer" icon="/usr/share/pixmaps/themes/puppy16/audio-volume-high.png">
exec:urxvt -e alsamixer
</TrayButton>
<!-- <TrayButton popup="Show Desktop" icon="mini-desktop.xpm">
showdesktop
</TrayButton>
-->
<!-- Additional Pager attributes; width, height -->
<Pager/>
<!-- Additional TaskList attribute: maxwidth -->
<TaskList maxwidth="2000"/>
<Dock/>
<Swallow name="xload" width="32">
xload -nolabel -bg "#04061B" -fg "#ff0000" -hl yellow -update 1
</Swallow>
</Tray>
</JWM>
<!-- jwm-end -->
#################################################################################