Dstatus - dwm status bar

Hey guys,
for quite some time I've been working on dstatus for my own desktop. To share and improve dstatus I'd like to introduce it to the ArchLinux community now. dstatus is a small but expandable status application designed for use with dwm. While it certainly doesn't fit the suckless approach due to its use of plugins it now works rather nice.
Features:
- dstatus features a plugin system. This makes it easy to add new plugins that add information not accessible right now.
- dstatus features groups. Groups bind together parts of your status line. If a dynamic part of that group becomes undisplayable (muted volume for example) the whole group will be hidden.
- dstatus' format can be configured via config.h. It's syntax is described in the project's README.
- dstatus' plugins can be configured via config.mk. It enables to exclude certain plugins from compilation and installation
Currently there aren't many plugins, just some basic stuff for time, volume, mpd and battery. I'd be happy to accept contributions for new plugins.
If you're interested compile and try this small application and provide some feedback. The project can be found at Bitbucket.
Here's a link to the dstatus AUR package.
Regards,
Patrick
Last edited by pks (2013-06-06 17:15:03)

mauritiusdadd wrote:
derrickcope wrote:What I am asking is shouldn't it be able to do it already without patching? Bash can output color so why do I have to patch?
No. Bash can show colours because it can parse and interpret the escape sequences. Dwm code lacks of that feature and for this reason you have to apply a patch.
Thanks, that's what I was asking. If xsetroot -name can accept bash sequences then wouldn't it be simple just to use this to show color. @jasonwryan is right, I do need to read up more on dwm. Since I am in China it is problematic to search for things on the web even with a vpn and the suckless website is sparse on infomation.
Seems that this would be the easiest way to add color to the status bar but maybe "xsetroot -name" doesn't output in color even though it does have "-fg -bg" switches.

Similar Messages

  • Greek letters in dwm status bar? How?

    Is there a change in config.h that I could do to show Greek letters normally?
    Thank you

    Sorry..
    The problem exists when I open a Greek web page in a browser. In dwm status bar the Greek characters of the title of the web page are not displayd correctly.
    Here is my config.h:
    /* See LICENSE file for copyright and license details. */
    /* appearance */
    static const char font[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
    static const char normbordercolor[] = "#444444";
    static const char normbgcolor[] = "#222222";
    static const char normfgcolor[] = "#bbbbbb";
    static const char selbordercolor[] = "#005577";
    static const char selbgcolor[] = "#005577";
    static const char selfgcolor[] = "#eeeeee";
    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[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
    static const Rule rules[] = {
    /* class instance title tags mask isfloating monitor */
    { "Gimp", NULL, NULL, 0, True, -1 },
    /* { "Firefox", NULL, NULL, 1 << 8, False, -1 },*/
    /* layout(s) */
    static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
    static const int nmaster = 1; /* number of clients in master area */
    static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
    static const Layout layouts[] = {
    /* symbol arrange function */
    { "[]=", tile }, /* first entry is default */
    { "><>", NULL }, /* no layout function means floating behavior */
    { "[M]", monocle },
    /* 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[] = { "st", NULL };
    static const char *rebcmd[] = { "systemctl", "reboot", NULL };
    static const char *shutcmd[] = { "systemctl", "poweroff", NULL };
    static const char *dwbcmd[] = { "dwb", NULL };
    static Key keys[] = {
    /* modifier key function argument */
    { MODKEY, XK_p, spawn, {.v = dmenucmd } },
    { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
    { MODKEY|ShiftMask, XK_d, spawn, {.v = dwbcmd } },
    { MODKEY, XK_b, togglebar, {0} },
    { MODKEY, XK_j, focusstack, {.i = +1 } },
    { MODKEY, XK_k, focusstack, {.i = -1 } },
    { MODKEY, XK_i, incnmaster, {.i = +1 } },
    { MODKEY, XK_d, incnmaster, {.i = -1 } },
    { MODKEY, XK_h, setmfact, {.f = -0.05} },
    { MODKEY, XK_l, setmfact, {.f = +0.05} },
    { 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_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} },
    { MODKEY|ShiftMask, XK_r, spawn, {.v = rebcmd } },
    { MODKEY|ShiftMask, XK_s, spawn, {.v = shutcmd } },
    /* 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} },
    Last edited by hariskar (2013-10-02 13:46:57)

  • [Solved] dwm status bar

    I am learning about DWM...slowly...
    So, I have conky piped to dzen2 as per the screenshot;
    But how do I now remove the 'dwm-6.0' from the status bar?
    Thanks for your patience.
    Last edited by ancleessen4 (2013-04-13 11:05:17)

    dzconky;
    #!/bin/sh
    FG='#aaaaaa'
    BG='#333333'
    FONT='-*-inconsolata-*-r-normal-*-*-90-*-*-*-*-iso8859-*'
    conky | dzen2 -e - -h '14' -w '1100' -ta r -x '750' -fg $FG -bg $BG -fn $FONT &
    conky;
    out_to_console yes
    #out_to_x no
    background no
    update_interval 2
    total_run_times 0
    use_spacer none
    TEXT
    #Arch 64 :: $kernel :: $uptime_short :: ^fg(\#60B48A)$mpd_smart ^fg():: ${cpu cpu1}% / ${cpu cpu2}% :: cpu0 ${execi 5 sensors | grep "Core 0" | cut -d "+" -f2 | cut -c1-2}C cpu1 ${execi 5 sensors | grep "Core 1" | cut -d "+" -f2 | cut -c1-2}C :: ^fg(\#DC8CC3)$memperc% ($mem) ^fg():: ${downspeed enp0s20} ${upspeed enp0s20} :: ${time %a %b %d %H:%M}
    $kernel :: Updates: ${if_match ${execi 1800 (checkupdates | wc -l)} == 0}${color2}up to date${color}${else}${color3}${execi 1800 (checkupdates | wc -l)} new packages${color}${endif} :: ^fg(\#60B48A)$mpd_smart ^fg():: ^fg(\#DC8CC3)$memperc% = $mem ^fg():: ${time %H:%M} :: ^fg(\#8CD0D3)${execi 300 /home/neil/bin/weather.sh "EUR|LU|LU001|Luxembourg"}
    I have tried changing '-x' and '-w' but no change to the layout...
    Just tried to recompile with '-x=850'...to try and push dzen output to the right but no change...
    makepkg -efi --skipinteg
    I am sure this is a simple solution that I am missing...

  • DWM status bar

    Why doesn't this show color status in the dwm bar?
    red="echo -e \033[34;41mColor Text\033[0m"
    xsetroot -name $red
    Is my code wrong? or is DWM or Xsetroot removing the color?
    Last edited by derrickcope (2015-05-04 04:09:49)

    mauritiusdadd wrote:
    derrickcope wrote:What I am asking is shouldn't it be able to do it already without patching? Bash can output color so why do I have to patch?
    No. Bash can show colours because it can parse and interpret the escape sequences. Dwm code lacks of that feature and for this reason you have to apply a patch.
    Thanks, that's what I was asking. If xsetroot -name can accept bash sequences then wouldn't it be simple just to use this to show color. @jasonwryan is right, I do need to read up more on dwm. Since I am in China it is problematic to search for things on the web even with a vpn and the suckless website is sparse on infomation.
    Seems that this would be the easiest way to add color to the status bar but maybe "xsetroot -name" doesn't output in color even though it does have "-fg -bg" switches.

  • Dstatus: Yet another status bar for dwm

    I decided to fix up my custom dwm status bar that I've hacked on for awhile into something a bit more presentable. Therefore, I give you dstatus!
    So what makes this different from the rest? For starters, it's somewhat laptop specific. Things like battery, backlight, and possibly SSID aren't of much use to a desktop. However, these bits can be turned off at compile time if you don't want them. In fact, all the elements can be toggled and rearranged however you like it.
    In addition, the main loop polls as little as necessary; just time, cpu usage, and battery are polled. Other elements are updated by threads listening to events.
    Configuration:
    config.mk defines which elements will be compiled into the binary. Turn any of them off by commenting out the appropriate line.
    config.h defines the look of everything. Elements can be formatted (in a limited fashion) according to printf. Some elements can display either a percentage or a bar.
    I've also provided an AUR package.
    The source is UNLICENSED so feel free to hack away. :-)

    Thanks @jasonwryan, I just don't know where to post it

  • [SOLVED] Problem with adding package update count to dwm's status bar

    Following http://www.andreascarpino.it/blog/posts … s-part-ii/, I added:
    $ crontab -l
    */10 * * * * ~/bin/tempdb
    Along with
    #!/bin/bash
    # ~/bin/tempdb
    fakedb=/dev/shm/fakepacdb
    realdb=/var/lib/pacman
    [[ ! -d $fakedb ]] && { mkdir -p "$fakedb/sync" || exit 1; }
    [[ ! -L $fakedb/local ]] && { ln -s "$realdb/local" "$fakedb" || exit 2; }
    exec fakeroot pacman --dbpath "$fakedb" -Sy
    pkgs=$(pacman --dbpath "$fakedb" -Qqu | wc -l)
    aurpkgs=$(cower -udf 2> /dev/null | wc -l)
    unset msg1
    unset msg2
    unset packages
    msg1="pacman: 0"
    msg2="aur: 0"
    if [[ ${pkgs} -gt 0 ]]; then
    msg1="pacman: ${pkgs}"
    fi
    if [[ ${aurpkgs} -gt 0 ]]; then
    msg2="aur: ${aurpkgs}"
    fi
    updb="UPDB: ${msg1}, ${msg2}"
    export updb
    The problems is with being able to export the variable updb, because exporting only exports to subshells. I also have my ~/bin/dwmstatus script:
    #!/bin/bash
    sep=" | "
    volsep="VOL"
    datesep="DATE"
    timesep="TIME"
    vol=$(amixer get Master | tail -1 | sed 's/.*\[\([0-9]*%\)\].*/\1/')
    volstat=$(amixer get Master | tail -n 1 | cut -d' ' -f 8-)
    sdate=$(date +"%B %d")
    stime=$(date +"%r")
    if [[ ${volstat} == "[off]" ]];
    then
    vol="--%"
    fi
    out="${updb} ${sep} ${volsep} ${vol} ${sep} ${datesep} ${sdate} ${sep} ${timesep} ${stime}"
    xsetroot -name "${out}"
    I only want the checking of updates to occur every few minutes (for now I tried 10), and just using the exported variable that contains the whole
    "UPDB: pacman:3, aur:1",..
    I'm not exactly sure how to fix my hacked-together scripts. When I simply run the tempdb script, it doesn't do much exept for updating to the fake database, but being able to use the updb variable has not worked yet. I also tried sourcing the script, but that just quits urxvt when running in dwm, and it logs me out when sourcing from plain X.
    I guess my main question is: what is the best way to show updates from the dwm status bar, or how can I fix what I am trying to do now?
    Last edited by wolfcore (2012-03-17 00:21:47)

    jasonwryan wrote:
    I use this:
    crontab -e
    @hourly /home/jason/Scripts/checkupdates
    grep ups Scripts/dwm-status
    ups(){
    ups="$(/tmp/aurupdates | wc -l)"
    if [ $ups = 0 ]; then
    echo "0"
    else echo -en "$ups"
    fi
    Script is keenerd's from here: http://www.mail-archive.com/pacman-dev@ … 08405.html
    Okay, I see it. But your ups() function checks /tmp/aurupdates; how do you check for AUR updates? I looked at your repos, and saw
    pac()
    pup="$(pacman -Qqu --dbpath /tmp/checkup-db-jason/ | wc -l)"
    if [ $pup == 0 ]; then
    echo "0"
    else
    echo -en "\x05$pup\x01"
    fi
    This is what you use along with keenerd's checkupdates, right?

  • Status bar for openbox

    I find myself to be over-cluttered lately, so I ask this; Is there such thing as a status bar for Openbox, much like the ones for dwm, wmii, etc?  Here's what I'm looking for:
    ability to:
    - rename the tags
    - use commands like ALT+1 or ALT+2 to switch workspaces
    (optional but would be cool:)- have conky items in the status
    - always on top; when windows maxamize it doesn't go over it
    - put asterisk next to workspace name if URGENT hint is active (eg. if I get an IM).  I know one of the status bars do this.
    Can I just use one of the status programs from one of those window managers, or is there an alternative, or would this be a simple script?
    Thanks!

    hi dax965,
    dax965 wrote:- rename the tags
    no, there is no such thing like a "status bar". you can use dzen-bar (or how it's called), but for me it didn't work properly.  though, played only 15 minutes with it. perhaps more effort more results....
    - use commands like ALT+1 or ALT+2 to switch workspaces
    sure take a look at rc.xml. there you can change almost everything, key-bindings, mouse-stuff, application behaviour related to wm, etc.
    (optional but would be cool:)- have conky items in the status
    make a conky "status bar". take a look at some screenshots in the forum. it's a common conky setup.
    - always on top; when windows maxamize it doesn't go over it
    rc.xml
    - put asterisk next to workspace name if URGENT hint is active (eg. if I get an IM).  I know one of the status bars do this.
    you could use a panel with "show all opened windows on all desktops". openbox doesn't provide this.
    Can I just use one of the status programs from one of those window managers, or is there an alternative, or would this be a simple script?
    Thanks!
    vlad

  • DWM Bottom Bar Interface Patch

    NOTE: THE PATCH IS POSTED BELOW IN MY SECOND POST IN THIS THREAD. INSTRUCTIONS FOR FORMATTING THE ROOT WINDOW REMAIN THE SAME AS IN THIS POST.
    I modified the DWM code so that instead of one bar, it is possible to have two at the same time, one on the top and one on the bottom. They can both be hidden separately with key combinations and are managed by DWM, and so both act like normal status bars (i.e. windows behave properly around them). The top bar shows the standard DWM info, along with anything that is piped to the root window with xsetroot (as is standard). But if the bottom bar is enabled, a second bar shows up. This bar also shows information from the root window. If you were to want the text "this is the top" to appear in the top bar and "this is the bottom" to appear in the bottom bar, you would format it to the root window like so: "this is the topBOTTOM=this is the bottom".
    I was just asking to check if there is a demand for such a patch; if there is, I will clean up my version and post it here.
    Screenshot of the two bars "in action":
    http://img59.imageshack.us/img59/1943/t … enshot.jpg
    The scrolling breaking news on the bottom is another patch for conky that enables rss feeds to scroll on one line. If anyone wants this patch I will provide it as well.
    Moderator edit: read the rules on posting screenshots
    Last edited by .:B:. (2010-06-27 12:43:28)

    Alright, after a long while (sorry), here's the patch and instructions. First, download and extract (I had to compress it for the upload sites to work) this patch to a directory on your computer:
    http://www.mediafire.com/file/q2nq5mwml … ar.diff.gz
    The text of the patch is provided below ONLY FOR REFERENCE. The formatting is off and the patch ends up not working. Use the linked patch.
    diff -r fd72a695c7f2 -r 02377b01f0c6 dwm.c
    --- a/dwm.c Sat Feb 06 18:11:01 2010 -0500
    +++ b/dwm.c Sat Feb 06 18:17:56 2010 -0500
    @@ -125,6 +125,7 @@
    float mfact;
    int num;
    int by; /* bar geometry */
    + int bby; /* ADDED bottom bar geometry */
    int mx, my, mw, mh; /* screen size */
    int wx, wy, ww, wh; /* window area */
    unsigned int seltags;
    @@ -132,11 +133,16 @@
    unsigned int tagset[2];
    Bool showbar;
    Bool topbar;
    + // ADDED info on bottom bar
    + Bool showbottombar;
    + Bool bottombar;
    Client *clients;
    Client *sel;
    Client *stack;
    Monitor *next;
    Window barwin;
    + // ADDED bottom bar window pointer
    + Window bbarwin;
    const Layout *lt[2];
    @@ -242,6 +248,7 @@
    /* variables */
    static const char broken[] = "broken";
    static char stext[256];
    +static char btext[256];
    static int screen;
    static int sw, sh; /* X display screen geometry width, height */
    static int bh, blw = 0; /* bar geometry */
    @@ -505,6 +512,8 @@
    XUnmapWindow(dpy, mon->barwin);
    XDestroyWindow(dpy, mon->barwin);
    + XUnmapWindow(dpy, mon->bbarwin);
    + XDestroyWindow(dpy, mon->bbarwin);
    free(mon);
    @@ -553,6 +562,7 @@
    updatebars();
    for(m = mons; m; m = m->next)
    XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
    + XMoveResizeWindow(dpy, m->bbarwin, m->wx, m->bby, m->ww, bh);
    arrange(NULL);
    @@ -613,6 +623,9 @@
    m->mfact = mfact;
    m->showbar = showbar;
    m->topbar = topbar;
    + // ADDED monitor setup
    + m->bottombar = bottombar;
    + m->showbottombar = bottombar ? True : False;
    m->lt[0] = &layouts[0];
    m->lt[1] = &layouts[1 % LENGTH(layouts)];
    strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
    @@ -723,6 +736,16 @@
    drawtext(NULL, dc.norm, False);
    XCopyArea(dpy, dc.drawable, m->barwin, dc.gc, 0, 0, m->ww, bh, 0, 0);
    + if (m->showbottombar)
    + {
    + dc.x = 0;
    + dc.w = TEXTW(btext);
    + drawtext(btext, dc.norm, False);
    + dc.x += dc.w;
    + dc.w = m->ww - dc.x;
    + drawtext(NULL, dc.norm, False);
    + XCopyArea(dpy, dc.drawable, m->bbarwin, dc.gc, 0, 0, m->ww, bh, 0, 0);
    + }
    XSync(dpy, False);
    @@ -1716,6 +1739,14 @@
    CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
    XDefineCursor(dpy, m->barwin, cursor[CurNormal]);
    XMapRaised(dpy, m->barwin);
    + // ADDED drawing bottom bar
    + if (m->bottombar) {
    + m->bbarwin = XCreateWindow(dpy, root, m->wx, m->bby, m->ww, bh, 0, DefaultDepth(dpy, screen),
    + CopyFromParent, DefaultVisual(dpy, screen),
    + CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
    + XDefineCursor(dpy, m->bbarwin, cursor[CurNormal]);
    + XMapRaised(dpy, m->bbarwin);
    + }
    @@ -1730,6 +1761,13 @@
    else
    m->by = -bh;
    + // ADDED geometry of window
    + if (m->showbottombar) {
    + m->wh -= bh;
    + m->bby = m->wy + m->wh;
    + }
    + else
    + m->bby = -bh;
    Bool
    @@ -1890,8 +1928,43 @@
    void
    updatestatus(void) {
    - if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
    + char buftext[512];
    + if(!gettextprop(root, XA_WM_NAME, buftext, sizeof(buftext)))
    strcpy(stext, "dwm-"VERSION);
    + else {
    + // Parse input; currently delimited by BOTTOM=
    + char* blocation = strstr(buftext,"BOTTOM=");
    + if (blocation != NULL)
    + {
    + int c = 0;
    + for (char* i = buftext; i < blocation; i++)
    + {
    + if (c < sizeof(stext) - 1)
    + stext[c] = *i;
    + else
    + break;
    + c++;
    + }
    + stext[c] = '\0';
    + blocation += 7;
    + c = 0;
    + for (char* i = blocation; i < (blocation + sizeof(buftext)); i++)
    + {
    + if (c < sizeof(btext) - 1)
    + btext[c] = *i;
    + else
    + break;
    + c++;
    + }
    + btext[c] = '\0';
    + }
    + else
    + {
    + for (int i = 0; i < sizeof(stext); i++)
    + stext[i] = buftext[i];
    + stext[sizeof(stext) - 1] = '\0';
    + }
    + }
    drawbar(selmon);
    Now apply the patch (if you are using the tarball) by running
    patch -p1 < path/to/patch.diff
    Next, add the following lines to config.h:
    under the line "static const Bool topbar = True; /* False means bottom bar */" (keep in mind this must be true for this patch to be useful)
    put the following:
    static const Bool bottombar = True; /* True means an extra bar on the bottom */
    (This is used as your switch for turning the bottom bar on and off)
    IMPORTANT: so that you can show and hide the bottom bar with a keybinding do the following:
    before the keys[] array is declared, add the line:
    #include "togglebottombar.c"
    , next, in the keys array, add a line like the following:
    { MODKEY, XK_i, togglebottombar, {0} },
    Obviously, any key combo can be used. This hides the bottom bar with the modkey (mine is set to the windows or "super" key) and i.
    Finally, copy and paste this code into a file called "togglebottombar.c" in your dwm source directory:
    void togglebottombar(const Arg *arg) {
    selmon->showbottombar = !selmon->showbottombar;
    updatebarpos(selmon);
    XMoveResizeWindow(dpy, selmon->bbarwin, selmon->wx, selmon->bby, selmon->ww, bh);
    arrange(selmon);
    Now, format the text in your root window as described in the first post:
    assuming *TEXTONTOP* is text into the top bar and *TEXTONBOTTOM* is text into the bottom bar, you would format your root window text like this:
    *TEXTONTOP*BOTTOM=*TEXTONBOTTOM*
    For example, I have info on the top, and network info and news on the bottom (as shown in the screenshot thread).
    Last edited by RedScare (2010-02-09 03:19:38)

  • [SOLVED] dwm-status.sh, possible to include scripts within the script?

    I have 'dwm-status.sh' printing some basic info (mpd, vol, date) into the status bar. Is it possible to make it include eg. gmail, weather, and battery scripts in a similar way that conky would? (execpi 60 python ~/.scripts/gmail.py)
    Also, off topic: How can I see which other special characters represent which icons in Ohsnap font? e.g. "Ñ" "Î" "¨" "¹" "ê" "í" "È represent cpu, memory, hdd, vol, clock.... how about the rest?
    dwm-status.sh:
    #!/bin/sh
    icons=("Ñ" "Î" "¨" "¹" "ê" "í" "È")
    getMusic() {
    msc="$(ncmpcpp --now-playing '{%a - %t}|{%f}')"
    if [ ! $msc ]; then
    echo -ne "\x0A${icons[4]}\x01 music off"
    else
    echo -ne "\x0A${icons[4]}\x01 ${msc}"
    fi
    getVolume() {
    vol="$(amixer get Master | egrep -o "[0-9]+%" | head -1 | egrep -o "[0-9]*")"
    echo -ne "\x0A${icons[5]}\x01 ${vol}"
    getDate() {
    dte="$(date '+%b %d %a')"
    echo -ne "\x0A${icons[1]}\x01 ${dte}"
    getTime() {
    tme="$(date '+ %H:%M')"
    echo -ne "\x0A${icons[6]}\x01 ${tme}"
    while true; do
    xsetroot -name "$(getMusic) $(getVolume) $(getDate) $(getTime)"
    sleep 1
    done
    Last edited by Winston-Wolfe (2013-06-26 13:10:11)

    Thanks guys, I've managed to get my notification scripts printing by simply not using execpi:
    getMail() {
    mai="$(~/.scripts/gmail.py)"
    echo -ne "\x0A${icons[3]}\x01 ${mai}"
    But like you said, I now have a calling frequency challenge.
    Trilby, that looks great. I've got it partially working, but I'm at a loss on how to go about printing the variables in the loop for those blocks that happen periodically.
    otherwise your email indicator (for example) will only pop up for one second every 5 minutes.
    ^ exactly what's currently happening.
    Is there something that just prints the variable without calling for an update like $(getMail) does that I could put into the loop?
    let loop=0
    while true; do
    # stuff that happens every second here
    xsetroot -name "$(getMusic) $(getVolume) $(getDate) $(getTime)"
    if [[ $loop%60 -eq 0 ]]; then
    #stuff that happens every minute here
    xsetroot -name "$(getMusic) $(getMail) $(getVolume) $(getDate) $(getTime)"
    fi
    if [[ $loop%300 -eq 0 ]]; then
    # stuff that happens every 5 minutes here
    xsetroot -name "$(getMusic) $(getMail) $(getWeather) $(getVolume) $(getDate) $(getTime)"
    let loop=0 #this prevents an eventual overflow
    fi
    let loop=$loop+1
    sleep 1
    done
    Last edited by Winston-Wolfe (2013-06-26 08:54:47)

  • Xmonad Status Bar Not Appearing

    Hey guys I've been reading through posts and trying to get dzen2 to appear. But it simply doesn't show up.
    So I tried using a default status bar
    main = xmonad $ defaultConfig {
    logHook = dynamicLog
    Provided from
    http://xmonad.org/xmonad-docs/xmonad-co … icLog.html
    and I still do not have any status bars appearing.
    Refer Below, changed my current xmonad configuration.
    My xmonad.hs is based of thayer's configuration.
    Last edited by Jabrick (2011-10-30 22:01:26)

    Ok I've finally got a dzen bar to appear.
    In my xinitrc where i normally start xmonad
    I now have the line
    exec xmonad | dzen2
    But nothing appears in the bar I've tried several examples and it doesn't seem to work.
    Is there something I'm missing?
    I do have a ~/.conkyrc file
    That looks like
    # Conky Config File
    # just log everything to the desktop
    # Main options (alphabetically)
    alignment bl
    background yes
    default_color 606060
    draw_outline no
    draw_shades no
    double_buffer yes
    gap_x 10
    gap_y 10
    minimum_size 100 100
    own_window yes
    own_window_type override
    own_window_transparent yes
    total_run_times 0
    update_interval 1
    use_xft yes
    xftalpha 0.7
    xftfont Verdana:size=8
    # After TEXT is formatted on screen
    TEXT
    ${tail /var/log/everything.log 20}
    This is my  xmonad config file right now....
    If I could just get this to work I can finally tinker around.
    Been frustrating! Urgh!
    --Imports--
    import XMonad
    --Actions--
    import XMonad.Actions.CycleWindows -- classic alt-tab
    import XMonad.Actions.CycleWS -- cycle thru WS', toggle last WS
    import XMonad.Actions.DwmPromote -- swap master like dwm
    --Hooks--
    import XMonad.Hooks.DynamicLog -- statusbar
    import XMonad.Hooks.EwmhDesktops -- fullscreenEventHook fixes chrome fullscreen
    import XMonad.Hooks.ManageDocks -- dock/tray mgmt
    import XMonad.Hooks.UrgencyHook -- window alert bells
    import XMonad.Hooks.SetWMName -- matlab fix
    --Layouts--
    import XMonad.Layout.Named -- custom layout names
    import XMonad.Layout.NoBorders -- smart borders on solo clients
    --Utils--
    import XMonad.Util.EZConfig -- append key/mouse bindings
    import XMonad.Util.Run(spawnPipe) -- spawnPipe and hPutStrLn
    import System.IO -- hPutStrLn scope
    import qualified XMonad.StackSet as W -- manageHook rules
    main = do
    status <- spawnPipe myDzenStatus -- xmonad status on the left
    conky <- spawnPipe myDzenConky -- conky stats on the right
    xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig
    { modMask = mod4Mask
    , borderWidth = 2
    , normalBorderColor = "#dddddd"
    , focusedBorderColor = "#0000ff"
    -- , handleEventHook = fullscreenEventHook
    , workspaces = myWorkspaces
    , layoutHook = myLayoutHook
    , manageHook = manageDocks <+> myManageHook
    <+> manageHook defaultConfig
    ,logHook = myLogHook status
    , startupHook= setWMName "LG3D"
    `additionalKeysP` myKeys
    -- Tags/Workspaces
    -- clickable workspaces via dzen/xdotool
    myWorkspaces :: [String]
    myWorkspaces = clickable . (map dzenEscape) $ ["1","2","3","4","5"]
    where clickable l = [ "^ca(1,xdotool key super+" ++ show (n) ++ ")" ++ ws ++ "^ca()" |
    (i,ws) <- zip [1..] l,
    let n = i ]
    -- Layouts
    -- the default layout is fullscreen with smartborders applied to all
    myLayoutHook = avoidStruts $ smartBorders ( full ||| mtiled ||| tiled )
    where
    full = named "X" $ Full
    mtiled = named "M" $ Mirror tiled
    tiled = named "T" $ Tall 1 (5/100) (2/(1+(toRational(sqrt(5)::Double))))
    -- sets default tile as: Tall nmaster (delta) (golden ratio)
    -- Window management
    myManageHook = composeAll
    [ className =? "MPlayer" --> doFloat
    , className =? "Vlc" --> doFloat
    , className =? "Gimp" --> doFloat
    , className =? "XCalc" --> doFloat
    , className =? "Chromium" --> doF (W.shift (myWorkspaces !! 1)) -- send to ws 2
    , className =? "Nautilus" --> doF (W.shift (myWorkspaces !! 2)) -- send to ws 3
    , className =? "Gimp" --> doF (W.shift (myWorkspaces !! 3)) -- send to ws 4
    , className =? "stalonetray" --> doIgnore
    -- Statusbar
    myLogHook h = dynamicLogWithPP $ myDzenPP { ppOutput = hPutStrLn h }
    myDzenStatus = "dzen2 -w '320' -ta 'l'" ++ myDzenStyle
    myDzenConky = "conky -c ~/.conkyrc | dzen2 -x '320' -w '704' -ta 'r'" ++ myDzenStyle
    myDzenStyle = " -h '20' -fg '#777777' -bg '#222222' -fn 'arial:bold:size=11'"
    myDzenPP = dzenPP
    { ppCurrent = dzenColor "#3399ff" "" . wrap " " " "
    , ppHidden = dzenColor "#dddddd" "" . wrap " " " "
    , ppHiddenNoWindows = dzenColor "#777777" "" . wrap " " " "
    , ppUrgent = dzenColor "#ff0000" "" . wrap " " " "
    , ppSep = " "
    , ppLayout = dzenColor "#aaaaaa" "" . wrap "^ca(1,xdotool key super+space)· " " ·^ca()"
    , ppTitle = dzenColor "#ffffff" ""
    . wrap "^ca(1,xdotool key super+k)^ca(2,xdotool key super+shift+c)"
    " ^ca()^ca()" . shorten 20 . dzenEscape
    -- Key bindings
    myKeys = [ ("M1-<Tab>" , cycleRecentWindows [xK_Alt_L] xK_Tab xK_Tab ) -- classic alt-tab behaviour
    , ("M-b" , sendMessage ToggleStruts ) -- toggle the status bar gap
    , ("M-<Tab>" , toggleWS ) -- toggle last workspace (super-tab)
    , ("M-<Right>" , nextWS ) -- go to next workspace
    , ("M-<Left>" , prevWS ) -- go to prev workspace
    , ("M-S-<Right>", shiftToNext ) -- move client to next workspace
    , ("M-S-<Left>" , shiftToPrev ) -- move client to prev workspace
    , ("M-r" , spawn "xmonad --restart" ) -- restart xmonad w/o recompiling
    , ("M-x" , spawn "chromium" ) -- launch browser
    , ("M-S-x" , spawn "chromium --incognito" ) -- launch private browser
    , ("C-M1-<Delete>" , spawn "sudo shutdown -r now" ) -- reboot
    , ("C-M1-<End>" , spawn "sudo shutdown -h now" ) -- poweroff
    , ("<XF86AudioMute>" , spawn "amixer -q sset Master toggle") --Toggle Volume
    , ("<XF86AudioLowerVolume>", spawn "amixer -q sset Master 2- unmute") -- lower volume
    , ("<XF86AudioRaiseVolume>", spawn "amixer -q sset Master 2+ unmute") -- raise volume
    , ("<Print>" , spawn "import -window root `date '+%Y%m%d-%H%M%S'`.png") --Take a Screenshot

  • Stlarch_icons .xmb icon pack for dzen or other status bars

    I made a .xbm icon pack for dzen or other status bars. They're 8x8 like sm4tik's. Much thanks to him and lokaltog. The icons are based on theirs and various other souces and some are original. I originally got the inspiration from lokaltog's post in the dwm hackers thread about drawing icons into fonts. There are over 250 right now. (I lost count - my head is about to spin off!) There are different variations of most of them. You'll have to play around and test them. I don't know how to show all of them in a screenshot? If anyone can help me with that or post one, that would be great. I put it in the aur also(stlarch_icons). It will install them to /usr/share/icons/stlarch_icons, or you can just download the tarball from sourceforge or my configs and copy them where you want. Cheers. Here's a screenshot of monsterwm sporting the new icons:

    Hey, thanks! I'm using them with my dwm + dzen2 combo setup right now, they do look really good. Also I made a picture for you which contains all of your icons (Heh, I just used scrot and abused pcmanfm filemanager and combined pictures together...)
    <-- Here's the link, so you can add it your post!

  • How do I turn off and on the icon size slider bar at the lower right status bar of a folder window.

    I have been trying for days to help a friend with a new iMac to turn on the icon size slider bar that on my iMac appears at the bottom of ever folder when it is open when in the "view" > "icon" mode.  I cannot find anything that discusses this slider bar.  I can turn this status bar off and on on both my machine and my friends machine, but I cannot turn off or on the slider on either machine. 

    This did not help.  I am a Mac User since 1984 and generally I am never stymied buy the Mac OS, but this one has me.   I can open and close the lower status bar, as you described, and that works fine for me because I have the icon slider bar already there and it works fine; however when I open the lower status bar on my friends machine there is no icon size slider bar, and I can't seem to find out how to get it there, as it is on my machine or at all. The icon size can be controlled from the View menu, but as a photographer, it is really handy to have it at the bottom of the folder window.  Thanks for trying. 

  • The status bar is pushed up at about 3/4 of the screen, so I can view onlu firefox at about 1/4, good thing there is a scroll bar, but below the status bar is white display? can u please help me, I want to drag down the status bar so I can have a full vi

    The status bar is pushed up at about 3/4 of the screen, so I can view only Firefox at about 1/4, good thing there is a scroll bar, but below the status bar is white display? can u please help me, I want to drag down the status bar so I can have a full view
    == This happened ==
    Every time Firefox opened

    Your code is absolutely unreadable - even if someone was willing to
    help, it's simply impossible. I do give you a few tips, though: If you
    understand your code (i.e. if it really is YOUR code), you should be
    able to realize that your minimum and maximum never get set (thus they
    are both 0) and your exam 3 is set with the wrong value. SEE where
    those should get set and figure out why they're not. Chances are you
    are doing something to them that makes one 'if' fail or you just
    erroneously assign a wrong variable!

  • How can I create a status bar at the bottom of a window ?

    I would like to create a status bar at the bottom of my main window similiar to "Internet explorer" has. I thought of using a tool bar but I can't see how to keep it positioned at the bottom of the window when the window is resizable. Any other ideas on how to do this the bar only needs to contain a small amout of text and maybe an icon or two.

    CVI doesn't have a status bar control on UI element like the one available in Visual Studio++. The best way to replicate this is most like through a string control that is resized and positioned to remain at the bottom of the window and colored to look appropriately. I have also seen the combination of a decoration and a text message used.
    Best Regards,
    Chris Matthews
    Measurement Studio Support Manager

  • How can I implement a status bar at the bottom of a resizable application?

    Hello all,
    I am a JavaFx newbie and I am implementing an application (a Sokoban game), with a menu at the top of the frame and a gaming area covering the rest of the frame. To support the game, I have to load images at certain positions in the gaming area.
    The game also includes a level editor with another menubar and where images are set to other positions.
    I implemented this in another view, swiching from the game mode to the level editor mode and vice versa is just done by setting the other view visible. Up to now this works, here the important statements building these details:
    Group root = new Group();
    gameView = new Group(); // for gaming mode
    le_view = new Group()   // for level editor mode
    MenuBar gameMenubar = new MenuBar();
    Menu menuGame = new Menu(bundle.getString("MenuGame"));
    ... building the menu items and menues ...
    gameView.getChildren().add(gameMenubar);
    ImageView buildingView[][] = new ImageView[22][22];
    for (nCol = 0; nCol < 22; nCol++) {
        for (nRow = 0; nRow < 22; nRow++) {
            buildingView[nCol][nRow] = new ImageView();
            buildingView[nCol][nRow].setX(nCol * 26 + 5);
            buildingView[nCol][nRow].setY(nRow * 26 + 40);
            gameView.getChildren().add(buildingView[nCol][nRow]);
    gameView.setVisible(true);
    root.getChildren().add(gameView);
    ... same stuff to build the le_view ...
    le_View.setVisible(false);
    root.getChildren().add(le_View);
    Scene scene = new Scene(root, 800, 600, Color.CORNSILK); Now I want to introduce a status bar at the bottom of the frame, which of course has to follow the bottom of the frame, if it is resized. And of course the menu and the status bar should not grow vertically, if the height of the frame is increased.
    The implementation seems to be easy with StackPane for the frame and one BorderPane for each mode.
    For the first step I only tried implementing the game mode with only one BorderPane (just setting the menu, the gaming area and the status bar each into a HBox and setting these three HBoxes at the top, into the center and at the bottom). I also tried this via GridPane and via VBox; I always get any erroneous behaviour:
    Either the menubar is visible, but the menus do not pop up the menu items, or the anchor point of the menu and of gaming area are set 100 pixels left of the left frame border and move into the frame when the frame width is increased, or the menu is set 20 pixels below the top of the frame, or HBox with the menu grows when the frame height is increased, so that the anchor point of the gaming area moves down.
    Can you describe me a correct construction of such a frame? Thanks in advance.
    Best regards
    Gerhard

    Hello Gerhard,
    Glad the code helped, thanks for a fun layout exercise.
    For the draft code I just pulled an icon off the internet over a http connection.
    If you haven't done so already place any icons and graphics you need local to your project, so that resource lookups like:
    Image img = new Image("http://www.julepstudios.com/images/close-icon.png");become
    Image img = new Image("close-icon.png");then performance may improve.
    Another possible reason for your performance problem could be that when you use a vbox, the vbox content can overflow the area of the borderpane center and might be sitting on top of the menu pane, making you unable to click the menu (which is what happens to me when I try that with the draft program with the vbox wrapping mod, then resize the scene to make it smaller). This was a trick which caught me and the reason that I used a Group originally rather than a vbox. I found a vbox still works but you need to tweak things a bit. The trick I saw was that the order in which you add stuff to the borderpane is important. The borderpane acts like a stack where the last thing added floats over the top of everything else if you size the scene small enough. For your project you want the menu on top always, so it always needs to be the last thing added to the borderpane, but when you swap in the level pane for the game pane, then back out again, the game pane can end up on top of the menu which makes the menu seem like you can't click it (only when the scene is sized small enough). It was quite a subtle bug which took me a little while to work out what was happening. For me the solution was to add just one vbox to the center of the border, and then swap the game pane and the level editor in and out of the vbox, that way the center of the layout always stayed behind the menu bar and the status bar.
    I added some revisions to reflect the comments above and placed some comments in the code to note what was changed and why.
    public class SampleGameLayoutRevised extends Application {
      public static void main(String[] args) { Application.launch(args); }
      public void start(Stage stage) throws Exception {
        final BorderPane gameLayout = new BorderPane();
        final Group gameView = new Group();
        final MenuBar gameMenubar = new MenuBar();
        final Menu gameMenu = new Menu("Mode");
        final VBox centerView = new VBox();
        centerView.setStyle("-fx-background-color: darkgreen");  // we set a background color on the center view to check if it overwrites the game menu.
        MenuItem playGameMenu = new MenuItem("Play Game");
        MenuItem levelEditMenu = new MenuItem("Edit Levels");
        gameMenu.getItems().add(playGameMenu);
        gameMenu.getItems().add(levelEditMenu);
        gameMenubar.getMenus().add(gameMenu);
        final StackPane levelEditView = new StackPane();
        levelEditView.getChildren().add(new Text("Level Editor"));
        ImageView buildingView[][] = new ImageView[22][22];
        Image img = new Image("http://www.julepstudios.com/images/close-icon.png");  // use of http here is just for example, instead use an image resource from your project files.
        for (int nCol = 0; nCol < 22; nCol++) {
          for (int nRow = 0; nRow < 22; nRow++) {
            ImageView imgView = new ImageView(img);
            imgView.setScaleX(0.5);
            imgView.setScaleY(0.5);
            buildingView[nCol][nRow] = imgView;
            buildingView[nCol][nRow].setX(nCol * 20 + 5);
            buildingView[nCol][nRow].setY(nRow * 20 + 40);
            gameView.getChildren().add(buildingView[nCol][nRow]);
        final VBox statusBar = new VBox();
        final Text statusText = new Text("Playing Game");
        statusBar.getChildren().add(statusText);
        statusBar.setStyle("-fx-background-color: cornsilk"); // we set a background color on the status bar,
                                                              // because we can't rely on the scene background color
                                                              // because, if the scene is sized small, the status bar will start to overlay the game view
                                                              // and if we don't explicitly set the statusBar background the center view will start
                                                              // to bleed through the transparent background of the statusBar.
        gameLayout.setCenter(centerView); // we add the centerview first and we never change it, instead we put it's changeable contents in a vbox and change out the vbox content.
        gameLayout.setBottom(statusBar);
        gameLayout.setTop(gameMenubar);   // note the game layout is the last thing added to the borderpane so it will always stay on top if the border pane is resized.
        playGameMenu.setOnAction(new EventHandler<ActionEvent>() {
          public void handle(ActionEvent event) {
            centerView.getChildren().clear();  // here we perform a centerview vbox content swap.
            centerView.getChildren().add(gameView);
            statusText.setText("Playing Game");
        levelEditMenu.setOnAction(new EventHandler<ActionEvent>() {
          public void handle(ActionEvent event) {
            centerView.getChildren().clear();  // here we perform a centerview vbox content swap.
            centerView.getChildren().add(levelEditView);
            statusText.setText("Editing Level");
        playGameMenu.fire();
        Scene scene = new Scene(gameLayout, 800, 600, Color.CORNSILK);
        stage.setScene(scene);
        stage.show();
    }Other than that I am not sure of a reason for the slowdown you are seeing. In my experience JavaFX has been quick and responsive for the tasks I have been using it for. Admittedly, I just use if for a bunch of small trial projects, but I've never seen it unresponsive for a minute.
    - John

Maybe you are looking for

  • PowerPivot Excel 2013 crashes after column rename in source datatabase

    Hello, Using Windows 8.1, Excel 2013 64Bits, PowerPivot Add-In : Not using a SQL Server TabularModel just a local Excel Model. Having 32MB Ram  memory. Readed a table from a SQL Source that contains 13.000.000 records. After loading I discoverd that

  • Deleting PO Document types

    Dear All ,          We are doing implementation through best practice building block installation .After Base line package installation we got dummy PO DB  as a document type . Is there any harm in deleting this doc type ? We want to use customise  P

  • API for getting diagnotic server info

    Is there an API for getting diagnostic information about the server (memory usage, etc.). We'd like to write a program to monitor the server.

  • Decimal to binary conversion

    hi...anyone here knows the code to convert decimal to binary.Please help me!!!

  • Why do I have to change my plan when I switch my device?

    My IPhone 4s isn't working at all and I was told I could temporarily switch to another device. I am switching to a basic phone. When I proceed online to switch the device, it tells me I have to switch plans as well. I don't need more data, but I do n