Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 10 Dec 2019, 10:28
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
cwm, minimalistic window manager
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [10 Posts]  
Author Message
Iguleder


Joined: 11 Aug 2009
Posts: 2031
Location: Israel, somewhere in the beautiful desert

PostPosted: Thu 01 Dec 2011, 05:14    Post subject:  cwm, minimalistic window manager
Subject description: A home-made port from OpenBSD to GNU/Linux
 

Here's cwm, one of the best lightweight window managers around. It's a window manager for those who like doing stuff with the keyboard - you can do anything with cwm, using just two or three keyboard strokes.

It also gives windows nothing but a 1px border, so it's ideal for small screens.

There are many old Linux packages for it, but none of them are recent, so I ported it on my own. This is the latest version, from OpenBSD's CVS.

The package was built on Puppy 5.3. Since libbsd is missing in Slackware, I also built a tiny package and attached it.

More information: here, see the screenshot Smile
Dependencies: libbsd, attached too.
Documentation: here and here, except one change - Shift is replaced with Super (the Windows key). The reason for this is conflicts with other key bindings.

Here's my build script:
Code:
#!/bin/sh

PKG_NAME="cwm"
PKG_VER="cvs$(date +%d%m%Y)"
PKG_REV="1"
PKG_DESC="Minimalistic window manager"
PKG_CAT="BuildingBlock"
PKG_DEPS="+libbsd"

download() {
   [ -f $PKG_NAME-$PKG_VER.tar.xz ] && return 0

   # download the sources
   mkdir $PKG_NAME-$PKG_VER
   [ $? -ne 0 ] && return 1

   # determine the list of source files
   wget -O index.html http://www.openbsd.org/cgi-bin/cvsweb/xenocara/app/cwm
   [ $? -ne 0 ] && return 1
   files="$(cat index.html | grep href=\"./ | cut -f 10 -d \=  | cut -f 2 -d \> | cut -f 1 -d \<)"
   [ $? -ne 0 ] && return 1
   rm -f index.html
   [ $? -ne 0 ] && return 1

   # download the source files
   for i in $files
   do
      wget -O $PKG_NAME-$PKG_VER/$i "http://www.openbsd.org/cgi-bin/cvsweb/xenocara/app/cwm/$i?rev=HEAD;content-type=text%2Fplain"
      [ $? -ne 0 ] && return 1
   done

   # create a sources tarball
   tar -c $PKG_NAME-$PKG_VER | xz -9 > $PKG_NAME-$PKG_VER.tar.xz
   [ $? -ne 0 ] && return 1

   # clean up
   rm -rf $PKG_NAME-$PKG_VER
   [ $? -ne 0 ] && return 1

   return 0
}

build() {
   # extract the sources
   tar -xJvf $PKG_NAME-$PKG_VER.tar.xz
   [ $? -ne 0 ] && return 1

   cd $PKG_NAME-$PKG_VER

   # patch the package to link against libbsd instead of having the BSD C
   # library functions compiled in statically
   echo -n '--- cwm-cvs01122011-orig/calmwm.h   2011-12-01 11:46:46.034898678 +0200
+++ cwm-cvs01122011/calmwm.h   2011-12-01 11:47:41.445205948 +0200
@@ -31,6 +31,15 @@
 #include <X11/extensions/Xrandr.h>
 #include <X11/keysym.h>

+/* BSD C library functions, through libbsd */
+#include <bsd/stdio.h> /* fgetln() */
+#include <bsd/stdlib.h> /* strtonum() */
+#include <bsd/string.h> /* strlcat(), strlcpy() */
+
+/* two missing BSD C library definitions */
+#define TAILQ_END(head) NULL
+#define __dead
+
 #undef MIN
 #undef MAX
 #define MIN(x, y) ((x) < (y) ? (x) : (y))
' | patch calmwm.h
     [ $? -ne 0 ] && return 1

   # add a missing header to xevents.c and kbfunc.c
   sed -i s/'#include <unistd.h>'/'&\n#include <signal.h>'/ xevents.c kbfunc.c
     [ $? -ne 0 ] && return 1

   # replace the Shift key with Super, so key bindings of GTK+ or Qt do not
   # conflict with cwm
   sed -i s/'ShiftMask'/'Mod4Mask'/ conf.c
     [ $? -ne 0 ] && return 1

   # build the package
   bison.yacc parse.y
   [ $? -ne 0 ] && return 1
   cc $CFLAGS $(pkg-config --libs libbsd xft xinerama xrandr xcb xft x11 xau xdmcp fontconfig xext) -lexpat -lfreetype -lz -o cwm *.c
   [ $? -ne 0 ] && return 1

   return 0
}

package() {
   # install the package
   install -D -m755 cwm $INSTALL_DIR/usr/bin/cwm
   [ $? -ne 0 ] && return 1
   install -D -m644 cwm.1 $INSTALL_DIR/usr/share/man/man1/cwm.1
   [ $? -ne 0 ] && return 1
   install -D -m644 cwmrc.5 $INSTALL_DIR/usr/share/man/man5/cwmrc.5
   [ $? -ne 0 ] && return 1

   # install the license
   install -D -m644 LICENSE $INSTALL_DIR/$LEGAL_DIR/$PKG_NAME/LICENSE
   [ $? -ne 0 ] && return 1

   # add the post-install script
   echo -n "#!/bin/sh

echo \"Setting cwm as the default window manager\"
echo cwm > ./etc/windowmanager" > $INSTALL_DIR/pinstall.sh
   [ $? -ne 0 ] && return 1
   chmod 755 $INSTALL_DIR/pinstall.sh
   [ $? -ne 0 ] && return 1

   return 0
}
libbsd-0.3.0.tar.gz
Description  sources
gz

 Download 
Filename  libbsd-0.3.0.tar.gz 
Filesize  100.01 KB 
Downloaded  610 Time(s) 
libbsd_DOC-0.3.0.pet
Description 
pet

 Download 
Filename  libbsd_DOC-0.3.0.pet 
Filesize  24.25 KB 
Downloaded  599 Time(s) 
libbsd_DEV-0.3.0.pet
Description 
pet

 Download 
Filename  libbsd_DEV-0.3.0.pet 
Filesize  16.73 KB 
Downloaded  597 Time(s) 
libbsd-0.3.0.pet
Description 
pet

 Download 
Filename  libbsd-0.3.0.pet 
Filesize  18.24 KB 
Downloaded  652 Time(s) 

_________________
My homepage
My GitHub profile
Back to top
View user's profile Send private message Visit poster's website 
harii4


Joined: 30 Jan 2009
Posts: 449
Location: La Porte City, IA , U.S.A.

PostPosted: Thu 01 Dec 2011, 23:53    Post subject:  

Quote:
Here's cwm, one of the best lightweight window managers around.

Development of cwm started from patches to evilwm - ahhh it started with greatness Twisted Evil

I'll have to look for an older one - i don't think it'll work with Txz-pup.

_________________
3.01 Fat Free / Fire Hydrant featherweight/ TXZ_pup / 431JP2012
----------------------------------------------------------------------------------------
Peace and Justice are two sides of the same coin.
Back to top
View user's profile Send private message Visit poster's website 
harii4


Joined: 30 Jan 2009
Posts: 449
Location: La Porte City, IA , U.S.A.

PostPosted: Mon 19 Dec 2011, 18:54    Post subject:  

How about an DotPet for older puppys? Confused
_________________
3.01 Fat Free / Fire Hydrant featherweight/ TXZ_pup / 431JP2012
----------------------------------------------------------------------------------------
Peace and Justice are two sides of the same coin.
Back to top
View user's profile Send private message Visit poster's website 
harii4


Joined: 30 Jan 2009
Posts: 449
Location: La Porte City, IA , U.S.A.

PostPosted: Sun 03 Jun 2012, 21:20    Post subject:  

http://people.debian.org/~roktas/debian/pool/main/c/cwm/
an .deb (deb2pet) cwm that works in puppy 4 and txz-pup.
you still need libbsd.pet too.

_________________
3.01 Fat Free / Fire Hydrant featherweight/ TXZ_pup / 431JP2012
----------------------------------------------------------------------------------------
Peace and Justice are two sides of the same coin.
Back to top
View user's profile Send private message Visit poster's website 
rufwoof


Joined: 24 Feb 2014
Posts: 3672

PostPosted: Mon 04 Feb 2019, 09:07    Post subject:  

Reviving a old thread - just to add a reference http://murga-linux.com/puppy/viewtopic.php?p=1017159#1017159 ... to using cwm in EasyOS

The appeal for me is it removes Puppy bloat and temptation to tweak the look of a desktop, which after all is just a program launcher. And the periodic annoyance of a desktop being corrupted (loss of icons or tray launchers etc.).

Simple/light single file configuration, for example here's my /root/.cwmrc
Code:
# .cwmrc
#
gap                           2 0 0 0
ignore                        xclock
ignore                        xload
color inactiveborder         Black
color activeborder         "#494949"
color groupborder         "#01a252"
color urgencyborder      "#3d9751"
color selfont                  "#0034A9"
color font                     "#FFFFFF"
color menufg               "#49F6F6"
color menubg               "#333333"
fontname                  "DejaVu Sans:size=14:antialias=true"
bind-key CM-comma      "amixer set Master 5%-"
bind-key CM-period         "amixer set Master 5%+"
command " sakura "        "sakura"
command " Audacious "   "audacious"
command " Office "         "soffice"
command " mtpaint "      "mtpaint"
command " firefox "      "/shared-folder/firefox64/ff"

command " " "nul"
command " Pup Advert Blocker " "pup-advert-blocker"
command " Firewall "   "firewall_ng"

command "  " "nul"
command " EXIT " "pkill cwm"

My preference is to boot to cli (qfix=nox (pfix under puppy)), load up tmux and have a tput based menu on one tmux window (that contains shutdown, reboot, mounts ..etc admin commands), and another tmux window that I launch X from, using xwin for a full root type jwm/rox desktop (for admin purposes), or in EasyOS I've created a ewin script that launches X within a Xephyr/pflask (container i.e. chroot with capabilities dropped etc.). Whilst it still runs as root within that container, root is very heavily restricted, as good as a restricted userid, so your browser etc. can run securely within that. For that ewin X session I use cwm.

The main/default tab in my browser shows the date/time in its title and contains all my bookmarks (manually maintained). I clear out cache etc. (ctrl-shift-delete) often, typically after logging out of one web site so that other web sites can't steal those userid/passwords (via cross scripting) and if there is a browser flaw that opens up remote execution, they're very restricted in what that can do (xephyr/container). EasyOS snapshots/rollbacks are quick/easy also, so resetting a container back to pristine/clean is comforting. I run a portable firefox quantum, so that auto updates also.

Firefox within cwm has no title bar, no tray ...etc. so more screen real estate, makes other window managers such as jwm look very letter-box looking. Typically in cwm I maximise all windows and just alt-tab between those (or left mouse in the top of screen 2 pixel region for the open windows list menu). As per the above config file I leave a 2 pixel top of screen so when a window is maximised (ctrl-alt-M) I can still left/middle/right mouse click that region (desktop) to show the cwm applications/groups/windows menus (attached full screen (first) image shows my right mouse in top of screen applications menu).

Second (somewhat flared) image is a picture taken using my phone of the console (tty1 i.e. ctrl-alt-F1). I've recently reverted to using 640x480 again for that, after having tried 800x600 for a while i.e. video=640x480 kernel boot parameter (in grub4dos menu.lst)
s.jpg
 Description   
 Filesize   34.75 KB
 Viewed   385 Time(s)

s.jpg

c.jpg
 Description   
 Filesize   24.13 KB
 Viewed   382 Time(s)

c.jpg


_________________
( ͡° ͜ʖ ͡°) :wq
Fatdog multi-session usb

echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14532
Location: Gatineau (Qc), Canada

PostPosted: Mon 04 Feb 2019, 12:53    Post subject:  

Hi, rufwoof.

Yikes.

I usually like alternative WMs, but this one is going too much on
the "empty" side.

