ArcoLinux - 19.06.1 - i3wm - 基本操作 - ~/.config/i3/config


 クラウディア


1. 概要
2. $mod 定義
3. モニタの設定
4. メニュー
5. ログアウト・シャットダウン
6. リスタート・リロード
7. アプリケーションの起動
8. スクリーンショット

1. 概要

 前ページの、キー操作を含め、「i3wm」の定義は、コンフィグレーションファイルに入っています。  このプラットフォームのコンフィグレーションファイルは、

~/.config/i3/config
 です。  見たら、デフォルトで 1083行もあるので、全部掲載するのは控えて、主なところや、わたしのいじるところを中心に少し掲載します。

2. $mod 定義

 中心となる、$mod の定義、既に調べましたが・・・。

#####################################################################################################################
#################                          Define the $mod variable/key                             #################
#####################################################################################################################

# Key to rule them all : Super(Windows) or Alt key?

# Mod4 = Windows or Super key on keyboard
# Mod1 = Alt key on keyboard

#Set Alt key
#set $mod Mod1

#set Super key
set $mod Mod4
 ちゅうことで、$mod は、Mod4、つまり Win キーになっております。

3. モニタの設定

 このあたりが、モニタの設定のようで・・・。

#####################################################################################################################
#################                          Single and Dual screen                                   #################
#####################################################################################################################


# setting variables for later use
# use xrandr and/or arandr to know the names of your monitors
# use this line to tell which monitor is on the right
# xrandr --output DVI-I-2 --right-of DVI-I-1 --auto
#exec --no-startup-id xrandr --output LVDS1 --mode 1366x768 --output DP3 --mode 1920x1080 --right-of LVDS1
#exec --no-startup-id xrandr --output DVI-I-0 --right-of HDMI-0 --auto
#exec --no-startup-id xrandr --output DVI-1 --right-of DVI-0 --auto
#exec --no-startup-id xrandr --output DVI-D-1 --right-of DVI-I-1 --auto
exec --no-startup-id xrandr --output HDMI2 --right-of HDMI1 --auto


# my current setup

#set $firstMonitor DP3
#set $secondMonitor LVDS1

#set $firstMonitor DVI-I-0
#set $secondMonitor HDMI-0


#set $firstMonitor DVI-0
#set $secondMonitor DVI-1

#set $firstMonitor DVI-I-1
#set $secondMonitor DVI-D-1

set $firstMonitor HDMI1
set $secondMonitor HDMI2
 いじれば、サイズを変更できそうな気がします。

4. メニュー

 メニューっぽい記述が・・・。

#####################################################################################################################
#################                          3 menu's in arcolinux                                     #################
#####################################################################################################################

# start dmenu
bindsym $mod+shift+d exec --no-startup-id dmenu_run -i -nb '#191919' -nf '#fea63c' -sb '#fea63c' -sf '#191919' -fn 'NotoMonoR
egular:bold:pixelsize=14'

# gmrun
bindsym mod1+F2 exec --no-startup-id gmrun

# start xfce-appfinder
bindsym mod1+F3 exec --no-startup-id xfce4-appfinder

# start rofi full
bindsym $mod+F11 exec --no-startup-id rofi -show run -fullscreen -font "Noto Sans 13"

# start rofi small
bindsym $mod+F12 exec --no-startup-id rofi -show run -font "Noto Sans 13"
 $mod+Shift+d で「dmenu」が起動します。  操作については、後述します。

5. ログアウト・シャットダウン

 ログアウト・シャットダウンの関連が

#####################################################################################################################
#################                          how to exit, logoff, suspend, ...                        #################
#####################################################################################################################


# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec --no-startup-id "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit
 i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"


#Press $mod (super) and X to exit - check toolbar for next choices
bindsym $mod+X mode "$mode_system"
bindsym control+mod1+Delete mode "$mode_system"

set $mode_system System (k) lock, (l) logout, (u) suspend, (h) hibernate, (r) reboot, (s) shutdown
mode "$mode_system" {
    bindsym k exec --no-startup-id ~/.config/i3/scripts/i3exit.sh lock, mode "default"
    bindsym l exec --no-startup-id ~/.config/i3/scripts/i3exit.sh logout, mode "default"
    bindsym u exec --no-startup-id ~/.config/i3/scripts/i3exit.sh suspend, mode "default"
    bindsym h exec --no-startup-id ~/.config/i3/scripts/i3exit.sh hibernate, mode "default"
    bindsym r exec --no-startup-id ~/.config/i3/scripts/i3exit.sh reboot, mode "default"
    bindsym s exec --no-startup-id ~/.config/i3/scripts/i3exit.sh shutdown, mode "default"

    # back to normal: Enter or Escape
    bindsym Return mode "default"
    bindsym Escape mode "default"
}
 $mod+X で、下記のメニューが表示されます。

 これで、下記の操作が有効になります。

 動作  キー 備考
ロック k
ログアウト l
サスペンド u
ハイバネート h
再起動 r
シャットダウン s
取消 ESC

6. リスタート・リロード

 正に、この「~/.config/i3/config」を書き換えたときの動作が

#####################################################################################################################
#################                          reload changed configuration                             #################
#####################################################################################################################


# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart

# reload the configuration file
bindsym $mod+Shift+c reload
 つまり
動作 キー 備考
リスタート $mod+Shift+r
リロード $mod+Shift+c

7. アプリケーションの起動

 アプリケーションの起動が

#####################################################################################################################
#################                          execute applications at boot time                        #################
#####################################################################################################################

# USER APPLICATIONS TO START AT BOOT

#browser
#exec --no-startup-id vivaldi-stable
for_window [class="Vivaldi-stable"] focus

#text-editor
#exec --no-startup-id geany
#exec --no-startup-id atom

#file manager
exec --no-startup-id thunar

#Mail clients
#exec --no-startup-id evolution

#Music
#exec --no-startup-id spotify
for_window [class="Spotify"] focus
 ちゅうことで、417行目の記述で、ログイン時に「ファイルマネージャ」が起動していて、そのプログラムが「thunar」ということがわかります。  起動しないようにするには、ここをコメントアウトします。

8. スクリーンショット

 スクリーンショット(画面キャプチャ)の定義が

#####################################################################################################################
#################                          screenshots                                              #################
#####################################################################################################################


bindsym Print exec --no-startup-id scrot 'ArcoLinux-%Y-%m-%d-%s_screenshot_$wx$h.jpg' -e 'mv $f $$(xdg-user-dir PICTURES)'
bindsym Control+Print exec --no-startup-id xfce4-screenshooter
bindsym Control+Shift+Print exec --no-startup-id gnome-screenshot -i
#bindsym shift+Print exec --no-startup-id shutter
 のあたりですな。  定義通りであれば、「scrot」「xfce4-screenshooter」「gnome-screenshot」がインストールされていて、それぞれ次のような動きをするはず。
動作 キー 備考
「scrot」でキャプチャしてピクチャフォルダに保存 Print
「xfce4-screenshooter」を起動 Contol+Print
「gnome-screenshot」を起動 Contol+Shift+Print

 「scrot」以外は、動作確認できました。


earthcar(アースカー)
葬送のフリーレン Prime Video