LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 07-22-2018, 02:40 PM   #1
rufwoof
Member
 
Registered: Nov 2017
Distribution: Debian Desktop; OpenBSD Server
Posts: 65

Rep: Reputation: Disabled
OpenBSD cwm tmux iridium


Theo likes Iridium web browser https://marc.info/?l=openbsd-misc&m=152872551609819&w=2 ... good enough for me

Base OpenBSD running cwm window manager plus iridium (installed via pkg_add) together with openup https://www.mtier.org/solutions/apps/openup/ that is run periodically to keep the base system and programs security updated, can make a reasonable desktop setup.

Set your .xinitrc to start both tmux and iridium, and you can then alt-tab between the two. In iridium you can ctrl-tab between browser tabs (or more likely just use the mouse). In tmux you can open and flip between multiple windows. I like to have all my windows maximised (using ctrl-alt-M) and I've set cwm to leave a 2 pixel gap at the top of the screen so I can left or right mouse press that to show current windows and my cwm menu respectively.

Store your private stuff under root, run the browser as user, and your private stuff (diary/whatever) is isolated/secure. I'm using vi as my tmux text editor and cli as my 'file manager'.

In iridium I have a tab that shows the current time in the title and hence on the tab. I also have a tab bar containing bookmarks, calculator, text editor, paint, googledocs, mail and music bookmarks. In effect a gui desktop. For calculator, text editor and paint I have local copies of html/javascript files to provide that functionality. Googledocs is good for spreadsheet and word processing etc. A online email account also more often support notes/calendar/appointments/todo ..etc. type options. Iridium as a mp4, mp3 (videos/music) player along with radio stations/other media works well in my experience.

Currently my calculator html/javascript 'program' works very well, I'm using a scientific type version so it supports pi, logs ...etc. type functions. The text editor html/javascript I'm currently using is OK, but needs improvement/tidying up. The paint program is currently very limited and needs quite a bit of additional work (or replacing with a better version). The current version only supports saving to .png file format.

I do actually have another program installed, ddclient, as I've activated the httpd web server and set it up so that I have a fixed domain name that points to my dynamic IP address - which required installing ddclient, but means that others can "call/visit" me from anywhere using the same fixed domain name (I'm using ddnsfree).

Took a little while to get used to using cwm and its keybindings, but after a while I found that the few that I use do come naturally. I only use a handful or so including alt-tab between iridium and tmux.

A nice feature with tmux is that you can set it up to collaborate. You and a assistant can log/ssh in as the same userid, attach to the same tmux session and both see the exact same thing at the same time, where either of you can type/edit things.

vi ... is starting to become more natural for me, but does require persistence. Again I'm using only a handful of commands that fulfill my needs.

Command line ... as a longer term 'nix user that comes relatively easy for me.

What I do like is how OpenBSD comes ready to go out of the box, with sensible configurations and settings. My config file contents are small. I'm running OpenBSD on bare metal on a Acer Aspire with Phenom X4 and using the onboard Radeon/Ati graphics. The PC has 2GB of RAM. Despite being a decade old+ PC it works really well, nice and quick under OpenBSD, graphics and sound are great.

In later posts I'll show my configuration and I'll post some screenshots.
 
Old 07-22-2018, 02:52 PM   #2
rufwoof
Member
 
Registered: Nov 2017
Distribution: Debian Desktop; OpenBSD Server
Posts: 65

Original Poster
Rep: Reputation: Disabled
~/.xinitrc ....

Code:
# .xinitrc
#
xsetroot -bg \#222222 -mod 3 3 &
export   LC_ALL=en_US.UTF-8
iridium file:///home/user/timetab.html &
xterm -e tmux &
cwm

~/.Xdefaults ...

