You are not logged in.

#251 2011-02-08 21:35:03

keks
Member
Registered: 2007-07-11
Posts: 32

Re: Show off your Dwm configuration!

Although no tag actually really looks like this in...
dwmirl6.png

Offline

#252 2011-02-10 15:22:15

Alm
Member
Registered: 2010-09-15
Posts: 56

Re: Show off your Dwm configuration!

What font are you using?


See, you're unpacking.

Offline

#253 2011-02-10 15:57:07

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

Re: Show off your Dwm configuration!

That would be the dina font.


thayer williams ~ cinderwick.ca

Offline

#254 2011-02-22 13:58:27

Meyithi
Member
From: Wirral, UK
Registered: 2009-06-21
Posts: 550
Website

Re: Show off your Dwm configuration!

Added bstack and uselessgaps, whittled down my tags a bit.

ssfeb_thumb.png

confs @ http://www.meyithi.com/dots/nb


The mind roams more freely in empty rooms.
dwm - colours - ncmpcpp - system
irc://irc.freenode.net:meyithi

Offline

#255 2011-03-01 13:56:02

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: Show off your Dwm configuration!

New dwm set up. tray is stalonetray

2011-03-01-001113_1280x800_scrot.png

Offline

#256 2011-03-01 14:13:25

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641
Website

Re: Show off your Dwm configuration!

Nice looking tags you have there mate. smile

Offline

#257 2011-03-04 22:58:45

redhalo
Member
Registered: 2009-08-11
Posts: 22

Re: Show off your Dwm configuration!

How did you do the selection lines above the tags? Looks great.

Offline

#258 2011-03-04 23:19:45

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: Show off your Dwm configuration!

redhalo wrote:

How did you do the selection lines above the tags? Looks great.

Thanks!

I created a function that draws the line above selected tags:

void drawseltagline(unsigned long col[ColLast]){
   XGCValues gcv;
   XRectangle r = { dc.x, dc.y, dc.w, 2 };

   gcv.foreground = col[ColBorder];
   XChangeGC(dpy, dc.gc, GCForeground, &gcv);
   XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
}

and in drawbar() function, do something like this:

   // draw tag names
   for(i = 0; i < LENGTH(tags); i++) {
      dc.w = TEXTW(tags[i]);
      col = m->tagset[m->seltags] & 1 << i ? dc.colors[1] : dc.colors[0];
      ltcol = occ & 1 << i || m->tagset[m->seltags] & 1 << i ? dc.colors[0] : dc.colors[2];
      drawtext(tags[i], ltcol, urg & 1 << i);
      drawseltagline(col);
      dc.x += dc.w;
   }

You may have to play around with the positioning of the text in the bar (i.e. see drawtext() function), and bar height (bh). Experiment, and have fun!

P.S. I have many applied patches, so if you just copy and paste the above, you'll most likely run into problems (for example i have statuscolors patch that allows me to have multiple colors, etc...)

Last edited by kcirick (2011-03-04 23:23:23)

Offline

#259 2011-03-04 23:26:27

redhalo
Member
Registered: 2009-08-11
Posts: 22

Re: Show off your Dwm configuration!

I've been trying to figure out how to do this exact thing. Thanks for giving me something to play with.

Offline

#260 2011-03-08 08:10:19

usbtopc
Member
Registered: 2011-03-05
Posts: 7

Re: Show off your Dwm configuration!

Screenshot1

Screenshot2

Screenshot3

config:dwm-plus

Last edited by usbtopc (2011-03-31 07:59:17)

Offline

#261 2011-03-09 13:43:34

monotiz
Member
Registered: 2007-10-20
Posts: 134

Re: Show off your Dwm configuration!

Is there a way to make as "urgent" the skype tag?
Urgent tag works fine with empathy but don't work with skype.

I'd lito to not use a system tray app.

Thanks

Last edited by monotiz (2011-03-09 13:43:56)

Offline

#262 2011-03-09 14:01:55

tvale
Member
From: Palmela, Portugal
Registered: 2008-12-11
Posts: 169

Re: Show off your Dwm configuration!


archlinux x86_64 @ Asus UL30A

dwm and patches
conky-dzen

Offline

#263 2011-03-15 12:19:18

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 455

Re: Show off your Dwm configuration!

dwm on eeepc with some patches:
- cycle
- pango
- uselessgaps
- nbstack
- pertag2
- push
- pidgin layout
- scratchpad

clean:
http://dl.dropbox.com/u/15563529/clean.png

