Openbox

What do you have and what do you want?

Moderators: b1o, jkerr82508

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Openbox

Postby viking60 » 30 Sep 2012, 12:01

I have decided to try out Openbox. Gnome 3 has been letting people down a bit with an arrogant "know it all" attitude - and did not corect it until Linus Torvalds expressed his views in no uncertain terms.

So it is getting "almost usable" (and Linus does in fact use it now :-D )
The main problem is that Gnome has taken away a lot of customisation possibilities. Rightclick is gone and you need to install a lot of extensions to get some of the old flexibility back.
One way to deal with this is to combine Gnome with a window manager like E16 (works fine in Arch) but then again E16 works better without Gnome. As a standalone "DE" it is somewhat limited though.
Image


So I decided to try Openbox and use it as a standalone DE. This will let me customize my DE like I want and give me my beloved right-click back. I will be able to assign keys and combinations of keys to do everything I like.
I want to implement the "Aeoro snap" to pop my active windows to the left or right side of the screen. I want panels and yes some nice animated bloat too.
I know; it is not the fashionable thing to say but I want to impress my suroundings with it and thus get closer to some guru status... :-D
It must be all custumizable and very functional.
So can it be done? Can I drop Gnome or KDE for a simple WM?
Well I will give it a try - the downside to it is that it will involve..... work :shock:

So sit tight on the edge of your chairs while I do that (work) and I will report back on my shortcomings and successes......
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Openbox

Postby viking60 » 30 Sep 2012, 12:35

I start with installing openbox (obviously :-D ) and it seems to be important to copy the files I want to customize to my home directory so I have to make an openbox directory there and copy all those important files in there.

Code: Select all

mkdir -p ~/.config/openbox

and then

Code: Select all

cp /etc/xdg/openbox/{rc.xml,menu.xml,autostart,environment} ~/.config/openbox

These files will be vital in customizing openbox ...later.

Since I already have gdm openbox is now an option as standalonoe login or as KDE/Openbox and Gnome/Openbox login ( I will not go into the latter two here). So I log into Openbox and see .... a gray background... and nothing else.

Well I did say I wanted to customize it myself :Doh:
Rightclicking gives me the menu though so I can fire up programs from a predefined menu that not contains everything i have installed on my box.
Still.... it is a start.....
I can go in and edit these menus in

Code: Select all

~/.config/openbox/menu.xml
and add or remove anything i like. But again that is a lot of work so overwhelmed by laziness I search for a solution to automate this - and I find and install menumaker
It will detect anything I have installed and make a menu out of it.
Then I remove and replace my preinstalled rightclick menus with:

Code: Select all

mmaker -vf OpenBox3

That was easy and worked like a charm......

So the flexibility is already there: I can rightclick and fire every program on my box - the menu structure is OK and can still be tweaked as mentione above. I can add icons to them but I decided that it is not worth the effort.

By now I have this fairly functional system that looks like crap so I want a background now +1
The easy way to do this is to install nitrogen and fire it up like this:

Code: Select all

nitrogen --no-recurse /home/<you>/<your_backgrounds>

Then you can pick one of your favorites from that directory.
Image
Again it works like a charm so by now I have I nicer looking desktop.
You can use feh instead of nitrogen if your distro does not have it in the repo:

Code: Select all

feh --bg-scale /home/user/pictures/your_pic.png

But I am really missing a panel....
Time to install tint2 and fire it up. It is a nice clean botom panel that is built for Openbox.

And then I go bananas and install cairo-compmgr and cairo dock. and added a theme after having installed openbox-themes.
Now things are looking really nice. I loged out and loged back in and all was gone.... :berserk2

Well time to edit the autostart file in ~/.config/openbox to make things start every time (remember the files we copied above?):
I added this:

Code: Select all

nitrogen --restore &
tint2 &
cairo-compmgr &

And now it all starts every time. And you can add pretty much everthing there followed by a & it will always be readdy for another entry.
This is very flexible.
The main file for adding flexibility is ~/.config/openbox/rc.xml here you can edit keybindings and add new ones.
So even if I have all my menus available now I miss the good old <ALT>+<F2> so I installed gmrun and added the following code to rc.xml

Code: Select all

<keybind key="A-F2">
    <action name="execute"><execute>gmrun</execute></action>
</keybind>

I also noticed that I had to reassign my prtscr button so I also added

Code: Select all

<!-- Screenshot -->
   <keybind key="Print">
     <action name="Execute">
       <command>sh -c "import -window root ~/Bilder/`date '+%Y%m%d-%H%M%S'`.png"</command>
     </action>
   </keybind>

(Replace Bilder with your pic.. directory)
But as I stated above my "piece de resistance" (it is french and means... something :-D ) would be the Aero snap so I also added

Code: Select all

 <!-- Keybindings for window tiling -->
    <keybind key="W-Left">        # HalfLeftScreen
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>0</x>
        <y>0</y>
        <height>100%</height>
        <width>50%</width>
      </action>
    </keybind>
    <keybind key="W-Right">        # HalfRightScreen
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>0</y>
        <height>100%</height>
        <width>50%</width>
      </action>
    </keybind>
    <keybind key="W-Up">        # HalfUpperScreen
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>0</x>
        <y>0</y>
        <width>100%</width>
        <height>50%</height>
      </action>
    </keybind>
    <keybind key="W-Down">        # HalfLowerScreen
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>0</x>
        <y>-0</y>
        <width>100%</width>
        <height>50%</height>
      </action>
    </keybind>
    <keybind key="C-Left">        # QuartLowerLeftScreen
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>0</x>
        <y>-0</y>
        <width>50%</width>
        <height>50%</height>
      </action>
    </keybind>
    <keybind key="C-Right">        # QuartUpperRightScreen
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>0</y>
        <width>50%</width>
        <height>50%</height>
      </action>
    </keybind>
    <keybind key="C-Up">        # QuartUpperLeftScreen
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>0</x>
        <y>0</y>
        <width>50%</width>
        <height>50%</height>
      </action>
    </keybind>
    <keybind key="C-Down">        # QuartLowerRightScreen
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>-0</y>
        <width>50%</width>
        <height>50%</height>
      </action>
    </keybind>
    <keybind key="A-Right">        # FullScreen
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>0</x>
        <y>0</y>
        <width>100%</width>
        <height>100%</height>
      </action>
    </keybind>
    <keybind key="A-Left">        # MiddleScreen
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <x>center</x>
        <y>center</y>
        <width>50%</width>
        <height>50%</height>
      </action>
    </keybind>

from http://ubuntuforums.org/showthread.php?t=1796793
That works perfectly fine and now my Openbox installation is fully functional -Good looking and it is very flexible. I think I will forget about Gnome and KDE now and stick to this one.
ImageImageImageImage
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
rolf
Guru-Berserk
Posts: 1107
Joined: 16 Mar 2010, 16:07

Re: Openbox

Postby rolf » 30 Sep 2012, 15:56

Image

So, that looks very impressive. :B

What distro are you doing this on?

Code: Select all

[rolf@localhost ~]$ urpmq nitrogen
kde4-style-nitrogen
[rolf@localhost ~]$ urpmq menumaker
No package named menumaker
[rolf@localhost ~]$ urpmq gmrun
No package named gmrun


Editing .xml scares me, so I hope there would be sufficient paste-and-click examples, should I do this. It's tempting to try to wipe the annoyances and bloat of KDE, to get all the same functionality I depend on, but I am a little set in my ways and, let me see, let me see, yup, a little bit lazy. :)
Thanks for the show! Image

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Openbox

Postby viking60 » 30 Sep 2012, 17:04

