You are not logged in.

#751 2012-05-19 04:08:37

Crunch
Member
From: -+-
Registered: 2011-02-17
Posts: 56

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

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

#752 2012-05-19 10:19:50

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

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


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

#753 2012-05-19 10:24:51

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

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

A question that just came to my mind: Does anybody here use Mercurial patch queues to maintain a stack of patches?

Offline

#754 2012-05-19 23:47:43

Crunch
Member
From: -+-
Registered: 2011-02-17
Posts: 56

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

Unia wrote:
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

tZHRmZg

Last edited by Crunch (2012-05-19 23:51:18)


Registered Linux user #536591.

Offline

#755 2012-05-30 16:06:21

inch
Member
Registered: 2010-12-21
Posts: 49

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

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

#756 2012-06-04 19:34:34

MinimalBoot
Member
Registered: 2012-05-01
Posts: 38

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

tZTM2Zw

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

#757 2012-06-04 19:49:12

Meyithi
Member
From: Wirral, UK
Registered: 2009-06-21
Posts: 550
Website

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

MinimalBoot wrote:

http://ompldr.org/tZTM2Zw

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


The mind roams more freely in empty rooms.
dwm - colours - ncmpcpp - system
irc://irc.freenode.net:meyithi

Offline

#758 2012-06-04 20:06:11

MinimalBoot
Member
Registered: 2012-05-01
Posts: 38

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

Meyithi wrote:
MinimalBoot wrote:

http://ompldr.org/tZTM2Zw

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

Thank you! Works just fine and exactly the way I expected smile

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

#759 2012-06-08 06:24:48

darkfeline
Member
Registered: 2012-02-14
Posts: 94

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

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

#760 2012-06-08 14:38:16

MinimalBoot
Member
Registered: 2012-05-01
Posts: 38

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

darkfeline wrote:

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

#761 2012-06-08 14:47:25

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

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

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.

Last edited by stlarch (2012-06-08 14:52:59)

Offline

#762 2012-06-08 16:30:28

MinimalBoot
Member
Registered: 2012-05-01
Posts: 38

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

stlarch wrote:
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

#763 2012-06-08 22:43:20

darkfeline
Member
Registered: 2012-02-14
Posts: 94

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

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

#764 2012-06-09 09:23:04

ivoarch
Member
Registered: 2011-03-31
Posts: 436

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

@ darkfeline
Please this is dwm thread, use other for your issue...


I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#765 2012-06-11 19:16:22

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

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? smile


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

#766 2012-06-11 19:33:16

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 455

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

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? smile

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

#767 2012-06-11 19:33:48

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

OK100 wrote:
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? smile

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 wink


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

#768 2012-06-11 21:19:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,422
Website

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

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

Online

#769 2012-06-11 21:38:48

Onyros
Member
From: Lisbon, Portugal
Registered: 2007-10-11
Posts: 307

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

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

#770 2012-06-12 16:03:34

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

@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

#771 2012-06-12 16:55:32

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,422
Website

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

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

Online

#772 2012-06-12 17:18:03

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

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

#773 2012-06-12 17:28:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,422
Website

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

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

Online

#774 2012-06-12 17:29:19

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

Trilby wrote:

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 big_smile

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

#775 2012-06-15 17:34:12

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

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:
tZWNtZA

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

Board footer

Powered by FluxBB