oblogoutというopenbox専用みたいな
Exitツールがあったのですが、もう使えなくなって、
5年ぐらいは経ったような気はします。
(検索してみたましたら、今現在は、
logout-py3-gitという名でありました)
bunsenlbas(boron)で、yadというコマンドを使い、
Exitメニューを構成しているのを見つけました。
真似て、archbangで試してみました。
pacmanで、yadはインストールできます。
下記のようなスクリプトを作ります。
~/Exit
#!/bin/bash
yad --center --undecorated --timeout="20" --skip="taskbar" --timeout-indicator="top" --button="Reboot:systemctl reboot" --button="Shutdown:systemctl poweroff" --button="Logout:kill -9 -1" --button="Cancel:1"
yad --center --undecorated --timeout="20" --skip="taskbar" --timeout-indicator="top" --button="Reboot:systemctl reboot" --button="Shutdown:systemctl poweroff" --button="Logout:kill -9 -1" --button="Cancel:1"
ファイルに実行権限を。
$ chmod +x Exit
これをopenboxのメニューに反映。
Exitの部分を下記に差し替えます。
~/.config/openbox/menu.xml
差し替える部分(戻せるよう、バックアップ)
<menu id="exit_menu" label="Exit">
<item label="Log Out">
<action name="Exit">
<prompt>yes</prompt>
</action>
</item>
<item label="Reboot">
<action name="Execute">
<command>systemctl reboot</command>
</action>
</item>
<item label="Poweroff">
<action name="Execute">
<command>systemctl poweroff</command>
</action>
</item>
<item label="Log Out">
<action name="Exit">
<prompt>yes</prompt>
</action>
</item>
<item label="Reboot">
<action name="Execute">
<command>systemctl reboot</command>
</action>
</item>
<item label="Poweroff">
<action name="Execute">
<command>systemctl poweroff</command>
</action>
</item>
以下に差し替える。
<item label="Exit">
<action name="Execute">
<command>/home/user/Exit</command>
</action>
</item>
<action name="Execute">
<command>/home/user/Exit</command>
</action>
</item>
$ openbox --reconfigure
真ん中に小さく出ているのが、それです。
拡大すると、
アイコンを付けたり、Supendとか、User changeとか、
項目を増やすこともできたりします。
詳しくは、
$ man yad
参考になるyoutube動画は下記のurl。
https://www.youtube.com/watch?v=kwR0SpjnFWI
タイトル:
Tutorial - How to create a power menu with YSD
https://www.youtube.com/watch?v=kwR0SpjnFWI&t=1s
※urlが間違っていました。すみません。
注意点は、shでなくbashスクリプトにすることです。
スクリプトにせず直接menu.xmlに書いても、
反応するはずですが、まあ長いですから。
bunsenlabs(boron)のyadコマンド列を参考までに。
~/.config/jgmenu/prepend.csv
About Bunsen Alternatives,yad --button="OK":0 --center --window-icon=distributor-logo-bunsenlabs --text-info --title="About Bunsen Alternatives" --filename="/usr/share/bunsen/docs/helpfiles/helpfile-bl-alternatives.txt" --width=900 --height=700 --fontname=Monospace,distributor-logo-bunsenlabs
archbang上でこの通りしても、もちろん再現できません。
咀嚼して応用すれば、似た感じにできると思います。
↓ ↓ ↓ ↓
bunsen(boron)から、/usr/bin/bl-exitと、
/usr/share/applicaitons/bl-exit.desktop
を持ってきました。
adwaitaにexit関連のアイコンはないので、
numix-icon-theme-gitをインストールしました。
lxappearanceで、同アイコンテーマをシステムアイコンに変更。
(yadは、システムアイコンに指定したアイコンしか使えません)
/usr/bin/bl-exitは、スクリプトファイルで、
改ざんできます。(^^)
yad_gui() {
yad --class=WmanExit --title "Exit" --close-on-unfocus --undecorated --center --on-top --borders=10 --window-icon=system-log-out \
--button=" _Logout!system-log-out!Logout":'bash -c "kill -9 -1"' \
--button=" Re_boot!system-reboot!":'bash -c "systemctl reboot"' \
--button=" _Power Off!system-shutdown!":'bash -c "systemctl poweroff"'
}
yad --class=WmanExit --title "Exit" --close-on-unfocus --undecorated --center --on-top --borders=10 --window-icon=system-log-out \
--button=" _Logout!system-log-out!Logout":'bash -c "kill -9 -1"' \
--button=" Re_boot!system-reboot!":'bash -c "systemctl reboot"' \
--button=" _Power Off!system-shutdown!":'bash -c "systemctl poweroff"'
}
--buttonの行を、suspendとlock-sessionを削除して
上記のように3行にしました。オレンジのところを
オリジナルから変えました。
--window-iconの意味は、ファイルの中にある複数の画像を
その意味の合うところに割り当てる機能のようです。
あとは、openboxのmenu.xmlを修正。
reconfigureすれば、反映されるはずです。
キャンセルは、デスクトップを1回クリックすると、
bl-exitの表示は消えます。