1. 概要
以下、「CachyOS 260124 sway」での操作です
「Gemini」伍長のおかげで、「waybar」のクリックが効かなくなった原因がわかりました。
2. インストール
yes | pacman -S -y jgmenu papirus-icon-theme
3. sway 設定
デフォルトで「swaybar」が動作しているので、「waybar」が動作するようにします。
ログインユーザで。
vim ~/.config/sway/config
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command while date +'%Y-%m-%d %X'; do sleep 1; done
colors {
statusline #ffffff
background #323232
inactive_workspace #32323200 #32323200 #5c5c5c
}
}
219行の後に、行を追加します。
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
swaybar_command waybar
4. waybar 設定
ログインユーザで。
cp -R /etc/xdg/waybar ~/.config/waybar
vim ~/.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;
}
フォントを変更します。
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: "MigMix 1M", FontAwesome, Roboto, Helvetica, Arial, sans-serif;
font-size: 12px;
}
~/.config/waybar/config.jsonc
// Choose the order of the modules
"modules-left": [
"sway/workspaces",
"sway/mode",
"sway/scratchpad",
"custom/media"
],
10行目に、行を追加します。
// Choose the order of the modules
"modules-left": [
"custom/launcher",
"sway/workspaces",
"sway/mode",
"sway/scratchpad",
"custom/media"
],
}
}
218、219行の間に、「custom/launcher」の項目を追加します。
},
"custom/launcher": {
"format":" ",
"on-click": "jgmenu_run",
"tooltip": false
}
}
220行は、このままコピペしてもだめです。
そのために、「vi」でなく、明示的に「vim」で書いておるのですが、「"」ダブルコーテーションの間は、半角スペースで挟んで。
挿入モードで Ctrl+V に続けて、「uf1d8」と入力します。
紙飛行機のアイコンになるはずです。
221行がミソで、以前は、「"on-click": "exec jgmenu_run",」と書いていたように記憶していたのですが・・・。
少なくとも、現在は「"on-click": "jgmenu_run",」と「exec」を抜かないと、「exec」というコマンドを実行しようとします。
5. jgmenu 設定
ログインユーザで。
「jgmenu」のデザインをカスタマイズして、終了メニューを加えます。
mkdir -pv ~/.config/jgmenu
sh
cat << 'EOF' >> ~/.config/jgmenu/jgmenurc
menu_margin_x = 15
menu_margin_y = 32
menu_valign = top
item_height = 22
font = MigMix 1M bold 9
icon_theme = Papirus
color_sel_bg = #ffffff 40
csv_name_format = %nEOF
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 キーを押さないと消えないのが少し面倒かな。
6. 参考サイト
本ページは、「Gemini」伍長を参考にさせていただきました。