Hi, folks. It's been a while, isn't it?
Well, I know nowadays people are telling X11 will be dead soon and the future is Wayland, but for the ones like me, dinosaurs that can't live without things like fluxbox or openbox, how the future will be?
Openbox is a very mature WM, offering some tricks we don't see much around here.
Here's one much helpful: Making custom menus.
I've already shown the path to do the same in fluxbox in the past.
Now I show you all to do that in openbox.
First, locate in rc.xml the block of code that refers the menu. It's something like this:
<menu>
<hideDelay>250</hideDelay>
<middle>no</middle>
<submenuShowDelay>100</submenuShowDelay>
<submenuHideDelay>400</submenuHideDelay>
<applicationIcons>yes</applicationIcons>
<manageDesktops>yes</manageDesktops>
<file>menu.xml</file>
</menu>
My suggestion is to duplicate the code but creating a new menu in the tag <file>. Something like this:
<menu>
<hideDelay>250</hideDelay>
<middle>no</middle>
<submenuShowDelay>100</submenuShowDelay>
<submenuHideDelay>400</submenuHideDelay>
<applicationIcons>no</applicationIcons>
<manageDesktops>yes</manageDesktops>
<file>/home/pibarnas/.config/openbox/custom.xml</file>
</menu>
Don't forget to associate a keybind key to call your future menu, into the rc.xml too:
<keybind key="W-c">
<action name="ShowMenu">
<menu>custom</menu>
</action>
</keybind>
Now, in $HOME/.config/openbox, create the file custom.xml, following the rules to make openbox menus (openbox menus):
Always starting with
<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openbox.org/ file:///usr/share/openbox/menu.xsd">
And finish with:
</openbox_menu>
<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openbox.org/ file:///usr/share/openbox/menu.xsd">
<menu
id="custom"
label="custom"
>
<item
label="Music"
>
<action
name="Execute"
>
<execute>sakura -x /home/pibarnas/bin/music.sh -h</execute>
</action>
</item>
<item
label="Vim"
>
<action
name="Execute"
>
<execute>/opt/appimages/vi</execute>
</action>
</item>
<item label="_backup OB files">
<action name="Execute">
<prompt>
Fazer backup das configs?
</prompt>
<execute>
/home/pibarnas/bin/bkp_openbox2.sh
</execute>
</action>
</item>
<item label="Edit Backup">
<action name="Execute">
<execute>
/opt/appimages/vi /home/pibarnas/bin/bkp_openbox2.sh
</execute>
</action>
</item>
<menu
id="Sair"
label="Sair"
>
<item
label="Reiniciar"
>
<action name="Execute">
<command>/usr/bin/systemctl reboot</command>
</action>
</item>
<item
label="Desligar"
>
<action name="Execute">
<command>/usr/bin/systemctl poweroff</command>
</action>
</item>
</menu></menu>
</openbox_menu>
That's it! Apart from the root menu, now I have a custom menu that's shown when I press Windows key+"c". You can make several openbox menus, each one with some functionality (a menu to close the session, for instance). Mine's like this:
Only to show you the difference, my root menu is like this:
That's all folks! Hope you enjoy this tip!


Nenhum comentário:
Postar um comentário