- 1. 概要
- 2. インストール
- 3. バー設定
- 4. メニュー設定
1. 概要
「Fedora」では、デフォルトで「rofi」というメニューが容易してあります。
Mod+D で、と中央に表示されます。

他と同様、メニューは、「jgmenu」、アイコンは「papirus」を使用することにします。
2. インストール
「root」ユーザ権限で。
dnf install -y jgmenu papirus-icon-theme
3. バー設定
バーには、他のプラットフォームと同様「waybar」を使用していいます。
起動は
/usr/share/sway/config.d/90-bar.conf
で、定義しています。
ファイルの中身は
# Status Bar: waybar
#
# Read `man 5 sway-bar` for more information about this section.
#
# Requires: waybar
bar {
position top
swaybar_command waybar
}
となっておる。
「waybar」のコンフィグレーションファイルは
/etc/xdg/waybar
配下にあります。
ログインユーザで。
自前の定義を作成します。
cp -R /etc/xdg/waybar ~/.config/waybar
「waybar」のフォントを変更します。
vi ~/.config/waybar/style.css
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif;
font-size: 13px;
}
3行目を下記のように書きます。
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: "MigMix-1M", FontAwesome, Roboto, Helvetica, Arial, sans-serif;
font-size: 13px;
}
バーに「jgmenu」を組み込みます。
vi ~/.config/waybar/config
{
// "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 30, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
"spacing": 4, // Gaps between modules (4px)
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad", "custom/media"],
8行目に、メニューの項目を組み込みます。
{
// "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 30, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
"spacing": 4, // Gaps between modules (4px)
// Choose the order of the modules
"modules-left": ["custom/menu", "sway/workspaces", "sway/mode", "sway/scratchpad", "custom/media"],
}
}
164行目と165行目(行番号は、バージョンによって異なります)の間に、メニューの項目を組み込みます。
},
"custom/menu": {
"format": " ? ",
"on-click": "swaymsg exec jgmenu_run",
"tooltip": false
},
}
「vim」で編集する場合、166行目の、文字列内には、半角スペース入力後、Ctrl+V、u で「f1d8」を入力します。
これで、mod+Shift+c で、「sway」を再起動してやれば、「waybar」が更新されます。
4. メニュー設定
ログインユーザで。
「jgmenu」のデザインをカスタマイズして、終了メニューを加えます。
mkdir -pv ~/.config/jgmenu
sh
cat << 'EOF' >> ~/.config/jgmenu/jgmenurc
menu_margin_x = 20
menu_margin_y = 40
menu_valign = top
item_height = 22
font = MigMix 1M bold 9
icon_theme = Papirus
color_sel_bg = #ffffff 40
csv_name_format = %n
EOF
cat << 'EOF' >> ~/.config/jgmenu/append.csv
^sep()
ログアウト,pkill sway,system-log-out
再起動,sudo /sbin/reboot,system-reboot
シャットダウン,sudo /sbin/poweroff,system-shutdown
EOF
exit
「/sbin/reboot」「/sbin/poweroff」は、「visudo」でパスワードなしで、ログインユーザが実行できるようにしておく必要があります。
「jgmenu」を表示した状態で、「あ、やめた」ってなったとき、メニューを消すのに、ESC キーを押さないと消えないのが少し面倒かな。
|