Sorry this is in Arch, but this should be pretty "cross distro"
http://rpm.pbone.net/index.php3 gives a hit for mandriva 2012 for nitrogen so this is strange - but there is a package for it:
http://rpm.pbone.net/index.php3/stat/4/ ... 6.rpm.html
You will find rpms for gmrun too (Fedora RH SUSE) but you can use dmenu which is the most common one; there is a Mandriva package for that:
http://rpm.pbone.net/index.php3/stat/4/ ... 6.rpm.html
Simply replace gmrun with dmenu in the example above.
Menumaker is a problem :think: But you will get allong with obmenu.

I will give it a go om Mandriva ....
PS: And yes there are lots of cut and paste examples out there so don't worry. Remember the original file is still there, since we copied it to the ~/.config/openbox folder.
If you install LXDE in Mandriva as per this Wiki you should get openbox too.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Openbox

Postby viking60 » 01 Oct 2012, 11:14

Ok rolf here is what I did in coocker 2012 i686.
I installed openbox and openbox-menu. Then I had a particular Mandriva challenge where kdm does not present the present options/log in alternatives (proyvind is working on it - or asked me to have a look at it :confused ).
Since a full update is not an option in cooker at the moment due to some serious X11/KDE -dependency breakage I simply installed gdm and task-gnome-minimal and removed kde (i can re-install later and keep the gdm login) ( don't even know if task-gnome minimal is needed - I'll check later).

So after a reboot I now have the openbox option and pick that to log in. And that looks exactly like in Arch!
A grey background but the menus pop up with a right-click.
So far so good:

Ok so I repeat the making of directories and copy the content of /etc/xgd...etc...etc as described above and did a little editing of menu.xml on the copied file. a re-configuring openbox from the menu did not catch the change - but logging out and back in, did - so we are good, and the procedure so far is exactly the same....

I pick openbox Configuration manager from the system menu and change my theme - It works.
Now it is time to install nitrogen:

Code: Select all

[thomas@bernie ~]$ sudo urpmi nitrogen
[sudo] password for thomas:


    $MIRRORLIST: media/contrib/release/nitrogen-1.5.2-2-mdv2012.0.i586.rpm
Installerer nitrogen-1.5.2-2-mdv2012.0.i586.rpm fra /var/cache/urpmi/rpms     
Forbereder …                     #############################################
      1/1: nitrogen              #############################################
[thomas@bernie ~]$

Hey it is all there!

I downloaded the purple mushrom wallpaper from our wallpaper section and fired up GIMP to convert it to png and set it with nitrogen. No problem!
This is what my Mandriva openbox looks like so far:
Image
It has 4 desktops and you can switch with CTRL+ALT + left/right ARROW

Installing the tint2 panel and firing it up with .... tint2 +1 nice!
Time to go to the autostart file and make this lovely changes stick.....
Ok so I decided that I really need gmrun so I stole the binary package from Centos:
http://pkgs.org/centos-6-rhel-6/epel-i3 ... /download/
And it works like a charm.
I also need menumaker so I downloaded it from:
ftp://ftp.webtrek.com/pub/rpms/MenuMake ... noarch.rpm
And that does not work so forget it :wall:
Looks like we will have to alter the generated menu manually for now.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
rolf
Guru-Berserk
Posts: 1107
Joined: 16 Mar 2010, 16:07

Re: Openbox

Postby rolf » 01 Oct 2012, 14:37

Great! :s :think: 4 desktops, can it go to 6?

I'm always intimidated trying to guess what version of what other rpm distro might work with Mandriva. As to menumaker, it seems it will run right out of the tarball without even compiling --> http://menumaker.sourceforge.net/

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Openbox

Postby viking60 » 01 Oct 2012, 15:08

rolf wrote:Great! :s :think: 4 desktops, can it go to 6?