Code:
Xft.dpi:                        157
*font:                          -b&h-lucida-medium-r-*-*-24-*-*-*-*-*-iso8859-14
*background:                    #000033
*foreground:                    #FFFFFF
*faceName:                      News10:size=11:antialias=true
*cursorColor:                   LightBlue
!XTerm.vt100.faceName:          DejaVu:size=11:antialias=false
XTerm.vt100.faceName:           News10:size=11:antialias=true
!                               when run xterm runs ~/.profile
XTerm*loginShell:               true
xterm*scrollBar:                false
!                               xcalc buttons count left to right top to bottom
xcalc*geometry:                 265x346
xcalc*font:                     -*-helvetica-bold-r-*-*-20-*-*-*-p-*-*-*
xcalc.ti.button20.label:        /
xcalc.ti.button3.label:         SqRt
~/.cwmrc ....

Code:
# .cwmrc
# 
gap                             2 0 0 0
ignore                          xclock
ignore                          xload
color inactiveborder            Black
color activeborder              "#494949" 
color groupborder               "#01a252"
color urgencyborder             "#3d9751"
color selfont                   "#0034A9"
color font                      "#FFFFFF"
color menufg                    "#49F6F6"
color menubg                    "#333333"
#fontname                       "DejaVu Sans:size=11:antialias=true"
fontname                        "News10:size=11:antialias=true"
bind-key CM-comma               "mixerctl outputs.master=-5"
bind-key CM-period              "mixerctl outputs.master=+5"
command " xterm "               "/usr/bin/env LANG=en_US.UTF-8 xterm -fa DejaVu:size=11"
command " tmux "                "/usr/bin/env LANG=en_US.UTF-8 xterm -fa DejaVu:size=11 -e tmux"
command " iridium "             "iridium"
command " diary "               "xterm -e su - root -c 'vi /home/user/bin/diary'"
command " cpu temp "            "/home/user/bin/.cputemp"
command " Reboot "              "xterm -e su - root -c 'shutdown -r now'"
command " Shutdown "            "xterm -e su - root -c 'shutdown -p now'"
~/.tmux.conf ....

Code:
bind-key -n F1 next-window
bind-key -n F2 new-window

#hilite current window
set-window-option -g window-status-current-bg red
set-window-option -g window-status-current-fg yellow

bind -T copy-mode-vi PageDown          send-keys -X page-down
bind -T copy-mode-vi PageUp            send-keys -X page-up
/etc/sysctl.conf .... (inspection of /var/log/Xorg.0.log indicated I should add this to /etc/sysctl.conf )

Code:
machdep.allowaperture=3
/etc/rc.conf.local ...

Code:
apmd_flags=-A
httpd_flags=
inetd_flags=
sndiod_flags=-s default -m play,mon -s mon
sshd_flags=NO
 
Old 07-22-2018, 02:58 PM   #3
rufwoof
Member
 
Registered: Nov 2017
Distribution: Debian Desktop; OpenBSD Server
Posts: 65

Original Poster
Rep: Reputation: Disabled
A couple of screenshots
Attached Thumbnails
Click image for larger version

Name:	s1.jpg
Views:	77
Size:	122.9 KB
ID:	28192   Click image for larger version

Name:	s2.jpg
Views:	70
Size:	57.2 KB
ID:	28193  
 
Old 07-23-2018, 06:42 AM   #4
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 2,679

Rep: Reputation: Disabled
I use OpenBSD as my backup to Linux, in case systemd encroaches too much & we can't get rid of it.

I'm actually on my OBSD machine now, I have been using it daily for a couple of months now, almost as easy.

Fluxbox is my regular WM, firefox my browser, then I just use a video player & a music player - just beginning to record using a USB mic.
 
Old 07-23-2018, 09:20 AM   #5
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,702
Blog Entries: 8

Rep: Reputation: 631Reputation: 631Reputation: 631Reputation: 631Reputation: 631Reputation: 631
My mistake. I answered my own question by re-reading the post.

Last edited by Randicus Draco Albus; 07-23-2018 at 09:23 AM.
 
Old 07-23-2018, 11:30 AM   #6
rufwoof
Member
 
Registered: Nov 2017
Distribution: Debian Desktop; OpenBSD Server
Posts: 65

