You are not logged in.

#26 2008-11-14 02:44:09

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

Re: The dwm thread

far0k wrote:

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!

You're very welcome and I'm glad the info is of some use to others.  I've uploaded my config.h and dwm.c--the latter of which is mostly default except for the tweaked setlayout function (as discussed recently on the dwm mailing list.)  As you'll probably notice, the keybinds are fairly basic. That's because most of my shortcuts are defined by xbindkeys--see the xbindkeysrc there as well.  Cheers.


thayer williams ~ cinderwick.ca

Offline

#27 2008-11-14 02:56:11

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

Re: The dwm thread

steve___ wrote:

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

Thanks steve! We've got similar expectations of our window managers.  That last tip is great and just what I was looking for to toggle my trayer app into view with a single bind.  I'll add that to the wiki for sure.


thayer williams ~ cinderwick.ca

Offline

#28 2008-11-18 01:00:56

Honken
Member
Registered: 2007-03-02
Posts: 79

Re: The dwm thread

I hope you don't mind me asking this here, but what is the mfact? I don't get what it does, changing it seems to do nothing?

Thanks. smile

Offline

#29 2008-11-18 02:12:17

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

Re: The dwm thread

That's the division between the main window and the tiled windows.  Changing it should change the size of the main window and the stack.


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

Offline

#30 2008-11-18 03:06:57

Aprz
Member
From: Newark
Registered: 2008-05-28
Posts: 277

Re: The dwm thread

config.h

static const char font[]            = "-*-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#cccc00";
static const char normbgcolor[]     = "#333333";
static const char normfgcolor[]     = "#cccccc";
static const char selbordercolor[]  = "#cccc00";
static const char selbgcolor[]      = "#444455";
static const char selfgcolor[]      = "#000000";
static unsigned int borderpx        = 0;        /* border pixel of windows */
static unsigned int snap            = 5;       /* snap pixel */
static Bool showbar                 = True;     /* False means no bar */
static Bool topbar                  = True;     /* False means bottom bar */
static Bool readin                  = True;     /* False means do not read stdin */

...

static Bool resizehints = False; /* False means respect size hints in tiled resizals */

...

static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
static const char *termcmd[]  = { "aterm", NULL };

Nothing too special. I pretty much liked the default look for Awesome3.0 so I made it very similar to that (a little less blue when it highlights)

dwm.c

void setup(void) {

     ...

     bh = dc.h = dc.font.height + 2 + 5;

     ...

}

Which the is where I can change the thickness of the status bar (You can pretty much do whatever geometry thing you want at line 1310, like if you want the status bar to float and stuff), but you also have to do it to dmenu.c if you're using dmenu (line 630).

I also just download the source code of DWM and Dmenu right off http://www.suckless.org instead of using abs or anything like that.

I just started learning C/C++ about a week ago (and I've been using a lot of Suckless stuff for about a half year, mostly can poke at the coding because I know Java and it has similar syntax), lol, but I am hoping when I learn more and the Suckless philosophy will lead me int he right direction when coding, and I hope I'll be able to do some neat stuff with DWM and Dmenu along with some of the other cool stuff from Suckless, like SIC to make it better it looking while keeping the code short, efficient, and DWM be just as productive. Right now trying to figure out how to make DWM status bar glossy. :\ Probably be awhile before I figure out.

screenshotnq4.th.png

Heh, don't shun me because I was using float in the screenshot. XD Using float defeats one of the purpose of using a tiling manager, I don't even remember why I was using float. big_smile

Wallpaper is made by ST.x at http://bbs.archlinux.org/viewtopic.php?id=57742 .

Last edited by Aprz (2008-11-18 03:22:59)

Offline

#31 2008-11-18 11:37:48

robmaloy
Member
From: Germany
Registered: 2008-05-14
Posts: 263

Re: The dwm thread

i modified a layout (called bottomstack) from:

------------
|           |
|    M      |
------------
|   |   |   |
------------

to behave like this:


3 windows:

------------
|           |
|    M      |
------------
|     |     |
------------

(the same as above)



4+ windows:

------------
|     |     |
|  M  |     |
------------
|   |   |   |
------------

(two windows on top, each having 1/2 of screen width)


but its for 4.9, haven't tested it on newer versions cause 4.9 totally fits my needs (and i dunno what exactly changed lol)


☃ Snowman ☃

Offline

#32 2008-11-18 13:01:14

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

Re: The dwm thread

robmaloy wrote:

i modified a layout (called bottomstack)

I've done the same with my 4.7, except the number of clients in the main section is configurable with keyboard shortcuts.  Very similar to ntile, but for bstack instead.


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

Offline

#33 2008-11-18 18:26:59

Honken
Member
Registered: 2007-03-02
Posts: 79

Re: The dwm thread

rson451 wrote:

That's the division between the main window and the tiled windows.  Changing it should change the size of the main window and the stack.

Ohhhhh, that makes sense. Thanks a lot rson!

Offline

#34 2008-11-18 19:08:59

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

Re: The dwm thread

No problem.


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

Offline

#35 2008-11-19 05:08:55

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: The dwm thread

Really like dwm--except for a problem with diablo and wine, for now: http://bbs.archlinux.org/viewtopic.php?id=59282 (figured that out now) smile
Thought I'd post my .xinitrc as it's cobbled together from several sources I found and it is simple--as in kiss.  Works well on my T21 Thinkpad (800 Mhz)

eval `cat ~/.fehbg`
while true 
do
echo [`date +" %d %b %Y %l:%M %p "`][ CPU: `awk '/cpu MHz/{print int($4)}' < /proc/cpuinfo` Mhz ]`acpi -b -t`
sleep 2
done | dwm

This gives time and date, cpu mhz, battery level and temp.

Edit:  This one took a bit longer to source out the temp for my desktop AMD cpu and gives date, time, cpu mhz and cpu temp.  Maybe save someone a bit of time.

eval `cat ~/.fehbg`
numlockx
while true 
do
echo [`date +" %d %b %Y %l:%M %p "`][ CPU: `awk '/cpu MHz/{print int($4)}' < /proc/cpuinfo` Mhz ][$(($(cat /sys/bus/pci/drivers/k8temp/0000\:00\:18.3/temp1_input) / 1000)) deg. C]
sleep 2
done | dwm

Last edited by bgc1954 (2008-11-19 17:51:28)


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#36 2008-11-22 19:40:15

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

Re: The dwm thread

Hi Thayer,
I'm happy you found something useful in what I passed on.

Here are four other tips I use; nothing too excited but I thought I'd pass them along to whoever might be interested.
1) swap alt and mod4
2) wm.log
3) editdwm
4) wm_status

1) I switch alt (mod1) with mod4.  I really enjoy mod4 being my primary key for key bindings.

$ cat ~/.Xmodmap

! Swap Mod1 (alt) and Mod4 (super)
clear mod1
clear mod4
keysym Super_L = Alt_L
keysym Alt_L = Super_L
keysym Alt_R = Super_L
keysym Menu = Menu
add mod1 = Alt_L Menu
add mod4 = Super_L Alt_R

And then set mod4 as the MODKEY in config.h

-   /* key definitions */
-   #define MODKEY Mod1Mask
-   #define TAGKEYS(KEY,TAG) \
+   /* key definitions */
+   #define MODKEY Mod4Mask
+   #define TAGKEYS(KEY,TAG) \

2) I redirect any X errors to a log file.

while true; do
    $HOME/bin/wm_status &
    sleep 10
done |while true; do
    dwm 2> $HOME/.dwm/wm.log
done

3) From what I read, people just starting out using dwm do not like the lack of dwmrc.  What I suggest is sym linking /var/abs/local/dwm-VERSION to /var/abs/local/dwm.  Then in a script do something like:

$ cat ~/bin/editdwm
#!/bin/bash

pkg="/var/abs/local/dwm/dwm*.pkg.tar.gz"

if [ -f $pkg ]; then
    mv $pkg{,-$(date +%Y%m%d%H%M)};
fi

