Linuxとwindowsの環境再構築に係るメモ

:

Linux

gnome keyring

.ssh/configの移行

ssh 秘密鍵の移行

gpg 鍵の移行

1gpg --export-secret-keys --armor > gpg-private.keys.backup # 秘密鍵のバックアップ
2gpg --export --armor > gpg-public.keys.backup # 公開鍵のバックアップ
3
4# 鍵のインポート
5gpg --import gpg-private.keys.backup
6gpg --import gpg-public.keys.backup

.config 以下のフルバックアップ

レポートデータの移行

Cmake のインストール(build essensial で入るのは古い)

apt で入るのは古かったが pacman で入るのは比較新しいかも?

xkeysnail の設定

dotfilesにある xkeysnail 関係のファイルを ~/.config/xkeysnail/以下に移植

1ln -s ~/dotfiles/xkeysnail/config.py ~/.config/xkeysnail/config.py
2ln -s ~/dotfiles/xkeysnail/start.sh ~/.config/xkeysnail/start.sh
3ln -s ~/dotfiles/xkeysnail/README.md ~/.config/xkeysnail/README.md

現状のconfig.pyの設定

 1import re
 2from xkeysnail.transform import *
 3
 4define_multipurpose_modmap({
 5    # SandS
 6    Key.SPACE: [Key.SPACE, Key.LEFT_SHIFT],
 7    # Capslock is escape when pressed and released. Control when held down.
 8    Key.CAPSLOCK: [Key.ESC, Key.LEFT_CTRL],
 9    Key.LEFT_CTRL: [Key.ESC, Key.LEFT_CTRL]
10})
11
12define_modmap({
13    Key.MUHENKAN: Key.LEFT_ALT,
14    Key.HENKAN: Key.RIGHT_ALT
15})

yaskkserv2 の設定

cargoをインストール

1git clone https://github.com/wachikun/yaskkserv2.git
2cd yaskkserv2
3cargo build --release
4cp -av target/release/yaskkserv2 /usr/local/sbin/
5cp -av target/release/yaskkserv2_make_dictionary /usr/local/bin
6
7yaskkserv2_make_dictionary --dictionary-filename=$HOME/.config/skk/dictionary.yaskkserv2 /usr/share/skk/*

yaskkserv2

Firefox の Alt 無効化設定およびフルスクリーンでのツールバー表示

Alt 無効化

about:config -> ui.key.menuAccessKeyを 0 にする。 ui.key.menuAccessKeyFocusesを false に。

フルスクリーン時のツールバー表示

browser.fullscreen.autohide を false に。

site ディレクトリの引っ越し

dein vim のインストール

autorandr のインストール

好みの設定をしたあとに autorandr -s <save name>

設定の適用はautorandr -l <save name>

モニタケーブル抜き刺し時に任意スクリプトを実行するなら ~/.config/autorandr/postswitch.d/以下にシェルスクリプト配置。

メインモニタのみ

xrandr --output eDP1 --off

デュアルモニタ

xrandr --output eDP1 --right-of HDMI1 --mode 1600x900

持ち運び

xrandr --output eDP1 --mode 1920x1080

libskk 絡みの how to

.config/libskk/rules/RULE_NAME/以下に libskk の設定ファイルのシンボリックリンクを貼って下さい。

1ln -s {~/dotfiles/libskk/,~/.config/libskk/rules/RULE_NAME/}keymap/
2ln -s {~/dotfiles/libskk/,~/.config/libskk/rules/RULE_NAME/}metadata.json
3ln -s {~/dotfiles/libskk/,~/.config/libskk/rules/RULE_NAME/}rom-kana

tlpui

実行には tlp が必要。

fish

現状のconfig.fish

 1alias pbcopy='xsel --clipboard --input'
 2alias pbpaste='xsel --clipboard --output'
 3status --is-interactive; and rbenv init - | source
 4set -x PATH $PATH /home/linuxbrew/.linuxbrew/bin/
 5set -g theme_display_date no
 6set -g theme_display_cmd_duration no
 7set -g theme_color_scheme solarized-light
 8set -Ux EDITOR (which vim)
 9if [ -n "$DESKTOP_SESSION" ]
10    set -x SSH_AUTH_SOCK /run/user/1000/keyring/ssh
11end

docker 関係の補完 https://github.com/barnybug/docker-fish-completion

Powerline フォントのインストール

1cd /tmp
2git clone https://github.com/powerline/fonts.git --depth=1
3cd fonts
4./install.sh
5cd ..
6rm -rf fonts/

fisher のインストール

1curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
2fisher add oh-my-fish/theme-bobthefish
3fisher add edc/bass # bashで書かれたシェルスクリプトを実行

i3

polybar

現状の~/.config/polybar/launch.sh

 1#!/usr/bin/env bash
 2
 3# Terminate already running bar instances
 4killall -q polybar
 5# If all your bars have ipc enabled, you can also use
 6# polybar-msg cmd quit
 7
 8# Launch bar1 and bar2
 9# polybar azukibar 2>&1 | tee -a /tmp/polybar1.log & disown
10# polybar HDMI1 2>&1 | tee -a /tmp/polybar2.log & disown
11counter=1
12if which "xrandr"; then
13  for m in $(xrandr --query | grep " connected" | cut -d" " -f1 | sort); do
14      MONITOR=$m polybar --reload azukibar 2>&1 |tee -a /tmp/polybar$(( counter )).log &
15      (( counter ++ ))
16  done
17else
18  polybar --reload azukibar &
19fi
20echo "Bars launched..." echo "Polybar launched..."

現状の~/.config/polybar/config

  1;==========================================================
  2;
  3;
  4;   ██████╗  ██████╗ ██╗  ██╗   ██╗██████╗  █████╗ ██████╗
  5;   ██╔══██╗██╔═══██╗██║  ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
  6;   ██████╔╝██║   ██║██║   ╚████╔╝ ██████╔╝███████║██████╔╝
  7;   ██╔═══╝ ██║   ██║██║    ╚██╔╝  ██╔══██╗██╔══██║██╔══██╗
  8;   ██║     ╚██████╔╝███████╗██║   ██████╔╝██║  ██║██║  ██║
  9;   ╚═╝      ╚═════╝ ╚══════╝╚═╝   ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝
 10;
 11;
 12;   To learn more about how to configure Polybar
 13;   go to https://github.com/polybar/polybar
 14;
 15;   The README contains a lot of information
 16;
 17;==========================================================
 18
 19[colors]
 20;background = ${xrdb:color0:#222}
 21background = #222
 22background-alt = #444
 23;foreground = ${xrdb:color7:#222}
 24foreground = #dfdfdf
 25foreground-alt = #555
 26primary = #ffb52a
 27secondary = #e60053
 28alert = #bd2c40
 29
 30[bar/azukibar]
 31monitor = ${env:MONITOR:}
 32width = 100%
 33height = 27
 34;offset-x = 1%
 35;offset-y = 1%
 36radius = 6.0
 37fixed-center = true
 38
 39background = ${colors.background}
 40foreground = ${colors.foreground}
 41
 42line-size = 3
 43line-color = #f00
 44
 45border-size = 4
 46border-color = #00000000
 47
 48padding-left = 0
 49padding-right = 2
 50
 51module-margin-left = 1
 52module-margin-right = 2
 53
 54font-0 = Source Han Code JP H:pixelsize=12;1
 55font-1 = FontAwesome:pixelsize=12;0
 56font-2 = Siji:style=Regular
 57
 58modules-left = i3 wlan eth wlan_bt
 59modules-center= date
 60modules-right = backlight-acpi pulseaudio memory battery cpu temperature fanspeed cpu_clock
 61
 62tray-position = right
 63tray-padding = 2
 64;tray-background = #0063ff
 65
 66;wm-restack = bspwm
 67;wm-restack = i3
 68
 69;override-redirect = true
 70
 71;scroll-up = bspwm-desknext
 72;scroll-down = bspwm-deskprev
 73
 74;scroll-up = i3wm-wsnext
 75;scroll-down = i3wm-wsprev
 76
 77cursor-click = pointer
 78cursor-scroll = ns-resize
 79
 80; for debug
 81[bar/example]
 82;monitor = ${env:MONITOR:HDMI-1}
 83width = 100%
 84height = 27
 85;offset-x = 1%
 86;offset-y = 1%
 87radius = 6.0
 88fixed-center = false
 89
 90background = ${colors.background}
 91foreground = ${colors.foreground}
 92
 93line-size = 3
 94line-color = #f00
 95
 96border-size = 4
 97border-color = #00000000
 98
 99padding-left = 0
100padding-right = 2
101
102module-margin-left = 1
103module-margin-right = 2
104
105;font-0 = fixed:pixelsize=10;1
106;font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
107;font-2 = siji:pixelsize=10;1
108
109;font-1 = FontAwesome5Free:style=Solid:size=10;4
110;font-2 = FontAwesome5Free:style=Regular:size=10;4
111;font-3 = FontAwesome5Brands:style=Regular:size=10;4
112
113;font-0 = DejavuSansMono:size=10;4
114;font-1 = NotoSansCJKJP:size=10;4
115;font-2 = FontAwesome:size=10;4
116;font-2 = Font Awesome 5 Free Regular:size=10;4
117;font-3 = Font Awesome 5 Free Solid:size=10;4
118;;;font-4 = Font Awesome 5 Brands Regular:size=10;4
119font-0 = Source Han Code JP H:pixelsize=12;1
120font-1 = FontAwesome:pixelsize=12;0
121
122modules-left = bspwm i3
123;modules-center = mpd
124modules-center=
125modules-right = filesystem backlight-acpi alsa pulseaudio xkeyboard memory cpu wlan eth battery temperature date powermenu
126
127tray-position = right
128tray-padding = 2
129;tray-background = #0063ff
130
131;wm-restack = bspwm
132;wm-restack = i3
133
134;override-redirect = true
135
136;scroll-up = bspwm-desknext
137;scroll-down = bspwm-deskprev
138
139;scroll-up = i3wm-wsnext
140;scroll-down = i3wm-wsprev
141
142cursor-click = pointer
143cursor-scroll = ns-resize
144
145[module/fanspeed]
146type = custom/script
147exec = $HOME/.config/polybar/modules/fan_speed
148interval = 3
149
150format-underline = #f90000
151label = %output% RPM
152
153[module/cpu_clock]
154type = custom/script
155exec = $HOME/.config/polybar/modules/cpu_clock
156interval = 3
157
158format-underline = #f90000
159label = %output% GHz
160
161[module/xwindow]
162type = internal/xwindow
163label = %title:0:30:...%
164
165[module/xkeyboard]
166type = internal/xkeyboard
167blacklist-0 = num lock
168
169format-prefix = " "
170format-prefix-foreground = ${colors.foreground-alt}
171format-prefix-underline = ${colors.secondary}
172
173label-layout = %layout%
174label-layout-underline = ${colors.secondary}
175
176label-indicator-padding = 2
177label-indicator-margin = 1
178label-indicator-background = ${colors.secondary}
179label-indicator-underline = ${colors.secondary}
180
181[module/filesystem]
182type = internal/fs
183interval = 25
184
185mount-0 = /
186
187label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
188label-unmounted = %mountpoint% not mounted
189label-unmounted-foreground = ${colors.foreground-alt}
190
191[module/bspwm]
192type = internal/bspwm
193
194label-focused = %index%
195label-focused-background = ${colors.background-alt}
196label-focused-underline= ${colors.primary}
197label-focused-padding = 2
198
199label-occupied = %index%
200label-occupied-padding = 2
201
202label-urgent = %index%!
203label-urgent-background = ${colors.alert}
204label-urgent-padding = 2
205
206label-empty = %index%
207label-empty-foreground = ${colors.foreground-alt}
208label-empty-padding = 2
209
210; Separator in between workspaces
211; label-separator = |
212
213[module/i3]
214type = internal/i3
215format = <label-state> <label-mode>
216index-sort = true
217wrapping-scroll = false
218
219; Only show workspaces on the same output as the bar
220;pin-workspaces = true
221
222label-mode-padding = 2
223label-mode-foreground = #000
224label-mode-background = ${colors.primary}
225
226; focused = Active workspace on focused monitor
227label-focused = %index%
228label-focused-background = ${colors.background-alt}
229label-focused-underline= ${colors.primary}
230label-focused-padding = 2
231
232; unfocused = Inactive workspace on any monitor
233label-unfocused = %index%
234label-unfocused-padding = 2
235
236; visible = Active workspace on unfocused monitor
237label-visible = %index%
238label-visible-background = ${self.label-focused-background}
239label-visible-underline = ${self.label-focused-underline}
240label-visible-padding = ${self.label-focused-padding}
241
242; urgent = Workspace with urgency hint set
243label-urgent = %index%
244label-urgent-background = ${colors.alert}
245label-urgent-padding = 2
246
247; Separator in between workspaces
248; label-separator = |
249
250
251[module/mpd]
252type = internal/mpd
253format-online = <label-song>  <icon-prev> <icon-stop> <toggle> <icon-next>
254
255icon-prev = 
256icon-stop = 
257icon-play = 
258icon-pause = 
259icon-next = 
260
261label-song-maxlen = 25
262label-song-ellipsis = true
263
264[module/xbacklight]
265type = internal/xbacklight
266output = eDP1
267format = <label> <bar>
268label = BL %percentage%%
269
270bar-width = 5
271bar-indicator = |
272bar-indicator-foreground = #fff
273bar-indicator-font = 2
274bar-fill = 
275bar-fill-font = 2
276bar-fill-foreground = #9f78e1
277bar-empty = 
278bar-empty-font = 2
279bar-empty-foreground = ${colors.foreground-alt}
280
281[module/backlight-acpi]
282inherit = module/xbacklight
283type = internal/backlight
284card = intel_backlight
285
286[module/cpu]
287type = internal/cpu
288interval = 2
289format-prefix = " "
290format-prefix-foreground = ${colors.foreground-alt}
291format-underline = #f90000
292label = %percentage%%
293
294[module/memory]
295type = internal/memory
296interval = 2
297fiormat = <label>
298format-prefix = " "
299format-prefix-foreground = ${colors.foreground-alt}
300format-underline = #4bffdc
301label = %percentage_used%%
302
303[module/wlan]
304type = internal/network
305interface = wlp2s0
306interval = 3.0
307
308format-connected = <ramp-signal> <label-connected>
309format-connected-underline = #9f78e1
310label-connected = %upspeed%↑ %essid% ↓%downspeed%
311
312;format-disconnected = <label-disconnected>
313;format-disconnected-underline = ${self.format-connected-underline}
314;label-disconnected = disconnected
315;label-disconnected-foreground = ${colors.foreground-alt}
316
317ramp-signal-0 = 
318ramp-signal-1 = 
319ramp-signal-2 = 
320ramp-signal-3 = 
321ramp-signal-4 = 
322ramp-signal-foreground = ${colors.foreground-alt}
323
324[module/wlan_bt]
325type = internal/network
326interface = bnep0
327interval = 3.0
328
329format-connected = <ramp-signal> <label-connected>
330format-connected-underline = #9f78e1
331label-connected = %upspeed%↑ bluetooth essid% ↓%downspeed%
332
333;format-disconnected = <label-disconnected>
334;format-disconnected-underline = ${self.format-connected-underline}
335;label-disconnected = disconnected
336;label-disconnected-foreground = ${colors.foreground-alt}
337
338ramp-signal-0 = 
339ramp-signal-1 = 
340ramp-signal-2 = 
341ramp-signal-3 = 
342ramp-signal-4 = 
343ramp-signal-foreground = ${colors.foreground-alt}
344
345[module/eth]
346type = internal/network
347interface = enp1s0
348interval = 3.0
349
350format-connected-underline = #55aa55
351format-connected-prefix = " "
352format-connected-prefix-foreground = ${colors.foreground-alt}
353label-connected = %upspeed%↑ %local_ip% ↓%downspeed%
354format-disconnected =
355;format-disconnected = <label-disconnected>
356;format-disconnected-underline = ${self.format-connected-underline}
357;label-disconnected = %ifname% disconnected
358;label-disconnected-foreground = ${colors.foreground-alt}
359
360[module/date]
361type = internal/date
362interval = 1
363
364date = " %Y-%m-%d (%a)"
365
366time = %H:%M:%S
367
368format-prefix = 
369format-prefix-foreground = ${colors.foreground-alt}
370format-underline = #0a6cf5
371
372label = %date% %time%
373
374[module/pulseaudio]
375type = internal/pulseaudio
376
377format-volume = <label-volume> <bar-volume>
378label-volume = VOL %percentage%%
379label-volume-foreground = ${root.foreground}
380
381label-muted = muted
382label-muted-foreground = #666
383
384bar-volume-width = 5
385bar-volume-foreground-0 = #55aa55
386bar-volume-foreground-1 = #55aa55
387bar-volume-foreground-2 = #55aa55
388bar-volume-foreground-3 = #55aa55
389bar-volume-foreground-4 = #55aa55
390bar-volume-foreground-5 = #f5a70a
391bar-volume-foreground-6 = #ff5555
392bar-volume-gradient = false
393bar-volume-indicator = |
394bar-volume-indicator-font = 2
395bar-volume-fill = 
396bar-volume-fill-font = 2
397bar-volume-empty = 
398bar-volume-empty-font = 2
399bar-volume-empty-foreground = ${colors.foreground-alt}
400
401[module/alsa]
402type = internal/alsa
403
404format-volume = <label-volume> <bar-volume>
405label-volume = VOL
406label-volume-foreground = ${root.foreground}
407
408format-muted-prefix = " "
409format-muted-foreground = ${colors.foreground-alt}
410label-muted = sound muted
411
412bar-volume-width = 10
413bar-volume-foreground-0 = #55aa55
414bar-volume-foreground-1 = #55aa55
415bar-volume-foreground-2 = #55aa55
416bar-volume-foreground-3 = #55aa55
417bar-volume-foreground-4 = #55aa55
418bar-volume-foreground-5 = #f5a70a
419bar-volume-foreground-6 = #ff5555
420bar-volume-gradient = false
421bar-volume-indicator = |
422bar-volume-indicator-font = 2
423bar-volume-fill = 
424bar-volume-fill-font = 2
425bar-volume-empty = 
426bar-volume-empty-font = 2
427bar-volume-empty-foreground = ${colors.foreground-alt}
428
429[module/battery]
430type = internal/battery
431battery = BAT0
432adapter = AC
433full-at = 98
434
435format-charging = <animation-charging> <label-charging>
436format-charging-underline = #ffb52a
437
438format-discharging = <animation-discharging> <label-discharging>
439format-discharging-underline = ${self.format-charging-underline}
440
441format-full-prefix = " "
442format-full-prefix-foreground = ${colors.foreground-alt}
443format-full-underline = ${self.format-charging-underline}
444
445label-charging = %percentage%%
446label-discharging = Discharging %percentage%% %time%
447
448ramp-capacity-0 = 
449ramp-capacity-1 = 
450ramp-capacity-2 = 
451ramp-capacity-foreground = ${colors.foreground-alt}
452
453animation-charging-0 = 
454animation-charging-1 = 
455animation-charging-2 = 
456animation-charging-foreground = ${colors.foreground-alt}
457animation-charging-framerate = 750
458
459animation-discharging-0 = 
460animation-discharging-1 = 
461animation-discharging-2 = 
462animation-discharging-foreground = ${colors.foreground-alt}
463animation-discharging-framerate = 750
464
465[module/temperature]
466type = internal/temperature
467thermal-zone = 0
468warn-temperature = 80
469
470format = <ramp> <label>
471format-underline = #f50a4d
472format-warn = <ramp> <label-warn>
473format-warn-underline = ${self.format-underline}
474
475hwmon-path=/sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input
476
477label = %temperature-c%
478label-warn = %temperature-c%
479label-warn-foreground = ${colors.secondary}
480
481ramp-0 = 
482ramp-1 = 
483ramp-2 = 
484ramp-foreground = ${colors.foreground-alt}
485
486[module/powermenu]
487type = custom/menu
488
489expand-right = true
490
491format-spacing = 1
492
493label-open = 
494label-open-foreground = ${colors.secondary}
495label-close =  cancel
496label-close-foreground = ${colors.secondary}
497label-separator = |
498label-separator-foreground = ${colors.foreground-alt}
499
500menu-0-0 = reboot
501menu-0-0-exec = menu-open-1
502menu-0-1 = power off
503menu-0-1-exec = menu-open-2
504
505menu-1-0 = cancel
506menu-1-0-exec = menu-open-0
507menu-1-1 = reboot
508menu-1-1-exec = sudo reboot
509
510menu-2-0 = power off
511menu-2-0-exec = sudo poweroff
512menu-2-1 = cancel
513menu-2-1-exec = menu-open-0
514
515[settings]
516screenchange-reload = true
517;compositing-background = xor
518;compositing-background = screen
519;compositing-foreground = source
520;compositing-border = over
521;pseudo-transparency = false
522
523[global/wm]
524margin-top = 5
525margin-bottom = 5
526
527; vim:ft=dosini
528

rofi

インストールするだけ。

cron の引っ越し

現状予定無し。

proxy 設定

1alias set-proxy "bass source switch_proxy.sh"
2funcsave set-proxy

今のswitch_proxyの中身。

 1#!/bin/env bash
 2file=/etc/apt/apt.conf
 3proxy_address="http://proxy.uec.ac.jp:8080"
 4grep -e '^\#' $file >/dev/null
 5if [ $? -ne 0 ];then
 6    sudo sed -i -e 's/\(.*\)/\#\1/g' $file
 7    export -n HTTP_PROXY
 8    export -n HTTPS_PROXY
 9    export -n http_proxy
10    export -n https_proxy
11    git config --global --unset http.proxy
12    git config --global --unset https.proxy
13    git config --global --unset url."https://github.com/".insteadOf git@github.com:
14    git config --global --unset url."https://".insteadOf git://
15    echo proxy on to off
16else
17    sudo sed -i -e 's/^\#\(.*\)/\1/g' $file
18    export HTTP_PROXY=$proxy_address
19    export HTTPS_PROXY=$proxy_address
20    export http_proxy=$proxy_address
21    export https_proxy=$proxy_address
22    git config --global http.proxy $proxy_address
23    git config --global https.proxy $proxy_address
24    git config --global url."https://".insteadOf git://
25    git config --global url."https://github.com/".insteadOf git@github.com:
26    echo proxy off to on
27fi
28

dotfiles のシンボリックリンク作成

LaTeX 絡み

 1#!/usr/bin/perl
 2
 3$latex     = 'uplatex %O -kanji=utf8 -synctex=1 -interaction=nonstopmode -file-line-error %S';
 4$xelatex   = 'xelatex %O -no-pdf -synctex=1 -shell-escape -interaction=nonstopmode %S';
 5$lualatex  = 'lualatex -shell-escape -synctex=1 -interaction=nonstopmode';
 6
 7$bibtex    = 'upbibtex %O %B';
 8$biber     = 'biber %O --bblencoding=utf8 -u -U --output_safechars %B';
 9$dvipdf    = 'dvipdfmx %O -o %D %S';
10$makeindex = 'upmendex %O -o %D %S';
11$pdf_mode  = '3'; # .tex -> .dvi -> .pdf

cups

設定はhttp://localhost:631

flameshot

インストールするだけ。

scanner util gscan2pdf

scansnap fi-5110eox2 は linux の汎用ドライバで使える。 書類の終点近くが切れるので A4 の縦幅を 300mm くらいにすると良い。

avahi

avahi-daemon入れればいいと思う。

ティアリングの設定

i3wm は勝手に設定をしてくれない。 自分でやること。

Windows

写真データのバックアップ

windows 10 のライセンスキー確認

Office のライセンス確認