You are not logged in.

#676 2012-04-02 18:57:20

madders
Member
From: Reading, UK
Registered: 2012-04-01
Posts: 13

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

Thanks for the quick replies guys.

Bohoomil - this is the approach I was thinking about. I was going to use xrandr to get the resolutions and calculate the centre in a wrapper script, but I'm not sure how the script would know which monitor the xterm window will be displayed on.

JokerBoy - I was initially hoping to avoid patching dwm.c, but its probably not a bad idea for me to start looking at this. So I think I'll try out your patch. Multumesc!

Offline

#677 2012-04-02 19:08:32

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

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

@madders: or you can try pygtk-shutdown from AUR.

Offline

#678 2012-04-02 19:23:06

Army
Member
Registered: 2007-12-07
Posts: 1,784

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

Just a suggestion, you can also use dmenu

#!/bin/sh
if [ -f $HOME/.dmenurc ]; then
	. $HOME/.dmenurc
else
	DMENU='dmenu -i'
fi
cmd=$(echo -e "shutdown\nreboot\nlock" | $DMENU)
case $cmd in
	shutdown)
		sudo shutdown -h now
		;;
	reboot)
		sudo shutdown -r now
		;;
	lock)
		slock
		;;
esac

Then I bound this script with the following in the config.h

...
static const char *dmenupowerbutton[] =      { "dmenu-powerbutton", NULL };
...
{ 0,                     0x1008ff2a,   spawn,          {.v = dmenupowerbutton } },

This keycode appeared on the Macbook Pro I used to use, but it also works on my new netbook, so it probably works everywhere smile

Last edited by Army (2012-04-02 19:24:01)

Offline

#679 2012-04-02 23:03:32

madders
Member
From: Reading, UK
Registered: 2012-04-01
Posts: 13

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

Thanks for the other suggestions.

@OK100 - I installed this, but it's not really the look I was after, and there were quite a few gtk dependencies I had to install. Also, my issue really was around displaying the shutdown window centered, which this doesn't address. But thanks for the suggestion - it's still good to know about it.

@Army - Using dmenu is a great idea, I hadn't thought about that option. But even so I'm gonna stick with the window for now since I spent a while getting it to look right. The keycode works for my shutdown button too - so thank you for sharing that - it's ideal. In my script I've used ConsoleKit and dbus to trigger the shutdown/restart (I added suspend and hibernate too), but I think I'm going to go back to using sudo shutdown like your script - it's much simpler - then I can uninstall ConsoleKit.

@JokerBoy - I got your patch working perfectly. It works great with multiple monitors too. I had to patch it manually because it looks like it has dependencies on some of your other patches. Your other patches look really useful too though, so I think I'll be borrowing a few of those too :-) I'm guessing that the numbering of each diff file is for the dependencies?

Offline

#680 2012-04-02 23:59:02

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 435

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

subscribed smile

Offline

#681 2012-04-03 06:27:33

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

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

Army wrote:

Just a suggestion, you can also use dmenu

#!/bin/sh
if [ -f $HOME/.dmenurc ]; then
	. $HOME/.dmenurc
else
	DMENU='dmenu -i'
fi
cmd=$(echo -e "shutdown\nreboot\nlock" | $DMENU)
case $cmd in
	shutdown)
		sudo shutdown -h now
		;;
	reboot)
		sudo shutdown -r now
		;;
	lock)
		slock
		;;
esac

Then I bound this script with the following in the config.h

...
static const char *dmenupowerbutton[] =      { "dmenu-powerbutton", NULL };
...
{ 0,                     0x1008ff2a,   spawn,          {.v = dmenupowerbutton } },

This keycode appeared on the Macbook Pro I used to use, but it also works on my new netbook, so it probably works everywhere smile

Nice script, thanks!
I replaced pygtk-shutdown with this.

Offline

#682 2012-04-03 08:35:19

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

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

madders wrote:

@JokerBoy - I got your patch working perfectly. It works great with multiple monitors too. I had to patch it manually because it looks like it has dependencies on some of your other patches. Your other patches look really useful too though, so I think I'll be borrowing a few of those too :-) I'm guessing that the numbering of each diff file is for the dependencies?

I know it does tongue I was using a dual-monitor setup till a few days ago.. The numbering is for keeping track in which order they can be applied. smile Cu placere. big_smile

Last edited by JokerBoy (2012-04-03 08:35:32)

Offline

#683 2012-04-04 23:26:34