vi ~/.dwm/dwmrc &&
cd "/var/abs/local/dwm" &&
makepkg -g >> PKGBUILD &&
makepkg -esi /var/abs/local/dwm/PKGBUILD &&
#pacman -U /var/abs/local/dwm/dwm*.pkg.tar.gz &&
killall dwm
exit

4) I like to know if I have any new emails and IM/irc messages regardless of the machine I'm on.  As well I like to know the CPU temperature of my laptop.  Here is a script I call from ~/.xinitrc:

$ cat wm_status
#!/bin/bash

mail='-';
jabber='-';
battery='-';
temperature='-';
bat_dir="/proc/acpi/battery/BAT0";
mail_dir="/home/steve/.mail/inbox/new";
jabber_dir="/home/steve/.weechat/logs/";

    if [ -d "$bat_dir" ]; then
        remaining="$(awk '/remaining capacity/ {print $3}' <${bat_dir}/state)"
        total="$(awk '/last full capacity/ {print $4}' <${bat_dir}/info)"
        battery_level="$((remaining *100 /total))"
        battery="${battery_level}%"
    fi

    if [ $HOSTNAME == "dtsteve" ]; then
        mailcount="$(ls $mail_dir/ | wc -l > /srv/www/nginx/html/E.html)";
    fi

    if [ $HOSTNAME == "dtsteve" ]; then
        jabbercount="$(cat ${jabber_dir}/events | wc -l > /srv/www/nginx/html/I.html)";
    fi

    mail=$(w3m -dump http://dtsteve/E.html)
    jabber=$(w3m -dump http://dtsteve/I.html)
    if [ $HOSTNAME == "ltsteve" ]; then
        temperature=$(cat /proc/acpi/thermal_zone/THRC/temperature | sed 's/temperature:             //' | sed 's/ //')
    fi
    date=$(date '+%a %d %b %R');

    if [ $HOSTNAME == "ltsteve" ]; then
        echo "E:${mail} I:${jabber} B:${battery} T:${temperature} [${date}]"
    else
        echo "E:${mail} I:${jabber} [${date}]"
    fi

Lastly, I do not agree with the wiki when it states the recommended method for installation and configuration is "make install clean".  This is archlinux and I would suggest using makepkg.  If we're to include this method then I suggest it be relabelled from 'recommended' to 'easy'.

Offline

#37 2008-11-22 20:34:38

Redroar
Member
Registered: 2008-03-17
Posts: 200

Re: The dwm thread

I don't do any make install at all. I have ~/.bin in my path and just drop dwm in there. This is the best way to handle it for multi-user anyway, and no need to go root at any point.


Stop looking at my signature. It betrays your nature.

Offline

#38 2008-11-22 22:08:47

BabyDoc
Member
Registered: 2008-03-20
Posts: 76

Re: The dwm thread

Some nice tips steve, gonna try some of those.

Offline

#39 2008-11-22 22:32:43

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

Re: The dwm thread

steve___ wrote:

Lastly, I do not agree with the wiki when it states the recommended method for installation and configuration is "make install clean".  This is archlinux and I would suggest using makepkg.  If we're to include this method then I suggest it be relabelled from 'recommended' to 'easy'.

I 100% agree on this.  I have been using makepkg since day one.  In fact I have an alias to rebuild and install because of dwm

alias repkg='makepkg -efi'

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

Offline

#40 2008-11-24 07:10:10

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

Re: The dwm thread

So much to reply to, so little time! Thanks again, Steve for the tips and for all those interested, feel free to make changes or additions to the wiki as you see fit--I'm running low on time these days and don't know how long it'll take me to get everything updated.

@Steve: For #1, why go through the hassle of reassinging your keys with xmodmap if you just update the config.h anyway?

Regarding the whole 'make install clean' vs. ABS/pacman debate, I think it's really just a matter of preference. I can't recall for sure, but I thought the PKGBUILD overwrote the config.h by default, which ran the risk of overwriting a customized config.h whenever the version was bumped. You're right though, we should probably remove the 'recommended' bit and just call them all alternative methods.

Last edited by thayer (2008-11-24 07:11:02)


thayer williams ~ cinderwick.ca

Offline

#41 2008-11-24 18:47:53

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

Re: The dwm thread

re: @Steve: For #1, why go through the hassle of reassinging your keys with xmodmap if you just update the config.h anyway?

Otherwise a person wouldn't have all keys available to them or have to clobber the regular ALT keybindings for GUI programs (ie firefox, OOo, xpdf etc).

-steve

Offline

#42 2008-11-24 19:58:22

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

Re: The dwm thread

thayer wrote:

I can't recall for sure, but I thought the PKGBUILD overwrote the config.h by default, which ran the risk of overwriting a customized config.h whenever the version was bumped. You're right though, we should probably remove the 'recommended' bit and just call them all alternative methods.

The default PKGBUILD copies ./config.h to ./src/dwm-*/ then builds the package.  Not that important, just figured I'd put that out there big_smile


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

Offline

#43 2008-11-27 00:54:44

Honken
Member
Registered: 2007-03-02
Posts: 79

Re: The dwm thread

Hey guys, I've got another question (hope you don't mind me asking it here). When I set my DWM to floating mode and move around windows it goes painfully slow (~moving a windows 500px takes roughly 15 sec) and the CPU usage spikes up to 100% on both cores. Any idea of what might cause this?

I just checked, it does this in awesome as well. sad

Offline

#44 2008-11-27 01:50:28

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

Re: The dwm thread

Are you using dwm-5.2?  While moving a window, run top and press S-p (to sort by cpu).  Which process is taking up all your cpu?

Offline

#45 2008-11-27 02:45:36

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

Re: The dwm thread

Honken wrote:

Hey guys, I've got another question (hope you don't mind me asking it here). When I set my DWM to floating mode and move around windows it goes painfully slow (~moving a windows 500px takes roughly 15 sec) and the CPU usage spikes up to 100% on both cores. Any idea of what might cause this?

I just checked, it does this in awesome as well. sad

Sounds like a video card/driver issue to me.  Possibly to do with DRI. I suggest starting a separate thread for assistance.


thayer williams ~ cinderwick.ca

Offline

#46 2008-12-05 00:11:25

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

Re: The dwm thread

Hi All,
With a rule of:

{ "MPlayer",    NULL,       NULL,       0,              True },

Mplayer floats and is centered.  With a rule of:

{ NULL,         NULL,       "popup",    0,             True },

A term titled 'popup' floats but is not centered.  The window is in the top left of the screen.  Does anyone know why this is?

Last edited by steve___ (2008-12-05 00:12:02)

Offline

#47 2009-03-16 19:43:34

landwell
Member
Registered: 2008-11-24
Posts: 11

Re: The dwm thread

robmaloy wrote:

i modified a layout (called bottomstack) from:

------------
|           |
|    M      |
------------
|   |   |   |
------------

to behave like this:


3 windows:

------------
|           |
|    M      |
------------
|     |     |
------------

(the same as above)



4+ windows:

------------
|     |     |
|  M  |     |
------------
|   |   |   |
------------

(two windows on top, each having 1/2 of screen width)


but its for 4.9, haven't tested it on newer versions cause 4.9 totally fits my needs (and i dunno what exactly changed lol)

Can you post the code from your config.h you used for this; I'd like to change the layout but can't can find a tutorial.

Thanks.

Offline

#48 2009-10-23 22:16:59

pshr
Member
Registered: 2009-09-27
Posts: 36

Re: The dwm thread

dwm patch for shuffling windows.

I have looked around for this without any luck, feature like xmonad have. Sadly i suck at coding so i depend on others to do it for me smile

Cheers !
pshr

Offline

#49 2009-10-23 22:48:01

SamC
Member
From: Calgary
Registered: 2008-05-13
Posts: 611
Website

Re: The dwm thread

Offline

#50 2009-10-23 23:32:56

pshr
Member
Registered: 2009-09-27
Posts: 36

Re: The dwm thread

Hey Samc !

WTF! haha i must have missed those patches multiple times sad....man...i need to regenerate my brain !
Thanks man !

Cheers
pshr

Offline

Board footer

Powered by FluxBB