BFN.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 3672

PostPosted: Mon 04 Feb 2019, 16:32    Post subject:  

Hi musher0

I have ctrl-alt-F1 showing a real root tmux session, with multiple windows within that, one showing a tput based admin window (shutdown, reboot, mount things etc.) another that I used to launch X, and I've just added a third with some system monitoring things being displayed (top and a cpu usage chart) - just posted about that here

ctrl-alt-F3 is set to DISPLAY:1 ... on which I run a easy container (Xephyr/pflask) i.e. still root, but a capabilities etc dropped root, so very much like a very restricted userid. Within that I use cwm as the window manager.

ctrl-alt-F4 is standard EasyOS (real root), that uses jwm/rox ...etc.

So hardly bare Smile Each of those have their own benefits/pitfalls. Primarily I run the Xephyr for browser/internet stuff - and my music (audacious), tmux for ssh, standard root/jwm/rox for local system admin and other non internet tasks.

_________________
( ͡° ͜ʖ ͡°) :wq
Fatdog multi-session usb

echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14532
Location: Gatineau (Qc), Canada

PostPosted: Mon 04 Feb 2019, 16:56    Post subject:  

Hi, rufwoof.

Thanks for the info.

Isn't tmux ("term multiplexer") a WM for console? I thought it excluded using
anything else.

You have an Interesting screen setup, I must say.

BFN.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 3672

PostPosted: Mon 04 Feb 2019, 17:02    Post subject:  

Empty can be good. Even some web pages without any advertising can leave relevant/desired content visible via a letterbox. Yes I know you can full screen flip, but a larger (more empty) screen real estate is better from the get-go.

What with the window title, menu, tray, and more commonly nowadays a cookies warning that may not be shot unless you open up javascript (temporarily allow noscript), let alone if you do a find in addition to that.
letterbox.png
 Description   
 Filesize   73.36 KB
 Viewed   321 Time(s)

letterbox.png


_________________
( ͡° ͜ʖ ͡°) :wq
Fatdog multi-session usb

echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 3672

PostPosted: Mon 04 Feb 2019, 17:17    Post subject:  

musher0 wrote:
Isn't tmux ("term multiplexer") a WM for console? I thought it excluded using anything else.

tmux runs on the console. Within that you can have multiple (full screen) windows (I've set it so F11 adds a window, F12 steps between them). You can split each window into panes, and zoom/unzoom those (between full screen/restored). F11 and F12 because of the attached i.e. when using mc or mc text editor it uses F1 to F10. The normal control key for tmux is ctrl-B, but I set mine to be the backtick as I find that easier. If I want to actually key in a backtick such as in a script to make something execute, then I just have to press the backtick twice to get it to actually print to the script. That's a relatively infrequent action for me, so not really a inconvenience.

A nice feature is two of you can ssh into the same userid and attach to the same tmux session and collaborate (both edit/update windows). You can also detach and leave things running, reattach again from another location/device later. But all cli (terminal).

You can run that in addition to a X window manager such as jwm. For multiple X window managers you can do like EasyOS, run a Xephyr ... which is like another X server. For instance open a xterm window and run
Code:
Xephyr :3 &

and a small black window will appear - another X session.
Then in that xterm window run
Code:
DISPLAY=:3 jwm

and you should see the jwm tray appear in that smaller window. Could be any other window manager, twm, cwm ... whatever. You can also set Xephyr to create a larger window, for instance without looking IIRC its -fullscreen Xephyr parameter that will create a fullscreen version.

EasyOS 1.0 is good, but still has quirks. Changing backgrounds in one jwm (container), desktop icon locations ...etc. can revert or be lost. Using jwm as the real root session and cwm as the containers window manager makes EasyOS that more stable IMO, simply because cwm is so ... in your words 'empty'.
mce.png
 Description   
 Filesize   5.59 KB
 Viewed   316 Time(s)

mce.png


_________________
( ͡° ͜ʖ ͡°) :wq
Fatdog multi-session usb

echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [10 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0645s ][ Queries: 12 (0.0125s) ][ GZIP on ]