You are not logged in.
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
no tagcycle? useless, not suckless
Arch64/DWM || My Dropbox referral link
Offline
is it possible to toggle a single window floating?
imagine it as useful but didn't find anything yet
Offline
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
Arch64/DWM || My Dropbox referral link
Offline
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
Saboti, try this patch: http://punctweb.ro/dwm-patches/dwm-5.8. … olors.diff
Arch64/DWM || My Dropbox referral link
Offline
Saboti, try this patch: http://punctweb.ro/dwm-patches/dwm-5.8. … olors.diff
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
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
ah, stupid, overlooked that, thanks
Offline
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
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
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
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
.:[ git me! ] :.
Offline
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 ).
anyway, I'm keen to try the scratchpad patches and give you my opinion
Good choice.
Oh, if you smelt rudeness in my last post, it was intentional .
Last edited by lolilolicon (2010-12-20 03:02:33)
This silver ladybug at line 28...
Offline
yep, I even read the patch code before trying what I did up there ^
I gave it a shot, patch was clean
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
then I unpatched everything cause I dont think I need them, but it was fun
I'll keep a branch with those just in case
.:[ git me! ] :.
Offline
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
If you open the patch it says it is a diff - I'd apply it that way...
Offline
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
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)
Arch64/DWM || My Dropbox referral link
Offline
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/
Offline
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
i'm using dwm vanilla with this patch and it works great.
PS: apply it by hand..
Arch64/DWM || My Dropbox referral link
Offline
i'm using dwm vanilla with this patch and it works great.
PS: apply it by hand..
togglebar(NULL);
No such code
Last edited by xxsashixx (2010-12-31 17:03:04)
Offline
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} },
....................
};
Arch64/DWM || My Dropbox referral link
Offline
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
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)
Arch64/DWM || My Dropbox referral link
Offline
That just broke my config.h, had to redo it
Offline