You are not logged in.
It's 9menu so right-click behaves like Openbox root menu. The C code works I just don't know how to include this in dwm.
#include <stdio.h>
#include <stdlib.h>
#define MENUSCRIPT "\
#!/bin/sh \n\
9menu -teleport -warp -popup -bg \"#101010\" -fg \"#c0c0c0\" -font \"-*-dejavu sans mono-medium-r-*-*-17-*-*-*-*-*-*-*\" \
\"Run\":\"dmenu_run -b -fn 'DejaVu Sans Mono-15' -nb '#101010' -nf '#c0c0c0' -sb '#c0c0c0' -sf '#101010' &\" \
\"Ranger\":\"xterm -e ranger &\" \
\"Firefox\":\"firefox &\" \
\"Geany\":\"geany &\" \
\"Terminal\":\"xterm &\" \
----------: \
\"Exit\":exit \n\
"
int main()
{
system(MENUSCRIPT);
return 0;
}
Offline
Calling System() to execute a shell to just in turn run a different binary is ridiculous. Just run 9menu with it's parameters through dwm's built in exec.
static const char *menucmd[] = { "9menu", "-teleport", "-warp", ... , NULL };
Fill in the dots with all your other parameters for 9menu.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Pretty sure I've seen this done, but is there a patch that will remove the window title from the statusbar, or will that require some editing of dwm.c?
Offline
Pretty sure I've seen this done, but is there a patch that will remove the window title from the statusbar, or will that require some editing of dwm.c?
Although it's old and may no longer apply cleanly, this might be what you want. It will at least point you to the relevant lines of code.
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
Thanks; that's prpbably where I origianlly saw the patch.
Edit - and you're right, it no longer applies cleanly.
Last edited by PackRat (2017-03-06 01:57:10)
Offline
Hi, I've tried a few of WMs (i3wm, dwm, awesomeWM), I think I'm mostly satisfied with dwm.. I use pertag, tilegap and movestack patches from official site... But there's a thing that bothers me most... It's that I'm unable to change the height of the windows, I currently don't have a much time to look into it, but I've searched before and haven't managed to find patch like that... Has anyone tried that or seen patch for this? Thanks for anyone's reply
Offline
matej, can you clarify what you want? How do you want to change the height of the windows: manually, or change a default height? Tilers generally have windows fill the available space within their tiled region, so I'm not really clear what changing the height would mean unless you want to leave a gap at the top or bottom of the screen. Alternatively, do you mean manually change window height either with mouse resizing or a keybinding?
EDIT: oops, in hindsight there is a meaning that seems more likely, but if you could confirm this is what you want it'd still be helpful: do you mean within the stack (e.g. windows on the right half of the screen in rstack mode) change the portion of the vertical height given to each window?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
that edit i don't want gaps, i just want to be able change height of a window in the stack
EDIT:
maybe this? http://dwm.suckless.org/patches/cfacts i need to look into it, still last versin 6.1 so it's possible i'll need to modify it a bit
EDIT #2:
there's also mistake in the patch,,, the height of stack(?) tiles must be multiplied instead of divided as it's in the original source (it has been changed for master tiles, but not for stack)
Last edited by matej.focko (2017-03-14 22:05:45)
Offline
Perhaps I'm not using the right search terms but would anyone point me to the right direction, if it exists, to finding a patch. I currently use the warp patch, which focus window where mouse cursor is hovering. This goes against what I need for one type of work flow.
I download pdf in web browser (master) and open the pdf. It opens zathura in the client side. I press cntrl+p to open the floating print menu. I press enter to let it print. The float window is over the master side so when the floating print pop up goes away, focus is now on master, which is the web browser. Is there any patch that can focus on last active window when float windows are closed?
I'd hate to give up the warp patch as in other work flows, this is very handy. Anyone else come up against this situation? Any guidance always appreciated.
Edit: Another workaround would be if anyone can suggest a way to have floating windows show up on top right of screen (first client ) that would work too.
Last edited by frank604 (2017-03-22 23:36:51)
Offline
Can anyone help, I have the following code:
static const char *dmenucmd[] = { "j4-dmenu-desktop", "--dmenu", "dmenu -i -fn '-*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*' -nb '#222222' -sb '#005577'", "--no-generic", "--term=urxvt", NULL };
the problem is I want -fn, -nb, -sb to have value from font, normbgcolor, selbgcolor, but if I change it to the following:
static const char *dmenucmd[] = { "j4-dmenu-desktop", "--dmenu", "dmenu -i -fn", font, "-nb", normbgcolor, "-sb", selbgcolor, "--no-generic", "--term=urxvt", NULL };
it won't work because "dmenu -i -fn '-*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*' -nb '#222222' -sb '#005577'" must be in one string.
I don't even know C, so I hope you understand what I'm saying.
Thanks in advance.
Offline
Your best best would be to use preprocessor macros:
#define FONT "-*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*"
#define NB "#222222"
#define SB "#005577"
...
static const char *font = FONT
...
static const char *dmenucmd[] = { "j4-dmenu-desktop", "--dmenu", "dmenu -i -fn '" FONT "' -nb '" NB "' -sb ...
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks a lot.
Another question, is there a way to make an application that can't remember its own windows placement (such as terminal, gvim, etc) to be placed on the center of the screen when it's started? By default it's started on the corner near tags, it doesn't affect application like Firefox, though but it's quite irritating, requires me to move it to the center of the screen.
I'm in floating mode, BTW.
Offline
I suspect the following diff to dwm.c (based on dwm-git) should do that:
1048,1051c1048,1049
< c->x = MAX(c->x, c->mon->mx);
< /* only fix client y-offset, if the client center might cover the bar */
< c->y = MAX(c->y, ((c->mon->by == c->mon->my) && (c->x + (c->w / 2) >= c->mon->wx)
< && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
---
> c->x = c->mon->mx + (c->mon->mw - c->w) / 2;
> c->y = c->mon->my + (c->mon->mh - c->h) / 2;
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
@Trilby: it appears that everything is forced to be placed in the center (e.g. GIMP).
Without those patch, GIMP can remember the placement, but after patched, GIMP lost its placement.
Before:
https://ptpb.pw/RJ9O.png
After:
https://ptpb.pw/bvpO.png
Last edited by zanculmarktum (2017-06-14 12:54:23)
Offline
True, you can adapt my approach. Just check if c->x and c->y are zero before centering. Then any client that specifies a (non-zero) position would be placed as requested, but any client that doesn't specify coordinates would be centered. Of course this would fail on clients that actually wanted 0,0 coordinates, but there's really no good way around that.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Something like this?
if c->x == 0 and c->y {
c->x = c->mon->mx + (c->mon->mw - c->w) / 2;
c->y = c->mon->my + (c->mon->mh - c->h) / 2;
}
Please fix, I don't know C, lol.
Offline
You'd either have to check c->x and c->y prior to the 2 lines above, or compare them to c->mon->mx:
if (c->x == c->mon->mx && c->y == c->mon->my) {
c->x = c->mon->mx + (c->mon->mw - c->w) / 2;
c->y = c->mon->my + (c->mon->mh - c->h) / 2;
}
This checks if the window *would* be mapped at the upper right corner of the monitor, and it so it moves it to the center of the monitor.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
How can I set this command in config.h so later assign it to print key?
maim ~/Pictures/Screenshot-$(date -Iseconds | cut -d'+' -f1).png
Thanks!
Ps: Maim is yet another Scrot like screenshot tool!
Last edited by oldgaro (2017-09-19 19:25:48)
GNU - Dwm - St - Screen - Zsh - SpacEmacs - Neovim
Github
Offline
You could save this command line as a script in e.g. /usr/local/bin, name it e.g. "screenshot" , then assign the print key to the executable like this:
[...]
static const char *screenshot[] = { "/usr/local/bin/screenshot", NULL };
[...]
{ 0, XK_Print, spawn, {.v = screenshot } },
[...]
Offline
What? Why create a script. Just use that command passed to a shell - or just use the macro defined specifically for this purpose:
{ 0, XK_Print, swan, SHCMD("maim ~/Pictures/Screenshot-$(date -Iseconds | cut -d'+' -f1).png") },
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks!
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
{ 0, XK_Print, spawn, SHCMD("maim ~/Pictures/Screenshot-$(date -Iseconds | cut -d'+' -f1).png") },
Last edited by oldgaro (2017-09-21 00:59:50)
GNU - Dwm - St - Screen - Zsh - SpacEmacs - Neovim
Github
Offline
This is of course the better solution I just prefer scripts, because I can change them anytime without the need to recompile anything.
Last edited by sekret (2017-09-21 08:05:57)
Offline
This is of course the better solution I just prefer scripts, because I can change them anytime without the need to recompile anything.
Interesting! I somewhat change my scripts sometimes...I will keep your solution commented in config.h for later use!..haha
GNU - Dwm - St - Screen - Zsh - SpacEmacs - Neovim
Github
Offline
Does anyone know why St do not fill the entire screen?
Same happens with Spacemacs, urxvt but not with firefox, zathura,steam...
https://imgur.com/OqWlAfm
https://github.com/oldgaro/dotfiles/blo … nfig.def.h
thanks!
PS: resizehint to 0 did not make any effect!
Last edited by oldgaro (2017-09-23 23:02:33)
GNU - Dwm - St - Screen - Zsh - SpacEmacs - Neovim
Github
Offline
Please read the wiki before posting here: https://wiki.archlinux.org/index.php/Dw … al_windows
Also, this is a hacking, not a general support, thread.
Offline