Topic: Netwmpager How-to

Netwmpager is a pager small and easily configured but not very documented.

For those who are not familiar with installing applications from source. The three commands we are going to use.

* You run configure (you usually have to type ./configure as most people don't have the current directory in their search path). This builds a new Makefile.
* Type make This builds the program. That is, make would be executed, it would look for the first target in Makefile and do what the instructions said. The expected end result would be to build an executable program.
* Now, as root, type make install. This again invokes make, make finds the target install in Makefile and files the directions to install the program.

- from: http://tldp.org/LDP/LG/current/smith.html

1) Downloading and extracting

Here is where you get the Netwmpager: http://ftp.osuosl.org/pub/gentoo/distfi … 11.tar.bz2

Note: you need libxft-dev.

I download everything first in my downloads folder:

$ cd ~/downloads
$ wget http://ftp.osuosl.org/pub/gentoo/distfiles/netwmpager-1.11.tar.bz2
$ tar -xvf netwmpager-1.11.tar.bz2

After extracting ($ tar -xvf netwmpager-1.11.tar.bz2) go to "netwmpager-1.11" folder.

$ cd netwmpager-1.11

2) Installing

Now you're in netwmpager-1.11 folder and we can start actual installing.

$ ./configure

And result should be something like this:

xxx@xxx:~/downloads/netwmpager-1.11$ ./configure
checking for program gcc... /usr/bin/gcc
checking for CC flag -std=gnu99 -pipe -Wall -Wshadow -Wcast-align -Wpointer-arith -Wundef -Wmissing-prototypes -Wredundant-decls... yes
checking for CC flag -Wdeclaration-after-statement... yes
checking for CC flag -Wold-style-definition... yes
checking for CC flag -Wno-pointer-sign... yes
checking if CC can generate dependency information... yes
checking for program pkg-config... /usr/bin/pkg-config
checking xft (pkg-config)... yes
checking CFLAGS for xft... -I/usr/include/freetype2  
checking LIBS for xft... -lXft  
creating config.mk

Compiler Settings:
CC:                  gcc
LD:                  gcc
CFLAGS:              -O2 -std=gnu99 -pipe -Wall -Wshadow -Wcast-align -Wpointer-arith -Wundef -Wmissing-prototypes -Wredundant-decls -Wdeclaration-after-statement -Wold-style-definition -Wno-pointer-sign -MMD -MP -MF .dep-$@  -DDEBUG=0
LDFLAGS:             

Installation Directories:
bindir:              /usr/local/bin
datadir:             /usr/local/share
xxx@xxx:~/downloads/netwmpager-1.11$

When I was installing Netwmpager first time I got an error (related to lxft, unfortunately I don't remember details) which I was able to solve by installing "libxft-dev" (FreeType-based font drawing library for X)

EDIT
I made little test and removed libxft-dev (I originally thought it was libxft2, but it wasn't) which caused this while configure:

hanna@elrond:~/downloads/netwmpager-1.11$ ./configure
checking for program gcc... /usr/bin/gcc
checking for CC flag -std=gnu99 -pipe -Wall -Wshadow -Wcast-align -Wpointer-arith -Wundef -Wmissing-prototypes -Wredundant-decls... yes
checking for CC flag -Wdeclaration-after-statement... yes
checking for CC flag -Wold-style-definition... yes
checking for CC flag -Wno-pointer-sign... yes
checking if CC can generate dependency information... yes
checking for program pkg-config... /usr/bin/pkg-config
checking xft (pkg-config)... no
checking xft (-lXft -lXrender -lfontconfig -lfreetype -lz -lX11)... no

configure failed.

After this I installed libxft-dev and I was able to carry on.

$ sudo apt-get install libxft-dev

[EDIT ENDS]

So we assume that everything went well and possible problems are solved. We can carry on.

$ make

After that as root (it will ask your password).

$ sudo make install

Hopefully everything went well.

3) Configuring
As mention in the beginning, you can configure Netwmpager to look the way you want. The example config file is in "/usr/local/share/netwmpager"

$ cd /usr/local/share/netwmpager
$ cp config-example ~/.config/netwmpager/config

open the config file with your favourite editor:

$ leafpad ~/.config/netwmpager/config

Here is my Netwmpager config: http://crunchbanglinux.org/pastebin/147

Trickiest part is probably geometry as it requires little math.

geometry = "160x20-1120+780"

I have 1280x800 screen and above position it's exactly on left bottom corner. It'll will be 160px wide and 20px high.
But if you would like to have it on right corner:

geometry = "160x20+1120+780"

Launching it: alt+f2 and type netwmpager
You can also add it in autostart.sh (main menu -> preferences -> Openbox Config -> Edit autostart.sh)

netwmpager &

Anything to add and comments are welcome. I apologise if I didn't make any sense, English isn't my language.

Last edited by Hanna (2009-01-31 16:19:54)

HANNA (without "h" in the end) likes green and #! smile
Also know as ultraturquoise online / #! last.fm / #! DeviantART / U / Q

Re: Netwmpager How-to

Thanks Hannah, that was perfect. big_smile I would have never figured that out myself.

Netwmpager looks like a huge improvement on the LXPanel equivalent.

Again, I appreciate the effort. smile

foomandoonian's tumblelog & twitter

Re: Netwmpager How-to

I thought that if I do a how-to I better do it properly tongue

I wouldn't have guessed it myself either, but helpful friend of my suggested to do "apt-cache search xft" and look for something like libxft.

Last edited by Hanna (2009-01-31 13:28:33)

HANNA (without "h" in the end) likes green and #! smile
Also know as ultraturquoise online / #! last.fm / #! DeviantART / U / Q

Re: Netwmpager How-to

Note: you need libxft-dev.

yikes I had no idea that this was the problem.
You have no idea how much I appreciate this big_smile
Thank you so much Hanna!

big_smile

Delves deeper into code... tongue

All in an effort to learn...
Delves deeper into code...

Re: Netwmpager How-to

Hi Hanna

This is a very nice Howto !!

Have you considered a Wiki page for this ??

If you don't know how to do it, then PM me and I'll guide you trough it, it's very easy smile

/Niels
Registered Linux user #133791 > Get counted at http://counter.li.org
-----------------------------------------------------------------------
So Many Things To Do, And No Time For Nuts !

Re: Netwmpager How-to

I suppose it would be too much to ask if you know how to make it behave like lxpanel's (just click to select desktop, not windows)?

All in an effort to learn...
Delves deeper into code...

Re: Netwmpager How-to

^It's not. I would have added it there because this worked for me but not for Foom for some reason hmm

Basically you need to recompile it again after changing this on line 1136 in pager.c

    if (button == 1) {
            if (pager->mouse.window_idx == -1) {
                x_set_current_desktop(desk);
            } else if (!pager->mouse.dragging) {
                x_set_active_window(pager->windows[pager->mouse.window_idx].window, SOURCE_INDICATION_PAGER);
            }

for this:

    if (button == 1) {
            if (pager->mouse.window_idx == -1) {
                x_set_current_desktop(desk);
            } else if (!pager->mouse.dragging) {
                x_set_current_desktop(desk);
                x_set_active_window(pager->windows[pager->mouse.window_idx].window, SOURCE_INDICATION_PAGER);
            }

source: http://bbs.archlinux.org/viewtopic.php?pid=464847

or I can send you a deb which I ended up making with checkinstall (which worked for Foom). smile

Last edited by Hanna (2009-02-02 07:52:39)

HANNA (without "h" in the end) likes green and #! smile
Also know as ultraturquoise online / #! last.fm / #! DeviantART / U / Q

Re: Netwmpager How-to

Wow. I had actually tried going into the code myself and checking out the code for myself. I tried disabling things, but I never really thought of adding in a single line, or searching around, seeing as netwmapger has poor documentation.

Thanks again Hanna big_smile

All in an effort to learn...
Delves deeper into code...