Page 1 of 1

PekWM the ellegant "desktop environment"

Posted: 08 Sep 2014, 14:03
by viking60
I have heard of Fluxbox (never tried it though) and it's ability to group windows after topics or whatever your logic's may demand. Then I heard of PekWM that has the same ability with a little more "finesse".

So I downloaded the Manjaro version of it.

It is a lightweight "DE" (Windows manager really - and not a fully fledged DE) that competes with Openbox (my favorite) and it is easily installed with the good Manjaro installer.
So I fire it up and am almost blown away by that slick and elegant design - almost like a fashion statement from a designer like Yves Saint Armani or Georgio Laurent :-D
Image

The menus blend in nicely in a consistent and well thought of "look"

So the looks and feel of this thing is A+
The functionality is pretty known to an openbox user - if you can right-click you get the menu - and there is status bar on top -Tint2- and another "App-starting panel" at the bottom.
So I fire up a few windows and do the "grouping thing" that is supposed to make PekWM stand out.

I middle-klick on the windows I want to group and drag them to the top/staus bar of the window I want to group it in - works like a charm. That windows becomes "tabbed" and I can switch among the "tabs" or group-members with <Winkey+TAB>.

This is great and ensures an efficient workflow:
You can make one group called "love letters" and one group called "business" or "difficult customers" and each of them can contain spreadsheets, letters, pictures or whatever.
It comes in handy and keeps your desktop clean.

Have a look at the tabs on this window; you see the terminal but by a click or by Winkey+TAB you can switch to Geany or Opera who are grouped into the same window.
Image
This is pretty much the same thing as the Opera tab-stacking which makes Opera the logical browser for this Desktop environment. +1
In ordinary Linux you can use different desktops aka workspaces for this but you get them in addition on on PekWM, so it is one more instrument to make your work/activity even better.

So far the experience with this has been very positive making me wonder if I should give up my beloved Openbox...
Then I discovered that PekWM in the Manjaro version does not have dynamic menus :!:

That is a turnoff and it does matter - I need the menu to reflect everything that is installed, to keep the system clean or to find the right programs; doesn't everyone?
The downside of the static menu is also that it is not in "Valhallian" as it should be on my systems.

So I had to install pekwm-menu and have a look at the config files that we can find in ~/.pekwm and altered the menu file by adding this:

Code: Select all

Submenu = "Programmer" {
   Entry { Actions = "Dynamic pekwm-menu lxde-applications.menu" }
 }

I found the available menu files in /etc/xdg/menus/ (lxde-applications.menu in this case)
Et voila I had a submenu called "Programmer" that contains everything installed and in Valhallian :smug
Image
It does make sense to make the Dynamic menu the main menu and not a Submenu and add static favorites to the Dynamic menu instead - So I gave that a try:
~/.pekwm/menu

Code: Select all

         
            RootMenu = "Programmer" { icon="icons"
   Entry { Actions = "Dynamic pekwm-menu lxde-applications.menu &"  }
    Separator {} 
   Entry = "Terminal" { Actions = "Exec sakura &" }
   Separator{}
    Submenu = "Pekwm" { icon="/home/thomas/.pekwm/icons/xterm.png"
      Submenu = "Theme" {
              Entry { Actions = "Dynamic $_PEKWM_SCRIPT_PATH/pekwm_themeset.sh $_PEKWM_THEME_PATH" }
              Entry { Actions = "Dynamic $_PEKWM_SCRIPT_PATH/pekwm_themeset.sh ~/.pekwm/themes" }
              }
      Submenu = "Innstillinger" {
         Entry = "Menu" { Actions = "Exec geany ~/.pekwm/menu" }
              Entry = "Autoproperties" { Actions = "Exec geany ~/.pekwm/autoproperties" }
              Entry = "Config" { Actions = "Exec geany ~/.pekwm/config" }
              Entry = "Keys" { Actions = "Exec geany ~/.pekwm/keys" }
              Entry = "Mouse" { Actions = "Exec geany ~/.pekwm/mouse" }
              Entry = "Start" { Actions = "Exec geany ~/.pekwm/start" }
              Entry = "Vars" { Actions = "Exec geany ~/.pekwm/vars" }
         }
      Submenu = "Handling" {
         Entry = "Last inn på nytt" { Actions = "Reload" }
              Entry = "Omstart" { Actions = "Restart" }
         }
        }
 
         Entry = "Gå ut" { Actions = "Exec oblogout" }
 }

Now everything that is installed and everything new that gets installed, will be shown in the main menu. I added the Static "favorites" "Terminal" and the "Pekwm" settings menu that lets me reload when changes are made or altering the theme etc. + the logout shutdown restart dialog (oblogout).
Image

To move and re-size windows I used Winkey + ENTER after that I could move the WIndow around with the arrow keys and re-size it if I hold down Winkey.
Like Openbox PekWM is much of a Key shortcut WM, but you can use the mouse.
One thing that is really annoying is that when you move your mouse to a new window; that window gets focus - which is fine - but the other windows loose focus and are made transparent and unreadable.
This is annoying when you search in Geany or any other program - the search window will have focus and the window that shows the result - is unreadable. :evil:
Edit: This was fixed by editing compton in the start file to this.

