Since my laptop is often (dis)connected from the dock to which an Apple Keyboard is attached, I am looking for a convenient way to trigger some changes in keyboard layout through from the command line / script.
The effect I want to achieve is the same as going to System Settings -> Keyboard Layout -> Options ...
I have an Expect script that ssh's to a remote server and runs some commands before exiting.
One of the commands I run is the "hostname" Command. After I run this command I save the output
using this line in the code below...
Basically it executes the hostname command, then I loop through the "$expect_out(buffer)" variable
line by line.