You are not logged in.

#1451 2015-12-12 15:34:02

synorgy
Member
From: $HOME
Registered: 2005-07-11
Posts: 272
Website

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

@null: I've got centerclock working with latest head. I don't have a patch worked up, but you should be able to steal my drawbar implemtation (which is here: https://github.com/bbenne10/dwm/blob/master/dwm.c#L715) and it should "just work". Hope this helps!

Has anyone found (or put together) a working Pango patch for latest head? I know it's probably low priority for most as Xft is good enough in most cases, but I'm interested in keeping my bar setup the same, and it depends on pango's set_layout_markup functionality. Unfortunately, I've not quite had the time to fully understand the new drw.{c,h} changes. (Part-time Master's student + Fulltime job keeps me busy enough tongue)

EDIT: @null: That version depends on "clockformat" from Unia's patch. You might also want to up the length of the allocated char array.

Last edited by synorgy (2015-12-12 15:35:49)


"Unix is basically a simple operating system, but you have to be a genius to understand the simplicity." (Dennis Ritchie)

Offline

#1452 2015-12-12 15:45:34

synorgy
Member
From: $HOME
Registered: 2005-07-11
Posts: 272
Website

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

Sorry for the noise, but I just went back and found holomorph's Pango patch. I'll try that out and get back to you all.


"Unix is basically a simple operating system, but you have to be a genius to understand the simplicity." (Dennis Ritchie)

Offline

#1453 2015-12-12 16:50:20

synorgy
Member
From: $HOME
Registered: 2005-07-11
Posts: 272
Website

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

@holomorph: I'm not sure what you meant by "broken" in your pango diff, but it works perfectly for me. I just hand patched it into my dwm setup and it seems to be working very well!


"Unix is basically a simple operating system, but you have to be a genius to understand the simplicity." (Dennis Ritchie)

Offline

#1454 2015-12-12 17:11:20

lounge
Member
Registered: 2015-03-01
Posts: 23

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

Ocypheum wrote:

Fixed another bug in statuscolors patch. Get the latest here.

I tried to patch this one and faild

patching file drw.c
patching file drw.h
patching file dwm.c
Hunk #1 FAILED at 51.
Hunk #2 succeeded at 263 with fuzz 2 (offset 2 lines).
Hunk #3 FAILED at 718.
Hunk #4 FAILED at 807.
Hunk #5 succeeded at 1041 (offset -24 lines).
Hunk #6 succeeded at 1572 (offset -8 lines).
patch unexpectedly ends in middle of line
Hunk #7 FAILED at 1745.
4 out of 7 hunks FAILED -- saving rejects to file dwm.c.rej

I compared dwm.c.rej with dwm.c and changed errors ,but now i got 7Out of 7 hunks failed.

Last edited by lounge (2015-12-12 19:07:07)

Offline

#1455 2015-12-13 14:01:31

synorgy
Member
From: $HOME
Registered: 2005-07-11
Posts: 272
Website

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

@lounge: It might be easier to try and hand patch it in rather than change the diff itself. It is often pretty simple to see where things "should" go based on intuition. Those things which confuse patch tend not to confuse the human eye quite so much.

I may also suggest ditching the statuscolors patch altogether and use the pango patch to apply markup to the status area. You can see what Pango offers here: https://developer.gnome.org/pango/stabl … ormat.html. I think you'll find that it offers a lot more flexibility than the statuscolors patch. Pango is also signficantly easier to patch in than it used to be.


"Unix is basically a simple operating system, but you have to be a genius to understand the simplicity." (Dennis Ritchie)

Offline

#1456 2015-12-13 16:19:20

bstaletic
Member
Registered: 2014-02-02
Posts: 658

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

I'd like to ask for someone to port tab patch to dwm-6.1. The only patches I apply are tab and pertag. I have tried appliing the patch manually, reading the latest git based tab patch and making (what I thought were) appropriate changes.

The problem with my dwm.c is when running dwm xorg just cleanly exits, so nothing can be found in the logs. Or I just don't know where to look.

Here are my hand patched dwm.c.

The tab patch contains part that edits config.h, but that part (I assume) is fine, and there's part of the patch that edits dwm.1, but since that is a man page it should be irrelevant for how dwm executes.

If I had more time I'd start debugging, but currently I've been having so little time to myself. That said I will be able to test a patch if anyone provides one.Thanks in advance.

EDIT:
I've discovered fancybar and dualstatus patches, both updated for dwm-6.1. In combination they can easily replace tab patch, so in the mean time I'll be using that.

Last edited by bstaletic (2015-12-14 19:48:12)

Offline

#1457 2015-12-16 20:46:54

parazyd
Member
From: Amsterdam
Registered: 2012-10-14
Posts: 259
Website

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

Is there a patch that will make the bar act like AwesomeWM when it comes to windows?
Like, not having only the current active window title on the bar, but all the windows on the current tag(s)?

/edit

Clickablefancybar is supposed to do it... Will see how it works.

Last edited by parazyd (2015-12-16 22:38:39)

Offline

#1458 2015-12-16 23:17:19

bstaletic
Member
Registered: 2014-02-02
Posts: 658

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

parazyd,

That's what fancybar is for.

Offline

#1459 2015-12-17 01:28:47

jsoy9pQbYVNu5nfU
Member
Registered: 2013-04-19
Posts: 108

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

I often use mpv for listening to music. I wrote a simple function that lets dwm control mpv via is UNIX domain socket interface. This should work on many versions of dwm.

Required global variable in config.h: path to the socket.

/* Note that on many systems, the maximum length of this path is limited
 * to 108 bytes */
static const char mpvsocket[] = "/home/joj/.mpv.socket";

Callback in dwm.c. Other mpv commands can be added very easily.

#include <sys/un.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>

enum
{
  MpvToggle,
  MpvNext,
  MpvPrev,
  MpvMuteVolume,
  MpvRaiseVolume,
  MpvLowerVolume,
  MpvSeekAhead10,
  MpvSeekBehind10,
  MpvSeekAhead30,
  MpvSeekBehind30,
  MpvQuit,
  MpvNextChapter,
  MpvPrevChapter,
  MpvSwitchAudioChannel
};

void
mpvcmd(const Arg *a)
{
  int sfd;
  struct sockaddr_un addr;

  if((sfd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
    return;
  memset(&addr, 0, sizeof(struct sockaddr_un));
  addr.sun_family = AF_UNIX;
  strncpy(addr.sun_path, mpvsocket, sizeof(addr.sun_path)-1);

  if(connect(sfd, (struct sockaddr*)&addr, sizeof(struct sockaddr_un)) == -1)
  {
    close(sfd);
    return;
  }

/* When defining additional actions, note that every command must be
 * terminated by a newline '\n' character.  */
#define mpv_send(msg) \
  {\
    int tmp __attribute__((unused)) = write(sfd, msg, sizeof(msg)-1); \
  }
  switch(a->i)
  {
    case MpvToggle:
      mpv_send("cycle pause\n");
      break;
    case MpvLowerVolume:
      mpv_send("add volume -1\n");
      break;
    case MpvRaiseVolume:
      mpv_send("add volume +1\n");
      break;
    case MpvMuteVolume:
      mpv_send("cycle mute\n");
      break;
    case MpvNext:
      mpv_send("playlist_next\n");
      break;
    case MpvPrev:
      mpv_send("playlist_prev\n");
      break;
    case MpvSeekAhead10:
      mpv_send("seek +10\n");
      break;
    case MpvSeekAhead30:
      mpv_send("seek +30\n");
      break;
    case MpvSeekBehind10:
      mpv_send("seek -10\n");
      break;
    case MpvSeekBehind30:
      mpv_send("seek -30\n");
      break;
    case MpvQuit:
      mpv_send("quit\n");
      break;
    case MpvNextChapter:
      mpv_send("add chapter +1\n");
      break;
    case MpvPrevChapter:
      mpv_send("add chapter -1\n");
      break;
    case MpvSwitchAudioChannel:
      mpv_send("switch_audio\n");
      break;
  }
#undef mpv_send

  close(sfd);
}

Example keybindings:

  { MODKEY,                       XK_z,                       mpvcmd, { .i = MpvPrev }},
  { MODKEY,                       XK_g,                       mpvcmd, { .i = MpvToggle }},
  { MODKEY,                       XK_v,                       mpvcmd, { .i = MpvNext }},

The code is part of my own dwm setup.

Compile with -std=c99 or -std=gnu99.

Offline

#1460 2015-12-20 10:21:03

lounge
Member
Registered: 2015-03-01
Posts: 23

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

I got another problem patching fancybarclickable ,theres no rejects so i dont know what to do from here or theres something wrong wit the patch?

patch -p1 < dwm-6.1-fancybarclickable.diff
patching file config.def.h
patching file dwm.c
Hunk #1 succeeded at 131 (offset 2 lines).
Hunk #2 succeeded at 167 (offset 2 lines).
Hunk #3 succeeded at 438 (offset 2 lines).
Hunk #4 succeeded at 452 (offset 2 lines).
Hunk #5 FAILED at 698.
patch: **** malformed patch at line 199: @@ -804,6 +890,51 @@ focus(Client *c) {

Offline

#1461 2016-01-01 14:19:16

null
Member
Registered: 2009-05-06
Posts: 398

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

@synorgy:
Thanks, your code for the center clock is working great smile

Last edited by null (2016-01-01 14:19:35)

Offline

#1462 2016-01-07 14:58:49

4bytes
Member
Registered: 2015-10-26
Posts: 7

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

Ocypheum wrote:

Fixed another bug in statuscolors patch. Get the latest here.

Thank you for the patch.

I have the following line in my dwmstatus.c:
status = smprintf("BAT:\x06%s\x01....", bat...);

and the result is the following:
IXtVmaU.png

How can I remove white spaces between BAT: 95 MAIL....?

Thank you in advance!

Offline

#1463 2016-01-07 16:52:00

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

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

4bytes, based on what you've provided there, there'd be no white space - unless it is inserted 'upstream' of that line into the bat variable.  What dwmstatus.c are you using (e.g. where is *your* dwmstatus.c, there are *many* versions of it out there).

EDIT: oops!  Sorry, I didn't realize suckless was now providing a dwmstatus.c  But the same still holds - the line you showed is not in the suckless supplied template, so what is in yours that fills the bat variable?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#1464 2016-01-07 19:26:04

null
Member
Registered: 2009-05-06
Posts: 398

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

There seems to be extra space between text in different colors with the patch. I also got this with the same script as before that didn't had spaces.

Offline

#1465 2016-01-07 21:33:03

Shibumi
Package Maintainer (PM)
Registered: 2013-04-14
Posts: 41
Website

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

Hello everybody,
Maybe you can help me. I am using the statuscolor patch with the following settings:

#define NUMCOLORS         5
static const char colors[NUMCOLORS][MAXCOLORS][8] = {
  // border   foreground background
  { "#444444", "#bbbbbb", "#000000" },  // normal
  { "#005577", "#eeeeee", "#005577" },  // selected
  { "#ff0000", "#eeeeee", "#007722" },  // up
  { "#444444", "#eeeeee", "#772200" },  // down
  { "#444444", "#eeeeee", "#775e00" }  // middle
  // add more here
};

Furthermore I am using this custom script https://paste.archlinux.de/YrJ8Vg/ . When I execute it, it looks like this: https://paste.archlinux.de/NY7f/ .

My problem is that DWM is using a lot CPU Power when I execute it. Even when I just execute the script once and stop it, DWM will still use a lot of CPU (about 20-40% on both cores of my AMD E2 Vision Dualcore). Only when I reset the statusbar via: xsetroot -name "bla" the usage goes down.

I know, my bash-script is also not very efficient. But my bash-script only needs about 1% of my CPU.. If I use DWM with so much colours, DWM needs 20-40% CPU at highest and 5% in idle..  Maybe it's a bug in statuscolours?

Offline

#1466 2016-01-07 22:13:36

4bytes
Member
Registered: 2015-10-26
Posts: 7

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

Trilby wrote:

4bytes, based on what you've provided there, there'd be no white space - unless it is inserted 'upstream' of that line into the bat variable.  What dwmstatus.c are you using (e.g. where is *your* dwmstatus.c, there are *many* versions of it out there).

EDIT: oops!  Sorry, I didn't realize suckless was now providing a dwmstatus.c  But the same still holds - the line you showed is not in the suckless supplied template, so what is in yours that fills the bat variable?

Please look at my dwmstatus.c here

Offline

#1467 2016-01-12 17:19:50

jgr
Member
Registered: 2015-12-21
Posts: 8

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

For anyone having whitespace issues with the dwm statuscolors patch: https://github.com/jgrar/dwm-patches/tr … atuscolors. Note: patch applies to latest git.

PS. I'm updating a number of patches to apply to latest git (that don't already) and I will try to keep that going for as long as I can, open to requests.

Offline

#1468 2016-01-13 00:19:42

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

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

Thanks jgr: I'm going to merge your post with the dwm hacks thread, as there is an active interest in this patch there...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#1469 2016-01-14 07:41:19

kanazky
Member
From: Vancouver, Canada
Registered: 2011-11-02
Posts: 70

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

Hey guys,

I tried patching my DWM with better-borders, fancy bar, status colors, systray and uselessgaps. However I am now full of errors when making the files. Has anyone got a working dwm 6-1 with these patches applied I can have?

Link to my broken copy:
https://github.com/jakesteele/dwm-6-1

UPDATE:

Sorry, wasn't looking for support on fixing my copy but rather for someone else's similarly patched copy from the thread that I can then use as ground work.

Last edited by kanazky (2016-01-14 19:22:20)


Archlinx + DWM big_smile I love Wingo-WM Bring it back!!

Offline

#1470 2016-01-14 08:01:10

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

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

This isn't a general dwm support thread.

Open a new thread and include a lot more information; like which patches apply cleanly and which fail and what "full of errors" means:
https://bbs.archlinux.org/viewtopic.php?id=57855


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#1471 2016-01-20 12:24:03

4bytes
Member
Registered: 2015-10-26
Posts: 7

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

jgr wrote:

For anyone having whitespace issues with the dwm statuscolors patch: https://github.com/jgrar/dwm-patches/tr … atuscolors. Note: patch applies to latest git.

PS. I'm updating a number of patches to apply to latest git (that don't already) and I will try to keep that going for as long as I can, open to requests.

Hey jgr,

Thank you for your afford to make statuscolors work.
I have applied your patch, but I have some problems with "eating characters" on dwmstatus. Please look at the picture below:
http://i.imgur.com/QZ8pmBg.png

Could you please help?

Thank you in advance.

Offline

#1472 2016-01-20 14:07:57

jgr
Member
Registered: 2015-12-21
Posts: 8

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

4bytes wrote:
jgr wrote:

For anyone having whitespace issues with the dwm statuscolors patch: https://github.com/jgrar/dwm-patches/tr … atuscolors. Note: patch applies to latest git.

PS. I'm updating a number of patches to apply to latest git (that don't already) and I will try to keep that going for as long as I can, open to requests.

Hey jgr,

Thank you for your afford to make statuscolors work.
I have applied your patch, but I have some problems with "eating characters" on dwmstatus. Please look at the picture below:
http://i.imgur.com/QZ8pmBg.png

Could you please help?

Thank you in advance.

Hi 4bytes,

Thanks for trying out the patch. It would be great if you posted this as an issue to the repo, you are more than welcome to! I just don't want to feel like I'm hijacking the thread, unless the mods are ok with it.

A couple of things I want to know:

  • Just to confirm nothing else might be causing the issue; did you apply this patch with no other patches and only your statusbar?

  • I see that the status text has been truncated at the end (at the elipses "...") is it eating any other characters in your status text?

  • Can I please have your statusbar code?

I haven't extensively tested this patch and I did make some dramatic changes to how the patch calculates the total width of colored text. I'll try a few things to see if I can reproduce what you're seeing and get back to you with an update.

Thanks,
jgr

Last edited by jgr (2016-01-20 14:09:21)

Offline

#1473 2016-01-21 09:49:16

4bytes
Member
Registered: 2015-10-26
Posts: 7

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

jgr wrote:

Thanks for trying out the patch. It would be great if you posted this as an issue to the repo, you are more than welcome to! I just don't want to feel like I'm hijacking the thread, unless the mods are ok with it.

Which repo are you talking about? I was and am building dwm from here: git://git.suckless.org/dwm

jgr wrote:
  • Just to confirm nothing else might be causing the issue; did you apply this patch with no other patches and only your statusbar?

  • I see that the status text has been truncated at the end (at the elipses "...") is it eating any other characters in your status text?

  • Can I please have your statusbar code?

Yes. I applied your patch for both versions of my dwm (with patches: pertag, syst`ray, push and fancybar) and also I have applied your patch on the 'clean' version of dwm. Unfortunately I had the same result.
One more interesting thing: the more I colorize items (icons or text) on the status bar, the more characters are eaten.

Here is the latest version of my dwmstatus: http://ix.io/nmT
It is without colors but the issue is also reproduced with it. You can append colors in this section:

		status = smprintf("%s %s "
                          "%s %s "
                          "%s %s "
                          "%s %s "
                          "%s %s "
                          "%s %s",
                          volume, SEPR_ICON,
                          battery, SEPR_ICON,
                          WTHR_ICON, wthr, SEPR_ICON,
                          MAIL_ICON, nmail, SEPR_ICON,
                          TIME_ICON, tmkv);
jgr wrote:

I haven't extensively tested this patch and I did make some dramatic changes to how the patch calculates the total width of colored text. I'll try a few things to see if I can reproduce what you're seeing and get back to you with an update.

Thank you very much.

Offline

#1474 2016-01-21 20:20:22

jgr
Member
Registered: 2015-12-21
Posts: 8

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

4bytes wrote:

Here is the latest version of my dwmstatus: http://ix.io/nmT
It is without colors but the issue is also reproduced with it. You can append colors in this section:

I am yet to reproduce this. Here is your dwmstatus on my statuscolors-patched-only branch of dwm with random colors added:

DItIYB

I should have asked this before but what are your locale settings? And what fonts are you using?

Offline

#1475 2016-01-22 11:27:29

4bytes
Member
Registered: 2015-10-26
Posts: 7

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

jgr wrote:
4bytes wrote:

Here is the latest version of my dwmstatus: http://ix.io/nmT
It is without colors but the issue is also reproduced with it. You can append colors in this section:

I am yet to reproduce this. Here is your dwmstatus on my statuscolors-patched-only branch of dwm with random colors added:

http://paste.click/DItIYB

I should have asked this before but what are your locale settings? And what fonts are you using?

Sure. Please look at the output below:

int@sophie ~/dev/dwm $ grep -A3 '*fonts' config.def.h 
static const char *fonts[] = {
    "DejaVu Sans:size=10.5",
    "FontAwesome:size=10.5",
};

Locale:

int@sophie ~ $ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Last edited by 4bytes (2016-01-22 15:26:39)

Offline

Board footer

Powered by FluxBB