- 1. 概要
- 2. ダウンロード
- 3. 設定
- 4. 確認
1. 概要
前ページの結果を「ArcoLinux」にも反映してみようという寸法です。
作成した「freedesktop」を「FreeBSD」に組み込んでみます。
2. ダウンロード
ダウンロードして取得できるようにしました。
「curl」が必要ですので、インストールしておいてください。
「curl」とアイコンテーマで使う「papirus-icon-theme」をインストールしておきます。
「root」ユーザ権限で。
pkg install -y curl papirus-icon-theme
ダウンロード。
mkdir -pv /usr/local/share/lua/5.2/freedesktop
cd /usr/local/share/lua/5.2/freedesktop
curl --insecure https://freebsd.sing.ne.jp/download/lua/5.2/desktop.lua --output ./desktop.lua
curl --insecure https://freebsd.sing.ne.jp/download/lua/5.2/init.lua --output ./init.lua
curl --insecure https://freebsd.sing.ne.jp/download/lua/5.2/menu.lua --output ./menu.lua
上記は、「FreeBSD 13.2 RELEASE」以降、「lua」のバージョンが変わったため、下記になります。
mkdir -pv /usr/local/share/lua/5.3/freedesktop
cd /usr/local/share/lua/5.3/freedesktop
curl --insecure https://freebsd.sing.ne.jp/download/lua/5.3/freedesktop/desktop.lua --output ./desktop.lua
curl --insecure https://freebsd.sing.ne.jp/download/lua/5.3/freedesktop/init.lua --output ./init.lua
curl --insecure https://freebsd.sing.ne.jp/download/lua/5.3/freedesktop/menu.lua --output ./menu.lua
3. 設定
コンフィグレーションファイルを編集して組み込みます。
ログインユーザで。
まず、「~/.config/awesome/rc.lua」が存在しない場合は。
mkdir -pv ~/.config/awesome
cp /usr/local/etc/xdg/awesome/rc.lua ~/.config/awesome/.
それから。
vi ~/.config/awesome/rc.lua
先頭部分で、「freedesktop」を読みこみます。
local hotkeys_popup = require("awful.hotkeys_popup")
-- Enable hotkeys help widget for VIM and other apps
の箇所を、下記へ(これは前ページと同じ)
local hotkeys_popup = require("awful.hotkeys_popup")
-- Freedesktop menu
local freedesktop = require("freedesktop")
-- Enable hotkeys help widget for VIM and other apps
メニューのフォントも好みのものへ、変更して、幅を少し広くします。
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
を下記のように書き換えます。
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
beautiful.icon_theme = "Papirus-Dark"
beautiful.menu_font = "MigMix 1M Regular 10"
beautiful.menu_width = 180
beautiful.menu_height = 22
beautiful.font = "MigMix 1M Regular 10"
beautiful.notification_font = "MigMix 1M Bold 14"
beautiful.hotkeys_font = "MigMix 1M Regular 10"
beautiful.hotkeys_modifiers_fg = "#32CD32"
次の箇所が本番、メニューの組み込みです。
-- {{{ Menu
-- Create a launcher widget and a main menu
myawesomemenu = {
{ "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
{ "manual", terminal .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awesome.conffile },
{ "restart", awesome.restart },
{ "quit", function() awesome.quit() end },
}
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
{ "open terminal", terminal }
}
})
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
menu = mymainmenu })
を下記のように書き換えます。
-- {{{ Menu
-- Create a launcher widget and a main menu
myawesomemenu = {
{ "キー定義", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end, menubar.utils.lookup_icon("preferences-desktop-keyboard-shortcuts") },
{ "マニュアル", terminal .. " -e man awesome", menubar.utils.lookup_icon("system-help") },
{ "定義編集", editor_cmd .. " " .. awesome.conffile, menubar.utils.lookup_icon("accessories-text-editor") },
{ "awesome 再起動", awesome.restart, menubar.utils.lookup_icon("system-restart") },
{ "ログアウト", function() awesome.quit() end, menubar.utils.lookup_icon("system-log-out") },
}
myexitmenu = {
{ "ログアウト", function() awesome.quit() end, menubar.utils.lookup_icon("system-log-out") },
{ "再起動", "sudo /sbin/reboot", menubar.utils.lookup_icon("system-reboot") },
{ "シャットダウン", "sudo /sbin/poweroff", menubar.utils.lookup_icon("system-shutdown") }
}
mymainmenu = freedesktop.menu.build({
icon_size = 32,
before = { { "Awesome", myawesomemenu, beautiful.awesome_icon }, },
after = { { "終了", myexitmenu, menubar.utils.lookup_icon("system-shutdown") }, }
})
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
menu = mymainmenu })
コンフィグレーションファイルの書き換えは、こちらの方が、前ページより少ないですね。
2020年11月12日、表示内容を日本語へと少し書き換えました。
下で掲載している画像と異なるものがありますので、ご注意ください。
4. 確認
前項まで終わったら、Ctrl+Win+R で、「awesome」をリスタートして、確認します。

ほぼ、思い通りです(フォントは、もう1サイズ小さい方がいいかしら)。
後は、インストールするアプリケーションが、うまく組み込まれるかを確認するのみです。
末尾のページに記しましたが、結論は、「awesome」を再起動しないとメニューは更新されません。
まぁ、正にこのメニューを使用して更新すればいいわけですが・・・。
|