You are not logged in.
Thanks, I think I've got it figure out.
Also, one request as I can't seem to figure it out as I'm pretty new to coding but I've learned a bit so far. Could someone write a patch to draw a 1px line under the bar ( or over depending on if the bar is at the top or bottom ) ?
No real function, more of a look thing that I think would look nice.
Last edited by Crunch (2012-05-19 04:08:57)
Registered Linux user #536591.
Offline
Thanks, I think I've got it figure out.
Can you share your patch? I'd like to play around with it too
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
A question that just came to my mind: Does anybody here use Mercurial patch queues to maintain a stack of patches?
Offline
Crunch wrote:Thanks, I think I've got it figure out.
Can you share your patch? I'd like to play around with it too
Probably not the best way to do it but it works and it was a quick try;
I added a second color " col2 " which still acts as it should when urg/etc, then used the bit of code from drawsquares since it did what I was looking to do as the square only appeared on occupied tags. And I figured occ was occupied, and everything is working so far.
and defined " occupiedCol " in config.h so that it's easy enough to change.
col = dc.colors[ (m->tagset[m->seltags] & 1 << i ? 1:(urg & 1 << i ? 2:0))];
col2 = dc.colors[ (m->tagset[m->seltags] & 1 << i ? 1:(urg & 1 << i ? 2:occupiedCol))];
if( m == selmon && selmon->sel && selmon->sel->tags & 1 << i, occ & 1 << i ) {
drawtext(tags[i].name, col2, True);
drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i, occ & 1 << i, col2);
} else {
drawtext(tags[i].name, col, True);
drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i, occ & 1 << i, col);
}
Could probably be cleaned up a bit though. May not be great at this but I got the result I was looking for, lol.
result;
blue tag = occupied
green tag = selected
grey tag = empty
Last edited by Crunch (2012-05-19 23:51:18)
Registered Linux user #536591.
Offline
Is someone using dwm using with a higher resolution than wuxga (1920*1200) - if so, which tiling mode(s) are you using?
==================
| | | |
| Master | A | B |
| | | |
==================
Master and two slaves (A and B) would be ideal (2560*1440/1600).
Last edited by inch (2012-05-30 16:06:55)
Offline
I have applied uselessgap patch from suckless.org, but it doesn't seem to be doing what I expected.
For me it seems that the middle gap is just 2x wider because there are two windows and the gap is being applied for each of them, but I need it only once there.
1. How do I fix it ?
2. Why isn't it gapping vertically ( not visible in the screenshot, but if I have two windows to the right, they are not being separated at all ) ?
Any help appreciated!
Offline
I have applied uselessgap patch from suckless.org, but it doesn't seem to be doing what I expected.
For me it seems that the middle gap is just 2x wider because there are two windows and the gap is being applied for each of them, but I need it only once there.1. How do I fix it ?
2. Why isn't it gapping vertically ( not visible in the screenshot, but if I have two windows to the right, they are not being separated at all ) ?Any help appreciated!
https://bbs.archlinux.org/viewtopic.php … 8#p1050418
https://bbs.archlinux.org/viewtopic.php … 3#p1050873
Basically uselessgaps and the new tile function don't play well together.
I don't keep my patches separate any more, so many patches need tweaking to work with other patches that they become bespoke before too long, especially in my case when I'm reverting back to 5.9's tile function.
Here's my latest patch, incorporates uselessgaps, statuscolors, -nmaster, centre floating windows and click to focus - http://codepad.org/TF7xvzx2 - and the config.h - http://codepad.org/XFbFH5A4
Offline
MinimalBoot wrote:I have applied uselessgap patch from suckless.org, but it doesn't seem to be doing what I expected.
For me it seems that the middle gap is just 2x wider because there are two windows and the gap is being applied for each of them, but I need it only once there.1. How do I fix it ?
2. Why isn't it gapping vertically ( not visible in the screenshot, but if I have two windows to the right, they are not being separated at all ) ?Any help appreciated!
https://bbs.archlinux.org/viewtopic.php … 8#p1050418
https://bbs.archlinux.org/viewtopic.php … 3#p1050873Basically uselessgaps and the new tile function don't play well together.
I don't keep my patches separate any more, so many patches need tweaking to work with other patches that they become bespoke before too long, especially in my case when I'm reverting back to 5.9's tile function.
Here's my latest patch, incorporates uselessgaps, statuscolors, -nmaster, centre floating windows and click to focus - http://codepad.org/TF7xvzx2 - and the config.h - http://codepad.org/XFbFH5A4
Thank you! Works just fine and exactly the way I expected
Edit: Is it possible to add status bar padding ( i.e., a kind of useless gap around everything in there ) ?
Last edited by MinimalBoot (2012-06-04 20:12:52)
Offline
Like others, I wanted icons in dwm statusbar without conky/dzen, so I patched up DejaVu Sans with a few icons and made an AUR package: https://aur.archlinux.org/packages.php?ID=59867. This is literally my first time mucking around with fonts, though, so it could be better. If anyone else wants an easy way to add icons to dwm statusbar, you can use this too. The icons start at unicode a000; the list of icons is included in a text file. The font name is "DejaVu Sans Dwm icons" for those of you using the pango patch.
If anyone wants to improve the icons or font, please feel free and contact me.
Offline
Like others, I wanted icons in dwm statusbar without conky/dzen, so I patched up DejaVu Sans with a few icons and made an AUR package: https://aur.archlinux.org/packages.php?ID=59867. This is literally my first time mucking around with fonts, though, so it could be better. If anyone else wants an easy way to add icons to dwm statusbar, you can use this too. The icons start at unicode a000; the list of icons is included in a text file. The font name is "DejaVu Sans Dwm icons" for those of you using the pango patch.
If anyone wants to improve the icons or font, please feel free and contact me.
Is there any tutorial ( from the beginning to actually using those fonts ) available for customizing ( making icons ) fonts like DejaVu ( TTF ) and Dina ( TTF ) ?
Offline
Is there any tutorial ( from the beginning to actually using those fonts ) available for customizing ( making icons ) fonts like DejaVu ( TTF ) and Dina ( TTF ) ?
https://bbs.archlinux.org/viewtopic.php … 36#p724236
I just updated my font, termsyn, and included a README with some info. I haven't tried a ttf font.
Last edited by stlarch (2012-06-08 14:52:59)
Offline
MinimalBoot wrote:Is there any tutorial ( from the beginning to actually using those fonts ) available for customizing ( making icons ) fonts like DejaVu ( TTF ) and Dina ( TTF ) ?
https://bbs.archlinux.org/viewtopic.php … 36#p724236
I just updated my font, termsyn, and included a README with some info. I haven't tried a ttf font.
Saw your thread before, but .. how do I begin if the font is TTF ( for example, the ones that are included in ttf-ms-fonts package ), not PCF ?
Offline
Short answer: Use fontforge.
Longish answer: I started with the DejaVu Sans TTF font. I made the icons as SVG with Inkscape, since I couldn't figure out fontforge's internal editor. You have to be careful, though, since fontforge uses path traces, where the inside of paths is "black" and the outside is "white", so if you used shapes in Inkscape, you have to convert them to paths and Union/Difference them as necessary. Then, you import them into fontforge into the unicode hexes that are free (I used aXXX, which is reserved for Yi syllables normally), go to Elements->Font info and edit as necessary, and go to File->Generate font (NOT File->Save, since that just saves the project. This cost me a lot of time to figure out!) As for how to package fonts, the wiki has a nice piece on it.
Offline
Just a quick question that's not worth its own topic. How can I put multiple commands under the same keypress in config.h? I want to run both slock and use dpms to turn my screen off when I press Alt+L. I've tried different things but none of them work. Who can help me fix this little issue?
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Just a quick question that's not worth its own topic. How can I put multiple commands under the same keypress in config.h? I want to run both slock and use dpms to turn my screen off when I press Alt+L. I've tried different things but none of them work. Who can help me fix this little issue?
I don't know if it's possible in config.h, but you can put the commands into a bash script and then bind it to a key in config.h.
Last edited by OK100 (2012-06-11 19:35:01)
Offline
Unia wrote:Just a quick question that's not worth its own topic. How can I put multiple commands under the same keypress in config.h? I want to run both slock and use dpms to turn my screen off when I press Alt+L. I've tried different things but none of them work. Who can help me fix this little issue?
I don't know if it's possible in config.h, but you can put the commands in a script and then bind a key in config.h to that script.
I know - just wanted to try if this would be possible too. I think it's cleaner
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Why would it not be possible?
{ MODKEY, XK_l, spawn, SHCMD("command1 && command2") },
// or: { MODKEY, XK_l, spawn, SHCMD("command1; command2") },
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
How about...
static const char *slockdpmsoff[] = { "xset", "dpms", "force", "off", "&&", "slock", NULL };
and
{ MODKEY, XK_l, spawn, {.v = slockdpmsoff } },
Force dpms off first, otherwise it'll just start slock first and dpms off only after. This way it turns the monitor off first.
Edit: never mind, it doesn't work, dunno why. In theory it should, methinks. I use a bash script to do it, instead, because that's how I trigger most commands through keybindings... Just thought this would "naturally" work.
Last edited by Onyros (2012-06-11 22:18:31)
Offline
@Onyros, I had already tried that.
@Trilby, Thanks, that works.
But, what's the difference between using SHCMD and using
static const char *...[]
...
{ MODKEY, XK_l, spawn, {.v = ... } },
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Just look at the macro definition. SHCMD is defined right above the keybindings. My suggestion would be the same as
static const char *new_command[] = { "/bin/sh", "-c", "command1 && command 2", NULL }
...
{ MODKEY, XK_l, spawn, {.v = new_command } },
I see two differences: one functional, and one cosmetic. The functional difference (the reason that other way didn't work) was because it was missing "/bin/sh -c ".
The cosmetic difference needs little explanation beyond the existence of the macro in the first place: it is there so such invocations can be written in an intuitive and easy to read fashion. Not using the macro (IMHO) leads to ugly confusing code where you have to look at the variable name in the key binding then look somewhere else for the variable definition and read between all the "...","...","..." to figure out what it does. The variable definition method can be no better than the macro, because the preprocessor expands this macro to be exaclty that ugly notation before compiling.
I suppose as a third point, I'd argue that using the macro is less error prone (eg human error) as evidenced by this very issue.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Sorry, I meant the differences between using /bin/sh to launch application and using the other way (if that's any different).
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
The relevant part of the "spawn" function in dwm.c:
execvp(((char **)arg->v)[0], (char **)arg->v);
And see `man execvp`.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
The relevant part of the "spawn" function in dwm.c:
execvp(((char **)arg->v)[0], (char **)arg->v);
And see `man execvp`.
You do make me learn stuff
Thanks! Will look into it!
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Just noticed a tiny issue with the systray patch: when in monocle mode, it shows the border of the monocle window under the systray. I have the monocly-no-border patch so it shouldn't. Here's a scrot:
What part of the systray patch do I have to edit so it won't show?
Here's my patch:
http://pastebin.com/UERjKrUM
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline