LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 06-26-2022, 10:36 AM   #1
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 687
Blog Entries: 1

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
NetBSD Hints


Moved from BSD Screenshots. Just hints I have from playing with NetBSD, maybe others can add items here as time goes on.

HTH:

For suspend, did you see this netbsd.org ?

For 2 finger scrolling, try adding this to xorg.conf

Code:
Section "InputDevice"
        Identifier  "Mouse0"
	Driver      "mouse"
	Option      "Protocol" "wsmouse"
	Option      "Device" "/dev/wsmouse"
	Option      "ZAxisMapping" "4 5 6 7"
	Option      "EmulateWheel" "true"
	Option      "EmulateWheelButton" "2"
	Option      "XAxisMapping" "6 7"
	Option      "YAxisMapping" "4 5"
EndSection

Last edited by jmccue; 06-26-2022 at 10:45 AM.
 
Old 06-27-2022, 09:26 AM   #2
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 687

Original Poster
Blog Entries: 1

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Just stopping this from being 'marked as zero'
 
Old 07-01-2022, 02:46 PM   #3
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
Nice!

I'm getting quite used to using page up/down and arrow up/down however, on my laptop both of those are in a vertical line of keys to the far right. Or space and shift-space. Or a combination of both, left hand thumb on spacebar to scroll down, right hand index finger on page up to scroll up.
 
Old 07-01-2022, 02:56 PM   #4
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
I don't really bother with suspend as I tend to vnc into a linux box for my gui desktop/programs (such as chrome, libreoffice ..etc.). So mostly just boot netbsd and fire up vncviewer to connect into that always on (server) desktop.

I find the best choice is to install tigervnc on both boxes and run x0vncserver on the server, that way for me has videos/youtubes play as well via vnc (same lan) as if played directly.

My linux server is a read only contained system, so a reboot has it back to pristine/clean again, so any virus caught whilst surfing only persist for that session, are automatically eradicated after a restart. Whilst my data files on the NetBSD laptop are secure in that the only outside communications layer is the vncviewer session, which is just basically a pixed read/write activity. No risk of ransomware or suchlike.

All of OpenBSD additional security was pretty much wasted in my usage case, unnecessary overheads. I'm very much liking NetBSD's quickness in comparison.
 
Old 07-01-2022, 06:52 PM   #5
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
Another source of hints

such as .shrc tips
 
1 members found this post helpful.
Old 07-02-2022, 03:33 AM   #6
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
Small tty font

I find the ctrl-alt-Fn (tty) fonts too small for my liking, but do like that smaller font for the initial bootup (can see more of what messages might have been indicated). So in .shrc or .profile or wherever alongside setting my keyboard to gb

setxkbmap gb

I also set a larger font
Code:
if [ ! -z $(tty | grep tty) ]; then
   /sbin/wsconsctl -f $(tty) -dw font="Boldface 16x32"
fi
which on my 1366x768 laptop has the tty look more like a regular 80x25 display rather than squint-to-view micro-text.

Last edited by rufwoof; 07-02-2022 at 08:10 AM. Reason: Had entered 16x62 instead of 16x32
 
1 members found this post helpful.
Old 07-02-2022, 07:39 AM   #7
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 687

Original Poster
Blog Entries: 1

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
rufwoof -

Thank You, I have been looking for that, I had it a long time ago but lost my notes and I could not find this setting in google. I am now using it!
 
1 members found this post helpful.
Old 07-02-2022, 08:02 AM   #8
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
Quote:
Originally Posted by jmccue View Post
rufwoof -

Thank You, I have been looking for that, I had it a long time ago but lost my notes and I could not find this setting in google. I am now using it!
There's probably a better way of doing the is tty test than my crude $(tty | grep tty) - but it does the job
 
Old 07-02-2022, 08:08 AM   #9
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
Quote:
Originally Posted by jmccue View Post
Moved from BSD Screenshots. Just hints I have from playing with NetBSD, maybe others can add items here as time goes on.

HTH:

For suspend, did you see this netbsd.org ?

For 2 finger scrolling, try adding this to xorg.conf

Code:
Section "InputDevice"
        Identifier  "Mouse0"
	Driver      "mouse"
	Option      "Protocol" "wsmouse"
	Option      "Device" "/dev/wsmouse"
	Option      "ZAxisMapping" "4 5 6 7"
	Option      "EmulateWheel" "true"
	Option      "EmulateWheelButton" "2"
	Option      "XAxisMapping" "6 7"
	Option      "YAxisMapping" "4 5"
EndSection
Tried that - but didn't work for my laptop touchpad.

First off I had no xorg.conf so used X -configure ... to generate one, but startx didn't work with that so I removed that /etc/xorg.conf and started X and extracted the default Screen settings being used for that (working) version (from /var/log/Xorg.1.log) and edited the xorg.conf to use those instead ... which worked OK. I then added those additional elements to the Mouse section, but touchpad behavior remains the same (no two finger scrolling). As I said before, not really a bother for me as page or arrow up/down works fine. More of a issue is that light touching of the touchpad invokes a click or mouse cursor move action which can be a bother at times when typing.

Last edited by rufwoof; 07-02-2022 at 08:37 AM. Reason: extended to include /var/log/Xorg.1.log
 
Old 07-02-2022, 08:28 AM   #10
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
screenshots

I have just base NetBSD installed, with pkgin and tigervnc the only other things installed on top of that.

For screenshots I use xwd -root >file.xwd, or with a delayed snapshot using
sleep 10;xwd -root >file.xwd

I then scp that over to my server and use gimp to open that file and Export it as a png (and a jpg ... and pick whichever is the smaller filesize as the version to use/upload).

Others I see pipe the xwd file through 'convert' - but that requires additional packages to be installed.

Alternatively there are online converters, a quick search for example indicated https://convertio.co/xwd-png/ ... but I haven't actually tried that.

Then to upload to a post, select the post editor choice that has the additional options and simply select and then upload that file, before closing the attach files window and the image should be visible as an attachement.
Attached Thumbnails
Click image for larger version

Name:	shot.jpg
Views:	4
Size:	177.1 KB
ID:	39203  
 
Old 07-02-2022, 08:34 AM   #11
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
battery charge/CPU temperature

For cli based indication of your battery charge and/or cpu temperature ...etc - just run ...

envstat
 
Old 07-02-2022, 03:18 PM   #12
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
Update CPU Microcode on NetBSD

https://retrobsd.ddns.net/57fd9.htm

... and other tips (Click the RetroBSD Net label in the top left corner)
 
Old 07-02-2022, 07:04 PM   #13
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
colorls

Install colorls (pkgin install colorls) and set your preference of colors in .Xdefaults/.Xresources, create a alias ls="colorls -G" ... so ls uses colors to distinguish different files (blue for folders, red for executables ...etc.). I've also tweaked the colors in .ctwmrc
Attached Thumbnails
Click image for larger version

Name:	glow.png
Views:	13
Size:	99.4 KB
ID:	39206  
 
Old 07-03-2022, 02:27 PM   #14
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
Quote:
Originally Posted by jmccue View Post
rufwoof -

Thank You, I have been looking for that, I had it a long time ago but lost my notes and I could not find this setting in google. I am now using it!
Editing /etc/wscons.conf to include ...

setvar ttyE0 font Boldface\\\ 16x32
setvar ttyE1 font Boldface\\\ 16x32
setvar ttyE2 font Boldface\\\ 16x32
setvar ttyE3 font Boldface\\\ 16x32

is an alternative choice. Boots with the green kernel regular text mode style, switches to white smaller graphics mode system boot font, until the wscons.conf file is parsed in late boot when the Boldface larger font kicks in. Note that the three \\\ are required for correct parsing to occur.
 
Old 07-04-2022, 09:23 AM   #15
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
Low battery alert sound

Rather than clutter a ctwm desktop with a laptop battery indicator I knocked out this script that sounds an alert once the batter level declines to 33% and the system isn't connected to mains power

Code:
#!/bin/sh
#                                          NetBSD amd64 laptop low battery warning
# Uses audiocfg test 0 as a audible alert sound i.e. assumes your sound is working
#     References envstat to identify the current charge level and whether mains is
#                                                                 connected or not
#                              For simplicity converts the likes of 92.13% to 9213
#                       Hard coded to initiate sound alerts at below 3333 i.e. 33%
#                          Hard coded to wait 10 seconds seconds, between measures
#          Save as battery.sh in your home folder and run it in background in your
#                                             .xinitrc or .xsession (if using xdm)
#                                                     i.e. /home/user/battery.sh &

sleep 30                                           # wait until X has settled down
while :;do
	CHARGING=$(envstat | grep "charging:     FALSE")        # Only test if not
	if [ ! -z "$CHARGING" ];then                            #      using mains
	    LEVEL=$(envstat -d acpibat0 | grep charge: | \
                                                  awk {'print $6'} | tr -d '()%.')
	    if [ $LEVEL -lt 3333 ];then
		audiocfg test 0         # we use this as a low battery alert sound
	    fi
	fi
	sleep 10
done
 
  


Reply

Tags
netbsd



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
Tricks and hints neo77777 Linux - General 145 08-24-2009 02:38 AM
Hints on installing Slackware Jargon Slackware 2 10-19-2002 10:39 PM
Debian 3.0 Helpful hints (Hopefully) Xreagan Linux - Distributions 2 08-26-2002 12:56 PM
Hints - process myquestion Programming 2 04-15-2002 07:26 PM
gcad hints ? jamaso Linux - General 0 03-02-2002 08:27 AM

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

All times are GMT -5. The time now is 07:19 AM.

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
Open Source Consulting | Domain Registration