Original Poster
Rep: Reputation: Disabled
Hi fatmac. I used WinXP up until support was dropped. I then moved over to Debian stable. What with SystemD and later releases not working as well for me ... I moved over to OpenBSD. In both cases initially dual booting for a while, but then making a total transition.

If you're OK with vi/vim for maintaining your private stuff. then having tmux running as root (I also run ranger as my file manager/launcher within one of the tmux windows) with multiple full screen windows, alongside your browser also running such that you can alt-tab between the two. Works really well for me personally, and having vi/tmux/ssh (scp etc.) type 'skills' comes in handy if/when you start running things on separate boxes or from different devices.

I've dug out and set up a old single core celeron as a OpenBSD server, so from my desktop system I can be connected to that as just another tmux window. I did try FreeBSD for a while, but by comparison OpenBSD is way way easier to setup and be up and running, mostly with just minor config tweaks (otherwise pretty much the default settings). I very much like how the OpenBSD experts have set sensible defaults out of the box.

I used to spend way too much time making the desktop look nice, and then changing things around again. Really though its just a program launcher. cwm puts that into perspective and pretty much keeps out of the way whilst being very easy to use once you've memorised a few key codes. Similar for ranger, I love how it structures the view and you can see into things (files/folders) and move up/down the current folder, or left/right up/down directory trees. Whilst it is highly flexible and potentially complex, I tend to just use a few keycodes, up/down arrows, r to 'run using' predominately. For cwm mostly I just use alt-ctrl m to maximise windows (I tend to avoid having more than one window per pane and instead just flip between panes), along with alt-shift / (questionmark) to show the 'exec' option and type the first two or three letters of the program I want to run and press enter to run it. Similar for vi, whilst some know many keycode to do clever things, I get by using just a small set of codes myself.
 
Old 07-23-2018, 02:52 PM   #7
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 2,679

Rep: Reputation: Disabled
I use AntiX, mainly in the morning, on a netbook to read my emails, etc.

Worth a look if you still want a L/W Linux system.

I usually put mc on my machines if it isn't already in the distro, best command line file manager/editor/extractor, been using it for years now.
 
Old 07-25-2018, 10:14 AM   #8
rufwoof
Member
 
Registered: Nov 2017
Distribution: Debian Desktop; OpenBSD Server
Posts: 65

Original Poster
Rep: Reputation: Disabled
I did briefly look at antix a while back, predominately however I toyed around with Puppy Linux and stuck with Debian as my main workhorse. I've since migrated pretty much 100% over to OpenBSD as both my desktop and server now. Still familiarising myself with OBSD but by comparison is way way easier to configure and comes with sensible/secure configuration out of the box. I've also used mc before, but not a great fan myself, I'm finding that ranger is more to my liking.

pkg_add ranger w3m
and using ranger as a file manager within a tmux window is pretty neat. You can navigate around directories/files using left/right/up/down arrow keys and I have mine set to show previews of images in addition to ranger showing previews of text files. I also pkg_add vim so right arrow on a file takes you into the vim editor (or asks what you want to open the file with). You can alternatively press the r for run with question. I leave iridium running so for instance if a pdf file I just type iri and press tab to autocomplete iridium, and then press enter and up pops the pdf in a iridium browser tab. w3m is needed for image displaying in ranger's preview pane.

Code:
#!/bin/sh
#
# 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 diary and load diary
# (as root, as my diary is owned by root)
tmux new -s work -d
tmux rename-window -t work diary
tmux send-keys -t work 'su - root -c "vi /home/user/bin/diary"' C-m

# Add another tmux window, rename it to ranger and load ranger
tmux new-window -t work
tmux rename-window -t work ranger
tmux send-keys -t work 'ranger --cmd="set preview_images true" --cmd="set show_hidden true"' C-m
# requires pkg_add w3m (textual web browser) for image previews

