Menu do Openbox com ícones

Publicado por edps em 04/06/2012

[ Hits: 14.206 ]

Blog: https://edpsblog.wordpress.com/

 


Menu do Openbox com ícones



Conforme o prometido à galera do VOL: Openbox-menu, e também aos que acompanham meu blog, demonstrarei nesta dica como implementar a utilização de ícones no menu do Openbox v3.5.

Como visto no finalzinho da introdução, será necessário a instalação da versão 3.5 do Openbox.

No Debian Squeeze nem percam tempo, antigamente funcionava bem, atualmente até podemos compilar, empacotar e instalar com sucesso, mas perdemos a ferramenta obconf, que tem diversas funções nesse WM.

Para maiores detalhes (caso queiram) sobre a compilação do Openbox no Squeeze, vejam a dica original:

Instalação

Execute os comandos abaixo:

sudo apt-get install build-essential pkg-config libpango1.0-dev libglib2.0-dev libxml2-dev libxcursor-dev libimlib2-dev libstartup-notification0-dev libxext-dev x11proto-randr-dev menu menu-xdg libmenu-cache1-dev libgtk2.0-dev lxmenu-data
$ wget -nv
http://mimarchlinux.googlecode.com/files/openbox-menu-0.3.6.7.tar.bz2
tar -jxf openbox-menu-0.3.6.7.tar.bz2
$ cd openbox-menu-0.3.6.7/
$ make
$ sudo make install
- Arch Linux

No Arch Linux instalamos facilmente assim:

wget https://aur.archlinux.org/packages/op/openbox-menu/openbox-menu.tar.gz
tar -zxvf openbox-menu.tar.gz
$ cd openbox-menu
$ makepkg -si


Tendo instalado o script, é hora de alterar o arquivo de configuração "~/.config/openbox/menu.xml":

nano ~/.config/openbox/menu.xml
Deixe-o assim:

<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/3.5/menu">
    <menu execute="/usr/bin/openbox-menu lxde-applications.menu" id="desktop-app-menu" label="Aplicativos"/>
    <menu id="root-menu" label="Openbox 3">
        <separator label="Menu"/>
        <menu id="desktop-app-menu"/>
        <separator/>
        <item label="Editor de Textos">
            <action name="Execute">
                <execute>
                    leafpad
                </execute>
            </action>
        </item>
        <item label="Gerenciador de Arquivos">
            <action name="Execute">
                <execute>
                    thunar
                </execute>
            </action>
        </item>
        <item label="Navegador Web">
            <action name="Execute">
                <execute>
                    x-www-browser
                </execute>
            </action>
        </item>
        <item label="Terminal">
            <action name="Execute">
                <execute>
                    x-terminal-emulator
                </execute>
            </action>
        </item>
        <separator/>
        <menu id="settings" label="Configurações">
            <menu id="conkyconfig" label="Conky">
                <item label="Edit .conkyrc">
                    <action name="Execute">
                        <execute>
                            leafpad ~/.conkyrc
                        </execute>
                    </action>
                </item>
                <separator label="Help?"/>
                <item label="man page">
                    <action name="Execute">
                        <execute>
                            terminator --command="man conky"
                        </execute>
                    </action>
                </item>
                <item label="Wiki Page">
                    <action name="Execute">
                        <execute>
                            x-www-browser http://crunchbanglinux.org/wiki/conky
                        </execute>
                    </action>
                </item>
            </menu>
            <menu id="dmenuconfig" label="dmenu">
                <item label="Edit start-up script">
                    <action name="Execute">
                        <execute>
                            leafpad ~/.config/dmenu/dmenu-bind.sh
                        </execute>
                    </action>
                </item>
                <separator label="Help?"/>
                <item label="man page">
                    <action name="Execute">
                        <execute>
                            terminator --command="man dmenu"
                        </execute>
                    </action>
                </item>
            </menu>
            <menu id="gmrunconfig" label="gmrun">
                <item label="Edit config file">
                    <action name="Execute">
                        <execute>
                            leafpad ~/.gmrunrc
                        </execute>
                    </action>
                </item>
                <separator label="Help?"/>
                <item label="man page">
                    <action name="Execute">
                        <execute>
                            terminator --command="man gmrun"
                        </execute>
                    </action>
                </item>
            </menu>
            <menu id="obConfig" label="Openbox">
                <item label="Edit menu.xml">
                    <action name="Execute">
                        <execute>
                            leafpad ~/.config/openbox/menu.xml
                        </execute>
                    </action>
                </item>
                <item label="Edit rc.xml">
                    <action name="Execute">
                        <execute>
                            leafpad ~/.config/openbox/rc.xml
                        </execute>
                    </action>
                </item>
                <item label="Edit autostart">
                    <action name="Execute">
                        <execute>
                            leafpad ~/.config/openbox/autostart
                        </execute>
                    </action>
                </item>
                <item label="GUI Menu Editor">
                    <action name="Execute">
                        <execute>
                            obmenu
                        </execute>
                    </action>
                </item>
                <item label="GUI Applications Settings Editor">
                    <action name="Execute">
                        <execute>
                            obapps
                        </execute>
                    </action>
                </item>
                <item label="GUI Config Tool">
                    <action name="Execute">
                        <execute>
                            obconf
                        </execute>
                    </action>
                </item>
                <item label="Reconfigure">
                    <action name="Reconfigure"/>
                </item>
                <item label="Restart">
                    <action name="Restart"/>
                </item>
            </menu>
            <menu id="terminatorconfig" label="Terminator">
                <item label="Edit config file">
                    <action name="Execute">
                        <execute>
                            leafpad ~/.config/terminator/config
                        </execute>
                    </action>
                </item>
                <separator label="Help?"/>
                <item label="man page">
                    <action name="Execute">
                        <execute>
                            terminator --command="man terminator_config"
                        </execute>
                    </action>
                </item>
            </menu>
            <menu id="tint2config" label="tint2">
                <item label="Edit config file">
                    <action name="Execute">
                        <execute>
                            leafpad ~/.config/tint2/tint2rc
                        </execute>
                    </action>
                </item>
                <item label="Restart tint2">
                    <action name="Execute">
                        <execute>
                            tint2restart
                        </execute>
                    </action>
                </item>
                <separator label="Help?"/>
                <item label="man page">
                    <action name="Execute">
                        <execute>
                            terminator --command="man tint2"
                        </execute>
                    </action>
                </item>
                <item label="Online Help">
                    <action name="Execute">
                        <execute>
                            x-www-browser http://code.google.com/p/tint2/wiki/Welcome
                        </execute>
                    </action>
                </item>
            </menu>
            <menu id="DisplaySettings" label="Display Settings">
                <item label="Adjust with grandr">
                    <action name="Execute">
                        <execute>
                            grandr
                        </execute>
                    </action>
                </item>
                <separator label="Help?"/>
                <item label="man xrandr">
                    <action name="Execute">
                        <execute>
                            terminator --command="man xrandr"
                        </execute>
                    </action>
                </item>
            </menu>
            <item label="Edit Default Applications">
                <action name="Execute">
                    <execute>
                        terminator --command="sudo update-alternatives --all"
                    </execute>
                </action>
            </item>
            <item label="User Interface Settings">
                <action name="Execute">
                    <execute>
                        lxappearance
                    </execute>
                </action>
            </item>
            <item label="Power Management">
                <action name="Execute">
                    <execute>
                        xfce4-power-manager-settings
                    </execute>
                </action>
            </item>
            <item label="Screensaver">
                <action name="Execute">
                    <execute>
                        xscreensaver-demo
                    </execute>
                </action>
            </item>
            <item label="Choose Wallpaper">
                <action name="Execute">
                    <execute>
                        nitrogen ~/Imagens/
                    </execute>
                </action>
            </item>
        </menu>
        <menu id="system" label="Sistema">
            <item label="GParted">
                <action name="Execute">
                    <execute>
                        gksudo gparted
                    </execute>
                </action>
            </item>
            <item label="User Login Settings">
                <action name="Execute">
                    <execute>
                        gksudo gdmsetup
                    </execute>
                </action>
            </item>
            <item label="Synaptic Package Manager">
                <action name="Execute">
                    <execute>
                        gksudo synaptic
                    </execute>
                </action>
            </item>
        </menu>
        <!--<menu id="help" label="Help" execute="cb-help-pipemenu" />-->
        <separator/>
        <item label="Executar">
            <action name="Execute">
                <execute>
                    gmrun
                </execute>
            </action>
        </item>
        <separator/>
        <item label="Exit">
            <action name="Exit">
                <execute>
                    cb-exit
                </execute>
            </action>
        </item>
    </menu>
</openbox_menu>

Caso necessário, substituam o comando cb-exit localizado bem no final do .conf por "exit", ou por "obshutdown".

Sobre esse último, vejam esta dica: obshutdown, Shutdown Menu para OpenBox

A mágica da coisa, é a utilização dos seguintes campos no arquivo já citado:

<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/3.5/menu">
    <menu execute="/usr/bin/openbox-menu lxde-applications.menu" id="desktop-app-menu" label="Aplicativos"/>
    <menu id="root-menu" label="Openbox 3">
        <separator label="Menu"/>
        <menu id="desktop-app-menu"/>
        <separator/>

Então, bastou adaptar o bem acabado menu do CrunchBang, e montar este que vos apresento:
Dica originalmente publicada em meu blog: mundo gnu: Menu do OpenBox com Ícones!

Outras dicas deste autor

Disk Manager: gerenciamento automático de partições

Concatenando arquivos PDF

Adicionando fontes no Arch Linux

Debian: modificando a forma como o APT instala pacotes

Bash Info Tools para Arch Linux

Leitura recomendada

Revertendo strings no terminal

TV Software Livre (videos online)

Instalar IRPF 2024 no Linux

Entrelinhas no LaTeX

Múltiplos terminais virtuais com GNU Screen

  

Comentários
[1] Comentário enviado por removido em 04/06/2012 - 19:22h

que legal. espero que vire padrão em breve.

[2] Comentário enviado por removido em 04/06/2012 - 19:41h

Seria legal mesmo, visto que o menu do OpenBox é muito pobre em recursos.

Quando tiver um tempo, montarei um menu.xml usando openbox-menu e com configurações extras ao estilo do que usei no artigo sobre a configuração do OpenBox:

http://www.vivaolinux.com.br/artigo/Configurando-um-Super-OpenBox/

Um abraço.

[3] Comentário enviado por oberon em 26/06/2012 - 00:18h

Meio off-topic, mas você poderia postar o seu .conkyrc ?

Bem bacana...

[4] Comentário enviado por removido em 26/06/2012 - 20:04h

@oberon, segue o código:


use_xft yes
xftfont Droid Sans:size=8
xftalpha 0.8
text_buffer_size 2048
color0 000000
color1 FCAF3E
color2 FFFFFF
color3 a00000
update_interval 1
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_argb_visual yes
double_buffer yes
minimum_size 180 0
maximum_width 280
draw_shades no
draw_outline no
draw_borders no
stippled_borders 0
border_margin 5
border_width 1
default_color white
own_window_colour white
alignment top_right
gap_x 10
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
use_spacer none

TEXT


${voffset 0}${font OpenLogos:size=16}J${font} Kernel: ${alignr}${kernel}
${font StyleBats:size=16}q${font} Uptime:$alignr$uptime
${font StyleBats:size=16}A${font} CPU:$alignr${cpu cpu0}%
${font StyleBats:size=16}g${font} RAM:$alignr$mem/$memmax
${font StyleBats:size=16}j${font} Swap:$alignr$swap/$swapmax


${voffset 4}${font Pie charts for maps:size=14}7${font} ${voffset -5}Root
${voffset 4}${fs_used /}/${fs_size /} ${alignr}${fs_bar 6,60 /}
${font Pie charts for maps:size=14}7${font} ${voffset -5}Home
${voffset 4}${fs_free /home}/${fs_size /home} ${alignr}${fs_bar 6,60 /home}
${font Pie charts for maps:size=14}7${font} ${voffset -5}win_d
${voffset 4}${fs_free /mnt/win_d}/${fs_size /mnt/win_d} ${alignr}${fs_bar 6,60 /mnt/win_d}
${font Pie charts for maps:size=14}7${font} ${voffset -5}virtual_machines
${voffset 4}${fs_free /mnt/virtual_machines}/${fs_size /mnt/virtual_machines} ${alignr}${fs_bar 6,60 /mnt/virtual_machines}
${font Pie charts for maps:size=14}7${font} ${voffset -5}Arch Linux ( / )
${voffset 4}${fs_free /mnt/arch_rootfs}/${fs_size /mnt/arch_rootfs} ${alignr}${fs_bar 6,60 /mnt/arch_rootfs}
${font Pie charts for maps:size=14}7${font} ${voffset -5}Arch Linux (~)
${voffset 4}${fs_free /mnt/arch_home}/${fs_size /mnt/arch_home} ${alignr}${fs_bar 6,60 /mnt/arch_home}


${voffset -6}${font PizzaDude Bullets:size=14}O${font} Up: ${upspeed eth0} kb/s ${alignr}${upspeedgraph eth0 8,60 F57900 FCAF3E}
${voffset 4}${font PizzaDude Bullets:size=14}U${font} Down: ${downspeed eth0} kb/s ${alignr}${downspeedgraph eth0 8,60 F57900 FCAF3E}
${voffset 4}${font PizzaDude Bullets:size=14}N${font} Upload: ${alignr}${totalup eth0}
${voffset 4}${font PizzaDude Bullets:size=14}T${font} Download: ${alignr}${totaldown eth0}
${voffset 4}${font PizzaDude Bullets:size=14}a${font} Ip Local: ${alignr}${addr lo}


${voffset -18}${goto 33}${font Arial Black:size=22}${color}${time %H}${color}${voffset 0}${time :%M}${time :%S}${color}${font}
${voffset 0}${goto 78}${font Liberation Sans:style=Bold:size=14}${color}${time %A}${color}${font}
${goto 78}${time %d %b %Y}


As fontes necessárias você pode ver nessa postagem do meu Blog:

http://gnu2all.blogspot.com.br/2012/06/fontes-para-conky.html

[5] Comentário enviado por px em 21/09/2014 - 20:37h

Dica testada e aprovada no Debian 7.6 (weezy).

[6] Comentário enviado por Minions em 23/08/2024 - 00:54h



Tem como adicionar um menu (outro arquivo) no menu principal do Openbox?



Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts