# i3 config file (v4) # issued: 2022-01-03 # modified: 2023-08-06 # Copyrights waived via CC0: http://creativecommons.org/publicdomain/zero/1.0/ # Source: i3 # Michael Stapelberg and contributors # https://i3wm.org/ # https://github.com/i3/i3/blob/next/LICENSE # Source: https://i3wm.org/docs/userguide.html # Source: https://wiki.archlinux.jp/index.php/I3 # キーボードレイアウトを変更した際は、設定ファイルを削除して i3-config-wizard を実行する # ;(セミコロン)や ,(カンマ)について: https://i3wm.org/docs/userguide.html#exec_quoting ## キーの定義 set $mod Mod4 set $alt Mod1 set $ctl Control set $sft Shift set $hyp Mod3 ## フォントの定義 set $fonts Hack,Migu 1C Bold 14px set $fonts_bar Hack,Migu 1C Bold 13px ## 色の定義 set $color_focus_border #004070 set $color_focus_bg #003077 set $color_focus_text #cccccc set $color_focus_indicator #223344 set $color_focus_cborder #003388 set $color_active_border #003060 set $color_active_bg #002030 set $color_active_text #999999 set $color_active_indicator #112233 set $color_active_cborder #002266 set $color_unfocus_border #101010 set $color_unfocus_bg #060606 set $color_unfocus_text #707070 set $color_unfocus_indicator #001122 set $color_unfocus_cborder #001144 set $color_background #000000 set $color_status #c0c0c0 set $color_separator #555555 ## キーワードの定義 set $noid exec --no-startup-id set $term urxvt set $launcher dmenu_run -fn 'monospace-14' set $filer ranger set $editor kak set $sandbox firejail --noprofile set $proxy_http export http_proxy="http://127.0.0.1:8118" && export https_proxy="http://127.0.0.1:8118" set $browser dillo set $messenger qtox set $messenger_url https://qtox.github.io/ set $dic /usr/lib/mozc/mozc_tool --mode=dictionary_tool set $lock xautolock -locknow #set $suspend loginctl suspend #set $poweroff loginctl poweroff #set $music_next mocp --next #set $music_prev mocp --previous #set $music_pause mocp --toggle-pause #set $music_stop mocp --stop set $brightness_up brightnessctl -c backlight s 5%+ set $brightness_down brightnessctl -c backlight s 5%- set $volume_up amixer -qc 0 sset Master 5%+ set $volume_down amixer -qc 0 sset Master 5%- set $volume_mute amixer -qc 0 sset Master toggle set $notify dzen2 -ta l -p 4 -geometry '300x45-305+30' ## キーの無効化 bindsym XF86WLAN nop ## ファンクションキー bindsym XF86MonBrightnessUp $noid $brightness_up | grep 'Current' | sed -E 's/^\s/ /g' | $notify bindsym XF86MonBrightnessDown $noid $brightness_down | grep 'Current' | sed -E 's/^\s/ /g' | $notify bindsym XF86AudioRaiseVolume $noid $volume_up | grep -E '^\s+Mono' | sed -E 's/^\s+Mono.+\[([0-9]+%)\](.*\[(on|off)\])*/ Vol: \1/g' | $notify bindsym $sft+XF86AudioRaiseVolume $noid amixer -qc 0 sset Master unmute && amixer -qc 0 sset Headphone unmute && amixer -qc 0 sset Speaker unmute && echo " Listen" | $notify bindsym $alt+XF86AudioRaiseVolume $noid amixer -qc 0 sset Capture cap 19 && echo " Speak" | $notify bindsym XF86AudioLowerVolume $noid $volume_down | grep -E '^\s+Mono' | sed -E 's/^\s+Mono.+\[([0-9]+%)\](.*\[(on|off)\])*/ Vol: \1/g' | $notify bindsym XF86AudioMute $noid $volume_mute | grep 'off' && echo " Mute" | $notify || echo " [Off] Mute" | $notify bindsym $sft+XF86AudioMute $noid amixer -qc 0 sset Master mute && amixer -qc 0 sset Headphone mute && amixer -qc 0 sset Speaker mute && amixer -qc 0 sset Mic mute && amixer -qc 0 sset Capture nocap 0 && echo " Silence" | $notify bindsym $alt+XF86AudioMute $noid amixer -qc 0 sset Capture nocap 0 && echo " Quiet" | $notify #bindsym XF86AudioPlay $noid $music_pause #bindsym XF86AudioNext $noid $music_next #bindsym XF86AudioPrev $noid $music_prev #bindsym XF86AudioStop $noid $music_stop ## マウス + 修飾キーでフローティングウィンドウのドラッグ floating_modifier $mod ## 自動起動 $noid i3-msg -q "workspace $ws1; $noid $term" $noid xss-lock -- $lock ## ショートカット # キーシムの調べ方 (Event Tester):xev # 1 ! exclam 2 " quotedbl 3 # numbersign 4 $ dollar 5 % percent 6 & ampersand 7 ' apostrophe 8 ( parenleft 9 ) parenright # - minus = equal ^ asciicircum ~ asciitilde | bar # @ at ` grave # [ bracketleft { braceleft ] bracketright } braceright # ; semicolon + plus : colon * asterisk # , comma < less . period > greater / slash ? question \ backslash _ underscore # Home Home End End PageUp Prior PageDown Next # 【テンキー】+ KP_Add - KP_Subtract * KP_Multiply / KP_Divide . KP_Decimal # i3 の設定ファイルの読込 bindsym $mod+$alt+$sft+r reload # i3 の再起動(レイアウトやアップデートの適用などに) bindsym $mod+$sft+r restart # i3 の終了(X セッションのログアウト) bindsym $mod+F10 exit # ウィンドウを閉ぢる bindsym $mod+$sft+q kill # 画面ロック bindsym $mod+F5 $noid $lock # システムの終了 #bindsym $mod+$sft+F10 $noid $poweroff # プログラムランチャ bindsym $hyp+d $noid $launcher # ターミナル bindsym $hyp+slash $noid $term # ファイラ bindsym $hyp+r $noid $term -e $filer # テキストエディタ bindsym $hyp+e $noid $term -e $editor # ブラウザ bindsym $hyp+1 $noid $proxy_http && $sandbox $browser bindsym $hyp+$sft+1 $noid $sandbox $browser $messenger_url # メッセンジャー bindsym $hyp+2 workspace $ws9; $noid $sandbox $messenger # 音声ミキサー bindsym $hyp+3 $noid $term -e alsamixer # 辞書ツール bindsym $hyp+F7 $noid $dic # シェルスクリプト bindsym --release $hyp+v $noid xdotool key --clearmodifiers ctrl+alt+v sleep 0.1 keyup Hyper_L bindsym $hyp+comma $noid date '+%Y-%m-%d' | tr -d '\n' | xclip -selection c bindsym $hyp+$sft+comma $noid date '+%Y年%-m月%-d日' | tr -d '\n' | xclip -selection c # ウィンドウのフォーカス bindsym $mod+h focus left bindsym $mod+j focus down bindsym $mod+k focus up bindsym $mod+l focus right bindsym $mod+Left focus left bindsym $mod+Down focus down bindsym $mod+Up focus up bindsym $mod+Right focus right # ウィンドウの移動 bindsym $mod+$sft+h move left bindsym $mod+$sft+j move down bindsym $mod+$sft+k move up bindsym $mod+$sft+l move right bindsym $mod+$sft+Left move left bindsym $mod+$sft+Down move down bindsym $mod+$sft+Up move up bindsym $mod+$sft+Right move right # 垂直(縦)分割 bindsym $mod+o split h # 水平(横)分割 bindsym $mod+v split v # フルスクリーンの切替 bindsym $mod+f fullscreen toggle # レイアウトの切替(重ねる、タブ、タイル) bindsym $mod+t layout stacking bindsym $mod+w layout tabbed bindsym $mod+e layout toggle split # タイル・フロート表示の切替 bindsym $mod+$sft+space floating toggle # タイル・フロートウィンドウのフォーカス切替 bindsym $mod+space focus mode_toggle # 親コンテナにフォーカス #bindsym $mod+a focus parent # 子コンテナにフォーカス #bindsym $mod+d focus child ## ウィンドウのリサイズ(リサイズモード) mode "resize" { bindsym h resize shrink width 8 px or 8 ppt bindsym j resize grow height 8 px or 8 ppt bindsym k resize shrink height 8 px or 8 ppt bindsym l resize grow width 8 px or 8 ppt bindsym Left resize shrink width 8 px or 8 ppt bindsym Down resize grow height 8 px or 8 ppt bindsym Up resize shrink height 8 px or 8 ppt bindsym Right resize grow width 8 px or 8 ppt # 通常モードへ移行 bindsym Return mode "default" bindsym Escape mode "default" bindsym $mod+r mode "default" } # ウィンドウのリサイズモードへ移行 bindsym $mod+r mode "resize" ## ワークスペース # デフォルトのレイアウト workspace_layout tabbed # 画面端のボーダーを非表示 hide_edge_borders both # ワークスペースの名前 set $ws1 "1" set $ws2 "2" set $ws9 "Private" # ワークスペースへフォーカス bindsym $mod+1 workspace $ws1 bindsym $mod+2 workspace $ws2 bindsym $mod+9 workspace $ws9 # コンテナをワークスペースへ移動 bindsym $mod+$sft+1 move container to workspace $ws1 bindsym $mod+$sft+2 move container to workspace $ws2 bindsym $mod+$sft+9 move container to workspace $ws9 ## フォント font pango:$fonts ## ステータスバー(i3bar) bar { # i3status を読込 status_command i3blocks # フォント font pango:$fonts_bar # 位置 position top # 区切記号 separator_symbol "|" # 配色 colors { # 背景 background $color_background # 文字 statusline $color_status # 区切 separator $color_separator # ワークスペースボタン # class border background text focused_workspace $color_focus_border $color_focus_bg $color_focus_text active_workspace $color_active_border $color_active_bg $color_active_text inactive_workspace $color_unfocus_border $color_unfocus_bg $color_unfocus_text } } # 表示モード(表示状態)のトグル bindsym $mod+b bar hidden_state toggle ## ウィンドウの配色 # class border background text indicator child_border client.focused $color_focus_border $color_focus_bg $color_focus_text $color_focus_indicator $color_focus_cborder client.focused_inactive $color_active_border $color_active_bg $color_active_text $color_active_indicator $color_active_cborder client.unfocused $color_unfocus_border $color_unfocus_bg $color_unfocus_text $color_unfocus_indicator $color_unfocus_cborder client.background $color_background