# 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
In addition to running iridium & in my .xinitrc I've added a call to the above script, which also loads my (text based) diary (that I store under root for separation from the browser that runs as user). So the default 'desktop' after startup is iridium running along with tmux so I can alt-tab between those two and where the browser might have multiple tabs open, and tmux has multiple windows open, that I tend to leave all of those maximised and that I step between using next-window (I've set that to be the F1 key). Workflow wise its really quick/flexible and without having to remember a load of keycode combinations.

Conceptually I mentally associate the tmux side of things as being root owned private/personal data and system admin type (non internet) functions, and the browser running as root as being the rest, predominately internet (insecure) facing activities.

Last edited by rufwoof; 07-25-2018 at 10:22 AM.
 
Old 07-25-2018, 10:33 AM   #9
rufwoof
Member
 
Registered: Nov 2017
Distribution: Debian Desktop; OpenBSD Server
Posts: 65

Original Poster
Rep: Reputation: Disabled
Might just be my wonky eyes, however the default colours for vim ... to me make it look like there's some 3D type depth i.e. where the comments/blue text looks deeper into the screen than the red text.
Attached Thumbnails
Click image for larger version

Name:	vim.png
Views:	45
Size:	143.1 KB
ID:	28222  
 
Old 07-25-2018, 06:00 PM   #10
TheTKS
Member
 
Registered: Sep 2017
Location: Canada
Distribution: Slackware, Ubuntu, elementary, Puppy, TinyCore, OpenBSD
Posts: 48

Rep: Reputation: Disabled
Quote:
Originally Posted by rufwoof View Post
Might just be my wonky eyes, however the default colours for vim ... to me make it look like there's some 3D type depth i.e. where the comments/blue text looks deeper into the screen than the red text.
Do you wear glasses? If so, try looking at that screen with and without them.

I'm nearsighted and I get the depth effect when wearing my glasses, but not when not, with my eyes at the same distance from the screen in both cases. I've noticed this before, with bifocals now as well as before bifocals.

I would be interested if anybody had an explanation for it. I can guess, but don't know optics well enough
 
Old 07-26-2018, 02:21 PM   #11
rufwoof
Member
 
Registered: Nov 2017
Distribution: Debian Desktop; OpenBSD Server
Posts: 65

Original Poster
Rep: Reputation: Disabled
With glasses its pronounced. Without glasses its a blur. Sort of still see some depth without glasses, but nowhere near as pronounced.

I still see similar effects with and without glasses when looking at this https://www.financialwisdomforum.org...r-rotation.gif (other than again, one is more blurred than the other).

https://www.theguardian.com/children...rd-eye-benders

Last edited by rufwoof; 07-26-2018 at 02:27 PM.
 
Old 07-27-2018, 05:15 PM   #12
rufwoof
Member
 
Registered: Nov 2017
Distribution: Debian Desktop; OpenBSD Server
Posts: 65

Original Poster
Rep: Reputation: Disabled
Been tweaking the console side of things.

Added ...

Code:
[ -z $TMUX ] && [ -z $DISPLAY ] && TERM=pccon0 
export TERM
to the end of /root/.profile

/root/.tmux.conf contains

Code:
bind-key -n F12 next-window
bind-key -n F11 new-window

#hilite current window
set-window-option -g window-status-current-bg red
set-window-option -g window-status-current-fg yellow
pkg_add mc ... and set that to have a tree left pane, gotar theme

I have

Code:
sndiod_flags=-s default -m play,mon -s mon
in /etc/rc.conf.local as per https://www.openbsd.org/faq/faq13.html#recordmon so that all sound sources are combined ... so that when I play a video in my X session, but then ctrl-alt-f4 and login to root at the console and run tmux and then run mc within that tmux window, sounds continue to still be heard. Nice thing about running tmux in the console is you can scroll and open up additional windows ...etc.