Code: Select all

compton -c -C -z -b -m 0.90 --shadow-red 0.1 --shadow-green 0.6 --shadow-blue 0.3 &

All in all a very nice Window manager though; worth having a look at for somewhat experienced users. I just might use this over Openbox :think:
There are enough themes for you to make changes to your liking:
Image

Video :A

Re: PekWM the ellegant "desktop environment"

Posted: 11 Sep 2014, 14:36
by viking60
It is possible to add tiling and areosnap to this thing.

Install wmctrl.

If you are going to use it (without variables) you must find your resolution with xrandr in my case it is 1724x1012 (width and hight on my Virtualbox)
the syntax is
gravity, x,y,w,h.

So I leave the gravity at 0 the next value is the X axis which we will leave at 0 for the left placement the next value is the distance from the top (Y) which is 25 pixels here (should cover the tint2 hight).

That brings us to the width of the window which is 862 (50% of 1724 aka half of the screen) here, and finally the height of 950.
So to make this easy; I can start from behind and fill in 950 on left and right my hight = 1012 and my tint2 panel is 25
so 1012 - 25 = 987

That will be the hight of my left and right window.
left
0,0,25,862,987
Translated this means that the left window starts with 0 gravity and 0 pixels from the left edge and 25 pixels from the top with a witdth of 862 pixels and a hight of 987 pixels.

Over to the right window:
right
0,862,25,862,987
Translation:
0 gravity and starting 862 pixels from the left edge (where the left window stops) 25 pixels from the top with a height of 987 pixels.

So that would make this edit in keys

Code: Select all

#Aerosnap/tiling
#Left
KeyPress = "Ctrl Left" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,25,861,987" }

#Right
KeyPress = "Ctrl Right" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,861,25,862,987" }

#Top
KeyPress = "Ctrl Up" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,25,1724,506"}

#Bottom
KeyPress = "Ctrl Down" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,506,1724,506"}

The top and bottom part is easy I just took the entire width and half the hight from xrandr.

And when I resize my Virtualbox window this becomes useless ;D

But If I don't this works very well - and people do not change the resolution that often outside Virtualbox.

Video coming up....
:A

Re: PekWM the ellegant "desktop environment"

Posted: 12 Sep 2014, 12:24
by viking60
I have tried to find an easy way to implement aero snap so I made some variables but they did not save much work so people will have to do the one time work of setting the data in
~/-pekwm/keys.
Here is the result wich is pretty much exactly the same functionality as in Openbox. (the difference is that I use % in Openbox so it works on every resolution).
I have half and quarter window tiles and use CTRL + ARROWS and ALT + ARROWS to place them.
~/.pekwm/keys

Code: Select all

#Aero snap/tiling
#Left
KeyPress = "Ctrl Left" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,$_DFT,860,987" }
#Top left
KeyPress = "Mod1 Left" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,$_DFT,860,494" }
#Right
KeyPress = "Ctrl Right" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,860,$_DFT,862,987" }
#Top right
KeyPress = "Mod1 Right" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,860,$_DFT,862,494" }
#Top
KeyPress = "Ctrl Up" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,$_DFT,$_BREDDE,506"}

#Bottom
KeyPress = "Ctrl Down" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,531,$_BREDDE,494"}
#Bottom left
KeyPress = "Mod1 Down" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,531,862,494"}
#Bottom right
KeyPress = "CTRL Mod1 Right" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,860,531,862,494"}
 

As you can see I have replaced the value for the width with a global variable -$_BREDDE and distance from the top with $_DFT which I have set in ~/.pekwm/vars it only containes the width that xrandr has presented.

Behold the Openbox with grouping functions...eh..no the Pekwm with tiling functions:
:A


Further discussion here

Re: PekWM the ellegant "desktop environment"

Posted: 16 Sep 2014, 00:55
by viking60
I forgot :Doh: If you have trouble implementing the Tile/snap function just give me the output of

Code: Select all

xrandr

And I'll fill in the numbers for you!

Re: PekWM the ellegant "desktop environment"

Posted: 18 Sep 2014, 11:11
by viking60
This WM works well with the "Arch side of the moon" wallpaper.
I set up this pekwm from "scratch" using the Manjaro buttons.
Image
Here I just changed the Wallpaper on the Manjaro Pekwm install:
Image


You will find Pekwm in the repos of most distros including Openmandriva and Mageia.

Re: PekWM the ellegant "desktop environment"

Posted: 21 Sep 2014, 13:35
by viking60
The theming capabilities are good without making this a pure "looker" - it is highly flexible.Tint2-svn can be used to fire applications: to make Pekwm even more light wight. I have kept the wbar here:
:A
Image
Image
Image
Image

