[{"content":"環境 ArchLinux ARM aarch64\nsystemd-networkd + dnsmasq + hostapd + ufw + (dnscrypt-proxy)\n+--------+ +- RPi -------------------+ | router | (((-+ 192.168.xxx.xxx(dhcp) | +-Laptop-------------+ +--------+ wlan0 | WLAN AP | | WLAN Client | | 192.168.50.1(static) +-))) (((-+ 192.168.50.x(dhcp) | +-------------------------+ uap0 | | +--------------------+ インストール sudo pacman -S dnsmasq hostapd dnscrypt-proxy ufw --needed dnscrypt-proxyはオプション。\nuap0インターフェースを作成 echo \u0026#39;ACTION==\u0026#34;add\u0026#34;, SUBSYSTEM==\u0026#34;ieee80211\u0026#34;, KERNEL==\u0026#34;phy0\u0026#34;, \\ RUN+=\u0026#34;/sbin/iw phy %k interface add uap0 type __ap\u0026#34;\u0026#39; | sudo tee /etc/udev/rules.d/90-uap0.rules 再起動するとuap0インターフェースが作成される\nuap0インターフェースのIPアドレスを固定 echo \u0026#39;[Match] Name=uap0 [Network] Address=192.168.50.1/24\u0026#39; | sudo tee /etc/systemd/network/80-wifi-ap.network hostapdの設定 sudo cp /etc/hostapd/hostapd.conf /etc/hostapd/hostapd.conf.bak echo \u0026#39;country_code=JP interface=uap0 driver=nl80211 ssid=raspiap # Whether to Broadcast ssid, 0 = off,1 = stealth ssid ignore_broadcast_ssid=0 hw_mode=a channel=36 ieee80211ac=1 # MAC Address access control, 0 = off macaddr_acl=0 # WMM(Wi-Fi Multimedia) wmm_enabled=1 # https://en.wikipedia.org/wiki/IEEE_802.11d-2001 ieee80211d=1 # https://en.wikipedia.org/wiki/IEEE_802.11h-2003 ieee80211h=1 # https://qiita.com/JhonnyBravo/items/5df2d9b2fcb142b6a67c local_pwr_constraint=3 spectrum_mgmt_required=1 # Use WPA auth_algs=1 wpa_key_mgmt=WPA-PSK # Use WPA2 wpa=2 # Use CCMP wpa_pairwise=CCMP # passphrase wpa_passphrase=passphrase\u0026#39; | sudo tee /etc/hostapd/hostapd.conf 設定項目はあまり理解してませんがwpa_passphrase項目を変えると接続時に求められるパスワードを変更できます。\ndnscrypt-proxyの設定(オプション) sudo cp /etc/dnscrypt-proxy/dnscrypt-proxy.toml /etc/dnscrypt-proxy/dnscrypt-proxy.toml.bak /etc/dnscrypt-proxy/dnscrypt-proxy.toml\n... +listen_addresses = [\u0026#39;127.0.0.1:50000\u0026#39;] ... +cache = false ... listen_addressのポートを50000番に変えてます。多分53ポートはバッティングすると思うので\ndnsmasqの設定 dnsmasqはdhcp serverとlocal dns cache serverとして動いてくれます。\nsudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf.bak echo \u0026#34;# listen interface interface=uap0 # On systems which support it, dnsmasq binds the wildcard address, # even when it is listening on only some interfaces. It then discards # requests that it shouldn\u0026#39;t reply to. This has the advantage of # working even when interfaces come and go and change address. If you # want dnsmasq to really bind only the interfaces it is listening on, # uncomment this option. About the only time you may need this is when # running another nameserver on the same machine. bind-interfaces # dhcp range 2~20, 12hrs to update dhcp lease dhcp-range=192.168.50.2,192.168.50.20,255.255.255.0,12h # Never forward plain names (without a dot or domain part) domain-needed # Never forward addresses in the non-routed address spaces. bogus-priv # upstream dns server server=127.0.0.1#50000 # don\u0026#39;t read /etc/resolv.conf no-resolv # listen for dns server on 192.168.50.1 listen-address=192.168.50.1 # dns cache size cache-size=1000 conf-dir=/etc/dnsmasq.d/,*.conf\u0026#34; | sudo tee /etc/dnsmasq.conf serverオプションは上流DNSキャッシュサーバーを指定できます。\nこの例ではさっきセットアップしたdnscrypt-proxyのアドレスとポートを指定しています。\nIPマスカレードを有効化 echo \u0026#39;net.ipv4.ip_forward=1\u0026#39; | sudo tee /etc/sysctl.d/routed-ap.conf ufw iptablesを直接弄るのはやりたくないのでufw経由でiptablesを設定します。\nsudo cp /etc/default/ufw /etc/default/ufw.bak /etc/default/ufw\n... +DEFAULT_FORWARD_POLICY=“ACCEPT\u0026#34; ... sudo cp /etc/ufw/before.rules /etc/ufw/before.rules.bak /etc/ufw/before.rules\n... *nat -F -A POSTROUTING -s 192.168.50.0/24 ! -d 192.168.50.0/24 -j MASQUERADE COMMIT ... # Don\u0026#39;t delete these required lines, otherwise there will be errors *filter ... *filterの前に書きます。\nsource ipが192.168.50.0/24でdestination ipが192.168.50.0/24でないパケットをIPマスカレードするルールです\nsystemdで起動時有効化 sudo systemctl enable ufw dnscrypt-proxy dnsmasq hostapd --now ufw許可 sudo ufw allow dns sudo ufw allow 67/udp 再起動 sudo systemctl reboot 参考元 https://www.raspberrypi.com/documentation/computers/configuration.html#setting-up-a-routed-wireless-access-point\nhttps://docs.raspap.com/ap-sta/\nhttps://www.mikan-tech.net/entry/raspi-ap-sta-router\nhttps://qiita.com/hoto17296/items/3aa5863ba9ef13400283\nhttps://www.itmedia.co.jp/news/spv/2008/14/news042.html\nhttps://github.com/imp/dnsmasq/blob/master/dnsmasq.conf.example\n","permalink":"https://s0racat.github.io/posts/2023-05-03-raspi-as-a-wifi-repeater/","summary":"環境 ArchLinux ARM aarch64\nsystemd-networkd + dnsmasq + hostapd + ufw + (dnscrypt-proxy)\n+--------+ +- RPi -------------------+ | router | (((-+ 192.168.xxx.xxx(dhcp) | +-Laptop-------------+ +--------+ wlan0 | WLAN AP | | WLAN Client | | 192.168.50.1(static) +-))) (((-+ 192.168.50.x(dhcp) | +-------------------------+ uap0 | | +--------------------+ インストール sudo pacman -S dnsmasq hostapd dnscrypt-proxy ufw --needed dnscrypt-proxyはオプション。\nuap0インターフェースを作成 echo \u0026#39;ACTION==\u0026#34;add\u0026#34;, SUBSYSTEM==\u0026#34;ieee80211\u0026#34;, KERNEL==\u0026#34;phy0\u0026#34;, \\ RUN+=\u0026#34;/sbin/iw phy %k interface add uap0 type __ap\u0026#34;\u0026#39; | sudo tee /etc/udev/rules.","title":"RaspberryPi 3b+をWiFiリピーターとして動かす(イーサネット、WiFiドングル不要)"},{"content":"こっち(2021-03-09-arch-secureboot)が古くなってたので書きました。\nいちいちhashをenrollしなくてもいい版です。\nインストール yay -S shim-signed mokutil sbsigntools 鍵作成 mkdir -p /var/lib/shim-signed/mok cd !$ openssl req -newkey rsa:4096 -noenc -keyout MOK.key -new -x509 -sha256 -days 3650 -subj \u0026#34;/CN=my Machine Owner Key/\u0026#34; -out MOK.crt openssl x509 -outform DER -in MOK.crt -out MOK.cer # MokManagerにenrollするのにDERフォーマットな証明書が必要 grubのstandalone版を生成 grub-mkconfig -o /tmp/grub.cfg grub-mkstandalone -O x86_64-efi --sbat=/usr/share/grub/sbat.csv -o /boot/efi/EFI/artix/grubx64.efi \u0026#34;/boot/grub/grub.cfg=/tmp/grub.cfg\u0026#34; さっきの鍵で起動したいファイルに署名 sbsign --key MOK.key --cert MOK.crt --output /boot/vmlinuz-linux /boot/vmlinuz-linux sbsign --key MOK.key --cert MOK.crt --output /boot/efi/EFI/artix/grubx64.efi /boot/efi/EFI/artix/grubx64.efi shimとMokManagerのefiバイナリをコピー \u0026amp;\u0026amp; NVRAMにエントリ作成 cp /usr/share/shim-signed/shimx64.efi /boot/efi/EFI/artix/BOOTx64.EFI cp /usr/share/shim-signed/mmx64.efi /boot/efi/EFI/artix/ cp /var/lib/shim-signed/mok/MOK.cer /boot/efi/EFI/artix/ efibootmgr --unicode --disk /dev/nvme0n1 --part 1 --create --label \u0026#34;Shim\u0026#34; --loader \u0026#34;\\EFI\\artix\\BOOTx64.EFI\u0026#34; それぞれのUEFIの設定を変更するなどしてShimを起動 \u0026gt; Enroll key from disk \u0026gt; MOK.cerを選択 \u0026gt; Continue \u0026gt; Yes \u0026gt; Continue Boot\nDKMSも自己署名する /etc/dkms/framework.conf.d/module-signing.conf\nsign_file=\u0026#34;/lib/modules/$(uname -r)/build/scripts/sign-file\u0026#34; mok_signing_key=/var/lib/shim-signed/mok/MOK.key mok_certificate=/var/lib/shim-signed/mok/MOK.cer MokManagerにenrollした.cerを削除 mokutil --delete /var/lib/shim-signed/mok/MOK.cer アップグレードされたカーネルに署名を自動化 https://wiki.archlinux.org/title/Secure_Boot#shim_with_key\n懸念と解決 grubからカーネルパラメーターを編集できてしまったら/bootへの書き込み権限が得られるのではないか(init=/bin/bashなど) root(/)を暗号化していても同じです(cryptdeviceパラメーター)。\ncryptdeviceパラメーターを消してinit=/bin/bashなどを付けると正常に起動できませんが暗号化されていないパーティションをマウントができてしまいます。\nなのでgrubにパスワードをかけましょう。\nhttps://wiki.archlinux.org/title/GRUB/Tips_and_tricks#Password_protection_of_GRUB_menu\nさらにカーネルパラメーターを編集する時以外はパスワードを要求しないようにもできます。\nhttps://wiki.archlinux.org/title/Talk:GRUB/Tips_and_tricks#Password_protection_of_non_local_system_boot_options\nUSBブートができてしまったらファイル書きかえできてしまう。 UEFIで内蔵ディスク以外を起動不可に設定してBIOSパスワードをかけましょう。\n参考 https://wiki.archlinux.org/title/Secure_Boot#shim\n","permalink":"https://s0racat.github.io/posts/2022-12-12-arch-secureboot-with-grub/","summary":"こっち(2021-03-09-arch-secureboot)が古くなってたので書きました。\nいちいちhashをenrollしなくてもいい版です。\nインストール yay -S shim-signed mokutil sbsigntools 鍵作成 mkdir -p /var/lib/shim-signed/mok cd !$ openssl req -newkey rsa:4096 -noenc -keyout MOK.key -new -x509 -sha256 -days 3650 -subj \u0026#34;/CN=my Machine Owner Key/\u0026#34; -out MOK.crt openssl x509 -outform DER -in MOK.crt -out MOK.cer # MokManagerにenrollするのにDERフォーマットな証明書が必要 grubのstandalone版を生成 grub-mkconfig -o /tmp/grub.cfg grub-mkstandalone -O x86_64-efi --sbat=/usr/share/grub/sbat.csv -o /boot/efi/EFI/artix/grubx64.efi \u0026#34;/boot/grub/grub.cfg=/tmp/grub.cfg\u0026#34; さっきの鍵で起動したいファイルに署名 sbsign --key MOK.key --cert MOK.crt --output /boot/vmlinuz-linux /boot/vmlinuz-linux sbsign --key MOK.key --cert MOK.crt --output /boot/efi/EFI/artix/grubx64.efi /boot/efi/EFI/artix/grubx64.","title":"archlinuxでセキュアブート with grub (鍵)"},{"content":"Windows 10 proはbitlockerを使ってCドライブを暗号化できるのですが、Windows 10 homeはできません\nなのでVeraCryptを使ってCドライブを暗号化する方法を書きます。bitlockerを使いたくない人にも良いかもしれません\nインストール なんらかの方法でVeraCryptを使える状態にします\nPortable版ではsystem disk暗号化機能が使えません\n構成 ここをクリック\nシングルブートかマルチブートか 初心者にはmulti-boot configurationはよくないよ 続けますか？\n暗号化オプション パスワード 短かいパスワード警告 20字以上のパスワードをおすすめするよ\nそれでも続けますか？\nランダムデータ収集 バーがフルになるまでやった\nレスキューディスク Skip Rescue Disk verificationにチェックすると物理メディアを作成しなくて済む\n前にレスキューディスクを作成していたとしても前のレスキューディスクは使えないよ 何回データ上書きするか なんとなく3passにした\n1回くらいはするべきでは、と思う\n正常にアンロックできるかテスト 暗号化中\u0026hellip; 終了 おまけ Linux側からVeracryptで暗号化されたドライブをマウント(scrapbox)\n","permalink":"https://s0racat.github.io/posts/2021-09-12-encrypt-windows-with-veracrypt/","summary":"Windows 10 proはbitlockerを使ってCドライブを暗号化できるのですが、Windows 10 homeはできません\nなのでVeraCryptを使ってCドライブを暗号化する方法を書きます。bitlockerを使いたくない人にも良いかもしれません\nインストール なんらかの方法でVeraCryptを使える状態にします\nPortable版ではsystem disk暗号化機能が使えません\n構成 ここをクリック\nシングルブートかマルチブートか 初心者にはmulti-boot configurationはよくないよ 続けますか？\n暗号化オプション パスワード 短かいパスワード警告 20字以上のパスワードをおすすめするよ\nそれでも続けますか？\nランダムデータ収集 バーがフルになるまでやった\nレスキューディスク Skip Rescue Disk verificationにチェックすると物理メディアを作成しなくて済む\n前にレスキューディスクを作成していたとしても前のレスキューディスクは使えないよ 何回データ上書きするか なんとなく3passにした\n1回くらいはするべきでは、と思う\n正常にアンロックできるかテスト 暗号化中\u0026hellip; 終了 おまけ Linux側からVeracryptで暗号化されたドライブをマウント(scrapbox)","title":"Windows 10 homeでCドライブを暗号化"},{"content":"edk2-ovmf をいれます\nそれだけです\nsudo pacman -S edk2-ovmf ウオー\n手軽、すばらしいarchlinux\n","permalink":"https://s0racat.github.io/posts/2021-07-19-virt-manager-efi/","summary":"edk2-ovmf をいれます\nそれだけです\nsudo pacman -S edk2-ovmf ウオー\n手軽、すばらしいarchlinux","title":"virt-managerで(u)efi bootしたい"},{"content":"概要 i3wmとはタイリングウィンドウマネージャの一種です。\n基本操作がすべてキーボードででき、$mod(prefixキー)+Enterでターミナルが起動, $mod+Shift+qでウインドウをキル, $mod+Shift+rでi3wmを再起動などできます。\n$modキーは大抵AltキーかSuper(Windows)キーです。\nこれはデフォルトですがカスタムキーバインドが自由に設定できます\n他のタイリングウィンドウマネージャと違うのはフローティングウィンドウができます\nフローティングウィンドウにするには$mod+Shift+spaceでできます\nおすすめパッケージ alacritty: ターミナル, 設定ファイルがyml kitty: ターミナル feh: 壁紙設定 nitrogen: 壁紙設定 flameshot: スクリーンショット(Qt) scrot: コマンドラインからスクリーンショット, シンプル gammastep: 画面を暖色にして目に優しく, waylandでも使える redshift:画面を暖色にして目に優しく, X11のみ使える gpicview: 画像ビューア lximage-qt: lxqtの画像ビューア gvfs-mtp: mtpデバイスをファイルマネージャーで操作, Androidなど thunar, pcmanfm, nemo: ファイルマネージャー pcmanfm-qt: ファイルマネージャー(Qt) i3lock: i3wmのためのロック画面 betterlockscreen: i3lockよりきれいなロック画面, aurにある i3status: アプレットなどを表示するバー i3status-rust: rustで書かれたi3status、設定ファイルはtoml kvantum: qt5のテーマ群, adaptaなどに似たテーマが入っていた qt5ct: qt5のテーマ設定 QT_QPA_PLATFORMTHEME変数をqt5ctに設定する必要がある\n~/.xprofileなどに追記\nexport QT_QPA_PLATFORMTHEME=qt5ct lxappearance-gtk3: gtk themeの設定 xfce4-clipman-plugin: クリップボードマネージャー pavucontrol: pulseaudioをguiで調整 pavucontrol-qt: pavucontrolのqt版 picom: コンポジター, ウィンドウ透過が設定できる, これ動かさないと画面がまともに動かないので推奨 rofi: dmenuの替え, テーマが豊富なのでカスタマイズがやりやすい rofimoji: rofiで絵文字が打てます, 絵文字フォントが必要だと思われる xfce4-notifyd: xfce4通知デーモン, これがgtkの設定尊重してくれてきれい dunst: 通知デーモン, こっちのほうがシンプルかも xss-lock: 画面の電源が切れた際とsuspendした際にロックしてくれる light: バックライト調整 playerctl: 音楽コントロール kate: kde付属のエディタ、kwriteというのも付いてくる lxqt-archiver: xarchiverのようなもの(Qt) kcalc: kdeの電卓(Qt) ksysguard: GUIのタスクマネージャー(プロセスモニター)(Qt) 設定 ユーザーの設定は~/.config/i3/configです\n起動するとウィザードが設定を生成してくれます\n最初に$modキーを何にするか聞かれるのでお好みの方を選んでください\nおすすめの設定について書きます\naltキー altキーを設定で書きやすくするために変数化してます。\ni3/config\nset $alt Mod1 set VAR KEY で変数定義できます\nここでは$altを定義してます\nウインドウをキル 60行目を書き変えます\ni3/config\nbindsym $mod+q kill bindsym KEY BEHAVIOR でキーバインド設定できます\nbindsym KEY exec COMMAND で任意のコマンドをキー割当します\n上記は$mod+Shift+qはきついので$mod+qでウインドウをキルできるようにしてます\nh, j, k, lでウィンドウ移動をできるようにする i3/config\nbindsym $mod+l focus left bindsym $mod+j focus down bindsym $mod+k focus up bindsym $mod+h focus right bindsym $mod+l focus left bindsym $mod+j focus down bindsym $mod+k focus up bindsym $mod+l focus right 垂直分割のキーバインドが衝突するので変更\ni3/config\nbindsym $mod+b split h fehで壁紙を設定 feh --bg-scale ~/Pictures/wallpaper.jpg で壁紙を設定できます\n画像ファイルのパスは書き換えてください\n次回起動時も同じ壁紙を設定する設定 i3/config\nexec --no-startup-id ~/.fehbg exec \u0026ndash;no-startup-id COMMAND で自動起動ができます\nワークスペースを移動 https://raw.githubusercontent.com/benkaiser/i3-wm-config/master/workspace_controller.py\nこれを~/.config/i3/workspace_controller.pyにダウンロード\u0026amp;配置\n$mod+tabで次のワークスペース\n$alt+tabで前のワークスペースに移動できます\ni3/config\nset $controlw ~/.config/i3/workspace_controller.py bindsym $mod+Tab exec $controlw next go bindsym $alt+Tab exec $controlw prev go キーボードで音楽コントロール i3/config\nbindsym XF86AudioPlay exec playerctl play-pause bindsym XF86AudioNext exec playerctl next bindsym XF86AudioPrev exec playerctl previous キーボードでバックライトコントロール i3/config\nbindsym XF86MonBrightnessUp exec light -A 5 bindsym XF86MonBrightnessDown exec light -U 5 フローティングウィンドウ i3/config\nfor_window [class=\u0026#34;Lxappearance\u0026#34;] floating enable for_window [class=\u0026#34;GParted\u0026#34;] floating enable for_window [class=\u0026#34;Pavucontrol\u0026#34;] floating enable for_window [class=\u0026#34;fcitx5-config-qt\u0026#34;] floating enable for_window [class=\u0026#34;mpv\u0026#34;] floating enable resize set 1000 800 for_window [class=\u0026#34;Gnome-system-monitor\u0026#34;] floating enable for_window [class=\u0026#34;Gpicview\u0026#34;] floating enable for_window [class=\u0026#34;Xarchiver\u0026#34;] floating enable 以下のコマンドでWindow classを取得できます\nxprop | grep WM_CLASS i3-gaps独自の設定 i3/config\ngaps inner 14 gaps outer 7 smart_gaps on for_window [class=\u0026#34;^.*\u0026#34;] border pixel 2 focus_follows_mouse no gaps inner num, gaps outer num でWindowの幅を調整できます\nfor_window [class=\u0026quot;^.*\u0026quot;] border pixel 2はWindowタイトルを消せます\nモニター電源が切れた, サスペンドした際にロック xss-lockはdpmsとsystemd eventに反応してロックプログラムを起動してくれます\nxss-lock -- i3lock -f -c 000000 -n 起動スクリプトなどに追記\n~/.xprofile\nxset s 180 120 dpmsの設定ですarchwiki\nトラブルシューティング /etc/xdg/autostartまたは~/.config/autostartのプログラムが自動起動しない i3wmは~/.config/autostartの.desktopファイルを自動起動してくれませんので\n~/.config/i3/autostart.shに書いて自動起動します\n実行権限をつけてあげてください\nこれはi3/configから起動する必要があります\ni3/config\nexec --no-startup-id ~/.config/i3/autostart.sh 私のautostart.shは https://gitlab.com/takuoh/config-artix/-/blob/master/dotfiles/.config/i3/autostart.sh です\n/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 \u0026amp;はgnome-polkitを立ち上げています。これがないとgpartedが権限要求できません\n/usr/lib/xfce4/notifyd/xfce4-notifyd \u0026amp;はxfce4通知デーモンを起動してます\n2022/06/19追記 dexと言う物がありま す ~/.config/autostartと/etc/xdg/autostartの下の.desktopファイルのExecを実行してくれます\ni3-wmでターミナル透過が出来ない、ティアリングが発生する まずコンポジターという物を入れます\nおすすめはpicomです\nmkdir -p ~/.config/picom cp /etc/xdg/picom.conf ~/.config/picom/picom.conf 任意のエディターで~/.config/picom/picom.confを開いて\nbackend = \u0026quot;xrender\u0026quot;;をbackend = \u0026quot;glx\u0026quot;;に変更して保存します\nそしてpicom -bをautostart.shに追記してログアウト \u0026amp; ログインしたらティアリングが直ってると思います\nHiDPI設定をした際にGtkFileChooserDialogが異常な大きさになる https://gitlab.com/takuoh/config-artix/-/blob/6d64ba05df3c68a6fc4e95ab2207f04e5bc971fc/dotfiles/.config/i3/config#L234\nHiDPI設定をした際にGTKのUIが小さく見える、QTのUIが大きく見える ~/.XresourcesでXft.dpiを設定している場合、UIがちゃんとスケールされるのはQTです。\n~/.XresourcesでXft.dpiを設定するとGTKアプリではフォントのみ拡大されます。GDK_SCALE変数を使う方法もありますがこれは整数の値しか設定できません。\nまたGDK_DPI_SCALE変数はフォントしかスケールしません。\n小数値を設定したい時が多分あると思います(1.25, 1.5など)。UIがスケールされなくてiconが見ずらいってことがあると思います。そのときは仕方ないのでQTアプリを使います。\n一応上にQTバックエンドなアプリを挙げています。\nldd /bin/flameshot | grep -i qtなんかでQtでできているか見れます。\n~/.XresourcesでXft.dpiを設定した際にQtのアプリのフォントが大きすぎる時はQT_AUTO_SCREEN_SCALE_FACTOR=0とQT_SCREEN_SCALE_FACTORS=1.5変数を設定して前述のqt5ctでフォントサイズを弄ってます。(環境変数をいじらなくともqt5ctでフォントサイズを調節することでもできます。)\nhttps://wiki.gnome.org/Projects/GnomeShell/ScaleFactorTests ここにどのスケールで設定すればいいか例があります。\nおわりに 僕のdotfilesリポジトリです\nhttps://gitlab.com/takuoh/config-artix\n","permalink":"https://s0racat.github.io/posts/2021-05-26-i3wm/","summary":"概要 i3wmとはタイリングウィンドウマネージャの一種です。\n基本操作がすべてキーボードででき、$mod(prefixキー)+Enterでターミナルが起動, $mod+Shift+qでウインドウをキル, $mod+Shift+rでi3wmを再起動などできます。\n$modキーは大抵AltキーかSuper(Windows)キーです。\nこれはデフォルトですがカスタムキーバインドが自由に設定できます\n他のタイリングウィンドウマネージャと違うのはフローティングウィンドウができます\nフローティングウィンドウにするには$mod+Shift+spaceでできます\nおすすめパッケージ alacritty: ターミナル, 設定ファイルがyml kitty: ターミナル feh: 壁紙設定 nitrogen: 壁紙設定 flameshot: スクリーンショット(Qt) scrot: コマンドラインからスクリーンショット, シンプル gammastep: 画面を暖色にして目に優しく, waylandでも使える redshift:画面を暖色にして目に優しく, X11のみ使える gpicview: 画像ビューア lximage-qt: lxqtの画像ビューア gvfs-mtp: mtpデバイスをファイルマネージャーで操作, Androidなど thunar, pcmanfm, nemo: ファイルマネージャー pcmanfm-qt: ファイルマネージャー(Qt) i3lock: i3wmのためのロック画面 betterlockscreen: i3lockよりきれいなロック画面, aurにある i3status: アプレットなどを表示するバー i3status-rust: rustで書かれたi3status、設定ファイルはtoml kvantum: qt5のテーマ群, adaptaなどに似たテーマが入っていた qt5ct: qt5のテーマ設定 QT_QPA_PLATFORMTHEME変数をqt5ctに設定する必要がある\n~/.xprofileなどに追記\nexport QT_QPA_PLATFORMTHEME=qt5ct lxappearance-gtk3: gtk themeの設定 xfce4-clipman-plugin: クリップボードマネージャー pavucontrol: pulseaudioをguiで調整 pavucontrol-qt: pavucontrolのqt版 picom: コンポジター, ウィンドウ透過が設定できる, これ動かさないと画面がまともに動かないので推奨 rofi: dmenuの替え, テーマが豊富なのでカスタマイズがやりやすい rofimoji: rofiで絵文字が打てます, 絵文字フォントが必要だと思われる xfce4-notifyd: xfce4通知デーモン, これがgtkの設定尊重してくれてきれい dunst: 通知デーモン, こっちのほうがシンプルかも xss-lock: 画面の電源が切れた際とsuspendした際にロックしてくれる light: バックライト調整 playerctl: 音楽コントロール kate: kde付属のエディタ、kwriteというのも付いてくる lxqt-archiver: xarchiverのようなもの(Qt) kcalc: kdeの電卓(Qt) ksysguard: GUIのタスクマネージャー(プロセスモニター)(Qt) 設定 ユーザーの設定は~/.","title":"i3wmについて"},{"content":"誰かがswayの記事を書いてくれているのでトラブルシューティングを中心に書きます。\nフルアーカイブは https://gitlab.com/takuoh/oldblog にもあります\n情報の探し方 検索する場合、swaywm site:qiita.com(DuckDuckGo) か swaywm site:zenn.dev(DuckDuckGo)で出ます\nswaywm/sway(Github Wiki)\nemersion/xdg-desktop-portal-wlr(Github Wiki)\n他にもarchwikiで検索、gentoo wikiで検索すると情報が出てきます\nTips サスペンドした際にロック sway/config\nexec swayidle before-sleep \u0026#39;swaylock -f -c 000000; swaymsg \u0026#34;output * dpms off\u0026#34;\u0026#39; after-resume \u0026#39;swaymsg \u0026#34;output * dpms on\u0026#34;\u0026#39; この例はswaylockを使ってますがお好みのスクリーンセーバーを使ってください\nモニターの電源(dpms)も切ってくれます\nマシンに触らなかった場合自動でロック sway/config\nexec swayidle -w \\ timeout 300 \u0026#39;swaylock -f -c 000000\u0026#39; \\ timeout 600 \u0026#39;swaymsg \u0026#34;output * dpms off\u0026#34;\u0026#39; resume \u0026#39;swaymsg \u0026#34;output * dpms on\u0026#34;\u0026#39; この場合5分でロックされ、その後10分後dpmsがオフになります\nfirefoxを動かす MOZ_ENABLE_WAYLAND=1 firefox で起動しますが\n~/.pam_environmentに書いて永続化します\necho MOZ_ENABLE_WAYLAND=1 \u0026gt;\u0026gt; ~/.pam_environment トラブルシューティング xdg-desktop-portal-gtkの起動が失敗する https://github.com/swaywm/sway/wiki#gtk-applications-take-20-seconds-to-start\nsway/config\ninclude /etc/sway/config.d/* gtkテーマが適用されない https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland\n#!/bin/sh # usage: import-gsettings config=\u0026#34;${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini\u0026#34; if [ ! -f \u0026#34;$config\u0026#34; ]; then exit 1; fi gnome_schema=\u0026#34;org.gnome.desktop.interface\u0026#34; gtk_theme=\u0026#34;$(grep \u0026#39;gtk-theme-name\u0026#39; \u0026#34;$config\u0026#34; | cut -d\u0026#39;=\u0026#39; -f2)\u0026#34; icon_theme=\u0026#34;$(grep \u0026#39;gtk-icon-theme-name\u0026#39; \u0026#34;$config\u0026#34; | cut -d\u0026#39;=\u0026#39; -f2)\u0026#34; cursor_theme=\u0026#34;$(grep \u0026#39;gtk-cursor-theme-name\u0026#39; \u0026#34;$config\u0026#34; | cut -d\u0026#39;=\u0026#39; -f2)\u0026#34; font_name=\u0026#34;$(grep \u0026#39;gtk-font-name\u0026#39; \u0026#34;$config\u0026#34; | cut -d\u0026#39;=\u0026#39; -f2)\u0026#34; cursor_size=\u0026#34;$(grep \u0026#39;gtk-cursor-theme-size\u0026#39; \u0026#34;$config\u0026#34; | cut -d\u0026#39;=\u0026#39; -f2)\u0026#34; gsettings set \u0026#34;$gnome_schema\u0026#34; gtk-theme \u0026#34;$gtk_theme\u0026#34; gsettings set \u0026#34;$gnome_schema\u0026#34; icon-theme \u0026#34;$icon_theme\u0026#34; gsettings set \u0026#34;$gnome_schema\u0026#34; cursor-theme \u0026#34;$cursor_theme\u0026#34; gsettings set \u0026#34;$gnome_schema\u0026#34; font-name \u0026#34;$font_name\u0026#34; gsettings set \u0026#34;$gnome_schema\u0026#34; cursor-size \u0026#34;$cursor_size\u0026#34; Lxappearanceなどでカーソルサイズを設定していた場合、それも設定されるようにちょっと変更を加えてます\n実行権限が必要です\nsway/config\nexec_always /path/to/import-gsettings floating windowが機能しない i3wm(X11)からsway(Wayland)になってWM_CLASSではなくapp_idを使うようになったようです\n例です\nsway/config\nfor_window [app_id=\u0026#34;gpartedbin\u0026#34;] floating enable swaymsg -t get_tree | grep \u0026quot;app_id\u0026quot; で起動しているwindowのapp_idが取得できます\nswaymsg使うとxwaylandで起動してるソフトがnullになるんですが\nxprop | grep WM_CLASS で取得して\nsway/config\nfor_window [class=\u0026#34;Lxappearance\u0026#34;] floating enable でできました\ngpartedが動かない polkitの権限要求が何故かxwaylandで動かないようです\nxhostをインストールして再起動すると動きます\narchlinuxではパッケージ名はxorg-xhostです\nsudo -E gparted でも動きます\nflameshot export XDG_CURRENT_DESKTOP=sway non systemdな環境でflameshotを動かす export XDG_CURRENT_DESKTOP=sway sway/config\nexec --no-startup-id dbus-update-activation-environment DISPLAY I3SOCK SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist#non-systemd-distributions=\nさいごに 僕のdotfilesリポジトリです\nhttps://gitlab.com/takuoh/config-artix\n","permalink":"https://s0racat.github.io/posts/2021-05-20-sway/","summary":"誰かがswayの記事を書いてくれているのでトラブルシューティングを中心に書きます。\nフルアーカイブは https://gitlab.com/takuoh/oldblog にもあります\n情報の探し方 検索する場合、swaywm site:qiita.com(DuckDuckGo) か swaywm site:zenn.dev(DuckDuckGo)で出ます\nswaywm/sway(Github Wiki)\nemersion/xdg-desktop-portal-wlr(Github Wiki)\n他にもarchwikiで検索、gentoo wikiで検索すると情報が出てきます\nTips サスペンドした際にロック sway/config\nexec swayidle before-sleep \u0026#39;swaylock -f -c 000000; swaymsg \u0026#34;output * dpms off\u0026#34;\u0026#39; after-resume \u0026#39;swaymsg \u0026#34;output * dpms on\u0026#34;\u0026#39; この例はswaylockを使ってますがお好みのスクリーンセーバーを使ってください\nモニターの電源(dpms)も切ってくれます\nマシンに触らなかった場合自動でロック sway/config\nexec swayidle -w \\ timeout 300 \u0026#39;swaylock -f -c 000000\u0026#39; \\ timeout 600 \u0026#39;swaymsg \u0026#34;output * dpms off\u0026#34;\u0026#39; resume \u0026#39;swaymsg \u0026#34;output * dpms on\u0026#34;\u0026#39; この場合5分でロックされ、その後10分後dpmsがオフになります\nfirefoxを動かす MOZ_ENABLE_WAYLAND=1 firefox で起動しますが","title":"sway Tips \u0026 トラブルシューティング"},{"content":"前提条件 linux \u0026gt;= 4.16\nqemu \u0026gt;= 2.12\n設定 /etc/modprobe.d/i915.conf\noptions i915 ... enable_gvt=1 enable_guc=0 ... /etc/modules-load.d/intel_gvt-g.conf\nkvmgt vfio-iommu-type1 vfio-mdev /etc/default/grub\nGRUB_CMDLINE_LINUX=\u0026#34;... intel_iommu=on ...\u0026#34; sudo grub-mkconfig -o /boot/grub/grub.cfg sudo reboot lspci -Dnn|grep VGA GVT_PCI=0000\\:00\\:02.0 ls /sys/bus/pci/devices/$GVT_PCI/mdev_supported_types/ GVT_GUID=$(uuidgen) GVT_PCI=0000\\:00\\:02.0 GVT_TYPE=i915-GVTg_V5_4 echo \u0026#34;$GVT_GUID\u0026#34;|sudo tee \u0026#34;/sys/bus/pci/devices/$GVT_PCI/mdev_supported_types/$GVT_TYPE/create\u0026#34; qemu-system-x86_64 \\ -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/$GVT_GUID 参考 https://kagasu.hatenablog.com/entry/2021/01/05/201126\nhttps://wiki.archlinux.org/title/Intel_GVT-g\n","permalink":"https://s0racat.github.io/posts/2021-05-14-intel-gvt-g/","summary":"前提条件 linux \u0026gt;= 4.16\nqemu \u0026gt;= 2.12\n設定 /etc/modprobe.d/i915.conf\noptions i915 ... enable_gvt=1 enable_guc=0 ... /etc/modules-load.d/intel_gvt-g.conf\nkvmgt vfio-iommu-type1 vfio-mdev /etc/default/grub\nGRUB_CMDLINE_LINUX=\u0026#34;... intel_iommu=on ...\u0026#34; sudo grub-mkconfig -o /boot/grub/grub.cfg sudo reboot lspci -Dnn|grep VGA GVT_PCI=0000\\:00\\:02.0 ls /sys/bus/pci/devices/$GVT_PCI/mdev_supported_types/ GVT_GUID=$(uuidgen) GVT_PCI=0000\\:00\\:02.0 GVT_TYPE=i915-GVTg_V5_4 echo \u0026#34;$GVT_GUID\u0026#34;|sudo tee \u0026#34;/sys/bus/pci/devices/$GVT_PCI/mdev_supported_types/$GVT_TYPE/create\u0026#34; qemu-system-x86_64 \\ -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/$GVT_GUID 参考 https://kagasu.hatenablog.com/entry/2021/01/05/201126\nhttps://wiki.archlinux.org/title/Intel_GVT-g","title":"Intel GVT-g"},{"content":"Internal error:Failed to initialize a valid firewall backend\nというエラーで仮想NATが起動しませんでした\n前まではebtablesを入れることで治りましたが\n最近公式リポジトリからebtablesが消滅したのでiptables-nftを入れてください\nsudo pacman -S --needed iptables-nft dnsmasq libvirtdを再起動してください\nsudo systemctl restart libvirtd https://superuser.com/questions/1063240/libvirt-failed-to-initialize-a-valid-firewall-backend\n","permalink":"https://s0racat.github.io/posts/2021-04-15-libvirt-err-truble/","summary":"Internal error:Failed to initialize a valid firewall backend\nというエラーで仮想NATが起動しませんでした\n前まではebtablesを入れることで治りましたが\n最近公式リポジトリからebtablesが消滅したのでiptables-nftを入れてください\nsudo pacman -S --needed iptables-nft dnsmasq libvirtdを再起動してください\nsudo systemctl restart libvirtd https://superuser.com/questions/1063240/libvirt-failed-to-initialize-a-valid-firewall-backend","title":"libvirtdのエラー解決方法メモ"},{"content":"fontconfigの設定ファイルをコピーするだけです\n~/.var/app/${Application ID}/config/fontconfig/ # ~/.var/app/us.zoom.Zoom/config/fontconfig/ Application IDはflatpak listで確認できます\n私はnoto-fonts-cjkの設定ファイルをコピーしてみました\nSymlinkは元のファイルにアクセス権が無いと反映されないのでコピーしないといけない\nmkdir ~/.var/app/us.zoom.Zoom/config/fontconfig/ cd ~/.var/app/us.zoom.Zoom/config/fontconfig/ cp ../../../../../.config/fontconfig/fonts.conf . archlinux,font: noto-fonts-cjkの場合は/usr/share/fontconfig/conf.avail/70-noto-cjk.confにあります\n","permalink":"https://s0racat.github.io/posts/2021-03-17-fontchange-in-flatpak/","summary":"fontconfigの設定ファイルをコピーするだけです\n~/.var/app/${Application ID}/config/fontconfig/ # ~/.var/app/us.zoom.Zoom/config/fontconfig/ Application IDはflatpak listで確認できます\n私はnoto-fonts-cjkの設定ファイルをコピーしてみました\nSymlinkは元のファイルにアクセス権が無いと反映されないのでコピーしないといけない\nmkdir ~/.var/app/us.zoom.Zoom/config/fontconfig/ cd ~/.var/app/us.zoom.Zoom/config/fontconfig/ cp ../../../../../.config/fontconfig/fonts.conf . archlinux,font: noto-fonts-cjkの場合は/usr/share/fontconfig/conf.avail/70-noto-cjk.confにあります","title":"Flatpakアプリケーションでのフォント変更方法"},{"content":"grubの場合 bootパーティションが/bootにマウントされていてefiパーティションが/boot/efiにマウントされている場合の例です\nyay -S shim-signed sudo cp /usr/share/shim-signed/shimx64.efi /boot/efi/EFI/arch/BOOTX64.efi sudo cp /usr/share/shim-signed/mmx64.efi /boot/efi/EFI/arch/ sudo efibootmgr --verbose --disk /dev/nvme0n1 --part 1 --create --label \u0026#34;Shim\u0026#34; --loader \u0026#34;\\EFI\\arch\\BOOTX64.efi\u0026#34; あとはBOOTX64.efiを起動してgrubx64.efiのhashを登録する\nsystemd-bootの場合 /bootをefiパーティションとして使っている場合,主にsystemd-boot\nyay -S preloader-signed sudo cp /usr/share/preloader-signed/{PreLoader,HashTool}.efi /boot/EFI/systemd sudo mv /boot/EFI/systemd/systemd-bootx64.efi /boot/EFI/systemd/loader.efi cd ~ sudo efibootmgr --verbose --disk /dev/nvme0n1 --part 1 --create --label \u0026#34;PreLoader\u0026#34; --loader \u0026#34;\\EFI\\systemd\\PreLoader.efi\u0026#34; どちらもカーネルとefiバイナリのhashを登録しないと起動しません\nここでハマりました\nhttps://wiki.archlinux.jp/index.php/%E3%82%BB%E3%82%AD%E3%83%A5%E3%82%A2%E3%83%96%E3%83%BC%E3%83%88\n","permalink":"https://s0racat.github.io/posts/2021-03-09-arch-secureboot/","summary":"grubの場合 bootパーティションが/bootにマウントされていてefiパーティションが/boot/efiにマウントされている場合の例です\nyay -S shim-signed sudo cp /usr/share/shim-signed/shimx64.efi /boot/efi/EFI/arch/BOOTX64.efi sudo cp /usr/share/shim-signed/mmx64.efi /boot/efi/EFI/arch/ sudo efibootmgr --verbose --disk /dev/nvme0n1 --part 1 --create --label \u0026#34;Shim\u0026#34; --loader \u0026#34;\\EFI\\arch\\BOOTX64.efi\u0026#34; あとはBOOTX64.efiを起動してgrubx64.efiのhashを登録する\nsystemd-bootの場合 /bootをefiパーティションとして使っている場合,主にsystemd-boot\nyay -S preloader-signed sudo cp /usr/share/preloader-signed/{PreLoader,HashTool}.efi /boot/EFI/systemd sudo mv /boot/EFI/systemd/systemd-bootx64.efi /boot/EFI/systemd/loader.efi cd ~ sudo efibootmgr --verbose --disk /dev/nvme0n1 --part 1 --create --label \u0026#34;PreLoader\u0026#34; --loader \u0026#34;\\EFI\\systemd\\PreLoader.efi\u0026#34; どちらもカーネルとefiバイナリのhashを登録しないと起動しません\nここでハマりました\nhttps://wiki.archlinux.jp/index.php/%E3%82%BB%E3%82%AD%E3%83%A5%E3%82%A2%E3%83%96%E3%83%BC%E3%83%88","title":"archlinuxでセキュアブート(ハッシュ登録版)"}]