so my root console session looks very like the attached (that's actually a image of the same setup under X as I can't take a snapshot of the console. In console the fonts aren't as nice)

Concept being that I store all personal/private docs/data under root and access that via the console, the rest (browser etc.) run under userid user in a X session. And I ctrl-alt-Fn flip between the two. I've removed user from the wheel group for that extra bit of protection.
Attached Thumbnails
Click image for larger version

Name:	tmux-mc.png
Views:	35
Size:	136.7 KB
ID:	28229  
 
Old 07-29-2018, 11:24 AM   #13
rufwoof
Member
 
Registered: Nov 2017
Distribution: Debian Desktop; OpenBSD Server
Posts: 65

Original Poster
Rep: Reputation: Disabled
So using user to login to X and run internet facing activities (browser, irc, mail ...etc.) and running cli with tmux and mc/calcurse (diary) under root for my personal files (so they're isolated from root). I use ctrl-alt-Fn keycode to switch between those sessions. A dark-hat (hacker) would have to break out of the browser (or whatever) and then privilege elevate to root in order for it to be game over.

But what about securing data so if your PC/laptop was stolen your private data still remains hidden (encrypted). I'm using a simple setup, using a encrypted filesystem file, in my case 2GB, created using

dd if=/dev/urandom of=/home/efs.img bs=1M count=2048

then associating that filesystem file to a virtual device and encryption key

vncontrol -ck vnd0 /home/efs.img
(and entering a password when prompted)

and then preparing that fs

newfs vnd0c

(note that I didn't use disklabel to slice the fs up, I've just left it at the default of all space being allocated to slice c).

I then mount it

mkdir /efs
chown root:wheel /efs
chmod go-wrx /efs
mount /dev/vnd0c /efs

and change/whatever files under /efs, before umounting it and freeing the virtual device using

umount /efs
vnconfig -u vnd0

Once you've done that once, you only have to subsequently run

vncontrol -ck vnd0 /home/efs.img
(and enter the password when prompted)
and
mount /dev/vnd0c /efs

... doing stuff as desire

and then
cd
sync
umount /efs
vnconfig -u vnd0

once you're done to ummount the filesystem and free the virtual device.

In my case I have no other virtual devices being used so the above is all for vnd0. OBSD supports up to four such virtual devices and you can list them using vncongif -l

Why use a encrypted file filesystem instead of full disk encryption? Because it still encrypts your files/data, but leaves the remainder of the system apparently open. Some countries now have laws where they can detain you until you disclose passwords. If when crossing a border control your laptop system is open and the encrypted single file electronically transferred once at your destination then that is safer than perhaps having to reveal your files content at the border. Under OBSD you don't have to worry about swap copies as OBSD encrypts swap and clears out copies as part of the default setup.

Last edited by rufwoof; 07-30-2018 at 07:58 AM.
 
Old 08-01-2018, 06:52 PM   #14
rufwoof
Member
 
Registered: Nov 2017
Distribution: Debian Desktop; OpenBSD Server
Posts: 65

Original Poster
Rep: Reputation: Disabled
Adding to the end of .profile

Code:
PS1="\[\e[34;1m\]Pwd: \[\e[36m\]\w\n\[\e[31;1m\]\u@\h> \[\e[32m\]"
yields a nice colourful prompt and green console text (also shows the current directory in blue above the prompt).
 
Old 08-02-2018, 01:55 AM   #15
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 9,966
Blog Entries: 7

Rep: Reputation: 2453Reputation: 2453Reputation: 2453Reputation: 2453Reputation: 2453Reputation: 2453Reputation: 2453Reputation: 2453Reputation: 2453Reputation: 2453Reputation: 2453
Quote:
Originally Posted by rufwoof View Post
Theo likes Iridium web browser https://marc.info/?l=openbsd-misc&m=152872551609819&w=2 ... good enough for me
i fail to find any mention of iridium in that post?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Are there cwm users? Beginner ask for help igadoter Slackware 9 03-24-2018 11:08 AM
NGK Laser Iridium Fixit7 General 3 01-05-2016 03:39 PM
[SOLVED] Help with CWM & Tint2 EurekaHeSaid Linux - Desktop 1 04-21-2015 10:39 AM
Dijistra Shortest Path over iridium in ns2 Moxammed Linux - Software 0 12-04-2013 06:44 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 12:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration