Friday, May 17, 2024

From (Programmers) Dvorak to (Neo) 3L

Dvorak mode: My journey learning the ThreeLayout (3L). I've decided to document my journey and capture my thoughts in a diary / journal format while going through the process. 

Why?: I enjoyed using Programmers Dvorak for the past 6 years, especially during software development sessions. However I had a few initial cons, which are the usual Vi(m) layout, and then later Emacs. Vim wasn't so bad, but when I started getting into Common Lisp, I switched back to Emacs, with Vanilla layout. As any Dvorak user can attest to, that required some finger gymnastics and became a pain after awhile. Swapping Alt with Ctrl eased that pain somewhat, and Lispy was a boon. I remembered using Xah Lee's Emacs keybindings in 2011 when I was getting into Emacs, so I decided to pick it back up, and most Emacs issues dissappeared afterwards. 

Then another issue arose, I realised that after getting in the zone (flow state) and coding for two to three hours, both pinkies were sore. While Programmer's Dvorak made reaching symbols easier, there were times when numbers needed to be interspersed during typing, sometimes a lot. I've been ignoring it for the most part for the past couple years, and it never developed into anything. Yet, it kept annoying me. Of course, an ergo keyboard would solve that issue, if I could afford it. Unfortunately, I am not in that position.

I started researching, and began seeing Colemak DH being touted as a great alternative. The thing is, I was spoilt by the ease of reaching the symbols with my strongest fingers, and Colemak DH seem to stick closely to QWERTY's symbol layout. I was on the verge of trying it out, but I also kept seeing other alternatives pop up once in a while, Neo / CarpalX / etc. The more I looked into Neo or Bone, the appeal was there, especially since it catered to programming. As I was about to give Bone a try, I saw their alternative layout section with a mention of an English focused layout, 3L. That sealed the deal for me, and the rest of this post is the result of that. 

As part of the learning process, I am going cold turkey, just as I did for Dvorak. I switched my Windows and FreeBSD bindings. The following is written solely with 3L.

3L mode

May 15th, 2024

First post typed using Three Layout, while learning, to capture my thoughts and document my progress.
  • Dvorak 1 year, Progrommers Dvorok 6 years
  • Started 3L cold turkey May 15, 2024
  • Switched Windows (ReNeo) and FreeBSD (setxkbmap us 3L) layouts
  • Using ReNeos onscreen keyboard
  • Trained on Klavaro up to level 20. Home and top rows. 

May 16th, 2024

  • I am left handed, and found it interesting that I spent more time training the left keys with more focus. Would default to Dvorak while training, but making a mistake would "reset" my fingers.
  • The right home keys flowed almost unconsciously. After checking, home row has similarities with Dvorak. e, t, n, s
  • Still confusing O with A...o lat.
  • Wrote company emails. Slow, not painful
  • Retrain up to level 20 in Klavaro. Home and top rows.

May 17th, 2024

  • Started from level 20, learning bottom rows, up to level 31
  • Turned off ReNeo on-screen keyboard and only reference for symbols. Chnfidence boosted.
  • After lvl 31, started velocity training. See results of first attempt, also compared with a quick switch over to Dvorak:

3L

Dvorak (tested immediately afterwards)

;; create a new layout
;; 3L with dead keys represented as _
(puthash "3l" "
_ 1 2 3 4 5 6 7 8 9 0 _ _
_ 1 2 3 4 5 6 7 8 9 0 _ _ 

q f u y z x k c w b _ _ \\
o h e a i d r t n s _
, m . j ; g l p v _

Q F U Y Z X K C W B _ _ _
O H E A I D R T N S _
, M . J ; G L P V _
" xah-fly-layout-diagrams)

May 18th, 2024 (After Shabbat)

  •  Just realized why typing feels strangely comfortable. Fingers are either straightened for top row or flexed for bottom row. Only index fingers are moved laterally and no over-extensions, all keys and symbols within reach.

May 19th, 2024

  • Fully committed on FreeBSD, setting my /usr/local/etc/X11/xorg.conf.d/00-keyboard.conf to:
Section "InputClass"
        Identifier "Keyboard1"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
        Option "XkbVariant" "3l"
        Option "XkbOptions" "ctrl:swap_lalt_ctl,ctl:swap_ralt_rctl,shift:both_capslock"
EndSection


May 24th, 2024

After some experimenting, decided to utilize Right-Alt as Cur key, similar to Neo based layouts and further reduce right pinky usage. Added benefit of having it act as a Cur 'lock'. Consulting man xkeyboard-config, resulted in the following XkbOptions

Option "XkbOptions" "ctrl:swap_lalt_ctl,shift:both_capslock,lv5:ralt_switch_lock"

Conclusion

WPM are steadily increasing and I am now comfortable enough using it on a daily basis, typing as low as 40 wpm. I only regress to Dvorak when I get in the flow state and start approaching 60 wpm and some of the bi-grams are still troublesome for me (ou, mo, ma, me) but I'm getting used to them.

This is definitely worth the effort of learning and the layers / levels are game changing



Wednesday, May 15, 2024

VirtualBox Virtual Networking between Guests

 Host: Windows 11

Guest 1: NixOS (Linux)

Guest 2: FreeBSD (Unix)

Reason: Needed to migrate files from NixOS to a fresh install of FreeBSD. Unfortunately, BSD was not

detecting the host's Shared Folder, so I decided to copy the file(s) the good old Unix way, SCP. As VirtualBox siloes each guest into its own network, using the default NAT setting, they do not communicate with the Host or the other Guests. Since VBox handles the networking, there are two options, either using Bridged or Internal Networking. This posts uses the Internal Networking option.

The setup for the guests are as follows; each guest will have the primary adapter (Adapter 1) set to the default NAT, and the secondary adapter (Adapter 2) set to Internal Network

Fig 1: NixOS Network Adapter 1 settings

Fig 2: NixOS Network Adapter 2 settings

Fig 3: FreeBSD Network Adapter 1 settings

Fig 4: NixOS Network Adapter 2 settings

Boot the guest VMs and check their assigned IP addresses, labelled as `inet` using `ifconfig`

 On both guests, Adapter 2 settings will be incremented by one(1), example, BSD will show `em0` as the primary and `em1` as the secondary. NixOS will auto-assign the inet and netmask, however, BSD may not. In that case, follow these steps.

  1. Determine the state of the interface with `ifconfig -d`. If the device `em1` appears as output, the interface is down. Alternatively, `ifconfig -u` will show all active network interfaces.
    1. If the interface is down, activate it (turn it on) with `ifconfig em1 up`
  2. Even though `em1` is now active, it may not have an IP address assigned. Even using DHCP, it may not have been leased an address. Either way, provide a static address with the following command
    1. `ifconfig em1 inet <ip.add.re.ss> netmask <sub.net.ma.sk>` the IP address and subnet mask were copied from Guest 1, just incremented the IP by 1. Example, Guest 1 is aaa.bbb.ccc.193, then set Guest 2 to aaa.bbb.ccc.194, keeping the subnet mask the same.
    2. Test your changes with `ifconfig em1`, and by pinging Guest 1. If your settings were accurate, then you should get a response.
  3. Ensure `sshd` is running on Guest 2. If it is, then log into Guest 1, and test it by SSHing to Guest 2. 
  4. Once logged in, disconnect and then use SCP to copy the files from Guest 1: `scp /guest1/local/file <username@guest2:/target/dir`