You are not logged in.

#1 2008-10-22 19:25:57

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

The dwm thread

I'd like to make revisions to the dwm article, but I'm having trouble finding some info.  If you can help fill in the blanks, I'll add this stuff to the wiki. Please make sure that any configs, tips, etc. work with the latest dwm v5.2.

1. Restart dwm without quitting X and other client applications
There are some older posts with proposed techniques, but none have worked for me so far.  How do you restart your dwm? Please provide code snippets and whatever is necessary to make it work.
If possible, I'd like to provide a method for users of startx, SLiM and other *DM login managers.

2. How is your 'make' environment set up?
Do you simply copy the abs directory, make changes to config.h, and run makepkg?
Do you patch dwm.c and make install etc manually?
Any tips in this direction?

3. Share your dwm stdin statusbar scripts with the community

4. Share your config.h files and/or any other patches you have created
    (new patches should really go to the dwm website for listing)

5. Any other tips or information you'd like to share/see on the wiki

Last edited by thayer (2009-07-09 18:57:47)


thayer williams ~ cinderwick.ca

Offline

#2 2008-10-23 14:33:53

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: The dwm thread

Heh, I guess this says a lot about the current trends of dwm within our community.


thayer williams ~ cinderwick.ca

Offline

#3 2008-10-23 14:56:36

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: The dwm thread

They all switched to Xmonad big_smile


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#4 2008-10-23 15:27:01

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: The dwm thread

moljac024 wrote:

They all switched to Xmonad big_smile

Aye, you may be onto something.  I still have have my trusty xmonad.hs at the ready and I'm conflicted over the simplicity of dwm and the beauty of Xmonad.  Awesome 3 on the other hand...well, let's just say I have no interest in Desktop Environments wink


thayer williams ~ cinderwick.ca

Offline

#5 2008-10-23 15:40:38

mentallaxative
Member
From: Australia
Registered: 2008-07-14
Posts: 134
Website

Re: The dwm thread

This is Arch; isn't everyone on the Openbox bandwagon? tongue

I wrote the little acpi example for the dwm article. Unfortunately I can't contribute much more than that. I also tried to do the restart-dwm-without-killing-x thing but gave up after a while. It's not like I plan on dropping out of X every day.

Installing dwm through makepkg is unnecessary trouble when sudo make install from the source directory does the same thing. I keep my source in ~/Builds/_compiled/dwm/ , as I have a ton of other pkgbuilds in the Builds directory and I didn't want it mixing with dwm which I make and install directly.

As for keyboard shortcuts, I spent quite a bit of time shuffling them about to get a good configuration. Through xmodmap, I changed the MODKEY to the super key, disabled Caps Lock and designated it as a second super key. Then I cut down my number of tags to only four, and changed the bindings for them to a,s,d,f, so I can quickly change tags with one hand without stretching my fingers too much.

Offline

#6 2008-10-23 16:52:42

PeteMo
Member
From: H'Burg, VA
Registered: 2006-01-26
Posts: 191
Website

Re: The dwm thread

I used dwm for a long time, but I've recently switched to xmonad.  I got tired of the changes to config.h with every release.  When I was using dwm, I used the mercurial repo and compiled dwm on my own.  Dwm is so simple, and makepkg adds complexity when configuring dwm.  I also used the mercurial patch queue for managing my changes to dwm.

thayer wrote:

I'm conflicted over the simplicity of dwm and the beauty of Xmonad

I felt this way too, for a long time.  That's why I stayed with dwm for so long.  I know a lot more C than haskell, but due to xmonad's extensive documentation and larger community, I've actually found it easier to set up than dwm.

Offline

#7 2008-10-23 21:37:18

Vintendo
Member
From: Netherlands
Registered: 2008-04-21
Posts: 375
Website

Re: The dwm thread

thayer wrote:
moljac024 wrote:

They all switched to Xmonad big_smile

Aye, you may be onto something.  I still have have my trusty xmonad.hs at the ready and I'm conflicted over the simplicity of dwm and the beauty of Xmonad.  Awesome 3 on the other hand...well, let's just say I have no interest in Desktop Environments wink

I've got the same problem. I love the simplicity of DWM, just in C and config in a C header. But the dual screen support of XMonad is soo good. But i dislike the 300Mb haskell compiler. I guess i have to learn haskell.

Offline

#8 2008-10-25 20:52:05

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,221
Website

Re: The dwm thread

1. You can get dwm to auto-restart by changing your .xinitrc to this

until dwm; do
    sleep 1
done

and compile like this: make && killall dwm && cp dwm ~/bin which I guess you could create as a command in config.h and bind to key,

Offline

#9 2008-10-25 21:19:14

skymt
Member
Registered: 2006-11-27
Posts: 443

Re: The dwm thread

Back when I used dwm, I had a patch to add a function/keybinding pair that would restart dwm by exec()-ing argv[0]. Unfortunately, I never posted it anywhere or backed it up, so it's lost now. But it worked well, so that's probably the tree you should bark up. Sorry I couldn't be of more help. hmm

Last edited by skymt (2008-10-25 21:19:50)

Offline

#10 2008-10-26 03:44:35

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: The dwm thread

Thanks for the input guys, I'll add some of this to the wiki soon...in the meantime, keep'em coming!  Also, I've made a few simple wallpapers for you existing dwm users: http://bbs.archlinux.org/viewtopic.php?id=57768


thayer williams ~ cinderwick.ca

Offline

#11 2008-10-26 14:23:48

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 634

Re: The dwm thread

i wrote this dwm to compiz post http://bbs.archlinux.org/viewtopic.php?id=55907, maybe you find it useful because it has my config and status lines

Last edited by leo2501 (2008-10-26 14:24:54)


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#12 2008-10-26 15:58:38

rostoQ
Member
Registered: 2008-06-25
Posts: 40

Re: The dwm thread

I think its a great idea. After using WMII very long, i tried ratpoison xmonad awesome and dwm. I got stucked with dwm because i found it most easy to configure (xmonad and/or awesome had the most ugly config-file i ever saw that time back).

I use pretty much the standart setup. Just changed keybindings and added monocle and pertag patches. (You dont need special tiling imo when you are just on 1024x768, in fact, i almost never tile).
This is why i cant submit anything for the wiki.

But i just got a 22" Widescreen, werefor i sure will fiddle some features...

It's not like I plan on dropping out of X every day.

So true, i dont want to spend my time configuring my wm anyway, its a thing i hope have to do just once (for one or two days). Then it should work - no need for daily eye-candy waste of time like you can do in gnome/kde wink

Offline

#13 2008-10-28 13:32:46

fuscia
Member
Registered: 2008-04-21
Posts: 398

Re: The dwm thread

oops! wrong thread. sorry.

Last edited by fuscia (2008-10-28 13:33:57)

Offline

#14 2008-10-29 00:31:55

cardinals_fan
Member
From: /dev/null
Registered: 2008-02-03
Posts: 248

Re: The dwm thread

I don't do anything special.  I edit the colors and app preferences in config.h, then make install.  I like the dwm defaults smile


Segmentation fault (core dumped)

Offline

#15 2008-10-29 01:09:32

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: The dwm thread

My startdwm script is below.

#!/bin/bash

#set desktop image
r=$RANDOM
let "r %= 2"
case $r in
0) 
  /usr/bin/feh --bg-center ~/images/Dawn_On_The_Deck_by_l8_bar.jpg & ;;
1)
  /usr/bin/feh --bg-center ~/images/01356_crepuscule_1680x1050_bar.jpg & ;; 
esac


sleep 3 
{
  #start any programs
  ~/bin/term &
  /usr/bin/conky &
  ~/bin/changevol -s &
} &

#generate statusbar and pass to dwm
~/bin/dwm_status | while true; do /usr/bin/dwm > /dev/null; done;

I've got mod1-shift-ctrl-q set to kill dwm, all clients are preserved and dwm is restarted.  HTH.

Last edited by rson451 (2008-10-29 01:15:34)


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#16 2008-10-30 00:00:05

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 634

Re: The dwm thread

rson451 wrote:

My startdwm script is below.

#!/bin/bash

#set desktop image
r=$RANDOM
let "r %= 2"
case $r in
0) 
  /usr/bin/feh --bg-center ~/images/Dawn_On_The_Deck_by_l8_bar.jpg & ;;
1)
  /usr/bin/feh --bg-center ~/images/01356_crepuscule_1680x1050_bar.jpg & ;; 
esac


sleep 3 
{
  #start any programs
  ~/bin/term &
  /usr/bin/conky &
  ~/bin/changevol -s &
} &

#generate statusbar and pass to dwm
~/bin/dwm_status | while true; do /usr/bin/dwm > /dev/null; done;

I've got mod1-shift-ctrl-q set to kill dwm, all clients are preserved and dwm is restarted.  HTH.

The line

~/bin/dwm_status | while true; do /usr/bin/dwm > /dev/null; done;

is the one responsible for restarting dwm preserving all clients when you press the "quit" keybinding? and how do you really kill dwm if you want plain X?


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#17 2008-10-30 00:23:56

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: The dwm thread

I wouldn't start dwm in the first place, in that case.  Why would you ever want plain X? you can't control windows from then on out.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#18 2008-10-30 00:40:05

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 634

Re: The dwm thread

ha, no i mean, that i really like that restart-dwm-without-quiting-my-apps thing, but maybe i only want plain X for god knows why tongue


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#19 2008-10-30 01:08:33

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: The dwm thread

rson451 wrote:

I wouldn't start dwm in the first place, in that case.  Why would you ever want plain X? you can't control windows from then on out.

I think what leo is getting at is that the way your script is setup you can't for example, drop back to SLIM using dwm's exit function.  Instead it just respawn dwm. It means that anyone who wanted to log into an alternative wm, such as Openbox would have to force an X reset with C+A+Backspace.


thayer williams ~ cinderwick.ca

Offline

#20 2008-10-30 01:20:09

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: The dwm thread

Oh, but of course there is. 

killall startdwm

archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#21 2008-10-30 01:36:39

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: The dwm thread

rson451 wrote:

Oh, but of course there is. 

killall startdwm

Doh! That didn't occur to me because I didn't run your script as a whole, I simply grabbed the loop and dropped it into my xinitrc.


thayer williams ~ cinderwick.ca

Offline

#22 2008-10-30 04:30:02

mentallaxative
Member
From: Australia
Registered: 2008-07-14
Posts: 134
Website

Re: The dwm thread

Does anyone know of a patch that allows dwm to switch to next/previous tags? I only know the one on the link in the wiki page, but I am using 5.0.1 which is not compatible with it.

Offline

#23 2008-10-30 07:41:06

fuscia
Member
Registered: 2008-04-21
Posts: 398

Re: The dwm thread

the only thing i do differently from what most people do is that i haven't installed dwm. i just run it from my home directory. i also have a file that i 'launch' it from called .dwm-launch (i suppose it could be called anything, dwm, banana, whatever...). the file contains...

while true
do
echo `date +" %I:%M %p "`
sleep 2
done | [i]nameofwhateversetupifeellikeusing[/i]

...so that i have a clock in that bar thing at the top. because i don't have it installed, it's easy for me to choose from a variety of previously setup versions of dwm (specifically, the config.h file). all i have to do is change the name in the .dwm-launch file, rather than having to re-edit and remake the config.h file.

Offline

#24 2008-11-13 23:21:21

far0k
Member
Registered: 2008-07-28
Posts: 5

Re: The dwm thread

Hi thayer

Have you posted your dwm config.h file anywhere?  I often borrow bits from your configs on http://cinderwick.ca/files and am interested to see what you have done with dwm.

Thank you for sharing all of the stuff that is currently there it is useful and time saving!

far0k

Offline

#25 2008-11-14 01:18:47

steve___
Member
Registered: 2008-02-24
Posts: 439

Re: The dwm thread

Hi All,
Here are the five adjustments I make to the dwm source:
1) add patches -- grid, monocle_count, pertag
2) disable mouse window focus
3) verticle split in grid mode
4) monocle toggle patch
5) configure tag key combos in config.h

1) These patches are found here:
grid - http://www.v4hn.de/patches/dwm-5.2-gridmode.diff
monocle_count - http://www.suckless.org/dwm/patches/dwm … count.diff
pertag - http://www.suckless.org/dwm/patches/dwm-5.2-pertag.diff