Re: PekWM the ellegant "desktop environment"

Posted: 25 Sep 2014, 00:20
by viking60
If you want icons on your Desktop then you can use idesk - it works well with Pekwm
Image
Some changes I made:
To make ALT TAB work I altered the ~/.pekwm/keys
under
#Moving in frames
I altered from this

Code: Select all

KeyPress = "Mod1 Tab" { Actions = "NextFrame EndRaise" }

To this

Code: Select all

KeyPress = "Mod1 Tab" { Actions = "NextFrameMRU EndRaise" }


This ensures that the windows you want get on "top" when selected with ALT TAB.
(Getting selected but staying behind the current Window is plain stupid in my book)

In fact the way Pekwm handles windows is not good at all in my book, this goes for the mouse handling too.
So to make Pekwm shift focus when moving the mouse over the Window I altered ~/.pekwm/mouse_sloppy
From

Code: Select all

FrameTitle {
   Enter = "Any Any" { Actions = "Focus" }
}

To :A

Code: Select all

FrameTitle {
   Enter = "Any Any" { Actions = "Focus;Raise" }
}

Re: PekWM the ellegant "desktop environment"

Posted: 26 Sep 2014, 15:52
by viking60
I made a wallpaper changer - that also works in openbox and takes care of the wbar background:
~/.pekwm/bgchange.sh

Code: Select all

#! /bin/bash
killall compton && compton  -C -b  &
while :
do
WALLPAPERS="/home/you/pics/wallpapers"
ALIST=( `ls -w1 $WALLPAPERS` )
RANGE=${#ALIST[@]}
let "number = $RANDOM"
let LASTNUM="`cat $WALLPAPERS/.last` + $number"
let "number = $LASTNUM % $RANGE"
echo $number > $WALLPAPERS/.last
nitrogen --set-scaled --save $WALLPAPERS/${ALIST[$number]}
killall wbar && wbar &
sleep 10s #<---change every xx seconds adjust as you like
done

Here the background will change every 10 seconds - adjust it as you like and change the path to your wallpaper directory (WALLPAPERS).
Chomd it to execute

Code: Select all

chmod +x ~/.pekwm/bgchange.sh

you can test run it with

Code: Select all

./bgchange.sh

while you are in the ~/.pekwm directory.

Once you are satisfied you can this line to ~/.pekwm/start with the full path to the script:

Code: Select all

/home/you/.pekwm/bgchange.sh &

Edit the path!
Now your background will change every 10 seconds or whatever timespan you have set

Other wallpaper changers have been discussed here
Edit:
For some reason the CPU goes through the roof when using Chromium with this - not so with Firefox or Opera (both running) :confused

Compton has the -C switch which should ensure that there are no shadows on docks but since the wbar gets reloaded it comes up with a shadow.
To avoid this I have tried to kill and reload compton in the script to no avail :confused

Code: Select all

killall compton && killall wbar && compton -c -C -z -b -m 0.90 --shadow-red 0.1 --shadow-green 0.6 --shadow-blue 0.3 && wbar &

This line does not work even if compton should be loaded with the -C switch here.
So I worked around it and removed the shadows in the script.

The script works 100% with that.
:A

Switch to Openbox from Pekwm

Posted: 27 Sep 2014, 10:54
by viking60
To switch directly to Openbox from the Pekwm menu you only have to enter this to the menu file:

Code: Select all

Entry = "Openbox" {Actions = "RestartOther openbox --replace"}

It will switch seamlessly to Openbox (in fact you will wonder if it has actually happened).
And the background changer will continue to run.
Just in case you get several instances of it running (switching more often than you have set) you may kill it like this:

Code: Select all

killall bgchange.sh

and the restart it in ALT+F2 with

Code: Select all

/home/<Your Directory>/.pekwm/bgchange.sh


Now I only need to find out how I can switch back to Pekwm from the OB menu :think:

Re: PekWM the ellegant "desktop environment"

Posted: 07 Oct 2014, 15:02
by viking60
Now I have a seem-less switch between PekWM and Openbox. You will not even notice - except for the different menu look.
:A

The background changer continues working on both WM's
I had to sacrifice shadows and the dynamic menu on the Openbox side.

But obmenu-generator can generate a complete static menu with icons in one sec so I can use that and add this line in menu.xml:

Code: Select all

<item label="Pekwm" icon="/usr/share/icons/gnome/16x16/apps/file-manager.png"><action name="Restart"><execute>pekwm --replace</execute></action></item>

Every time you re-generate the menu again it will generate:

Code: Select all

<item label="Pekwm" icon="/usr/share/icons/gnome/16x16/apps/file-manager.png"><action name="Execute"><execute>pekwm --replace</execute></action></item>

So I have to replace the action name from "Execute" to "Restart".

This works nicely.

Re: PekWM the ellegant "desktop environment"

Posted: 07 Nov 2014, 14:12
by viking60
I have a small problem with the dynamic menu.
If Crossover is installed it takes the place of "Applications"
Image