"busy":
http://dl.dropbox.com/u/15563529/busy.png

Last edited by OK100 (2011-03-15 12:22:02)

Offline

#264 2011-03-25 13:28:21

synorgy
Member
From: $HOME
Registered: 2005-07-11
Posts: 272
Website

Re: Show off your Dwm configuration!

I'm surprised I've never done this before...

Screenshot:
vN3E2YQ

Patches:
pertag, bstack, movestack, statuscolors

The font is a modified version of Tamsyn that includes the custom characters, such as the layout indicators and the glyphs in the statusbar. You can find it on a new thread here.

config.h:

/* See LICENSE file for copyright and license details. */

/* appearance */
static const char font[]              = "-*-tamsyn2-*-*-*-*-15-*-*-*-*-*-*-*";

#define NUMCOLORS         6             // need at least 3
static const char colors[NUMCOLORS][ColLast][8] = {
       // border   foreground  background
       { "#282626", "#D0D0D0", "#282626" },  // 0 = normal
       { "#A0A57E", "#A0A57E", "#282626" },  // 1 = selected
       { "#1C1C1C", "#D7AFD7", "#1C1C1C" },  // 2 = purple on black
       { "#1C1C1C", "#AFD787", "#1C1C1C" },  // 3 = green on black
       { "#A0A57E", "#282626", "#A0A57E" },  // 4 = black on green
       { "#282626", "#A8716D", "#282626" },  // 5 = red on black
       // add more here
};
static const unsigned int borderpx  = 1;        /* border pixel of windows */
static const unsigned int snap      = 32;       /* snap pixel */
static const Bool showbar           = True;     /* False means no bar */
static const Bool topbar            = True;     /* False means bottom bar */

/* tagging */
static const char *tags[] = { "WEB", "CODE", "MISC", "CHAT"};

static const Rule rules[] = {
    /* class      instance    title       tags mask     isfloating   monitor */
    { "Pidgin",   NULL,       NULL,       1 << 3,       False,       -1 },
//    { "Firefox",  NULL,       NULL
    { NULL,       NULL,      "ncmpcpp",  0,            True,     -1 },
};

/* layout(s) */
static const float mfact      = 0.55; /* factor of master area size [0.05..0.95] */
static const Bool resizehints = False; /* True means respect size hints in tiled resizals */

static const Layout layouts[] = {
    /* symbol     arrange function */
     { "¿",      bstack },
    { "½",      tile },    /* first entry is default */
     { "À",      bstackhoriz },
    { "¼",      monocle },
    { "¾",      NULL },    /* no layout function means floating behavior */
};

/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
    { MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
    { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static const char *dmenucmd[] = { "/home/bryan/.bin/dmenurun", NULL };
static const char *mpc_toggle[] = { "mpc", "toggle", NULL };
static const char *mpc_next[] = { "mpc","next", NULL };
static const char *mpc_prev[] = { "mpc","prev", NULL };
static const char *mpc_stop[] = { "mpc","stop", NULL };
static const char *pcmanfm[] = { "pcmanfm", NULL };
static const char *ncmpcpp[] = { "urxvtc","-title", "ncmpcpp", "-e","sh","-c","ncmpcpp", NULL };
static const char *dmenumpd[] = {"/home/bryan/.bin/dmenumpd",NULL};
static const char *termcmd[]  = { "urxvtc", NULL };
static const char *sleepcmd[] = { "sudo", "pm-suspend", NULL };

static Key keys[] = {
    /* modifier                     key        function        argument */
    { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
    { MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
    { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
    { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
    { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
    { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
    { MODKEY|ShiftMask,             XK_j,      movestack,      {.i = +1 } },
    { MODKEY|ShiftMask,             XK_k,      movestack,      {.i = -1 } },
    { MODKEY,                       XK_Return, zoom,           {0} },
    { MODKEY,                       XK_Tab,    view,           {0} },
    { MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
    { MODKEY,                       XK_b,      setlayout,      {.v = &layouts[0]} },
    { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[1]} },
    { MODKEY|ShiftMask,             XK_b,      setlayout,      {.v = &layouts[2]} },
    { MODKEY,                       XK_m,      setlayout,      {.v = &layouts[3]} },
    { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[4]} },
    { MODKEY,                       XK_space,  setlayout,      {0} },
    { MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    { MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    { MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    TAGKEYS(                        XK_1,                      0)
    TAGKEYS(                        XK_2,                      1)
    TAGKEYS(                        XK_3,                      2)
    TAGKEYS(                        XK_4,                      3)
    { MODKEY|ShiftMask,             XK_q,          quit,           {0} },
/*    { MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    { MODKEY,                       XK_period, focusmon,       {.i = +1 } },
     { MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    { MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },*/
    {0,                0x1008FF14,    spawn,        {.v = mpc_toggle }},
    {0,                0x1008FF15,    spawn,        {.v = mpc_stop }},
    {0,                0x1008FF17,    spawn,        {.v = mpc_next }},
    {0,                0x1008FF16,    spawn,        {.v = mpc_prev }},
    {0,             0x1008ff2f, spawn,      {.v = sleepcmd }},
    {MODKEY|ShiftMask, XK_z,    spawn,        {.v = ncmpcpp }},
    {MODKEY,                XK_e,        spawn,        {.v = pcmanfm }},
    {ControlMask,            XK_grave,    spawn,        {.v = dmenumpd }},
};

/* button definitions */
/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
    /* click                event mask      button          function        argument */
    { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    { ClkWinTitle,          0,              Button2,        zoom,           {0} },
    { ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    { ClkTagBar,            0,              Button1,        view,           {0} },
    { ClkTagBar,            0,              Button3,        toggleview,     {0} },
    { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
};

(There are probably 1000+ better ways of getting what I want on the status bar, but I'm comfortable in Python - so...)
dwm-status.py:

#!/usr/bin/python3
# coding: utf-8
import re
from datetime import datetime
from subprocess import *
from decimal import Decimal

def run_cmd(cmd):
    return Popen(cmd, stdout=PIPE).communicate()[0].decode("utf-8").strip()

def get_mpd():
    try:
        interim = run_cmd(["ncmpcpp", "--now-playing"]).split()[1:]
        for entry in interim:
            old_entry=entry
            entry = entry+" "
            interim[interim.index(old_entry)]=entry

        status = ''.join(interim)
    except OSError:
        return ''

    if "Cannot connect" in status or not status:
        status = "Not playing"

    return "\x02î\x01{status}  ".format(status=status)

def get_volume():
    try:
        mix = run_cmd(["/home/bryan/.bin/volctrl"])
    except:
        return ''

    volume = int(mix.split('\n')[1].lstrip('[').split('%')[0])

    icon = "í"
    if volume == 0:
        return "\x05ê Muted  "
    if volume < 66:
        icon = "ì"
    if volume < 33:
        icon = "ë"

    return "\x02{icon}\x01{volume}%  ".format(icon=icon, volume=str(volume))

def get_temp():
    icon = "þ"
    curTemp = run_cmd(["sensors"]).split('\n')
    for line in curTemp:
        if line.startswith('Core 0') == True:
            core0Temp = line.split()[2].lstrip('+').split('.')[0]
        elif line.startswith('Core 1') == True:
            core1Temp = line.split()[2].lstrip('+').split('.')[0]
    vidTemp = run_cmd(["nvidia-settings","-tq","[gpu:0]/GpuCoreTemp"])
    return "\x02{icon}\x01{core0Temp}° {core1Temp}° {vidTemp}°".format(icon=icon, core0Temp=core0Temp, core1Temp=core1Temp, vidTemp=vidTemp)

def get_mem_usage():
    icon = "ü"
    cmd=getoutput("free -m -t | tail -n 1 | awk '{total=$2} {used=$3} END {print used}  {print total}'").split()
    used=cmd[1]
    total=cmd[0]
    mem_perc=(Decimal(used)/Decimal(total)*100).quantize(Decimal("0"))
    return "\x02{icon}\x01{mem_perc}%".format(icon=icon,mem_perc=str(mem_perc))

def get_cpu_usage():
    icon = "û"
    cmd=getoutput('cat /proc/loadavg | cut -d " " -f1')
    cpu_perc=(Decimal(cmd)*100).quantize(Decimal(0))
    return "\x02{icon}\x01{cpu_perc}%".format(icon=icon,cpu_perc=str(cpu_perc))
def get_mail():
    icon = "ÿ"
    unread=run_cmd(["sh", "/home/bryan/.bin/checkmail.sh"])
    return "\x02{icon}\x01{unread}".format(icon=icon, unread=str(unread))

def get_date():
    date = datetime.now().strftime("%m/%d/%Y")
    return date

def get_time():
    time = datetime.now().strftime("%I:%M %P")
    return "\x02 {0}\x01".format(time)

print(
#    get_mail()   +
    get_mpd()   +
    get_volume() +
    get_temp() +
    get_cpu_usage() +
    get_mem_usage() +
    get_time()
)

(note that get_mail is commented out because I just did a reinstall and I don't have the necesary scripts any longer)

.bin/dmenurun is just a script that calls dmenu-run with environment variables so that I can change the font & colors in .zprofile. I do this for all of my dmenu scripts. It makes updating the colors and fonts much easier.

If you'd like to get any more information - let me know.


"Unix is basically a simple operating system, but you have to be a genius to understand the simplicity." (Dennis Ritchie)

Offline

#265 2011-03-25 17:54:17

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,250

Re: Show off your Dwm configuration!

That is bad ass synorgy. One of the cooler setups I have seen. Mine is ultra simple. It's on a netbook.

tOHBsdw     tOHBtMg    tOHBtMA

edit: I changed things up a bit. Added statuscolors patch. I dropped conky in favor of a status script with help from jasonwryan, Procyon, seiichiro0185, and others. I made the wallpaper with gimp. I added the icons by modifying the terminus 14 font. I drew the glyphs using examples from Lokaltog, boohomil, and synorgy (see above). Drawing the glyphs myself solved the spacing issue I had before. I used bdfedit to draw them.  Everything is in my configs. You can find more instructions for the font here, https://bbs.archlinux.org/viewtopic.php?id=92895.

edit:I made the font into an AUR package.  https://aur.archlinux.org/packages.php?ID=49117

Last edited by stlarch (2011-05-17 07:14:36)

Offline

#266 2011-03-25 18:05:26

tvale
Member
From: Palmela, Portugal
Registered: 2008-12-11
Posts: 169

Re: Show off your Dwm configuration!

lappy2-thumb.png
Configuration in signature.

Sorry, forgot I had already posted here.

Last edited by tvale (2011-03-25 18:06:37)


archlinux x86_64 @ Asus UL30A

dwm and patches
conky-dzen

Offline

#267 2011-03-26 09:41:11

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 455

Re: Show off your Dwm configuration!

synorgy wrote:

I'm surprised I've never done this before...

Screenshot:
http://ompldr.org/vN3E2YQ

Patches:
pertag, bstack, movestack, statuscolors

The font is a modified version of Tamsyn that includes the custom characters, such as the layout indicators and the glyphs in the statusbar. You can find it on a new thread here.

config.h:

/* See LICENSE file for copyright and license details. */

/* appearance */
static const char font[]              = "-*-tamsyn2-*-*-*-*-15-*-*-*-*-*-*-*";

#define NUMCOLORS         6             // need at least 3
static const char colors[NUMCOLORS][ColLast][8] = {
       // border   foreground  background
       { "#282626", "#D0D0D0", "#282626" },  // 0 = normal
       { "#A0A57E", "#A0A57E", "#282626" },  // 1 = selected
       { "#1C1C1C", "#D7AFD7", "#1C1C1C" },  // 2 = purple on black
       { "#1C1C1C", "#AFD787", "#1C1C1C" },  // 3 = green on black
       { "#A0A57E", "#282626", "#A0A57E" },  // 4 = black on green
       { "#282626", "#A8716D", "#282626" },  // 5 = red on black
       // add more here
};
static const unsigned int borderpx  = 1;        /* border pixel of windows */
static const unsigned int snap      = 32;       /* snap pixel */
static const Bool showbar           = True;     /* False means no bar */
static const Bool topbar            = True;     /* False means bottom bar */

/* tagging */
static const char *tags[] = { "WEB", "CODE", "MISC", "CHAT"};

static const Rule rules[] = {
    /* class      instance    title       tags mask     isfloating   monitor */
    { "Pidgin",   NULL,       NULL,       1 << 3,       False,       -1 },
//    { "Firefox",  NULL,       NULL
    { NULL,       NULL,      "ncmpcpp",  0,            True,     -1 },
};

/* layout(s) */
static const float mfact      = 0.55; /* factor of master area size [0.05..0.95] */
static const Bool resizehints = False; /* True means respect size hints in tiled resizals */

static const Layout layouts[] = {
    /* symbol     arrange function */
     { "¿",      bstack },
    { "½",      tile },    /* first entry is default */
     { "À",      bstackhoriz },
    { "¼",      monocle },
    { "¾",      NULL },    /* no layout function means floating behavior */
};

/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
    { MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
    { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static const char *dmenucmd[] = { "/home/bryan/.bin/dmenurun", NULL };
static const char *mpc_toggle[] = { "mpc", "toggle", NULL };
static const char *mpc_next[] = { "mpc","next", NULL };
static const char *mpc_prev[] = { "mpc","prev", NULL };
static const char *mpc_stop[] = { "mpc","stop", NULL };
static const char *pcmanfm[] = { "pcmanfm", NULL };
static const char *ncmpcpp[] = { "urxvtc","-title", "ncmpcpp", "-e","sh","-c","ncmpcpp", NULL };
static const char *dmenumpd[] = {"/home/bryan/.bin/dmenumpd",NULL};
static const char *termcmd[]  = { "urxvtc", NULL };
static const char *sleepcmd[] = { "sudo", "pm-suspend", NULL };

static Key keys[] = {
    /* modifier                     key        function        argument */
    { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
    { MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
    { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
    { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
    { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
    { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
    { MODKEY|ShiftMask,             XK_j,      movestack,      {.i = +1 } },
    { MODKEY|ShiftMask,             XK_k,      movestack,      {.i = -1 } },
    { MODKEY,                       XK_Return, zoom,           {0} },
    { MODKEY,                       XK_Tab,    view,           {0} },
    { MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
    { MODKEY,                       XK_b,      setlayout,      {.v = &layouts[0]} },
    { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[1]} },
    { MODKEY|ShiftMask,             XK_b,      setlayout,      {.v = &layouts[2]} },
    { MODKEY,                       XK_m,      setlayout,      {.v = &layouts[3]} },
    { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[4]} },
    { MODKEY,                       XK_space,  setlayout,      {0} },
    { MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    { MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    { MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    TAGKEYS(                        XK_1,                      0)
    TAGKEYS(                        XK_2,                      1)
    TAGKEYS(                        XK_3,                      2)
    TAGKEYS(                        XK_4,                      3)
    { MODKEY|ShiftMask,             XK_q,          quit,           {0} },
/*    { MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    { MODKEY,                       XK_period, focusmon,       {.i = +1 } },
     { MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    { MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },*/
    {0,                0x1008FF14,    spawn,        {.v = mpc_toggle }},
    {0,                0x1008FF15,    spawn,        {.v = mpc_stop }},
    {0,                0x1008FF17,    spawn,        {.v = mpc_next }},
    {0,                0x1008FF16,    spawn,        {.v = mpc_prev }},
    {0,             0x1008ff2f, spawn,      {.v = sleepcmd }},
    {MODKEY|ShiftMask, XK_z,    spawn,        {.v = ncmpcpp }},
    {MODKEY,                XK_e,        spawn,        {.v = pcmanfm }},
    {ControlMask,            XK_grave,    spawn,        {.v = dmenumpd }},
};

/* button definitions */
/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
    /* click                event mask      button          function        argument */
    { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    { ClkWinTitle,          0,              Button2,        zoom,           {0} },
    { ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    { ClkTagBar,            0,              Button1,        view,           {0} },
    { ClkTagBar,            0,              Button3,        toggleview,     {0} },
    { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
};

(There are probably 1000+ better ways of getting what I want on the status bar, but I'm comfortable in Python - so...)
dwm-status.py:

#!/usr/bin/python3
# coding: utf-8
import re
from datetime import datetime
from subprocess import *
from decimal import Decimal

def run_cmd(cmd):
    return Popen(cmd, stdout=PIPE).communicate()[0].decode("utf-8").strip()

def get_mpd():
    try:
        interim = run_cmd(["ncmpcpp", "--now-playing"]).split()[1:]
        for entry in interim:
            old_entry=entry
            entry = entry+" "
            interim[interim.index(old_entry)]=entry

        status = ''.join(interim)
    except OSError:
        return ''

    if "Cannot connect" in status or not status:
        status = "Not playing"

    return "\x02î\x01{status}  ".format(status=status)

def get_volume():
    try:
        mix = run_cmd(["/home/bryan/.bin/volctrl"])
    except:
        return ''

    volume = int(mix.split('\n')[1].lstrip('[').split('%')[0])

    icon = "í"
    if volume == 0:
        return "\x05ê Muted  "
    if volume < 66:
        icon = "ì"
    if volume < 33:
        icon = "ë"

    return "\x02{icon}\x01{volume}%  ".format(icon=icon, volume=str(volume))

def get_temp():
    icon = "þ"
    curTemp = run_cmd(["sensors"]).split('\n')
    for line in curTemp:
        if line.startswith('Core 0') == True:
            core0Temp = line.split()[2].lstrip('+').split('.')[0]
        elif line.startswith('Core 1') == True:
            core1Temp = line.split()[2].lstrip('+').split('.')[0]
    vidTemp = run_cmd(["nvidia-settings","-tq","[gpu:0]/GpuCoreTemp"])
    return "\x02{icon}\x01{core0Temp}° {core1Temp}° {vidTemp}°".format(icon=icon, core0Temp=core0Temp, core1Temp=core1Temp, vidTemp=vidTemp)

def get_mem_usage():
    icon = "ü"
    cmd=getoutput("free -m -t | tail -n 1 | awk '{total=$2} {used=$3} END {print used}  {print total}'").split()
    used=cmd[1]
    total=cmd[0]
    mem_perc=(Decimal(used)/Decimal(total)*100).quantize(Decimal("0"))
    return "\x02{icon}\x01{mem_perc}%".format(icon=icon,mem_perc=str(mem_perc))

def get_cpu_usage():
    icon = "û"
    cmd=getoutput('cat /proc/loadavg | cut -d " " -f1')
    cpu_perc=(Decimal(cmd)*100).quantize(Decimal(0))
    return "\x02{icon}\x01{cpu_perc}%".format(icon=icon,cpu_perc=str(cpu_perc))
def get_mail():
    icon = "ÿ"
    unread=run_cmd(["sh", "/home/bryan/.bin/checkmail.sh"])
    return "\x02{icon}\x01{unread}".format(icon=icon, unread=str(unread))

def get_date():
    date = datetime.now().strftime("%m/%d/%Y")
    return date

def get_time():
    time = datetime.now().strftime("%I:%M %P")
    return "\x02 {0}\x01".format(time)

print(
#    get_mail()   +
    get_mpd()   +
    get_volume() +
    get_temp() +
    get_cpu_usage() +
    get_mem_usage() +
    get_time()
)

(note that get_mail is commented out because I just did a reinstall and I don't have the necesary scripts any longer)

.bin/dmenurun is just a script that calls dmenu-run with environment variables so that I can change the font & colors in .zprofile. I do this for all of my dmenu scripts. It makes updating the colors and fonts much easier.

If you'd like to get any more information - let me know.

Can I have your xcompmgr configuration?
Thanks

Offline

#268 2011-03-30 20:46:29

synorgy
Member
From: $HOME
Registered: 2005-07-11
Posts: 272
Website

Re: Show off your Dwm configuration!

stlarch - Thanks. Glad you like it big_smile

tvale - that looks pretty amazing.

OK100 - of course you can. I ganked it straight from the wiki though - nothing special. This is 'comp' - taken straight from the wiki:

#!/bin/bash
#
# Start a composition manager.
# (xcompmgr in this case)

function comphelp () {
  echo "Composition Manager:"
  echo "   (re)start: COMP"
  echo "   stop:      COMP -s"
  echo "   query:     COMP -q"
  echo "              returns 1 if composition manager is running, else 0"
  exit
}

function checkcomp () {
  ( ps nc -C xcompmgr &>/dev/null ) && exit 1
  exit 0
}

function stopcomp () {
  ( ps nc -C xcompmgr &>/dev/null ) && killall xcompmgr
}

function startcomp () {
  stopcomp
  xcompmgr -CcfF -r4.2 -o.35 -l-5 -t-5 -D2&
  exit
}

case "$1x" in
    "x") startcomp;;
  "-qx") checkcomp;;
  "-sx") stopcomp; exit;;
      *) comphelp;;
esac

Very convienant way of starting and stopping xcompmgr. If you can't see it (or don't want the script and are really lazy), xcompmgr is started as:

 xcompmgr -CcfF -r4.2 -o.35 -l-5 -t-5 -D2&

The background for my urxvt's is set to true transparency with the background black @ 60% (though I'm considering using inheritPixmap, because it makes multiple terminals in monocle mode useless)


"Unix is basically a simple operating system, but you have to be a genius to understand the simplicity." (Dennis Ritchie)

Offline

#269 2011-03-31 12:56:47

ivoarch
Member
From: the six feet under the ground
Registered: 2011-03-31
Posts: 436

Re: Show off your Dwm configuration!

Here  MY dwm

201103302357051280x1024.th.png
201103302348361280x1024.th.png

Uploaded with ImageShack.us

Running programs:figlet,urxvt,ncmpcpp,metasploit
+Patches
Bottom stack  http://dwm.suckless.org/patches/bottom_stack
Movestack      http://dwm.suckless.org/patches/movestack

config.h

/* See LICENSE file for copyright and license details. */

/* appearance */
static const char font[]            = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#222020";
static const char normbgcolor[]     = "#222020";
static const char normfgcolor[]     = "#9CC76D";
static const char selbordercolor[]  = "#9CC76D";
static const char selbgcolor[]      = "#222020";
static const char selfgcolor[]      = "#B84E46";
static const unsigned int borderpx  = 1;        /* border pixel of windows */ 
static const unsigned int gappx     = 6;        /* gap pixel between windows */
static const unsigned int snap      = 32;       /* snap pixel */
static const Bool showbar           = True;     /* False means no bar */
static const Bool topbar            = True;     /* False means bottom bar */
 
/* tagging */
static const char *tags[] = { "1", "2", "3", "4" };

static const Rule rules[] = {
    /* class      instance    title       tags mask     isfloating   monitor */
    { "Gimp",     NULL,       NULL,       0,            True,        -1 },
    { "jumanji",  NULL,       NULL,       2 << 1,       False,       -1 }, 
};

/* layout(s) */
static const float mfact      = 0.55; /* factor of master area size [0.05..0.95] */
static const Bool resizehints = True; /* True means respect size hints in tiled  
 
 resizals */
  

#include "bstack.c"
#include "bstackhoriz.c"
static const Layout layouts[] = {
    /* symbol     arrange function */
    { "[]=",      tile },    /* first entry is default */
    { "><>",      NULL },    /* no layout function means floating behavior */ 
        { "[M]",      monocle },         
    { "TTT",      bstack },
    { "===",      bstackhoriz },
};

/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
    { MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
    { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
static const char *termcmd[]  = { "urxvt", NULL }; 
static const char *webcmd[] = {"jumanji", NULL };  
static const char *mancmd[] = {"urxvt", "-e", "ranger", NULL }; 
static const char *playcmd[] = {"urxvt", "-e", "ncmpcpp", NULL };
static const char *rebootcmd[] = {"sudo", "shutdown", "-r", "now", NULL }; 
static const char *quitcmd[] = {"sudo", "shutdown", "-h", "now", NULL }; 


#include "movestack.c"
static Key keys[] = {
    /* modifier                     key        function        argument */
    { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
    { MODKEY,                  XK_o, spawn,                         {.v = termcmd } }, 
        { MODKEY,        XK_i,       spawn,               {.v = webcmd } },  
        { MODKEY,             XK_u, spawn,          {.v = mancmd } }, 
        { MODKEY,             XK_y, spawn,          {.v = playcmd } },
        { MODKEY|ShiftMask,        XK_r,       spawn,       {.v = rebootcmd } }, 
        { MODKEY|ShiftMask,             XK_q, spawn,          {.v = quitcmd } },
    { MODKEY,                       XK_b,      togglebar,      {0} },
    { MODKEY,                       XK_h,      focusstack,     {.i = +1 } },
    { MODKEY,                       XK_g,      focusstack,     {.i = -1 } },
    { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
    { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
    { MODKEY|ShiftMask,             XK_j,      movestack,      {.i = +1 } },
    { MODKEY|ShiftMask,             XK_k,      movestack,      {.i = -1 } },
    { MODKEY,                       XK_Return, zoom,           {0} },
    { MODKEY,                       XK_Tab,    view,           {0} },
    { MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
    { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
    { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
    { MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} }, 
        { MODKEY,                       XK_a,      setlayout,      {.v = &layouts[3]} }, 
        { MODKEY,                       XK_s,      setlayout,      {.v = &layouts[4]} },
    { MODKEY,                       XK_space,  setlayout,      {0} },
    { MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    { MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    { MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    { MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    { MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    { MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    { MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    TAGKEYS(                        XK_1,                      0)
    TAGKEYS(                        XK_2,                      1)
    TAGKEYS(                        XK_3,                      2)
    TAGKEYS(                        XK_4,                      3)
    TAGKEYS(                        XK_5,                      4)
    TAGKEYS(                        XK_6,                      5)
    TAGKEYS(                        XK_7,                      6)
    TAGKEYS(                        XK_8,                      7)
    TAGKEYS(                        XK_9,                      8)
    { MODKEY|ShiftMask,             XK_q,      quit,           {0} },
};

/* button definitions */
/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
    /* click                event mask      button          function        argument */
    { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    { ClkWinTitle,          0,              Button2,        zoom,           {0} },
    { ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    { ClkTagBar,            0,              Button1,        view,           {0} },
    { ClkTagBar,            0,              Button3,        toggleview,     {0} },
    { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
};

dwm.c

/* variables */
static const char broken[] = "broken";
static char stext[256];
static int screen;
static int sw, sh;           /* X display screen geometry width, height */
static int bh, blw = 0;      /* bar geometry */
static int (*xerrorxlib)(Display *, XErrorEvent *);
static unsigned int numlockmask = 0;
static void (*handler[LASTEvent]) (XEvent *) = {
    [ButtonPress] = buttonpress,
    [ClientMessage] = clientmessage,
    [ConfigureRequest] = configurerequest,
    [ConfigureNotify] = configurenotify,
    [DestroyNotify] = destroynotify,
    [Expose] = expose,
    [FocusIn] = focusin,
    [KeyPress] = keypress,
    [MappingNotify] = mappingnotify,
    [MapRequest] = maprequest,
    [PropertyNotify] = propertynotify,
    [UnmapNotify] = unmapnotify
};

I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#270 2011-04-02 04:07:14

nXqd
Member
Registered: 2010-07-01
Posts: 173
Website

Re: Show off your Dwm configuration!

OK100 wrote:

dwm on eeepc with some patches:
- cycle
- pango
- uselessgaps
- nbstack
- pertag2
- push
- pidgin layout
- scratchpad

clean:
http://dl.dropbox.com/u/15563529/clean.png

"busy":
http://dl.dropbox.com/u/15563529/busy.png

I really love your config, can you share ?


When you live for a strong purpose, then hard work isn't an option. It's a necessity. - Steve Pavlina
dotFiles

Offline

#271 2011-04-04 16:44:37

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 455

Re: Show off your Dwm configuration!

nXqd wrote:
OK100 wrote:

dwm on eeepc with some patches:
- cycle
- pango
- uselessgaps
- nbstack
- pertag2
- push
- pidgin layout
- scratchpad

clean:
http://dl.dropbox.com/u/15563529/clean.png

"busy":
http://dl.dropbox.c63529/busy.png

I really love your config, can you share ?

Hi nXqd, dwm config is on my github.
- icon theme - Any Color You Like
- wallpaper - Soft and Clean with modified colors a bit - here
- GTK theme - BSM Simple Dark - modified version on my github

Offline

#272 2011-04-07 04:30:20

muffinss
Member
From: united states
Registered: 2011-02-07
Posts: 54

Re: Show off your Dwm configuration!

OK100 wrote:

dwm on eeepc with some patches:
- cycle
- pango
- uselessgaps
- nbstack
- pertag2
- push
- pidgin layout
- scratchpad

clean:
http://dl.dropbox.com/u/15563529/clean.png

"busy":
http://dl.dropbox.com/u/15563529/busy.png

How did you guys get stalonetray into dwm top bar like that? I've been trying to figure out how but don't know =/

Last edited by muffinss (2011-04-07 04:34:03)

Offline

#273 2011-04-07 05:37:43

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: Show off your Dwm configuration!

muffinss wrote:

How did you guys get stalonetray into dwm top bar like that? I've been trying to figure out how but don't know =/

For me it's a modification of trayer patch found here. The only thing is the width of the tray is fixed (i.e. doesn't dynamically expand and shrink depending on number of icons), but it's a minor detail.

Edit: You may need to manually apply the patch (I did, at least...)

Last edited by kcirick (2011-04-07 05:39:02)

Offline

#274 2011-04-07 05:51:49

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641
Website

Re: Show off your Dwm configuration!

You should give a try to fbpanel-dwm from aur too.

Offline

#275 2011-04-07 05:53:30

muffinss
Member
From: united states
Registered: 2011-02-07
Posts: 54

Re: Show off your Dwm configuration!

kcirick wrote:
muffinss wrote:

How did you guys get stalonetray into dwm top bar like that? I've been trying to figure out how but don't know =/

For me it's a modification of trayer patch found here. The only thing is the width of the tray is fixed (i.e. doesn't dynamically expand and shrink depending on number of icons), but it's a minor detail.

Edit: You may need to manually apply the patch (I did, at least...)

Don't mean to sound noobish, but how do I apply the patch?

EDIT:
Nevermind. I found your patch in this thread:
https://bbs.archlinux.org/viewtopic.php?pid=878006

And I was able to figure out how to apply it. It works! Thanks so much for making it!

Last edited by muffinss (2011-04-07 06:44:29)

Offline

Board footer

Powered by FluxBB