-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdevblog.md.backup
217 lines (161 loc) · 8.85 KB
/
devblog.md.backup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# My Developer Blog
This will inevitably be a dumping ground of information. Previously I have used Atlassian Confluence to store this kind of information, but I really enjoy the convenience of using github to store markdown. Basically if I want to do everything from a command line there isn't an issue with this approach.
## 06-JUL-2020 Modifying regolith preferences
For i3 configuration it would appear that you need to add overrides in `.config/regolith/Xresources`.
For example:
```
i3-wm.gaps.inner.size: 2
i3-wm.bar.font: pango:JetBrains Mono Medium 11, Material Design Icons 11
```
current resources can be queried via `$ xrdb -query`.
## 05-JUL-2020 Headphone & Speaker outputs on the CF-31
Edit: `/usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf`
In the `analog-output-speaker.conf` file modify
```
[Element Headphone]
switch = off
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
```
then modify:
```
[Element Speaker]
required-any = any
switch = mute
volume = off
```
followed by a reboot.
If there is no sound output, run `pavucontrol` and ensure, on the `Output Devices` tab that the mute button isn't enabled.
## 01-JUL-2020 Brightness Control on the CF-31
I've installed the `regolith` distribution on the CF-31 to give it a go, and found that the brightness control no longer
worked, so I had to go through the pain of searching on the internet, and trying multiple options, before I got it working
again.
For the CF-31, I edited `/etc/default/grub` and added `acpi_backlight=native acpi_osi=` to the end of the `GRUB_CMDLINE_LINUX_DEFAULT` line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=native acpi_osi= "
then update grub:
```bash
$ update-grub
```
and reboot.
To install the battery indicator in the i3 bar:
```bash
$ apt search i3xrocks-
$ sudo apt install i3xrocks-battery
$ regolith-look refresh
```
## 28-JUN-2020 Emulating a 3 button mouse
The Toughbooks have a two button trackpad. It's not the best or most responsive trackpad, it could be twice the size, but it is a standard since the CF-30. With only two buttons cut-and-paste via the middle button standard doesn't worth without a tweak to `xinput` (there are various suggestions on how to do this, but these seems to be at the right level).
So the command that I need to run on the CF-30 is:
```bash
$ xinput set-prop 11 "libinput Middle Emulation Enabled" 1
```
You can determine the right device number (11 in my case) by using the command:
```bash
$ xinput --list
```
On the CF-30 this produces:
```bash
msw@cf30:~$ xinput --list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ PS/2 Generic Mouse id=11 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
↳ Fujitsu Component USB Touch Panel id=9 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
↳ Panasonic Laptop Support id=12 [slave keyboard (3)]
```
On the CF-31 Mk4 the command is slightly different:
```bash
$ xinput set-prop 12 "Evdev Middle Button Emulation" 1
```
The next problem is where to put the command so it is run as the XSession is initiating. I firstly tried some different options in my $HOME directory, for example `.xsession`, `.xprofile`, `.Xsession`, '`.xsessionrc`. I added an `echo` in the command script so that I could see it being run.
When using the `sddm` display manager and the `i3` window manager it would appear none of the options I tried worked. Upon investigation I found the command script `/etc/X11/Xsession` creates three variables:
```bash
USERXSESSION=$HOME/.xsession
USERXSESSIONRC=$HOME/.xsessionrc
ALTUSERXSESSION=$HOME/.Xsession
```
but then these are not subsequently used in the script!
In the end I added a system-wide xsession script in `/etc/X11/Xsession.d` called 76xinput-emulate-three-button-mouse:
```bash
$ xinput set-prop 11 "libinput Middle Emulation Enabled" 1
$ echo "$HOME/.xsession has run" > /home/msw/.xsession.log
```
The second debugging line then proved this script was being run upon reboot.
This kind of thing troubles me, as it means documentation that you read online about how to run a script at startup is probably not right. You may try four different techniques like I did, and none of them work. It's the benefit and curse of having lots of options in the Linux world!
## 27-JUN-2020
Had an interesting problem at work on Friday. We have a `go` program that connects to a server. When we started debugging the `http.get` call we found that a windows setting `https_proxy` was redirecting all requests to a proxy (the server was on the internal network but on a different sub-net). By unsetting the environment variable the `go` program was able to connect without issue.
## 25-JUN-2020
I continue to use the i3 window manager on both Toughbooks. The keyboard shortcuts, and the way in which you can utilise workspaces for applications makes a lot of sense and is working especially well with the limited real estate of the meagre 1024x768 resolution provided by the daylight readable screen.
I read an article on [one users' experience of switching windows](i3 – Switching Windows) with the various options available. At the bottom of the article a couple of utilities that they used to create animated screen captures were mentioned that are definitely worth investigating further, [peek](https://github.com/phw/peek) and [screenkey](https://www.thregr.org/~wavexx/software/screenkey/).
Editing markup with [ghostwriter](https://github.com/wereturtle/ghostwriter) is pretty seamless, I'm quite happy with the results at the moment!
## 22-JUN-2020
### GIT Access via SSH keys
Setting up the Toughbook CF-31 to access this blog git repository without the need for passwords.
```bash
$ ssh-add ~/.ssh/id_rsa
```
Then add the public ssh key signature file `id_rsa.pub` contents to your [github SSH keystore](https://github.com/settings/keys)
I added an alias for github.com in `~/.ssh/config` so that the right port and sub-domain are used:
```
Host github.com
Hostname ssh.github.com
Port 443
```
Test the connection and then clone the repo:
```bash
$ ssh -T [email protected]
$ git clone ssh://[email protected]/urbancamo/urbancamo.github.io
```
Committing and pushing changes:
```bash
$ git commit -m "Blog updates" . ; git push
```
### xrandr commands
Disabling the built in display when using an external monitor:
```bash
$ xrandr --output LVDS-1 --off
```
When using both the HDMI and VGA output by default the screen left-to-right order is wrong.
```bash
$ xrandr --output HDMI-1 --left-of VGA-1
```
### Touchscreen Calibration
If you need to re-calibrate the touchscreen run the command:
```bash
$ xinput_calibrator --output-type xinput
```
Add the following lines to your `.xsession` file:
```
xinput set-int-prop "Fujitsu Component USB Touch Panel" "Evdev Axis Calibration" 32 592 15661 1049 15993
xinput set-int-prop "Fujitsu Component USB Touch Panel" "Evdev Axes Swap" 8 0
```
### nmcli commands
The utility `nmci` provides the ability to control network connections from the command line.
To see a list of wireless access points:
```
$ nmcli device wifi list
IN-USE BSSID SSID MODE CHAN RATE SIGNAL BARS SECURITY
* D4:CA:6D:84:F4:A2 wickens Infra 9 270 Mbit/s 84 ▂▄▆█ WPA1 WPA2
A0:63:91:F0:34:21 WICKENS4 Infra 7 270 Mbit/s 57 ▂▄▆_ WPA2
1C:3B:F3:B5:D6:CE wickens2 Infra 2 270 Mbit/s 47 ▂▄__ WPA2
38:A6:CE:DF:E7:00 SKY8C931 Infra 11 130 Mbit/s 47 ▂▄__ WPA2
A0:63:91:F0:34:20 WICKENS5 Infra 44 270 Mbit/s 44 ▂▄__ WPA2
62:45:B6:D3:49:D0 -- Infra 149 0 Mbit/s 40 ▂▄__ WEP
38:A6:CE:B7:5A:20 SKY8C931 Infra 6 130 Mbit/s 39 ▂▄__ WPA2
F4:6B:EF:44:9F:72 GummersHow Infra 6 195 Mbit/s 19 ▂___ WPA2
```
To connect to a particular access point:
```bash
$ nmcli connection up <SSID> --ask
```
this will prompt for the wifi password.
### Markdown Editor
`ghostwriter` seems pretty good and is easy to install thanks to it being in the ubuntu/debian repository.
Finally, [Jones the cat](https://avp.fandom.com/wiki/Jones_(cat)) (just to check that `ghostwriter` image import via drag-and-drop works OK):
![](jones.png)