Sure! Right-click->System->Openbox Configuration Manager .> pick desktop and set it to 6 (or more).
Image
It works; I have tested it.
rolf wrote:I'm always intimidated trying to guess what version of what other rpm distro might work with Mandriva. As to menumaker, it seems it will run right out of the tarball without even compiling --> http://menumaker.sourceforge.net/

Ah Bingo! Then we have what we need to make this truly rock :greetings
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
rolf
Guru-Berserk
Posts: 1107
Joined: 16 Mar 2010, 16:07

Re: Openbox

Postby rolf » 01 Oct 2012, 15:32

It looks like nitrogen is new for cooker. I can see an x86_64 package but it is built against a newer glibc, so I can't install it on 2011. Image

I've seen and struggled with the openbox configurations in light desktops like lxde. I am interested in the idea of a standalone Openbox DE. This looks like a very good map, if I can solve the nitrogen hurdle and I'll take a trip when I get a little more homework done. :greetings Image

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Openbox

Postby viking60 » 01 Oct 2012, 16:07

Just install feh and set your wallpaper with

Code: Select all

feh --bg-scale /path/to/image.file

feh is even in the 2010 repo...
To make it stick add this in your ~/.config/openbox/autostart file

Code: Select all

sh ~/.fehbg &


Edit: And the menumaker did the job nicely. :s I also edited the code above :oops:
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Openbox

Postby viking60 » 01 Oct 2012, 17:51

Remember my attempt at guru status?
Well here I have to install xcompmgr (cairo compmgr does not exist in Mandriva) and make it run before the cairo-dock and then I am ready to impress the world again :-D

This is what I have added in my autostart so far:

Code: Select all

nitrogen --restore &
parcellite &
xcompmgr -c &
cairo-dock &
tint2 &

And man I am starting to look real good here +1
Image
I'll admit that the cairo dock is a bit over the top - but I really need that guru staus :-D for some reason the tint2 has been cut off in the bottom but it is there...
Assigning ALT+F2 to gmrun went just fine so now I can start any application....
I made a little change on the prtscr assignment too; I decided to use gnome-screenshot with a 5 second delay and triggered by the WindowsKey+PrtScrn

Code: Select all

 <!-- Screenshot -->
       <keybind key="W-Print">
         <action name="Execute">
           <command>gnome-screenshot -d 5 "~/Bilder/`date '+%Y%m%d-%H%M%S'`.png"</command>
         </action>
       </keybind>

Here is the result:
Image
And even the "Aero snap" works perfectly fine.
I will now declare this Mandriva openbox setup for totally and utterly useful.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
rolf
Guru-Berserk
Posts: 1107
Joined: 16 Mar 2010, 16:07

Re: Openbox

Postby rolf » 02 Oct 2012, 01:10

Well, now, hang on there just a cotton-pickin' minute, Über-Guru-Berserk Image
All that print screen talk got me thinkin'. I use Ksnapshot a lot and almost every screenie I use the feature to select a region of the screen to capture. Is this possible in Openbox? :-D

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Openbox

Postby viking60 » 02 Oct 2012, 10:48

Sure!: That is an easy one:

Code: Select all

<!-- Screenshot -->
       <keybind key="Print">
         <action name="Execute">
           <command>ksnapshot</command>
         </action>
       </keybind>

That will start the dialog that you are used to, when you push the PRTSCR button.

What is within the <command></command> tags will be executed.
What I have done (to complicate things) is that my screenshot is automatically saved to a directory with the date as the pic name.

All you have to do is fill in ksnapshot.

Your key in this case is the prtscr button - if you want it to be Windows key + PRTSCR then you would alter keybind key to "W-Print"
Image

If I remember correctly the print key is pre-defined on installation so all you have to do is to open the rc.xml file and search for "print" and write "knsapshot" between the tags.
I am sure you can assign keys to make a snapshot of the active window etc but I am not that much of a ksnapshot guru.....
....
I will be making a smoking hot video Image for you - to remove all your doubts... just gimme a minute...
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"


Return to “Software”