Commit Graph
1772 Commits
Author SHA1 Message Date
Venelin Dechkov 9dc4646559 alsa -> pipewire 2026-07-30 13:03:12 +03:00
Venelin Dechkov 889ecc6eb9 pipewire support 2026-07-30 11:54:49 +03:00
Venelin Dechkov 4a5e539580 update time every min 2026-07-30 11:54:49 +03:00
Venelin Dechkov b275554213 fix bookmarks 2026-07-30 11:54:49 +03:00
Venelin Dechkov 07b79c903e toggle layouts 2026-07-30 11:54:49 +03:00
Venelin Dechkov ef7e66f609 clip history 2026-07-30 11:54:49 +03:00
Venelin Dechkov a4385c8858 browser depends on config 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov efb6df5dc7 fix warning 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov 647cff6727 toggle mic 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov e63ff9f1c4 fix firefox mic on alsa 2026-07-30 11:54:49 +03:00
Venelin Dechkov 4ad49de088 fix low battery 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov d6202280e9 unify amixer command 2026-07-30 11:54:49 +03:00
Venelin Dechkov 99e07cae46 no need to pop_back newline after cppipe update 2026-07-30 11:54:49 +03:00
Venelin Dechkov a2f3875b9a increment brightness by 1% 2026-07-30 11:54:49 +03:00
Venelin Dechkov 6799745b3c dont default to pulse 2026-07-30 11:54:49 +03:00
Venelin Dechkov eae82e465d screencap fix 2026-07-30 11:54:49 +03:00
Venelin Dechkov 56f7f07bf6 whitespace 2026-07-30 11:54:49 +03:00
Venelin Dechkov 6a34f8b666 minor inprovement 2026-07-30 11:54:49 +03:00
Venelin Dechkov f20804a589 shift+ins paste 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov 47306a4169 screenshot to clip 2026-07-30 11:54:49 +03:00
Venelin Dechkov c626039502 0 tag 2026-07-30 11:54:49 +03:00
Venelin Dechkov c094e542d9 status wifi not connected 2026-07-30 11:54:49 +03:00
Venelin Dechkov 0ab423c983 add includes to c++ files 2026-07-30 11:54:49 +03:00
Venelin Dechkov 695a141ae0 openbsd wifi status 2026-07-30 11:54:49 +03:00
Venelin Dechkov 61b65db6eb update screenshots path 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov 34ca51a324 browser shortcut open or show 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov 78c4acca67 gitignore 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov beac34fc53 status fix 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov 0e5b9f1473 major status improvements 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov 5b8797bccd web bookmarks 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov 491e29fefa vene fix notify window while its visible 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov e81536b695 vene signal changes in dwm and status bar upgrades 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov 336575522b vene files and dwm changes 2026-07-30 11:54:49 +03:00
vrdandVenelin Dechkov 002b9d1e66 vene config 2026-07-30 11:54:49 +03:00
Ruben GonzalezandHiltjo Posthuma 44dbc6809d buttonpress: fix status text click area mismatch
The status bar in drawbar() calculates the text width as TEXTW(stext)
- lrpad + 2. However, the click detection in buttonpress() used
TEXTW(stext) without adjusting for that padding.

This created an "extra" clickable area of some pixels to the left of
the status text that would incorrectly trigger ClkStatusText actions
instead of ClkWinTitle.

Steps to reproduce:
1. Set a status text: xsetroot -name "HELLO"
2. Move the mouse to the empty space with some pixels close to the
left of the word "HELLO" but in the title area.
3. Middle-click (or any binding for ClkStatusText).
4. You can see that the status bar action is triggered (default a
terminal spawns), even though you clicked in the window title area.

This fix ensures that the clickable area matches the visual text.
2026-03-13 18:27:18 +01:00
Ruben GonzalezandHiltjo Posthuma 2bb919e634 sendmon: resize fullscreen windows to target monitor
When a fullscreen window is moved to another monitor (e.g. via
tagmon), its geometry does not always match the new monitor's
dimensions.

Steps to reproduce:
1. Start dwm with two monitors (A and B).
2. Open a window on Monitor A.
3. Make the window fullscreen (e.g. Firefox with F11).
4. Move the window to Monitor B using the tagmon shortcut (Mod+Shift+>).
5. Go to the other monitor (B), observe that the window is still
visible on Monitor A and its contents, even though the window's title
is seen on Monitor B bar.
6. Go to the monitor A where the window is still in fullscreen, remove
the fullscreen and the window automatically will go to monitor B.

This fix ensures that fullscreen windows are correctly resized to the
new monitor's geometry during the move.
2026-03-10 19:52:48 +01:00
NRKandHiltjo Posthuma c3dd6a829b more overflow fix in getatomprop()
commit 244fa852 (and a9aa0d8) tried to fix overflow by checking
the number of items returned. however this is not sufficient
since the format may be lower than 32 bits.

to reproduce the crash, i used the reproducer given in commit
244fa85 but changed the XChangeProperty line to the following to
set the property to a 1 element 16 bit item:

	short si = 1;
	XChangeProperty(d, w, net_wm_state, XA_ATOM, 16,
		PropModeReplace, (unsigned char *)&si, 1);

this client reliably crashes dwm under ASAN since dwm is trying
to read a 32 bit value from a 16 bit one. fix it by checking for
format == 32 as well.

also change the access type from Atom to long, on my machine
Atom is typedef-ed to long already but that may not be true
everywere. the XGetWindowProperty manpage says format == 32 is
returned as `long` so use `long` directly.

(N.B: it also might be worth checking if the returned type is
 XA_ATOM as well, but i wasn't able to cause any crashes by
 setting different types so i'm leaving it out for now.)
2026-02-20 15:31:29 +01:00
NRKandHiltjo Posthuma 5c9f30300b getstate: fix access type and remove redundant cast
WM_STATE is defined to be format == 32 which xlib returns as
`long` and so accessing it as `unsigned char` is incorrect.

and also &p is already an `unsigned char **` and so the cast was
completely redundant.

given the redundant cast, i assume `p` was `long *` at some time
but was changed to `unsigned char *` later, but the pointer
access (and the cast) wasn't updated.

also add a `format == 32` check as safety measure before
accessing, just in case.
2026-02-20 15:31:28 +01:00
NRKandHiltjo Posthuma 397d618f1c fix not updating _NET_ACTIVE_WINDOW
currently clients that set the input field of WM_HINTS to true
(c->neverfocus) will never be updated as _NET_ACTIVE_WINDOW even
when they are focused. according to the ICCCM [0] the input
field of WM_HINTS tells the WM to either use or not use
XSetInputFocus(), it shouldn't have any relation to
_NET_ACTIVE_WINDOW. EWMH spec [1] also does not mention any
relationship between the two.

this issue was noticed when launching games via steam/proton and
noticing that _NET_ACTIVE_WINDOW was always wrong/stale (i.e not
updated to the game window).

for reference I've looked at bspwm [2] and it also seems to set
_NET_ACTIVE_WINDOW regardless of whether the client has WM_HINTS
input true or not.

[0]: https://x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#input_focus
[1]: https://specifications.freedesktop.org/wm/1.5/ar01s03.html#id-1.4.10
[2]: https://github.com/baskerville/bspwm/blob/c5cf7d3943f9a34a5cb2bab36bf473fd77e7d4f6/src/tree.c#L659-L662
2026-02-13 10:16:08 +01:00
Hiltjo Posthuma f63cde9354 bump version to 6.8 2026-01-30 11:18:38 +01:00
Chris DownandHiltjo Posthuma a9aa0d8ffb dwm: Fix getatomprop regression from heap overflow fix
Commit 244fa852fe ("dwm: Fix heap buffer overflow in getatomprop")
introduced a check for dl > 0 before dereferencing the property pointer.
However, I missed that the variable dl is passed to XGetWindowProperty
for both nitems_return and bytes_after_return parameters:

    XGetWindowProperty(..., &dl, &dl, &p)

The final value in dl is bytes_after_return, not nitems_return. For a
successfully read property, bytes_after is typically 0 (indicating all
data was retrieved), so the check `dl > 0` is always false and dwm never
reads any atom properties. So this is safe, but not very helpful :-)

