You are not logged in.

#176 2010-01-27 05:57:13

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Scrotwm / Spectrwm

To get stuff into the status bar, use the baraction.sh script.  A few examples are in the wiki (http://wiki.archlinux.org/index.php/Scrotwm), under "Satusbar configuration".

I don't think you can change the border width from the conf file.

Offline

#177 2010-01-27 06:16:22

Kitty
Member
From: The Burning Desert
Registered: 2008-01-11
Posts: 88

Re: Scrotwm / Spectrwm

bar_action          = conky

Make sure you have a ~/.conkyrc, as trying to specify a alt config on that line didn't work for me.

The money shot from my .conkyrc is:

TEXT
${time %R %a,%d-%#b-%y} |Mail:${new_mails} |Up:${uptime_short} |Temp:${acpitemp}C |Batt:${battery_short} |${addr wlan0} |RAM:$memperc% |CPU:${cpu}% | ${downspeedf wlan0}

That all fits into the 800 part of my 800x480 netbook screen.

I think the 1 pixel border is hardcoded as a design decision. So it's either live with it or write a patch, I guess.


/etc/rc.d/ is where daemons reside. Beware.

Offline

#178 2010-01-27 14:34:22

Aedit
Member
Registered: 2009-10-29
Posts: 138

Re: Scrotwm / Spectrwm

@Kitty: Thanks. I just added a few other settings and it works:

out_to_x no
out_to_console yes
update_interval 1.0
total_run_times 0
use_spacer none
TEXT
${time %R %a,%d-%#b-%y} |Mail:${new_mails} |Up:${uptime_short} |Temp:${acpitemp}C |Batt:${battery_short} |${addr wlan0} |RAM:$memperc% |CPU:${cpu}% | ${downspeedf wlan0}

That's with the regular conky from [Extra].

Last edited by Aedit (2010-01-27 15:05:43)

Offline

#179 2010-01-29 17:16:17

keegan
Member
Registered: 2009-05-12
Posts: 54

Re: Scrotwm / Spectrwm

When applying your cumulative patch to the scrotwm-cvs from aur I get this error during patching:

Hunk #7 FAILED at 1282.

It leaves behind a scrotwm.c.rej file that I'm guessing is the part of the diff that couldn't be applied:

--- scrotwm.c 2010-01-21 10:12:11.598822491 +0000
+++ scrotwm.patched1-8.c 2010-01-21 09:34:34.208084359 +0000
@@ -1282,7 +1339,7 @@
         if (fork() == 0) {
             if (display)
                 close(ConnectionNumber(display));
-            setenv("LD_PRELOAD", SWM_LIB, 1);
+            //setenv("LD_PRELOAD", SWM_LIB, 1);
             if (asprintf(&ret, "%d", r->ws->idx)) {
                 setenv("_SWM_WS", ret, 1);
                 free(ret);

It's using the 2010 01 23 cvs. Has something changed, or did I mess up a step?

Last edited by keegan (2010-01-29 17:19:41)

Offline

#180 2010-01-29 17:21:47

virus_found
Member
From: Moscow
Registered: 2009-05-22
Posts: 51
Website

Re: Scrotwm / Spectrwm

20100117 is the date of the last commit to the cvs repo.

Offline

#181 2010-01-29 17:29:07

keegan
Member
Registered: 2009-05-12
Posts: 54

Re: Scrotwm / Spectrwm

Well, I'm using this pkgbuild http://aur.archlinux.org/packages.php?ID=31789
I'm not a programmer, but when applying the patch it says 1 out of 31 hunks failed, so that means most of it is patching correctly, right? What did I do that's causing this hunk 7 not to apply?

Offline

#182 2010-01-29 17:32:23

Aedit
Member
Registered: 2009-10-29
Posts: 138

Re: Scrotwm / Spectrwm

The problem is that that part of the patch is already applied by a "sed" command in the PKGBUILD which comments out the LD_PRELOAD line. The patch tries to do it again and fails. That's OK though: scrotwm actually does build correctly.

Offline

#183 2010-01-29 17:47:41

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Scrotwm / Spectrwm

Ah, bugger.  With the sed'd patch, you can't apply patches.  Without the sed'd patch, you'll get a slew of (linux only) errors every time you open a terminal.

I am between a rock and a hard place.  Time to poll the users!  What do you guys think?  (I am leaning towards leaving the sed patch in place.)

Aedit:  I have been meaning to include default scripts, but have not decided on whose to use.  I will get off my bum and try all of them* before too long.

* Thank you, everyone, for posting those, by the way.

Last edited by keenerd (2010-01-29 17:49:21)

Offline

#184 2010-01-29 17:51:37

keegan
Member
Registered: 2009-05-12
Posts: 54

Re: Scrotwm / Spectrwm

Aedit: I guess you're right! Now I have colored status and it actually works like I wanted smile Thanks for suggesting this, it's much easier than recompiling everytime I want to make changes, but also doesn't get too complicated for me like xmonad wink

Offline

#185 2010-01-29 18:18:34

Aedit
Member
Registered: 2009-10-29
Posts: 138

Re: Scrotwm / Spectrwm

@keenerd: I could repost the patch without that hunk but it's not actually stopping the build. I was hoping that it would end up in cvs sooner rather than later and then people wouldn't need it.

The nice thing about using sed to do that patch is that it's quite robust with respect to changes in the source code -- you don't need to keep changing it. OTOH it's a little unconventional.

I'm not bothered which baraction script is put in as default. I guess it can be fairly simple with no dependencies other than bash. The upstream screenshot.sh works, with a dependency on scrot.

@keegan: glad you like it! A C program with a text config file is the best IMHO. The key bindings are a lot like xmonad, and it is more featureful than dwm.

Last edited by Aedit (2010-01-29 18:19:21)

Offline

#186 2010-01-29 18:30:37

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Scrotwm / Spectrwm

@Aedit
That line is needed for BSD, and ScrotWM is a BSD app first.  Maybe we could get it slipped in the linux make target.  So far Marco has been very forgiving over linux's other differences, and has patched for several quirks in glibc.

Offline

#187 2010-01-29 18:57:20

Aedit
Member
Registered: 2009-10-29
Posts: 138

Re: Scrotwm / Spectrwm

Yes I see. An #ifndef LINUX ... #endif around that line would do wouldn't it?

Last edited by Aedit (2010-01-29 19:01:25)

Offline

#188 2010-01-29 20:52:37

keegan
Member
Registered: 2009-05-12
Posts: 54

Re: Scrotwm / Spectrwm

Is there a way to show which workspaces have active windows in them? Sort of like how dwm or xmonad shows the tag list, and a box in the corner of a tag if it has any windows in it. I don't need a list of all workspaces, but some way to just show active ones in the bar.

Offline

#189 2010-01-29 22:37:29

Aedit
Member
Registered: 2009-10-29
Posts: 138

Re: Scrotwm / Spectrwm

No there's no list of workspaces in the status bar.  I like it that way because it leaves more space for status information. So you just have to remember where your windows are. Or hold down the mod key and run a finger over the number keys like a pianist...

Offline

#190 2010-01-29 22:53:16

Kitty
Member
From: The Burning Desert
Registered: 2008-01-11
Posts: 88

Re: Scrotwm / Spectrwm

Mod+Right or Mod+Left (arrows) will move you around, but only to active workspaces. So if you've got something open on WS 1,4 6,8,9, you'll only see those as you Mod+arrow around.


/etc/rc.d/ is where daemons reside. Beware.

Offline

#191 2010-01-30 00:04:22

keegan
Member
Registered: 2009-05-12
Posts: 54

Re: Scrotwm / Spectrwm

Yea, I found that one looking though the config. I don't think my original idea will matter tho, because I'm thinking of trying dzen2 out. I was thinking it'd be cool if there was a variable or something I could display with conky-cli. It'd be neat if there was something like that for the current workspace number and layout display, but I don't know enough programming to do that. I think all I'd miss is the toggling of it's display, especially for stuff like vlc. All in all I'm loving scrotwm tho smile

Offline

#192 2010-01-30 01:26:34

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Scrotwm / Spectrwm

edit:  I did not update it properly for the current head.  It has some amusing bugs now.

edit2:  It is ugly, but it works.

Here is an old-ish patch, updated for the current head.  It adds a keybinding to Mod+A, which duplicated Screen's Control+A command.  It will swap you back to the prior workspace.

--- scrotwm.c.orig    2010-01-29 16:30:10.000000000 -0500
+++ scrotwm.c    2010-01-30 11:58:18.000000000 -0500
@@ -232,6 +232,7 @@ struct swm_region {
     struct swm_geometry    g;
     struct workspace    *ws;    /* current workspace on this region */
     struct swm_screen    *s;    /* screen idx */
+    struct workspace    *ws_prior;
     Window            bar_window;
 };
 TAILQ_HEAD(swm_region_list, swm_region);
@@ -1469,6 +1470,7 @@ switchws(struct swm_region *r, union arg
         other_r->ws = old_ws;
         old_ws->r = other_r;
     }
+    this_r->ws_prior = old_ws;
     this_r->ws = new_ws;
     new_ws->r = this_r;
 
@@ -1517,6 +1519,54 @@ cyclews(struct swm_region *r, union arg 
 }
 
 void
+priorws(struct swm_region *r, union arg *args)
+{
+    int            wsid = args->id;
+    struct swm_region    *this_r, *other_r;
+    struct ws_win        *win;
+    struct workspace    *new_ws, *old_ws;
+    union arg        a;
+
+    if (!(r && r->s))
+        return;
+
+    this_r = r;
+    old_ws = this_r->ws;
+    new_ws = this_r->ws_prior;
+
+    DNPRINTF(SWM_D_WS, "priorws screen[%d]:%dx%d+%d+%d: "
+        "%d -> %d\n", r->s->idx, WIDTH(r), HEIGHT(r), X(r), Y(r),
+        old_ws->idx, wsid);
+
+    if (new_ws == NULL || old_ws == NULL)
+        return;
+    if (new_ws == old_ws)
+        return;
+
+    other_r = new_ws->r;
+    if (other_r == NULL) {
+        /* if the other workspace is hidden, switch windows */
+        if (old_ws->r != NULL)
+            old_ws->old_r = old_ws->r;
+        old_ws->r = NULL;
+
+        TAILQ_FOREACH(win, &old_ws->winlist, entry)
+            unmap_window(win);
+    } else {
+        other_r->ws = old_ws;
+        old_ws->r = other_r;
+    }
+    this_r->ws_prior = old_ws;
+    this_r->ws = new_ws;
+    new_ws->r = this_r;
+
+    stack();
+    a.id = SWM_ARG_ID_FOCUSCUR;
+    focus(new_ws->r, &a);
+    bar_update();
+}
+
+void
 cyclescr(struct swm_region *r, union arg *args)
 {
     struct swm_region    *rr = NULL;
@@ -2498,6 +2548,7 @@ enum keyfuncid {
     kf_ws_10,
     kf_ws_next,
     kf_ws_prev,
+    kf_ws_prior,
     kf_screen_next,
     kf_screen_prev,
     kf_mvws_1,
@@ -2571,6 +2622,7 @@ struct keyfunc {
     { "ws_10",        switchws,    {.id = 9} },
     { "ws_next",        cyclews,    {.id = SWM_ARG_ID_CYCLEWS_UP} },
     { "ws_prev",        cyclews,    {.id = SWM_ARG_ID_CYCLEWS_DOWN} },
+    { "ws_prior",        priorws,    {0} },
     { "screen_next",    cyclescr,    {.id = SWM_ARG_ID_CYCLESC_UP} },
     { "screen_prev",    cyclescr,    {.id = SWM_ARG_ID_CYCLESC_DOWN} },
     { "mvws_1",        send_to_ws,    {.id = 0} },
@@ -3093,6 +3145,7 @@ setup_keys(void)
     setkeybinding(MODKEY,        XK_0,        kf_ws_10,    NULL);
     setkeybinding(MODKEY,        XK_Right,    kf_ws_next,    NULL);
     setkeybinding(MODKEY,        XK_Left,    kf_ws_prev,    NULL);
+    setkeybinding(MODKEY,        XK_a,        kf_ws_prior,    NULL);
     setkeybinding(MODKEY|ShiftMask,    XK_Right,    kf_screen_next,    NULL);
     setkeybinding(MODKEY|ShiftMask,    XK_Left,    kf_screen_prev,    NULL);
     setkeybinding(MODKEY|ShiftMask,    XK_1,        kf_mvws_1,    NULL);

Last edited by keenerd (2010-01-30 16:59:47)

Offline

#193 2010-01-30 04:36:46

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Scrotwm / Spectrwm

Continuing to look at some overdue stuff, I've figured all the fuss about swmhack.  It is a holy grail of sorts, and it actually works.

One of the top requests for Awesome WM was the ability to "remember" where an app was launched.  Pop up dmenu, launch Gimp.  Switch to another desktop, and Gimp would follow you when it finished loading.  No one thought it would be possible for Gimp to pop into the desktop where dmenu launched it.

The swmhack does this.  It actually works.  It is really nifty.  I know of no other WM that offers this highly desired feature.  (Please correct me if that is wrong.)

The makefile was pretty fubar, but it can be compiled.  If someone could test it, here's the current build steps.  Marco actually gave these to us,  (back on page 2) but I guess it was lost in the shuffle.  He also used a few BSD only commands to build it, but those can be worked around.

cc -O2 -pipe -g -Wall -Wno-uninitialized -ggdb3 -I/usr/X11R6/include -c swm_hack.c -o swm_hack.o
cc -O2 -pipe -g -Wall -Wno-uninitialized -ggdb3 -I/usr/X11R6/include -c -fpic -DPIC swm_hack.c -o swm_hack.so
cc -shared -fpic  -o libswmhack.so.0.0 swm_hack.so
strip libswmhack.so.0.0
cp libswmhack.so.0.0 /usr/local/lib/
ln -s /usr/local/lib/libswmhack.so.0.0 /usr/local/lib/libswmhack.so

And of course uncomment
setenv("LD_PRELOAD", SWM_LIB, 1);

This is less than perfect; nothing in Arch uses /usr/local/lib.  It is just a prototype.  It will be cleaned up for a release.

Last edited by keenerd (2010-01-30 05:47:37)

Offline

#194 2010-01-30 05:47:14

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Scrotwm / Spectrwm

Could some folks gives scrotwm-cvs a whirl?

The PKGBUILD has some overhauls to it.  It builds with a completely different Makefile and includes the swmhack.  It seems to be working great, but I was already wrong earlier tonight.

Assuming no one finds flaws, I'll update the PKGBUILD for the main scrotwm package in a day or two.

Offline

#195 2010-01-30 06:47:46

Kitty
Member
From: The Burning Desert
Registered: 2008-01-11
Posts: 88

Re: Scrotwm / Spectrwm

{kitty|~}$ scrotwm -v
Welcome to scrotwm V0.9.22 cvs tag: $scrotwm: scrotwm.c,v 1.281 2010/01/13 23:22:31 dwc Exp $ scrotwm: other wm running

It builds from cvs and the remember where launched seems to work.

Ed: and for the all the hassle over profont, the pkg doesn't install the /etc/scrotwm.conf file.

Last edited by Kitty (2010-01-30 06:58:28)


/etc/rc.d/ is where daemons reside. Beware.

Offline

#196 2010-01-30 13:29:07

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Scrotwm / Spectrwm

You are correct.  Fixed.

Offline

#197 2010-01-30 17:23:28

Aedit
Member
Registered: 2009-10-29
Posts: 138

Re: Scrotwm / Spectrwm

keenerd wrote:

edit:  I did not update it properly for the current head.  It has some amusing bugs now.

edit2:  It is ugly, but it works.

Here is an old-ish patch, updated for the current head.  It adds a keybinding to Mod+A, which duplicated Screen's Control+A command.  It will swap you back to the prior workspace.

I see it's better after edit2. You can simplify priorws() if you add 2 lines to switchws() and call that:

--- scrotwm.c    2010-01-30 07:07:13.203172934 +0000
+++ scrotwm_priorws.c    2010-01-30 09:59:46.647964231 +0000
@@ -231,6 +231,7 @@ struct swm_region {
     TAILQ_ENTRY(swm_region)    entry;
     struct swm_geometry    g;
     struct workspace    *ws;    /* current workspace on this region */
+    struct workspace    *ws_prior;    /* prior workspace on this region */
     struct swm_screen    *s;    /* screen idx */
     Window            bar_window;
 };
@@ -1466,9 +1467,11 @@ switchws(struct swm_region *r, union arg
         TAILQ_FOREACH(win, &old_ws->winlist, entry)
             unmap_window(win);
     } else {
+        other_r->ws_prior = new_ws;
         other_r->ws = old_ws;
         old_ws->r = other_r;
     }
+    this_r->ws_prior = old_ws;
     this_r->ws = new_ws;
     new_ws->r = this_r;
 
@@ -1517,6 +1520,23 @@ cyclews(struct swm_region *r, union arg 
 }
 
 void
+priorws(struct swm_region *r, union arg *args)
+{
+    union            arg a;
+    struct swm_screen    *s = r->s;
+
+    DNPRINTF(SWM_D_WS, "priorws id %d "
+        "in screen[%d]:%dx%d+%d+%d ws %d\n", args->id,
+        r->s->idx, WIDTH(r), HEIGHT(r), X(r), Y(r), r->ws->idx);
+
+    if (r->ws_prior == NULL)
+        return;
+
+    a.id = r->ws_prior->idx;
+    switchws(r, &a);
+}
+
+void
 cyclescr(struct swm_region *r, union arg *args)
 {
     struct swm_region    *rr = NULL;
@@ -2498,6 +2518,7 @@ enum keyfuncid {
     kf_ws_10,
     kf_ws_next,
     kf_ws_prev,
+    kf_ws_prior,
     kf_screen_next,
     kf_screen_prev,
     kf_mvws_1,
@@ -2571,6 +2592,7 @@ struct keyfunc {
     { "ws_10",        switchws,    {.id = 9} },
     { "ws_next",        cyclews,    {.id = SWM_ARG_ID_CYCLEWS_UP} },
     { "ws_prev",        cyclews,    {.id = SWM_ARG_ID_CYCLEWS_DOWN} },
+    { "ws_prior",        priorws,    {0} },
     { "screen_next",    cyclescr,    {.id = SWM_ARG_ID_CYCLESC_UP} },
     { "screen_prev",    cyclescr,    {.id = SWM_ARG_ID_CYCLESC_DOWN} },
     { "mvws_1",        send_to_ws,    {.id = 0} },
@@ -3093,6 +3115,7 @@ setup_keys(void)
     setkeybinding(MODKEY,        XK_0,        kf_ws_10,    NULL);
     setkeybinding(MODKEY,        XK_Right,    kf_ws_next,    NULL);
     setkeybinding(MODKEY,        XK_Left,    kf_ws_prev,    NULL);
+    setkeybinding(MODKEY,        XK_a,        kf_ws_prior,    NULL);
     setkeybinding(MODKEY|ShiftMask,    XK_Right,    kf_screen_next,    NULL);
     setkeybinding(MODKEY|ShiftMask,    XK_Left,    kf_screen_prev,    NULL);
     setkeybinding(MODKEY|ShiftMask,    XK_1,        kf_mvws_1,    NULL);
@@ -4368,6 +4391,7 @@ new_region(struct swm_screen *s, int x, 
     HEIGHT(r) = h;
     r->s = s;
     r->ws = ws;
+    r->ws_prior = NULL;
     ws->r = r;
     TAILQ_INSERT_TAIL(&s->rl, r, entry);
 }

Offline

#198 2010-01-31 00:00:23

Kitty
Member
From: The Burning Desert
Registered: 2008-01-11
Posts: 88

Re: Scrotwm / Spectrwm

I added a section to the wiki page, about using scrotwm + xdm. Using the xdm-arch-theme from AUR it's a really nice setup.


/etc/rc.d/ is where daemons reside. Beware.

Offline

#199 2010-01-31 19:20:45

stealyourwife
Member
Registered: 2009-11-11
Posts: 8

Re: Scrotwm / Spectrwm

Does anybody know how to apply multiple tags to one window.. I figured this was possible since it is based on dwm and xmonad.

sorry if this question has already been asked

Offline

#200 2010-01-31 21:28:58

Aedit
Member
Registered: 2009-10-29
Posts: 138

Re: Scrotwm / Spectrwm

Tags correspond exactly to workspaces in scrotwm (or in other words there are no tags only workspaces), so your question is then whether you can show a single window on multiple workspaces. As far as I know you can't.

Offline

Board footer

Powered by FluxBB