You are not logged in.

#76 2010-11-26 09:57:50

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

just for fun I rewrote simongmzlj's cycle.c:

static int
cycle(int dist) {
    int curtags = selmon->tagset[selmon->seltags];
    int numtags = LENGTH(tags);
    int seltag  = -1;

    while(!(curtags & (1 << ++seltag)));
    seltag = (seltag + dist) % numtags;
    if(seltag < 0) seltag += numtags;

    return 1 << seltag;
}

static void
tagcycle(const Arg *arg) {
    const Arg a = { .i = cycle(arg->i) };
    tag(&a);
}

static void
viewcycle(const Arg *arg) {
    const Arg a = { .i = cycle(arg->i) };
    view(&a);
}

static void
viewtagcycle(const Arg *arg) {
    const Arg a = { .i = cycle(arg->i) };
    view(&a);
    tag(&a);
}

edit: added tagcycle.
edit2: rewrote stuff again, added viewtagcycle. I should probably put this on github or something.

Last edited by aeosynth (2010-11-28 14:47:10)

Offline

#77 2010-11-26 19:00:01

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

Re: DWM Hackers Unite! Share (or request) dwm patches.

no tagcycle? useless, not suckless smile

Offline

#78 2010-12-13 18:35:05

vanvalium
Member
From: Austria
Registered: 2010-10-09
Posts: 86

Re: DWM Hackers Unite! Share (or request) dwm patches.

is it possible to toggle a single window floating?
imagine it as useful but didn't find anything yet

Offline

#79 2010-12-13 18:39:04

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

Re: DWM Hackers Unite! Share (or request) dwm patches.

{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },

hmm

Offline

#80 2010-12-16 11:13:53

Saboti
Member
Registered: 2010-12-13
Posts: 2

Re: DWM Hackers Unite! Share (or request) dwm patches.

Hi everybody,

I have a little Problem with following Statuscolors-improved Patch:
http://www.mail-archive.com/dev@suckles … 06450.html

I patched everything in by Hand.
When i compile dwm it throws following error:

dwm.c: In Funktion »drawbar«:
dwm.c:735:9: Fehler: Inkompatibler Typ für Argument 1 von »drawtext«
dwm.c:192:13: Anmerkung: expected »const char *« but argument is of type »Tag«

Maybe someone can help me with this :-)

Last edited by Saboti (2010-12-16 11:14:27)

Offline

#81 2010-12-16 11:47:09

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

Re: DWM Hackers Unite! Share (or request) dwm patches.

Offline

#82 2010-12-16 13:10:54

Saboti
Member
Registered: 2010-12-13
Posts: 2

Re: DWM Hackers Unite! Share (or request) dwm patches.

JokerBoy wrote:

thx JokerBoy, it worked great with a litte change for the Pertag2 Patch from simongmzlj.

Line 71:

 drawtext(tags[i], col, True); 

change to:

drawtext(tags[i].name, col, True);

Greets Saboti

Offline

#83 2010-12-17 19:47:08

vanvalium
Member
From: Austria
Registered: 2010-10-09
Posts: 86

Re: DWM Hackers Unite! Share (or request) dwm patches.

JokerBoy wrote:

{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },

hmm

ah, stupid, overlooked that, thanks

Offline

#84 2010-12-19 15:04:02

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

something more of a "trick" , definitely not a patch..

I was going through the patches for a "scratchpad", although I'm not sure what exactly you want to accomplish I did this:

I use urxvt, and actually urxvtc.
Urxvt offers 'kuake' perl extension which is fun.
Having that in mind all I did was add those to my config.h

static const Rule rules[] = {
...
    { "URxvt",     "scratchpad",     NULL, 0,            True,        -1 },
...
};

...

static const char *scratchcmd[]    = { "urxvtdc", "-name", "scratchpad", "-pe", "kuake", "-geometry", "+740+396", NULL };

...

static Key keys[] = {
...
    { MODKEY,                       XK_F10,    spawn,          {.v = scratchcmd } },
...
};

So what that does is spawn a terminal floating in the center of the screen (in this case my screen - geometry is set to +740+396 which is the center for a 1920x1080 resolution screen)

You first need an instance of that terminal, to initialize it just press MODKEY+F10 ,
or have the scratchcmd in .xinitrc for example so that it's already initialized when you login.

Having initialized an instance of a urxvt terminal with the kuake extension all you do is press F10 to toggle it.
F10 is the default button for kuake extension but you can change it to w/e you want.

Problem is that if you dont F10 the terminal to hide it, and instead Ctrl+d it or exit it then the instance is lost.
In that case you need to press MODKEY+F10 (as mentioned above) to reinitialize a new instance.
Feature is you can do that more than one time and have multiple terminals spawn and hide with F10.

F10 toggles the terminals initialized by the scratchcmd/MODKEY+F10 keeping their position and state.


This can maybe extended to a script that'll know if an instance is running at any time, and if not initialize one automatically so that we can get rid of the shortcut MODKEY+F10 and the scatchcmd and just keep the rule
..or keep them, if we need more than one "scratchpads"

So that's it, I'm not sure if scratchpad is a good name for that, maybe togglepad is better as I'm not sure what the scratchpad does.

PS: urxvtdc is a script that ensures urxvtd is running before calling urxvtc.

Last edited by c00kiemon5ter (2010-12-19 15:07:09)


.:[ git me! ] :.

Offline

#85 2010-12-19 18:44:24

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: DWM Hackers Unite! Share (or request) dwm patches.

My scratchpad patch does everything you described, and it will determine if it is initialized. Also you can have as many scratchpads as you like, etc etc, without needing any perl extension (and works with xterm too, BTW).

Read my former posts in this thread if you want more info, or just try the patch.


This silver ladybug at line 28...

Offline

#86 2010-12-19 18:55:35

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

lolilolicon wrote:

My scratchpad patch does everything you described, and it will determine if it is initialized. Also you can have as many scratchpads as you like, etc etc, without needing any perl extension (and works with xterm too, BTW).

Read my former posts in this thread if you want more info, or just try the patch.

I didn't mean to make your patch sound ugly or anything, I just proposed something I think is simple enough, and doesn't need actual patching hmm
I dont I'll be using this myself tbh, I was just bored to study and thought I'd play some with this idea.
or I just interpreted your answer to be a bit curt (is that the word :S)

anyway, I'm keen to try the scratchpad patches and give you my opinion smile


.:[ git me! ] :.

Offline

#87 2010-12-20 03:00:43

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: DWM Hackers Unite! Share (or request) dwm patches.

c00kiemon5ter wrote:

I was just bored to study and thought I'd play some with this idea.

You did a good job understanding what my "scratchpad" did (mostly).
Yes, dwm.c is a bit cryptic with all the "Hungary notations" and sparse comments...
Anyway, I assure you my patch is not ugly (if not clever, elegant, and efficient wink).

anyway, I'm keen to try the scratchpad patches and give you my opinion smile

Good choice.

Oh, if you smelt rudeness in my last post, it was intentional wink.

Last edited by lolilolicon (2010-12-20 03:02:33)


This silver ladybug at line 28...

Offline

#88 2010-12-20 03:16:11

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

yep, I even read the patch code before trying what I did up there ^
I gave it a shot, patch was clean big_smile
I couldnt make urxvt/urxvtc work with it though, same as jasonryan mentioned.
didnt bother much fixing it (I read about changing the .Xdefaults urxvt name if set etc) as xterm works great with it instead smile

then I unpatched everything cause I dont think I need them, but it was fun big_smile
I'll keep a branch with those just in case smile


.:[ git me! ] :.

Offline

#89 2010-12-28 19:56:47

markbabc
Member
Registered: 2010-11-06
Posts: 157

Re: DWM Hackers Unite! Share (or request) dwm patches.

Ok im posting here because it is about DWM patches.

Im trying to apply this patch http://dwm.suckless.org/patches/defaulttransparency

and in here http://dwm.suckless.org/patches/ it doesnt say how to apply .patch files.

Iv got a dwm folder in my home dir where i edit config.h and then makepkg -g >> PKGBUILD and makepkg -efi to install my changes


In that dir there is a src dir and then in that dir there is dwm-5.8.2 which holds cnofig.def.h and dwm.c (along with a few others)

The patch says it modifies config.def.h and dwm.c but i dont know how to apply it.

Any help would be great and maybe an addition to the wiki would be nice for future dwm users?

Offline

#90 2010-12-28 20:05:47

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

If you open the patch it says it is a diff - I'd apply it that way...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#91 2010-12-28 20:09:18

markbabc
Member
Registered: 2010-11-06
Posts: 157

Re: DWM Hackers Unite! Share (or request) dwm patches.

jasonwryan wrote:

If you open the patch it says it is a diff - I'd apply it that way...

ohhh i thought diff was just a command to show the differences, i didnt know it could actually edit files

Offline

#92 2010-12-28 20:12:42

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

Re: DWM Hackers Unite! Share (or request) dwm patches.

patch -Np1 <  nameofthepatch.diff

you better make that changes by hand if that diff changes something in config.def.h.. and make them in your config.h..

Last edited by JokerBoy (2010-12-28 20:14:18)

Offline

#93 2010-12-28 20:13:58

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

It is just a record of the differences between the patched file(s) and the originals - but it can be applied, as per the instructions http://dwm.suckless.org/patches/


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#94 2010-12-31 09:05:18

xxsashixx
Member
Registered: 2007-12-11
Posts: 53

Re: DWM Hackers Unite! Share (or request) dwm patches.

Ok, I got scratchpad working only if i use spawn and not togglescratch, I am using dwm-sprinkles but it should be patched to use it no? Also how do I make the scratchpad open in the middle of the screen? Thanks

Offline

#95 2010-12-31 11:57:57

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

Re: DWM Hackers Unite! Share (or request) dwm patches.

i'm using dwm vanilla with this patch and it works great. smile

PS: apply it by hand..

Offline

#96 2010-12-31 17:00:24

xxsashixx
Member
Registered: 2007-12-11
Posts: 53

Re: DWM Hackers Unite! Share (or request) dwm patches.

JokerBoy wrote:

i'm using dwm vanilla with this patch and it works great. smile

PS: apply it by hand..

togglebar(NULL);

No such code

Last edited by xxsashixx (2010-12-31 17:03:04)

Offline

#97 2010-12-31 17:04:58

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

Re: DWM Hackers Unite! Share (or request) dwm patches.

you're funny..  use ONLY the lines with + in the front.

your config should have something like:

....................
static const char scratchpadname[] = "scratchy";
static const char *scratchpadcmd[] = { "xterm", "-name", scratchpadname, "-geometry", "130x30", NULL };

static Key keys[] = {
    /* modifier                     key        function        argument */
....................
    { MODKEY,                       XK_x,      togglescratch,  {.v = scratchpadcmd} },
....................
};

Offline

#98 2010-12-31 17:10:01

xxsashixx
Member
Registered: 2007-12-11
Posts: 53

Re: DWM Hackers Unite! Share (or request) dwm patches.

Yea I figured that out, no I need to apply the patch to dwm.c

dwm.c: In function 'manage':
dwm.c:1473:28: error: 'scratchpadname' undeclared (first use in this function)
dwm.c:1473:28: note: each undeclared identifier is reported only once for each function it appears in
dwm.c: At top level:
dwm.c:2493:1: warning: 'togglescratch' defined but not used

it is defined though..

Offline

#99 2010-12-31 17:12:00

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

Re: DWM Hackers Unite! Share (or request) dwm patches.

config.h

....................
static const char scratchpadname[] = "scratchy";
static const char *scratchpadcmd[] = { "xterm", "-name", scratchpadname, "-geometry", "130x30", NULL };

static Key keys[] = {
    /* modifier                     key        function        argument */
....................
    { MODKEY,                       XK_x,      togglescratch,  {.v = scratchpadcmd} },
....................
};

Last edited by JokerBoy (2010-12-31 17:16:59)

Offline

#100 2010-12-31 17:38:07

xxsashixx
Member
Registered: 2007-12-11
Posts: 53

Re: DWM Hackers Unite! Share (or request) dwm patches.

That just broke my config.h, had to redo it

Offline

Board footer

Powered by FluxBB