dl is probably just a dummy variable anyway, so fix by using a separate
variable for nitems, and check nitems > 0 as originally intended.
2026-01-16 14:13:51 +01:00
Hiltjo Posthuma 85fe518c1a bump version to 6.7
Put the maintainer at the top and bump years (time flies).
2026-01-10 11:31:44 +01:00
Chris DownandHiltjo Posthuma 244fa852fe dwm: Fix heap buffer overflow in getatomprop
When getatomprop() is called, it invokes XGetWindowProperty() to
retrieve an Atom. If the property exists but has zero elements (length
0), Xlib returns Success and sets p to a valid, non-NULL memory address
containing a single null byte.

However, dl (that is, the number of items) is 0. dwm blindly casts p to
Atom* and dereferences it. While Xlib guarantees that p is safe to read
as a string (that is, it is null-terminated), it does _not_ guarantee it
is safe to read as an Atom (an unsigned long).

The Atom type is a typedef for unsigned long. Reading an Atom (which
thus will either likely be 4 or 8 bytes) from a 1-byte allocated buffer
results in a heap buffer overflow. Since property content is user
controlled, this allows any client to trigger an out of bounds read
simply by setting a property with format 32 and length 0.

An example client which reliably crashes dwm under ASAN:

    #include <X11/Xlib.h>
    #include <X11/Xatom.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>

    int main(void) {
        Display *d;
        Window root, w;
        Atom net_wm_state;

        d = XOpenDisplay(NULL);
        if (!d) return 1;

        root = DefaultRootWindow(d);
        w = XCreateSimpleWindow(d, root, 10, 10, 200, 200, 1, 0, 0);
        net_wm_state = XInternAtom(d, "_NET_WM_STATE", False);
        if (net_wm_state == None) return 1;

        XChangeProperty(d, w, net_wm_state, XA_ATOM, 32,
                        PropModeReplace, NULL, 0);
        XMapWindow(d, w);
        XSync(d, False);
        sleep(1);

        XCloseDisplay(d);
        return 0;
    }

In order to avoid this, check that the number of items returned is
greater than zero before dereferencing the pointer.
2026-01-10 11:27:23 +01:00
Hiltjo Posthuma 7c3abae4e6 drw.c: drw_scm_free: call free inside
Because drw_scm_create() allocates it.
2025-09-29 18:48:27 +02:00
Hiltjo Posthuma 93f26863d1 cleanup schemes and colors 2025-09-27 12:10:17 +02:00
Hiltjo Posthuma 74edc27caa config: make refreshrate for mouse move/resize a config option
Bump the default from 60 to 120.
2025-08-12 19:17:20 +02:00
Hiltjo Posthuma 693d94d350 bump version to 6.6 2025-08-09 14:34:03 +02:00
Raymond ColeandHiltjo Posthuma cfb8627a80 Avoid unsigned integer underflow in drw_text() 2024-10-30 13:02:17 +01:00
Hiltjo Posthuma fcb2476b69 util.c: output function might override errno and thus affect perror()
Original patch by Raymond Cole with some modifications, thanks!
2024-10-27 20:10:07 +01:00
Hiltjo Posthuma 8933ebcf50 sync drw.{c,h} from dmenu
- drw: minor improvement to the nomatches cache
- overhaul utf8decoding and render invalid utf8 sequences as U+FFFD.

Thanks NRK for these improvements!
2024-10-05 13:06:08 +02:00