A copy of my patched source is found here:
http://members.porchlight.ca/steve/dwm-5.2.tgz

I used a 24" monitor at work and really enjoy the grid layout.  The monocle patch puts 1/xx to the left of the tags letting the user know how many applications are on a selected tag(s).  The pertag patch allows a user to have separate layouts per tag -- remembering each tags mwfact position as well.

2) I use the mouse infrequently so accidentally bumping it will change the window focus causing frustration.  To disable this feature one needs to change dwm.c (around line 616)

-   enternotify(XEvent *e) {
-           Client *c;
-           XCrossingEvent *ev = &e->xcrossing;
-
-           if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
-                   return;
-           if((c = getclient(ev->window)))
-                   focus(c);
-           else
-                   focus(NULL);
-   }
+   enternotify(XEvent *e) {
+           Client *c;
+           XCrossingEvent *ev = &e->xcrossing;
+
+           if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
+                   return;
+           if((c = getclient(ev->window)))
+                   return;
+           else
+                   focus(NULL);
+   }

3) Using the gridmode layout with two applications running, the screen will split horizontally -- I wanted vertically.  To make this change edit grid.c :

-    /* grid dimensions */
-    for(cols = 0; cols <= n/2; cols++)
-        if(cols*cols >= n)
-            break;
-    rows = (cols && (cols - 1) * cols >= n) ? cols - 1 : cols;
+    /* grid dimensions */
+    for(rows = 0; rows <= n/2; rows++)
+        if(rows*rows >= n)
+            break;
+    cols = (rows && (rows - 1) * rows >= n) ? rows - 1 : rows;

4) In dwm-4.7 pressing M-m would maximize a window and pressing M-m would restore the window.  To get this functionality, change in dwm.c (around line 1275):

-   setlayout(const Arg *arg) {
-           if(!arg || !arg->v || arg->v != lt[sellt])
-                   sellt ^= 1;
-           if(arg && arg->v)
-                   lt[sellt] = lts[curtag] = (Layout *)arg->v;
-           if(sel)
-                   arrange();
-           else
-                   drawbar();
-   }
+   setlayout(const Arg *arg) {
+       sellt ^= 1;
+       if(arg && arg->v && (arg->v != lt[sellt^1]))
+           lt[sellt] = (Layout *)arg->v;
+       if(sel)
+           arrange();
+       else
+           drawbar();
+   }

5) Most people use dwm incorrectly.  They treat each tag as a workspace and move applications around with M-S-#.  The developer's intended method was to pull tags into other tags.  For example, on tag 1 a user has a terminal and a web browser and on tag 5 a mail client and an IM/IRC client.  While working in tag 1 the user decides to check mail.  The user presses M-C-5 and the desired applications are displayed in the users stack (assuming the tile layout is selected).  Once finished, the user presses M-1 and is back to their original few.

I'm lazy and pressing M-C-# is annoying.  From reading the dwm ML, i saw how to create a keybinding for selecting multiple tags.  Currently how I work is:
tag 1 = two terminals
tag 2 = two terminals
tag 3 = two browsers

I bind M-q to tag 1 & 2, M-w to 1 & 3 and M-e to tag 2 & 3.  This allows me to have 4 terminals, 2 terminals and 2 browsers and the other 2 terminal and 2 browsers respectively.  This is done by adding this to config.h:

#define WORKSPACE(KEY,TAG) \
    { MODKEY,                       KEY,      view,           {.ui = TAG} },
.
.
.
    WORKSPACE(                      XK_q,                       1 << 0 | 1 << 1)
    WORKSPACE(                      XK_w,                       1 << 0 | 1 << 2)
    WORKSPACE(                      XK_e,                       1 << 1 | 1 << 2)

Lastly to anyone, feel free to add some of this information to the wiki.  I tried but found I needed to create a separate login for the wiki (one for the forums, one for the wiki, one for aur...?).  Then i found the wiki doesn't accept underscores (but the forums do) and then...  ohh cupcakes...  smile

Last edited by steve___ (2008-11-14 01:20:52)

Offline

Board footer

Powered by FluxBB