update
[configs.git] / debian-config.txt
1 - enable non-free in sources.list
2   needed for firmwares
3
4 deb http://deb.debian.org/debian/ buster main non-free
5 deb-src http://deb.debian.org/debian/ buster main
6
7 deb http://security.debian.org/debian-security buster/updates main non-free
8 deb-src http://security.debian.org/debian-security buster/updates main
9
10 # buster-updates, previously known as 'volatile'
11 deb http://deb.debian.org/debian/ buster-updates main non-free
12 deb-src http://deb.debian.org/debian/ buster-updates main
13
14 deb http://deb.debian.org/debian buster-backports main
15
16 - install firmwares
17
18   apt install firmware-amd-graphics firmware-iwlwifi firmware-realtek
19
20 - install new kernel (needed for amd gpu)
21
22   apt install linux-image-5.2.0-0.bpo.3-amd64
23
24 - firefox
25
26   - cookie autodelete
27   - ublock origin
28
29 - usual packages
30
31   emacs gcc make meson mutt tmux clang git xcscope-el elpa-magit git-el \
32   isync msmtp-mta cmake python3 libsecret-tools linux-cpupower powertop \
33   lm-sensors tor ripperx freecad gdb gimp adb smbclient cifs-utils pidgin \
34   unison audacity borgbackup
35
36 - sudo
37
38   adduser zer0 sudo
39
40 - gpg
41
42   copy private key in .gnupg
43
44 - gnome3
45
46   # list all shortcuts
47   gsettings list-recursively | grep -E 'keybindings|media-keys'
48
49   gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Super>ampersand']"
50   gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-2 "['<Super>eacute']"
51   gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-3 "['<Super>quotedbl']"
52   gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-4 "['<Super>apostrophe']"
53   gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['<Super>parenleft']"
54   gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-6 "['<Super>minus']"
55   gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-7 "['<Super>egrave']"
56   gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-8 "['<Super>underscore']"
57   gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-9 "['<Super>ccedilla']"
58
59   gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-1 "['<Super><Shift>ampersand']"
60   gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-2 "['<Super><Shift>eacute']"
61   gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-3 "['<Super><Shift>quotedbl']"
62   gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-4 "['<Super><Shift>apostrophe']"
63   gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-5 "['<Super><Shift>parenleft']"
64   gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-6 "['<Super><Shift>minus']"
65   gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-7 "['<Super><Shift>egrave']"
66   gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-8 "['<Super><Shift>underscore']"
67   gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-9 "['<Super><Shift>ccedilla']"
68
69   gsettings set org.gnome.mutter dynamic-workspaces false
70   gsettings set org.gnome.desktop.wm.preferences num-workspaces 9
71
72   gsettings set org.gnome.desktop.wm.keybindings panel-run-dialog "['<Super>r']"
73   gsettings set org.gnome.mutter overlay-key ""
74
75   gsettings set org.gnome.desktop.wm.keybindings cycle-windows "['<Super>Tab']"
76   gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Alt>Tab']"
77
78   gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['disabled']"
79   gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "['disabled']"
80
81   # enable workspace indicator, auto-move windows, alternate tab
82   gnome-tweaks
83
84   in settings, create a new shortcut for terminal emulator (super-enter)
85
86   -- bullseye: need to remove some new shortcuts
87   for i in 1 2 3 4 5 6 7 8 9; do gsettings set org.gnome.shell.keybindings switch-to-application-$i []; done
88
89 - gnome3 gtile
90
91   install gnome shell extension in firefox
92
93   set super+space as main shortcut
94
95 - gnome3 disable workspace popup
96
97   https://extensions.gnome.org/extension/959/disable-workspace-switcher-popup/
98
99 - gnome3 no title bar
100
101   instead of an extension:
102   https://joshtronic.com/2017/07/26/hide-title-bars-in-gnome-shell/
103   update .config/gtk-3.0/gtk.css
104
105 - gnome3: legacy system tray (for pidgin)
106
107   install topicons plus
108   disable "normal" notifications in gnome settings
109
110 - gnome3: improved workspace indicator
111
112 - load xresources at startup
113
114   # with +x perms
115   zer0@platinum:~$ cat bin/load-xresources.sh
116   xrdb -merge ~/.Xresources
117   xset r rate 200 30
118
119   zer0@platinum:~$ cat .config/autostart/load-xresources.desktop
120   [Desktop Entry]
121   Name=load-xresources
122   GenericName=load-xresources
123   Comment=load Xresources with xrdb, and set the kbd rate
124   Exec=~/bin/load-xresources.sh
125   Terminal=false
126   Type=Application
127   X-GNOME-Autostart-enabled=true
128
129 - pidgin
130
131   update
132   /usr/share/pixmaps/pidgin/tray/hicolor/22x22/status/pidgin-tray-available.png
133
134 - etc/hosts
135
136   add "127.0.0.1 glum"
137
138 - msmtp
139
140   dans ~/.msmtprc
141
142 defaults
143
144 account 6wind
145 tls on
146 port 587
147 from olivier.matz@6wind.com
148 host smtp.gmail.com
149 domain 6wind.com
150 aliases /etc/aliases
151 logfile /var/log/msmtp
152 auth on
153 user olivier.matz@6wind.com
154 password XXXX
155
156 account default
157 tls on
158 port 587
159 auto_from on
160 host mail.droids-corp.org
161 domain droids-corp.org
162 maildomain droids-corp.org
163 aliases /etc/aliases
164 logfile /var/log/msmtp
165 auth on
166 user zer0
167 password XXXX
168
169 - rcfiles
170
171 https://www.digitalocean.com/community/tutorials/how-to-use-git-to-manage-your-user-configuration-files-on-a-linux-vps
172
173 - passwords
174
175
176 $ secret-tool store --label=Google type google user olivier.matz@6wind.com
177 $ secret-tool lookup type google user olivier.matz@6wind.com
178 test
179
180 seahorse to show them in as gui
181
182 - set default editor
183
184 cat > /usr/local/bin/e << EOF
185 #!/bin/sh
186 emacs -nw "$@"
187 EOF
188
189 chmod a+x /usr/local/bin/e
190
191 update-alternatives --install /usr/bin/editor editor /usr/local/bin/e 10
192 update-alternatives --install /usr/bin/editor editor /usr/local/bin/e 10
193 update-alternatives --set editor /usr/local/bin/e
194
195 - powersaving
196
197 don't know how to change thresholds for fan control, so switch to
198 powersave, it avoids the fan to start when doing usual tasks
199
200 modprobe cpufreq_powersave
201 cpupower -c all frequency-set -g powersave
202 sensors
203
204 #disable all cpus but 0
205 for x in /sys/devices/system/cpu/cpu[1-9]*/online; do
206   echo 0 >"$x"
207 done
208
209
210 cat << EOF | sudo tee /etc/systemd/system/powertop.service
211 [Unit]
212 Description=PowerTOP auto tune
213
214 [Service]
215 Type=oneshot
216 Environment="TERM=dumb"
217 RemainAfterExit=true
218 ExecStart=/usr/sbin/powertop --auto-tune
219
220 [Install]
221 WantedBy=multi-user.target
222 EOF
223
224 systemctl daemon-reload
225 systemctl enable powertop.service
226
227
228 - pinning
229
230 /etc/apt/preferences
231
232 # note: do not use names like "jessie" with a=, use n= in that case --OM
233
234 Package: *
235 Pin: release a=testing
236 Pin-Priority: -10
237
238 Package: *
239 Pin: release a=unstable
240 Pin-Priority: -10
241
242 Package: *
243 Pin: release o=Debian
244 Pin-Priority: 900
245
246 and add this in /etc/apt/sources.list
247
248 # with low prio, for apt-pinning
249 deb http://ftp.fr.debian.org/debian/ testing main contrib non-free
250 deb-src http://ftp.fr.debian.org/debian/ testing main
251 deb http://ftp.fr.debian.org/debian/ unstable main contrib non-free
252 deb-src http://ftp.fr.debian.org/debian/ unstable main
253
254 - mount backup
255
256 fstab:
257 //192.168.1.12/music /backup/music cifs credentials=/etc/fstab-smb-credentials,workgroup=workgroup,rw,vers=1.0 0 0
258 //192.168.1.12/misc /backup/misc cifs credentials=/etc/fstab-smb-credentials,workgroup=workgroup,rw,vers=1.0 0 0
259 //192.168.1.12/photos /backup/photos cifs credentials=/etc/fstab-smb-credentials,workgroup=workgroup,rw,vers=1.0 0 0
260
261 /etc/fstab-smb-credentials:
262 username=zer0
263 password=...
264
265
266 - mouse
267
268   https://unix.stackexchange.com/questions/422470/how-to-set-device-specific-mouse-settings-in-wayland-under-libinput-debian-gnom
269   https://wayland.freedesktop.org/libinput/doc/1.4.0/faq.html#faq_config_options
270
271   libinput debug-events
272
273   apt install libevdev-tools evemu-tools
274   evemu-describe
275   mouse-dpi-tool /dev/input/event
276
277   e /lib/udev/hwdb.d/70-mouse.hwdb  -> 71-mouse.hwdb
278   # Logitech G400 (Wired)
279   mouse:usb:v046dpc245:name:Logitech Gaming Mouse G400:*
280   # MOUSE_DPI=3600@1000
281
282   udevadm hwdb --update
283   udevadm trigger /dev/input/event3
284   udevadm info /dev/input/event3
285
286   # need to go back to gdm (ctrl-alt-f1)
287
288 - mime applications
289
290   root@platinum:/home/zer0# xdg-mime default /usr/share/applications/okularApplication_pdf.desktop application/pdf
291   root@platinum:/home/zer0# xdg-mime query default application/pdf
292   /usr/share/applications/okularApplication_pdf.desktop
293
294   for mutt (bof...)
295
296   see /etc/mailcap
297
298   order in /etc/mailcap.order:
299     okular:application/pdf
300
301   needs update of /usr/lib/mime/packages
302     grep okular /etc/mailcap > /usr/lib/mime/packages/okular
303
304   then udpated by update-mime
305
306   see https://askubuntu.com/questions/1118437/promote-evince-in-etc-mailcap-order
307
308 - xterm
309
310   for middle click copy/paste
311
312   XTerm*selectToClipboard: false
313
314 - clipboard from command line: wl-clipboard
315
316   https://github.com/bugaevc/wl-clipboard
317
318 - load xrdb at xterm start
319
320   #!/bin/sh
321   
322   START_TIME=$(ps -C Xwayland --no-headers -o lstart)
323   PREV_START_TIME=$(cat ~/.xwayland_start 2> /dev/null)
324   
325   if [ "$START_TIME" != "$PREV_START_TIME" ]; then
326         load-xresources.sh
327         echo "$START_TIME" > ~/.xwayland_start
328   fi
329   
330   exec xterm "$@"
331
332
333
334
335 TODO
336 - emacs config
337 - mutt
338 - backup
339 - transfer data from neon
340 - gnome shortcuts
341 - retrieve windows key
342 - customize firefox
343 - gpg key on yubikey
344 - start xrdb -load ~/.Xresources at session start
345   https://bugzilla.redhat.com/show_bug.cgi?id=1225384
346 - mesa >= 19.2 ?
347   https://bugs.freedesktop.org/show_bug.cgi?id=110214#c91
348 - molette souris dans xterm: scroll plutot que up/down
349 - ~/bin dans le path
350 - imapami