wolfcore
Member
From: California
Registered: 2012-03-06
Posts: 137

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

Hey I'm trying to bind Mod + Tab to go to the next tag, and Mod + Tilde to go to the previous tag, but now that I think about it, I'm going about this the wrong way.

I've heard that tags are used differently than workspaces, and I read an article shared on this thread, but I still don't understand the workflow of pulling in tags and sending them out again, vs simply switching to # tag.

Can someone enlighten me?

Offline

#684 2012-04-04 23:44:33

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 19,031
Website

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

wolfcore wrote:

Hey I'm trying to bind Mod + Tab to go to the next tag, and Mod + Tilde to go to the previous tag, but now that I think about it, I'm going about this the wrong way.

The cycle patch does this.

I've heard that tags are used differently than workspaces, and I read an article shared on this thread, but I still don't understand the workflow of pulling in tags and sending them out again, vs simply switching to # tag.

Can someone enlighten me?

Just forget the workspace analogy and think in terms of pulling sets of different apps into view at any one time. I work from my first tag "base" and if I want to check mail, I just pull in that tag, do what I need and then togle it back out of view. Same with the other tags.

The one hack I would like to see to make this work seamlessly for me is to be able to pull the new tag to master, rather than into the stack.


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#685 2012-04-05 00:01:15

steve___
Member
Registered: 2008-02-24
Posts: 439

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

wolfcore wrote:

I've heard that tags are used differently than workspaces, and I read an article shared on this thread, but I still don't understand the workflow of pulling in tags and sending them out again, vs simply switching to # tag.

Can someone enlighten me?

I think switching 'view' and 'toggleview' makes life easier.
https://bbs.archlinux.org/viewtopic.php … 3#p1055143

Offline

#686 2012-04-05 05:12:15

wolfcore
Member
From: California
Registered: 2012-03-06
Posts: 137

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

jasonwryan wrote:
wolfcore wrote:

Hey I'm trying to bind Mod + Tab to go to the next tag, and Mod + Tilde to go to the previous tag, but now that I think about it, I'm going about this the wrong way.

The cycle patch does this.

I've heard that tags are used differently than workspaces, and I read an article shared on this thread, but I still don't understand the workflow of pulling in tags and sending them out again, vs simply switching to # tag.

Can someone enlighten me?

Just forget the workspace analogy and think in terms of pulling sets of different apps into view at any one time. I work from my first tag "base" and if I want to check mail, I just pull in that tag, do what I need and then togle it back out of view. Same with the other tags.

The one hack I would like to see to make this work seamlessly for me is to be able to pull the new tag to master, rather than into the stack.

steve___ wrote:
wolfcore wrote:

I've heard that tags are used differently than workspaces, and I read an article shared on this thread, but I still don't understand the workflow of pulling in tags and sending them out again, vs simply switching to # tag.

Can someone enlighten me?

I think switching 'view' and 'toggleview' makes life easier.
https://bbs.archlinux.org/viewtopic.php … 3#p1055143

Thanks guys, I've switched view with toggleview, although to me it would seem better to switch view with toggleview, and then view with tag?
Like this:

#define TAGKEYS(KEY,TAG) \
    { MODKEY,                       KEY,      toggleview,     {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask,           KEY,      tag,            {.ui = 1 << TAG} }, \
    { MODKEY|ShiftMask,             KEY,      view,           {.ui = 1 << TAG} }, \
    { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },

Seems like I use tag much less than view, and shift is more comfortable to press roll

Anyways... I like this new workflow. Spins like a dream.

Edit: now that I think about it...

Last edited by wolfcore (2012-04-05 05:14:46)

Offline

#687 2012-04-05 16:26:59

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,472
Website

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

Hello,

Somehow I can not get DWM to start after (succesfully) having applied statuscolor patch. There are no errors during patching and no errors uring compiling, but when X starts with my DWM session, no bar is showing and none of my keybindings work. All I see is my dzen2 and conky. I start DWM with a startdwm script as found in the Wiki but there is nothing at all in the ~/.dwm.log file.

Here's my config.h and statuscolor patch


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

#688 2012-04-05 16:59:54

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

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

Unia wrote:

Hello,

Somehow I can not get DWM to start after (succesfully) having applied statuscolor patch. There are no errors during patching and no errors uring compiling, but when X starts with my DWM session, no bar is showing and none of my keybindings work. All I see is my dzen2 and conky. I start DWM with a startdwm script as found in the Wiki but there is nothing at all in the ~/.dwm.log file.

Here's my config.h and statuscolor patch

The config.h needs to reflect the changes too. It looks like the patch you're using only patches dwm.c. You can try jasonwryan's statuscolors patch, http://beta.intuxication.org/jasonwryan … s-6.0.diff . It includes the config.h part. It uses 9 colors.

edit:spelling(your -> you're, dooh)

Last edited by stlarch (2012-04-05 22:21:03)

Offline

#689 2012-04-05 18:11:27

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,472
Website

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

stlarch wrote:
Unia wrote:

Hello,

Somehow I can not get DWM to start after (succesfully) having applied statuscolor patch. There are no errors during patching and no errors uring compiling, but when X starts with my DWM session, no bar is showing and none of my keybindings work. All I see is my dzen2 and conky. I start DWM with a startdwm script as found in the Wiki but there is nothing at all in the ~/.dwm.log file.

Here's my config.h and statuscolor patch

The config.h needs to reflect the changes too. It looks like the patch your using only patches dwm.c. You can try jasonwryan's statuscolors patch, http://beta.intuxication.org/jasonwryan … s-6.0.diff . It includes the config.h part. It uses 9 colors.

I took the config.h and patch from OK100's GitHub, but after his patch didn't work I picked Jokerboy's. They both patched without errors, so I don't think/suspect anything is wrong with either the patch or the config.h. You have more experience than I have though, so I'll try JWR's now


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

#690 2012-04-05 22:29:56

wolfcore
Member
From: California
Registered: 2012-03-06
Posts: 137

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

How can I check if there are any clients associated with a tag? I want to have a keybinding that either opens a program in a specified tag if there is no program with that tag, or execs toggleview to that tag if the program is already running.

Offline

#691 2012-04-05 22:35:58

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,472
Website

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

stlarch wrote:

The config.h needs to reflect the changes too. It looks like the patch you're using only patches dwm.c. You can try jasonwryan's statuscolors patch, http://beta.intuxication.org/jasonwryan … s-6.0.diff . It includes the config.h part. It uses 9 colors.

edit:spelling(your -> you're, dooh)

Thanks for your help! I realised what I was doing wrong and now it all works just fine 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

#692 2012-04-06 01:25:33

skrite
Member
Registered: 2009-09-07
Posts: 160

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

is there a way i can move a floating window behind one that is maximized? It seems that even if focus is on a window in the background and there is a non-tiled window open, it has to be open in the forground.
Thanks for any tips.

Offline

#693 2012-04-06 10:36:17

Army
Member
Registered: 2007-12-07
Posts: 1,784

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

skrite, I asked for this on the mailing list a few weeks ago, here's a patch which shows you how it's done. I actually use this one and like it a lot.

diff -paur dwm.old/dwm.c dwm.new/dwm.c
--- dwm.old/dwm.c	2012-03-31 21:33:15.129154942 +0200
+++ dwm.new/dwm.c	2012-03-31 21:34:13.809628624 +0200
@@ -1443,13 +1443,12 @@ restack(Monitor *m) {
 	drawbar(m);
 	if(!m->sel)
 		return;
-	if(m->sel->isfloating || !m->lt[m->sellt]->arrange)
-		XRaiseWindow(dpy, m->sel->win);
+	XRaiseWindow(dpy, m->sel->win);
 	if(m->lt[m->sellt]->arrange) {
 		wc.stack_mode = Below;
 		wc.sibling = m->barwin;
 		for(c = m->stack; c; c = c->snext)
-			if(!c->isfloating && ISVISIBLE(c)) {
+			if(c != m->sel && !c->isfloating && ISVISIBLE(c)) {
 				XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
 				wc.sibling = c->win;
 			}

Offline

#694 2012-04-06 13:40:37

skrite
Member
Registered: 2009-09-07
Posts: 160

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

Army: wow, thanks, that worked perfectly.

Offline

#695 2012-04-07 02:02:02

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,998
Website

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

I just switched over from xmonad to dwm.  I'm loving it so far.

I have yet to catch up on this thread; I'm up to page 16 and I plan to skim it all for good ideas, but I have one "patch" of my own which isn't worth a patch file but I like:

Make the layout symbol (or icon, thanks to termsyn font) a different color (with colorstatus patch) by changing line 472 of dwm.c in function drawbar

drawtext(m->ltsymbol, dc.colors[4], False);        // changed [4] from [0]

This may seem simple, but as I had to look for the right line to change, this might speed/ease the process for someone else.

EDIT: It's line 472 after the color status patch has been applied to an otherwise "vanilla" dwm 6.0

AFTER-THOUGHT: If others find this useful, and given this line is already changed by the color status patch, perhaps the patched line could be adjusted to include a constant that would be placed in the config.h.  In other words

dwm.c

drawtext(m->ltsymbol, dc.colors[LAYOUT_SYM_COLOR], False); 

config.h

#define LAYOUT_SYM_COLOR      0

Last edited by Trilby (2012-04-07 02:12:52)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#696 2012-04-07 20:10:15

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,998
Website

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

REQUEST: hide unfocused windows in monocle layout

Coming from xmonad this is a behavior I took for granted.  In dwm's monocle mode if I have a semi-transparent terminal ("true" transparency w/ xcompmgr) focused in monocle mode, I end up seeing other clients behind the terminal rather than the desktop.

While I know I could switch to pseudo-transparency, it ends up a bit choppy and ugly (when urxvt is resized it takes a moment to redraw the background).

If anyone has already implemented this please let me know.  Alternately if you know a good place to start, hints would be appreciated.  Otherwise, when I get some time, my plan is to look at the transparency patch to get hints on where to start.  I figure this is a good start as if I can get dwm to set all non-focused clients to fully transparent in moncle mode only I'd have the behavior I want.

Last edited by Trilby (2012-04-07 20:10:26)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#697 2012-04-08 14:04:23

ivoarch
Member
From: the six feet under the ground
Registered: 2011-03-31
Posts: 436

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

@Trilby 

Make the layout symbol (or icon, thanks to termsyn font) a different color (with colorstatus patch) by changing line 472 of dwm.c in function drawbar

I created two patches for this 
+
bg color
fg color

symbolcolor.diff (colored layout symbol)
https://github.com/ivoarch/dwm-patches/ … color.diff

dwm-6.0-xbm_layout_icons.plus.diff (based on "ok100" patch) + colored layout symbol and icons
https://github.com/ivoarch/dwm-patches/ … .plus.diff

For use with statuscolor.patch

just replace; 

dc.norm  , dc.sel     

whit

dc.colors[0]  dc.colors[1]

Last edited by ivoarch (2012-04-08 18:27:14)


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

Offline

#698 2012-04-08 16:57:42

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,472
Website

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

I need some help "creating" a patch. In the March screenshot thread, I saw a scrot of Kaptenen's DWM which had colors bars on the tags instead of the squares. He linked me to a January screenshot topic post that explained how to do so and so I am getting those bits together in a patch. The first half works, but the second doesn't. As soon as I add the ltcol stuff, I get

dwm.c:773:9: fout: ‘ltcol’ undeclared (first use in this function)
dwm.c:773:9: note: each undeclared identifier is reported only once for each function it appears in

How can I solve that? Here's my working patch so far: http://pastebin.com/Uvep94he
And here's what it has to be: http://pastebin.com/5JyfDZbx

PS: Also, with the working one, I get

dwm.c: In functie ‘drawbar’:
dwm.c:769:2: let op: impliciete declaratie van functie ‘drawborder’ [-Wimplicit-function-declaration]
dwm.c: Op bovenste niveau:
dwm.c:823:1: let op: conflicting types for ‘drawborder’ [enabled by default]
dwm.c:769:2: note: previous implicit declaration of ‘drawborder’ was here

Although it does built, I'd like to get rid of those messages. Do I have to declare a function somewhere? How?

Thanks in advance guys!


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

#699 2012-04-08 17:31:37

ivoarch
Member
From: the six feet under the ground
Registered: 2011-03-31
Posts: 436

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

@Unia
 
Try so

http://pastebin.com/Q4WgHU27

Last edited by ivoarch (2012-04-08 17:35:08)


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

Offline

#700 2012-04-08 19:57:56

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,472
Website

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

ivoarch wrote:

Hm, I took the parts from that patch that mine didn't have and integrated them, but now the lines above tag names look "off center" in regarding to the tag names. You can see here in the scrot:

tZGIxNA

The only part I didn't integrate from yours is the last, because I couldn't find any lines in my dwm.c that looked like that. Perhaps this is the cause?

EDIT: I took a second look, and it's not the lines that're off - it's the tag names. Without the patch, there's a little whitespace between the left edge of my screen and the first tag name. With the patch, there's none. Here's a normal one to compare:

tZGIxNg

Last edited by Unia (2012-04-08 20:00:26)


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