sway - 共通事項 - 定義 - 一般


 クラウディア


1. 概要
2. 定義
3. キー定義

1. 概要

 まずは、大元になる定義の話から。  各プラットフォームとの比較も掲載しておきます。

2. 定義

 定義ファイルは、下記にあります。
プラットフォーム システムファイル ユーザファイル 備考
Fedora /etc/sway ~/.config/sway/config ※1
/usr/share/sway/config.d
FreeBSD /usr/local/etc/sway/config ~/.config/sway/config ※2
Garuda Linux /etc/skel/.config/sway ~/.config/sway/config ※3
Manjaro /etc/sway ~/.config/sway/config ※4
CachyOS /etc/sway ~/.config/sway/config ※5
SparkyLinux /etc/sway/config ~/.config/sway/config ※6
/etc/sway/config.d/50-systemd-user.conf

 ※1 「Fedora」では、2つのシステムファイル用のフォルダを持っています。
 「/etc/sway」配下は、下記のフォルダ・ファイル構成になっています。


/etc/sway
|-- config
|-- config.d
|   |-- 10-systemd-cgroups.conf
|   `-- 10-systemd-session.conf
`-- environment
 「/usr/share/sway/config.d/」配下は、下記のファイル構成になっています。

/usr/share/sway/config.d/
|-- 50-rules-browser.conf
|-- 50-rules-pavucontrol.conf
|-- 50-rules-policykit-agent.conf
|-- 60-bindings-brightness.conf
|-- 60-bindings-media.conf
|-- 60-bindings-screenshot.conf
|-- 60-bindings-volume.conf
|-- 65-mode-passthrough.conf
|-- 90-bar.conf
|-- 90-swayidle.conf_
|-- 95-autostart-policykit-agent.conf
|-- 95-xdg-desktop-autostart.conf
`-- 95-xdg-user-dirs.conf
 デフォルトでは、ユーザ用のフォルダは用意されていませんが、作成してファイルを置けば、有効になります。
 ※2 「FreeBSD」での設定は、「Garuda Linux」を見習いたいと思います。


mkdir -pv ~/.config/sway/config.d
cp /usr/local/etc/sway/config ~/.config/sway/.
vi ~/.config/sway/config
 末尾の下記を

include /usr/local/etc/sway/config.d/*
 下記へ変更します。

include $HOME/.config/sway/config.d/*
 ※3 「Garuda Linux」では「/etc/skel/.config/sway」配下も「~/.config/sway」配下も、下記のフォルダ・ファイル構成になっています。


|-- cheatsheet
|-- config
|-- config.d
|   |-- application_defaults
|   |-- autostart_applications
|   |-- clamshell
|   |-- default
|   |-- input
|   |-- output
|   `-- theme
`-- scripts
    |-- clamshell.sh
    |-- import-gsettings
    |-- light.sh
    |-- lockman.sh
    |-- screenshot.sh
    `-- swayfader.py
 ※4 「Manjaro」については、「26.1」より前と移行では、構成が異なっているので、別途ページを設けます。
 ※5 「CachyOS」では「/etc/sway」配下が、それぞれ、下記のフォルダ・ファイル構成になっています。


/etc/sway
|-- config
`-- config.d
    `-- 50-systemd-user.conf
 デフォルトでは、ユーザファイルが用意されていないので、下記でコピーします。  ログインユーザで。

cp -R /etc/sway ~/.config/sway
 コピーしているので、システムとユーザ用はこの時点で、全く同じです。  一か所、書き直しておきます。

vi ~/.config/sway/config
 末尾の。

include /etc/sway/config.d/*
 の箇所を、ログインユーザ用に書き換えます。

include ~/.config/sway/config.d/*
 ※6 「SparkyLinux 8.2」へ、「sway」をインストールしてみましたが、キー操作が効かなかったので、以降の作業はしていません(2026年2月19日)。

3. キー定義

 主なキー定義のデフォルトの状態と、わたしがカスタマイズした状態を記述します。
プラットフォームキー定義備考
mod端末を開くウィンドウを
閉じる
表示切替リロードログアウト
CachyOSWinmod+Entermod+Shift+qmod+Shift+spacemod+Shift+cmod+Shift+e
FedoraWinmod+Entermod+Shift+qmod+Shift+spacemod+Shift+cmod+Shift+e
FreeBSDWinmod+Entermod+Shift+qmod+Shift+spacemod+Shift+cmod+Shift+e
Garuda LinuxWinmod+Entermod+qmod+Shift+spacemod+Shift+cmod+Shift+e
ManjaroWinmod+Entermod+Shift+qmod+Shift+spacemod+Shift+cmod+Shift+e


 端末を開くに関して、「Garuda Linux」では、デフォルトの端末を「alacritty」にしているのですが。
 「Wayfire」でもそうでしたが、「alacritty」は起動するとこけます。
 「FreeBSD」で動作した、「foot」をインストールして使用します。
 「Manjaro」では、そのままデフォルトの端末が「foot」になっています。
 「i3wm」には、再起動が「restart」で定義されているのですが、「sway」にはないようです。

 「FreeBSD」は、下記のように編集しています。


vi ~/.config/sway/config

    # Kill focused window
    bindsym $mod+Shift+q kill
 を下記へ。

    # Kill focused window
    bindsym $mod+Shift+q kill
    bindsym $mod+q kill

    # Toggle the current focus between tiling and floating mode
    bindsym $mod+Shift+space floating toggle

    # Swap focus between the tiling area and the floating area
    bindsym $mod+space focus mode_toggle
 を下記へ

    # Toggle the current focus between tiling and floating mode
    bindsym $mod+space focus mode_toggle

    # Swap focus between the tiling area and the floating area
    bindsym $mod+Shift+space floating toggle

audiobook.jp
earthcar(アースカー)
TikTok Shop 【リピート用プログラム】
それがだいじWi-Fi
5G CONNECT
EaseUS
ベルリッツ
【usus ウズウズ】
ハイスピードプラン
サウンドハウス
Amazonギフトカード
薬屋の独り言
U-NEXT
健康サポート特集
損保との違い
葬送のフリーレン Prime Video
アフィリエイトのアクセストレード
ネットオークションの相場、統計、価格比較といえばオークファン
JETBOY