Compare commits

...

88 Commits

Author SHA1 Message Date
Sravan Balaji
d8b91c7e8b Add window rule for heroic games launcher 2024-08-13 18:24:06 -04:00
Sravan Balaji
d0f7c11925 Merge remote-tracking branch 'upstream/master' 2024-08-06 15:29:09 -04:00
bakkeby
36cbcf53a2 IPC: do not bail on events from unknown file descriptors ref. #433
The natural cycle for dwm-msg is that:
   - the client registers
   - the client sends a message
   - a response is sent back
   - the client deregisters

There is a race condition such that a new client may end up with the same
file descriptor as another command that is deregistering, resulting in a
message to come through from a file descriptor that is not registered.

The handling of this situation is that the IPC patch will log:

   Got event from unknown fd 7, ptr 0x7, u32 7, u64 7 with events 17

before gracefully stopping (exiting) dwm.

The consequence of the error itself seems benign and the proposal here is
to allow dwm to keep running despite not being able to process the dwm-msg
command successfully.
2024-08-01 14:56:48 +02:00
Sravan Balaji
bbfe23ff81 Merge remote-tracking branch 'upstream/master' 2024-07-14 09:14:30 -04:00
bakkeby
f4258747be Swallow + noborder compatibility changes ref. #430 2024-07-14 14:27:11 +02:00
bakkeby
3bc91e187c Removing debug print statement 2024-07-14 14:26:45 +02:00
Sravan Balaji
a10bfa96db Merge remote-tracking branch 'upstream/master' 2024-07-12 20:06:29 -04:00
bakkeby
f67b8be209 status2d: make sure to terminate the copied text with a NULL character 2024-07-12 19:22:24 +02:00
bakkeby
df75e113a9 launcher + status2d: correct spacing to be the same as when not using status2d 2024-07-12 16:28:46 +02:00
bakkeby
b4b19e3a4c Adding launcher patch 2024-07-11 22:38:58 +02:00
Sravan Balaji
1ea3ac44ee Merge remote-tracking branch 'upstream/master' 2024-07-06 19:06:01 -04:00
bakkeby
8d754cd644 systray + xrdb compatibility issue ref. #429
When changing colour scheme during runtime using xrdb the systray and
icons would keep the original colours.

To work around that the systray icon windows need to be redrawn after
changing the background pixel value. Just calling XClearWindow for
each systray window results in the systray icons disappearing, they
do not automatically redraw. The solution is apparently to send an
Expose event to each window which should in principle trigger a redraw
from the application side.

One way to achieve this is to move the window out of the drawable area.
When the window is then brought back into view the X server will send
the Expose event for the window. The "easiest" way to do this is to
move the entire systray window out of view as part of the xrdb call.

It is possible to do this in the draw_systray function itself, but we
probably do not want to do this every single time the bar is drawn and
it may also cause some noticeable flickering.

This issue is isolated to using the systray without the alpha patch.
2024-07-01 09:53:43 +02:00
Sravan Balaji
c9654817f8 Merge remote-tracking branch 'upstream/master' 2024-06-16 06:58:33 -04:00
bakkeby
c1e9e0b035 Add missing void to updateclientlist definition
Caught by -pedantic implying -Wstrict-prototypes for OpenBSD's 16.0.6 Clang.

ref.
https://git.suckless.org/dwm/commit/5687f4696472ba6029bbba18e293e3e8b9e154ea.html
2024-06-13 10:22:29 +02:00
Sravan Balaji
ce57068ced Merge remote-tracking branch 'upstream/master' 2024-06-07 08:06:20 -04:00
Ampnbsp
edb36a3a14 togglefloating RENAMED_SCRATCHPADS_PATCH colour fix (#428)
Co-authored-by: Ampnbsp <Ampnbsp@email.org>
2024-06-06 21:23:07 +02:00
Sravan Balaji
50df892d62 Merge remote-tracking branch 'upstream/master' 2024-05-22 07:21:56 -04:00
bakkeby
66770cfbcc pango: upgrade to 0230520-e81f17d
Missed this line from drw_font_getexts.
2024-05-17 11:06:30 +02:00
bakkeby
018bb8eb18 pango: upgrade to 0230520-e81f17d
This upgrades the pango patch to:
https://dwm.suckless.org/patches/pango/dwm-pango-20230520-e81f17d.diff

The changes are fixes for some vertical alignment issues that were obvious only for CJK fonts.

The implementation in dwm-flexipatch is still simplified compared to the original patch, e.g.
avoiding changes like drw->fonts to drw->font and many similar function signatures.
2024-05-17 09:33:13 +02:00
Sravan Balaji
dcd6287f78 Update window rules 2024-05-13 08:11:22 -04:00
Sravan Balaji
8dee563611 Rename graphics module to system76-power
- Display current graphics mode rather than nvidia driver version
2024-05-11 12:43:16 -04:00
Sravan Balaji
d88c08a666 Merge remote-tracking branch 'upstream/master' 2024-05-08 09:56:23 -04:00
Sravan Balaji
22f2f25a50 Unmanage steam notification toasts 2024-05-06 08:45:33 -04:00
Sravan Balaji
f0c6bd28a0 Add NotoSans fonts to polybar
- Mainly to fix Millenium Parade in Spotify
2024-05-04 22:45:35 -04:00
bakkeby
dd1e34dbd6 switchtag: make sure to unfocus the selected client (if any) when triggering switchtag and potentially moving to another monitor ref. #425 2024-05-04 22:23:24 +02:00
Sravan Balaji
f925b6c896 Update dunst click actions to use dunst script 2024-05-04 09:17:55 -04:00
Sravan Balaji
0089c14d6e Add graphics module to show nvidia driver version 2024-05-04 09:02:08 -04:00
Sravan Balaji
510b15c7b8 Kernel Module Click Action Fix
- Run fastfetch and nvidia-smi when kernel module is clicked
- Wait 15 seconds after commands are run so terminal doesn't
  exit prematurely
2024-05-03 19:42:26 -04:00
Sravan Balaji
31c5ea9f26 Dunst Clear Notifications Module
- Add module to clear open notifications
- Change `/home/sravan` to `~/` in polybar
2024-05-03 19:31:04 -04:00
Sravan Balaji
1fbc9b35d8 Add click action to kernel module to display fastfetch 2024-05-03 19:10:42 -04:00
Sravan Balaji
33a8f5bb9a Update dunst module to include more buttons and history count
- Change filesystem module interval to 10 minutes
- Add more modules for dunst
- Change power menu module icon
- Change some media module components from scripts to text
2024-05-03 18:59:48 -04:00
Sravan Balaji
fff5a42a45 Merge remote-tracking branch 'upstream/master' 2024-05-03 17:50:10 -04:00
bakkeby
79404e419f Fix for dwm crashing following unmapping of systray window that had been moved to another monitor ref. #423 2024-05-02 22:08:16 +02:00
Sravan Balaji
d50575e707 Switch from xfce4-notifyd to dunst 2024-05-02 08:25:24 -04:00
Sravan Balaji
15db2c6298 Attempt to fix unmanaged window rule not working 2024-05-01 20:39:15 -04:00
Sravan Balaji
d298f3da81 xfce4-notifyd unmanage windows and polybar module
- Enable unmanaged patch
- Make xfce4-notifyd windows unmanaged instead of floating
- Change notification command to xfce4-notifyd
- Update polybar config to use xfce4-notifyd for notification module
2024-05-01 20:13:55 -04:00
Sravan Balaji
3268ba4179 Add xfce4-notifyd as a floating window 2024-05-01 19:58:24 -04:00
Sravan Balaji
20ae00286d Merge remote-tracking branch 'upstream/master' 2024-04-19 08:19:43 -04:00
bakkeby
a18f3ef370 noborder: refactoring implementation and adding same logic to configure function 2024-04-16 16:04:43 +02:00
Sravan Balaji
be122437ed Add Bar Transparency and Remove Over/Under Lines 2024-04-13 13:56:07 -04:00
Sravan Balaji
3797d8fda2 Invert polybar background and foreground colors for modules 2024-04-12 17:31:26 -04:00
Sravan Balaji
3a886c7dc2 Update Tags & Window Rules
- Combine spotify and podcast tags into single audio tag
- Create new media/video tag
- Add window rules / update tag for bunch of applications
2024-04-12 17:14:08 -04:00
Sravan Balaji
b2ffb9f2c1 Add Obsidian Window Rule 2024-04-05 08:17:13 -04:00
SalahDin Rezk
36b574eff6 Add bar padding smart patch (#419) 2024-04-04 16:51:13 +02:00
Sravan Balaji
d24d567eb7 Replace Filelight with QDirStat 2024-03-31 08:33:53 -04:00
Sravan Balaji
b0eb54e8cd Replace killall with pkill 2024-03-30 21:10:50 -04:00
Sravan Balaji
92cff92b6b Make shebang more portable to NixOS 2024-03-30 20:03:08 -04:00
Sravan Balaji
d565b6360f Add window rule for anytype 2024-03-30 09:43:26 -04:00
Sravan Balaji
abf9b0ce09 Merge remote-tracking branch 'upstream/master' 2024-03-28 15:11:53 -04:00
Sravan Balaji
23b55eaf9c Merge remote-tracking branch 'upstream/master' 2024-03-27 07:51:28 -04:00
bakkeby
82c3366317 tagpreview: proposed change to force hide preview window when changing tags ref. #415 2024-03-27 09:04:55 +01:00
bakkeby
cfabf03f62 bump version to 6.5
ref.
https://git.suckless.org/dwm/commit/061e9fe9a7db396c0c4f3d996c3908fb43a6d50c.html
2024-03-20 08:02:37 +01:00
Sravan Balaji
e284bd7404 Change preprocessor directive values from N/A to 0 2024-03-17 20:17:51 -04:00
Sravan Balaji
24e80c4eed Make tray background a configurable color 2024-03-15 14:08:28 -04:00
Sravan Balaji
477a1c1202 Add a justfile for common commands 2024-03-15 13:35:37 -04:00
Sravan Balaji
4ca6571a05 Merge remote-tracking branch 'upstream/master' 2024-03-15 13:30:29 -04:00
Sravan Balaji
d2ba136896 Remove window rules for Ferdium and Notion 2024-03-15 13:25:54 -04:00
Utkarsh Verma
58b58dc44e Add PERMON_VANITYGAPS_PATCH (#343) 2024-03-14 09:38:21 +01:00
Sravan Balaji
f4f7069cae Merge remote-tracking branch 'upstream/master' 2024-02-27 20:16:22 -05:00
bakkeby
5e85bc8b5c tab + alttab compatibility fix (conflicting function name drawtab) 2024-02-01 21:29:25 +01:00
bakkeby
01244cc1b9 Adding placedir patch ref. #407 2024-01-31 22:38:41 +01:00
Sravan Balaji
597a30207a Merge remote-tracking branch 'upstream/master' 2023-12-24 11:45:12 -05:00
bakkeby
5a0c5e617f Adding the do-not-die-on-color-allocation-failure patch ref. #404 2023-12-22 10:42:16 +01:00
bakkeby
9869c22cb2 Adding sendmoncenter patch ref. #402 2023-12-01 09:38:22 +01:00
Sravan Balaji
cbc88fc67e Change FiraCode to Monaspice Neon 2023-11-23 12:57:53 -05:00
Sravan Balaji
3f62ec4e0d Update Window Rules
- Add automatic tagging for Logseq, Gamescope, Syncthing, Nyrna, and OpenRGB
- Remove auto tagging for specific gaming related apps since they
  should be running inside gamescope anyways
2023-11-21 15:11:17 -05:00
Sravan Balaji
b1cae0ce5e Merge remote-tracking branch 'upstream/master' 2023-11-14 19:05:02 -05:00
bakkeby
03ede82d5c focusmaster: adding restack to address stack issues when using monocle or deck layouts ref. #398 2023-11-13 21:20:37 +01:00
Sravan Balaji
bd29edf9c0 Merge remote-tracking branch 'upstream/master' 2023-11-12 12:18:09 -05:00
bakkeby
817db8c3ca Adding focusmaster-return patch variant ref. #398 2023-11-12 09:41:31 +01:00
Songli Yu
d86ea2de25 Fix patch compatibility issue in the resizemousescroll function of TAPRESIZE_PATCH. (#393) 2023-11-08 21:34:43 +01:00
bakkeby
ad9664fa01 shift: skip sticky clients when working out which tags are occupied ref. #387 2023-11-08 21:09:27 +01:00
bakkeby
332c90049d sticky: prioritise non-sticky windows on focus(NULL) correction ref. #387 2023-11-07 21:44:39 +01:00
bakkeby
63bab1aa8a sticky: prioritise non-sticky windows on focus(NULL) ref. #387 2023-11-07 17:58:45 +01:00
Songli Yu
4a22fd046c Fix when only one client in a tag and click it to hide it, then click it one more time, the client will not show as expected. (#385) 2023-11-05 22:07:43 +01:00
bakkeby
83a047aca7 shift: filter out scratchpad tags ref. #382 2023-11-04 21:38:38 +01:00
bakkeby
1b5a58f231 Fix space before tab in indent 2023-10-20 10:53:10 +02:00
bakkeby
d807d3da3e renamed scratchpads: allow a fullscreen scratchpad auto-hide when focus is lost if combined with both the losefullscreen patch and the auto-hide patch for renamed scratchpads 2023-10-03 21:25:10 +02:00
bakkeby
dd1660b1ed renamed scratchpads: auto-unhide a minimised (icon state) scratchpad when toggled 2023-10-02 09:51:34 +02:00
bakkeby
ddb2e833a4 tagpreview: adding compatibility with powerline tags and taglabels 2023-10-01 21:07:58 +02:00
bakkeby
8191c0739a focusonclick: not skipping motionnotify events as to avoid interferring with tagpreview and other on hover patches 2023-10-01 20:51:16 +02:00
bakkeby
3e97a1d25c Makefile: remove the options target
The Makefile used to suppress output (by using @), so this target made sense at
the time.

But the Makefile should be simple and make debugging with less abstractions or
fancy printing.  The Makefile was made verbose and doesn't hide the build
output, so remove this target.

Prompted by a question on the mailing list about the options target.

ref.
https://git.suckless.org/dwm/commit/9f8855343c881bdc01b9fff5b956537ba1106b76.html
2023-09-22 18:08:42 +02:00
bakkeby
5865c68c0e systray + unmanaged: fixed compatibility issue 2023-09-22 18:05:25 +02:00
Mahdi Nayef
7849eaa08b Use pkg-config to locate fribidi library's files (#369) 2023-08-24 18:18:03 +02:00
bakkeby
74abea7c70 Adding unmanaged patch ref. #365 2023-06-27 17:24:36 +02:00
bakkeby
ab7d28ff0f bar border - allow for the border size to be explicitly set ref. #364 2023-06-27 16:31:02 +02:00
bakkeby
99f6f1b52c Adding focusfollowmouse patch ref. #364 2023-06-27 16:07:57 +02:00
bakkeby
1a1ce47917 layoutmenu: fixing warning from original patch 2023-06-27 14:59:48 +02:00
58 changed files with 1764 additions and 432 deletions

View File

@@ -9,17 +9,11 @@ OBJ = ${SRC:.c=.o}
# FreeBSD users, prefix all ifdef, else and endif statements with a . for this to work (e.g. .ifdef)
ifdef YAJLLIBS
all: options dwm dwm-msg
all: dwm dwm-msg
else
all: options dwm
all: dwm
endif
options:
@echo dwm build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
.c.o:
${CC} -c ${CFLAGS} $<
@@ -76,4 +70,4 @@ uninstall:
${DESTDIR}${MANPREFIX}/man1/dwm.1\
${DESTDIR}${PREFIX}/share/xsessions/dwm.desktop
.PHONY: all options clean dist install uninstall
.PHONY: all clean dist install uninstall

View File

@@ -1,4 +1,4 @@
This dwm 6.4 (e81f17d, 2023-04-09) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0).
This dwm 6.5 (5687f46, 2024-06-08) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0).
For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/dwm-flexipatch/blob/master/patches.def.h):
```c
@@ -19,6 +19,18 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
### Changelog:
2024-07-11 - Added variant of the launcher patch
2024-01-31 - Added the placedir patch
2023-12-22 - Added the do-not-die-on-color-allocation-failure patch
2023-12-01 - Added the sendmoncenter patch
2023-11-12 - Added the focusmaster-return patch variant
2023-06-27 - Added the focusfollowmouse and unmanaged patches
2023-06-25 - Added the toggletopbar patch
2023-01-18 - Added the view history patch
@@ -353,6 +365,10 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
- i.e. if topbar is 0 then dmenu will appear at the bottom and if 1 then dmenu will appear at
the top
- do-not-die-on-color-allocation-failure
- avoids dwm terminating (dying) on color allocation failures
- useful for the xrdb (xresources) and status2d patches
- [dragcfact](https://github.com/bakkeby/patches/wiki/dragcfact/)
- lets you resize clients' size (i.e. modify cfact) by holding modkey + shift + right-click
and dragging the mouse
@@ -433,9 +449,17 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
- allows focusing on clients based on direction (up, down, left, right) instead of client
order
- [focusfollowmouse](https://github.com/bakkeby/patches/wiki/focusfollowmouse)
- the window under the mouse cursor will receive focus when changing tags, closing windows or
moving client out of view (as opposed to the most recently focused client)
- [focusmaster](https://dwm.suckless.org/patches/focusmaster/)
- a simple patch that just puts focus back to the master client
- [focusmaster-return](https://dwm.suckless.org/patches/focusmaster/)
- a simple patch that just puts focus back to the master client
- additionally allows focus to be switched back to the previous client
- [focusonclick](https://dwm.suckless.org/patches/focusonclick/)
- this patch makes you switch focus only by mouse click and not sloppy (focus follows mouse
pointer)
@@ -500,6 +524,9 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
- [killunsel](https://dwm.suckless.org/patches/killunsel/)
- kills all visible clients that are not selected (only the selected client will remain)
- [launcher](https://dwm.suckless.org/patches/launcher/)
- adds buttons to the bar that can be used to launch applications
- [~leftlayout~](http://dwm.suckless.org/patches/leftlayout/)
- ~moves the layout symbol in the status bar to the left hand side~
@@ -581,6 +608,9 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
- [pertag](https://dwm.suckless.org/patches/pertag/)
- adds nmaster, mfact, layouts and more per tag rather than per monitor
- [placedir](https://github.com/bakkeby/patches/wiki/placedir)
- allows tiled windows to be moved in any direction (up, down, left, right)
- [placemouse](https://github.com/bakkeby/patches/wiki/placemouse)
- lets the user change the position of a client in the stack using the mouse.
@@ -638,6 +668,9 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
- [selfrestart](https://dwm.suckless.org/patches/selfrestart/)
- restart dwm without the unnecessary dependency of an external script
- [sendmoncenter](https://dwm.suckless.org/patches/sendmoncenter/)
- floating windows being sent to another monitor will be centered
- [sendmon\_keepfocus](https://github.com/bakkeby/patches/wiki/sendmon_keepfocus/)
- minor patch that allow clients to keep focus when being sent to another monitor
@@ -802,6 +835,10 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
- resets isfloating on any visible windows that have it set and optionally also applies a
layout
- [unmanaged](https://github.com/bakkeby/patches/wiki/unmanaged)
- adds a client rule that allows for windows to not be managed by the window manager
- this can be useful for external bars, widgets, launchers, docks, desktop icons and more
- [~urgentborder~](https://dwm.suckless.org/patches/urgentborder/)
- ~this patch makes "urgent" windows have different colors~

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,6 @@
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
#define CMD(...) { .v = (const char*[]){ __VA_ARGS__, NULL } }
#if ROUNDED_CORNERS_PATCH
static const unsigned int borderpx = 0; /* border pixel of windows */
static const int corner_radius = 10;
@@ -5,6 +8,13 @@ static const int corner_radius = 10;
static const unsigned int borderpx = 2; /* border pixel of windows */
#endif // ROUNDED_CORNERS_PATCH
#if BAR_BORDER_PATCH
/* This allows the bar border size to be explicitly set separately from borderpx.
* If left as 0 then it will default to the borderpx value of the monitor and will
* automatically update with setborderpx. */
static const unsigned int barborderpx = 0; /* border pixel of bar */
#endif // BAR_BORDER_PATCH
static const unsigned int snap = 10; /* snap pixel */
#if SWALLOW_PATCH
@@ -418,6 +428,13 @@ static char *statuscolors[][ColCount] = {
static const char *layoutmenu_cmd = "layoutmenu.sh";
#endif
#if BAR_LAUNCHER_PATCH
static const Launcher launchers[] = {
/* icon to display command */
{ "surf", CMD("surf", "duckduckgo.com") },
};
#endif // BAR_LAUNCHER_PATCH
#if COOL_AUTOSTART_PATCH
static const char *const autostart[] = {
"st", NULL,
@@ -442,7 +459,7 @@ static char *tagicons[][NUMTAGS] =
#endif // NAMETAG_PATCH
{
/* [DEFAULT_TAGS] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }, */
[DEFAULT_TAGS] = { "󰍩 ₁", "󰗚", "", "", "󰖟 ₅", " ₆", "󰊢 ₇", "", "" },
[DEFAULT_TAGS] = { "󰍩 ₁", "󰠮", "", "󰿎", "󰖟 ₅", " ₆", "󰊢 ₇", "󰊖", "" },
[ALTERNATIVE_TAGS] = { "A", "B", "C", "D", "E", "F", "G", "H", "I" },
[ALT_TAGS_DECORATION] = { "<1>", "<2>", "<3>", "<4>", "<5>", "<6>", "<7>", "<8>", "<9>" },
};
@@ -466,30 +483,49 @@ static const Rule rules[] = {
RULE(.wintype = WTYPE "UTILITY", .isfloating = 1)
RULE(.wintype = WTYPE "TOOLBAR", .isfloating = 1)
RULE(.wintype = WTYPE "SPLASH", .isfloating = 1)
RULE(.wintype = WTYPE "NOTIFICATION", .unmanaged = 1) // 1 - the window will be placed above all other windows
RULE(.title = "notificationtoasts_11_desktop", .unmanaged = 1) // 1 - the window will be placed above all other windows
RULE(.title = "Picture in picture", .isfloating = 1)
RULE(.class = "Ferdium", .tags = 1 << 0)
RULE(.class = "Beeper", .tags = 1 << 0)
RULE(.class = "Signal", .tags = 1 << 0)
RULE(.class = "discord", .tags = 1 << 0)
RULE(.class = "notion-app-enhanced", .tags = 1 << 1)
RULE(.class = "zoom", .tags = 1 << 0)
RULE(.class = "Logseq", .tags = 1 << 1)
RULE(.class = "obsidian", .tags = 1 << 1)
RULE(.class = "anytype", .tags = 1 << 1)
RULE(.class = "pocket-casts-linux", .tags = 1 << 2)
RULE(.class = "Spotify", .tags = 1 << 3)
RULE(.class = "Spotify", .tags = 1 << 2)
RULE(.class = "Pavucontrol", .tags = 1 << 2)
RULE(.class = "easyeffects", .tags = 1 << 2)
RULE(.class = "NoiseTorch", .tags = 1 << 2)
RULE(.class = "Audacity", .tags = 1 << 2)
RULE(.class = "mpv", .tags = 1 << 3)
RULE(.class = "vlc", .tags = 1 << 3)
RULE(.class = "Ristretto", .tags = 1 << 3)
RULE(.class = "trackma-qt", .tags = 1 << 3)
RULE(.class = "Trackma-gtk", .tags = 1 << 3)
RULE(.class = "obs", .tags = 1 << 3)
RULE(.class = "kdenlive", .tags = 1 << 3)
RULE(.class = "Blender", .tags = 1 << 3)
RULE(.title = "GNU Image Manipulation Program", .tags = 1 << 3)
RULE(.class = "Vivaldi-stable", .tags = 1 << 4)
RULE(.class = "Links", .tags = 1 << 4)
RULE(.class = "kitty", .tags = 1 << 5, .isterminal = 1)
RULE(.class = "Emacs", .tags = 1 << 6)
RULE(.class = "Code", .tags = 1 << 6)
RULE(.class = "GNU Octave", .tags = 1 << 6)
RULE(.title = "Steam", .tags = 1 << 7)
RULE(.class = "Lutris", .tags = 1 << 7)
RULE(.title = "Origin", .tags = 1 << 7, .isfloating = 1)
RULE(.title = "Ubisoft Connect", .tags = 1 << 7, .isfloating = 1)
RULE(.class = "gamescope", .tags = 1 << 7)
RULE(.class = "Oversteer", .tags = 1 << 7)
RULE(.class = "PrismLauncher", .tags = 1 << 7)
RULE(.class = "antimicrox", .tags = 1 << 7)
RULE(.class = "ProtonUp-Qt", .tags = 1 << 7)
RULE(.class = "heroic", .tags = 1 << 7)
RULE(.class = "Thunar", .tags = 1 << 8)
RULE(.class = "trackma", .tags = 1 << 8)
RULE(.class = "Trackma-gtk", .tags = 1 << 8)
RULE(.class = "obs", .tags = 1 << 8)
RULE(.class = "NoiseTorch", .tags = 1 << 8)
RULE(.class = "kdenlive", .tags = 1 << 8)
RULE(.class = "Syncthing GTK", .tags = 1 << 8)
RULE(.class = "Nyrna", .tags = 1 << 8)
RULE(.class = "openrgb", .tags = 1 << 8)
#if RENAMED_SCRATCHPADS_PATCH
RULE(.instance = "spterm", .scratchkey = 's', .isfloating = 1)
#elif SCRATCHPADS_PATCH
@@ -528,14 +564,17 @@ static const BarRule barrules[] = {
#if BAR_STATUSBUTTON_PATCH
{ -1, 0, BAR_ALIGN_LEFT, width_stbutton, draw_stbutton, click_stbutton, NULL, "statusbutton" },
#endif // BAR_STATUSBUTTON_PATCH
#if BAR_LAUNCHER_PATCH
{ -1, 0, BAR_ALIGN_LEFT, width_launcher, draw_launcher, click_launcher, NULL, "launcher" },
#endif // BAR_LAUNCHER_PATCH
#if BAR_POWERLINE_TAGS_PATCH
{ 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, NULL, "powerline_tags" },
{ 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, hover_pwrl_tags, "powerline_tags" },
#endif // BAR_POWERLINE_TAGS_PATCH
#if BAR_TAGS_PATCH
{ -1, 0, BAR_ALIGN_LEFT, width_tags, draw_tags, click_tags, hover_tags, "tags" },
#endif // BAR_TAGS_PATCH
#if BAR_TAGLABELS_PATCH
{ -1, 0, BAR_ALIGN_LEFT, width_taglabels, draw_taglabels, click_taglabels, NULL, "taglabels" },
{ -1, 0, BAR_ALIGN_LEFT, width_taglabels, draw_taglabels, click_taglabels, hover_taglabels, "taglabels" },
#endif // BAR_TAGLABELS_PATCH
#if BAR_TAGGRID_PATCH
{ -1, 0, BAR_ALIGN_LEFT, width_taggrid, draw_taggrid, click_taggrid, NULL, "taggrid" },
@@ -835,9 +874,6 @@ static const char *xkb_layouts[] = {
#define HOLDKEY 0 // replace 0 with the keysym to activate holdbar
#endif // BAR_HOLDBAR_PATCH
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
#if !NODMENU_PATCH
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
#endif // NODMENU_PATCH
@@ -864,7 +900,7 @@ static const char *clipboardcmd[] = { "rofi", "-show", "clipboard", NULL
static const char *rbwcmd[] = { "rofi-rbw", NULL };
static const char *volumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--rofi", NULL };
static const char *mediacmd[] = { "/home/sravan/.scripts/playerctl.sh", "--rofi", NULL };
static const char *notificationcmd[] = { "/home/sravan/.scripts/deadd.sh", "--rofi", NULL };
static const char *notificationcmd[] = { "/home/sravan/.scripts/dunst.sh", "--rofi", NULL };
static const char *sessioncmd[] = { "/home/sravan/.scripts/session.sh", "--rofi", NULL };
static const char *compositorcmd[] = { "/home/sravan/.scripts/picom.sh", "--rofi", NULL };
static const char *lowervolumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--lower", NULL };
@@ -945,9 +981,9 @@ static const Key keys[] = {
{ MODKEY|ControlMask, XK_b, tabmode, {-1} },
#endif // TAB_PATCH
#if FOCUSMASTER_PATCH
#if FOCUSMASTER_PATCH || FOCUSMASTER_RETURN_PATCH
{ MODKEY|ControlMask, XK_space, focusmaster, {0} },
#endif // FOCUSMASTER_PATCH
#endif // FOCUSMASTER_PATCH / FOCUSMASTER_RETURN_PATCH
#if STACKER_PATCH
STACKKEYS(MODKEY, focus)
@@ -964,6 +1000,13 @@ static const Key keys[] = {
{ MODKEY, XK_Down, focusdir, {.i = 3 } }, // down
#endif // FOCUSDIR_PATCH
#if PLACEDIR_PATCH
{ MODKEY|ControlMask, XK_Left, placedir, {.i = 0 } }, // left
{ MODKEY|ControlMask, XK_Right, placedir, {.i = 1 } }, // right
{ MODKEY|ControlMask, XK_Up, placedir, {.i = 2 } }, // up
{ MODKEY|ControlMask, XK_Down, placedir, {.i = 3 } }, // down
#endif // PLACEDIR_PATCH
#if SWAPFOCUS_PATCH && PERTAG_PATCH
{ MODKEY, XK_s, swapfocus, {.i = -1 } },
#endif // SWAPFOCUS_PATCH
@@ -1094,8 +1137,8 @@ static const Key keys[] = {
#endif // SHIFTVIEW_CLIENTS_PATCH
#if SHIFTBOTH_PATCH
{ MODKEY|ControlMask, XK_Left, shiftboth, { .i = -1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoleft
{ MODKEY|ControlMask, XK_Right, shiftboth, { .i = +1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoright
{ MODKEY|ControlMask, XK_Left, shiftboth, { .i = -1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoleft placedir
{ MODKEY|ControlMask, XK_Right, shiftboth, { .i = +1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoright placedir
#endif // SHIFTBOTH_PATCH
#if SHIFTSWAPTAGS_PATCH && SWAPTAGS_PATCH
@@ -1233,8 +1276,8 @@ static const Key keys[] = {
{ MODKEY, XK_Right, viewtoright, {0} }, // note keybinding conflict with focusdir
{ MODKEY|ShiftMask, XK_Left, tagtoleft, {0} }, // note keybinding conflict with shifttag
{ MODKEY|ShiftMask, XK_Right, tagtoright, {0} }, // note keybinding conflict with shifttag
{ MODKEY|ControlMask, XK_Left, tagandviewtoleft, {0} },
{ MODKEY|ControlMask, XK_Right, tagandviewtoright, {0} },
{ MODKEY|ControlMask, XK_Left, tagandviewtoleft, {0} }, // note keybinding conflict with placedir
{ MODKEY|ControlMask, XK_Right, tagandviewtoright, {0} }, // note keybinding conflict with placedir
#endif // FOCUSADJACENTTAG_PATCH
#if TAGALL_PATCH
@@ -1279,8 +1322,8 @@ static const Key keys[] = {
#if BAR_TAGGRID_PATCH
{ MODKEY|ControlMask, XK_Up, switchtag, { .ui = SWITCHTAG_UP | SWITCHTAG_VIEW } },
{ MODKEY|ControlMask, XK_Down, switchtag, { .ui = SWITCHTAG_DOWN | SWITCHTAG_VIEW } },
{ MODKEY|ControlMask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_VIEW } },
{ MODKEY|ControlMask, XK_Left, switchtag, { .ui = SWITCHTAG_LEFT | SWITCHTAG_VIEW } },
{ MODKEY|ControlMask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_VIEW } }, // note keybinding conflict with placedir
{ MODKEY|ControlMask, XK_Left, switchtag, { .ui = SWITCHTAG_LEFT | SWITCHTAG_VIEW } }, // note keybinding conflict with placedir
{ MODKEY|Mod1Mask, XK_Up, switchtag, { .ui = SWITCHTAG_UP | SWITCHTAG_TAG | SWITCHTAG_VIEW } },
{ MODKEY|Mod1Mask, XK_Down, switchtag, { .ui = SWITCHTAG_DOWN | SWITCHTAG_TAG | SWITCHTAG_VIEW } },
{ MODKEY|Mod1Mask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_TAG | SWITCHTAG_VIEW } },

View File

@@ -1,5 +1,5 @@
# dwm version
VERSION = 6.4
VERSION = 6.5
# Customize below to fit your system
@@ -29,7 +29,7 @@ FREETYPEINC = /usr/include/freetype2
#KVMLIB = -lkvm
# Uncomment this for the alpha patch and the winicon patch (BAR_ALPHA_PATCH, BAR_WINICON_PATCH)
XRENDER = -lXrender
#XRENDER = -lXrender
# Uncomment this for the mdpcontrol patch / MDPCONTROL_PATCH
#MPDCLIENT = -lmpdclient
@@ -52,8 +52,8 @@ XCBLIBS = -lX11-xcb -lxcb -lxcb-res
#IMLIB2LIBS = -lImlib2
# Uncomment for the bidi patch
#BDINC = -I/usr/include/fribidi
#BDLIBS = -lfribidi
#BDINC = `pkg-config --cflags fribidi`
#BDLIBS = `pkg-config --libs fribidi`
# includes and libs
INCS = -I${X11INC} -I${FREETYPEINC} ${YAJLINC} ${PANGOINC} ${BDINC}

28
drw.c
View File

@@ -337,14 +337,22 @@ drw_clr_create(
#if BAR_ALPHA_PATCH
if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap,
clrname, dest))
#if DO_NOT_DIE_ON_COLOR_ALLOCATION_FAILURE_PATCH
fprintf(stderr, "warning, cannot allocate color '%s'", clrname);
#else
die("error, cannot allocate color '%s'", clrname);
#endif // DO_NOT_DIE_ON_COLOR_ALLOCATION_FAILURE_PATCH
dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24);
#else
if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
DefaultColormap(drw->dpy, drw->screen),
clrname, dest))
#if DO_NOT_DIE_ON_COLOR_ALLOCATION_FAILURE_PATCH
fprintf(stderr, "warning, cannot allocate color '%s'", clrname);
#else
die("error, cannot allocate color '%s'", clrname);
#endif // DO_NOT_DIE_ON_COLOR_ALLOCATION_FAILURE_PATCH
#if NO_TRANSPARENT_BORDERS_PATCH
dest->pixel |= 0xff << 24;
@@ -428,10 +436,10 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
{
#if BAR_PANGO_PATCH
char buf[1024];
int ty;
unsigned int ew;
int i, ty, th;
unsigned int ew, eh;
XftDraw *d = NULL;
size_t i, len;
size_t len;
int render = x || y || w || h;
if (!drw || (render && !drw->scheme) || !text || !drw->fonts)
@@ -456,10 +464,14 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
len = strlen(text);
if (len) {
drw_font_getexts(drw->fonts, text, len, &ew, NULL, markup);
drw_font_getexts(drw->fonts, text, len, &ew, &eh, markup);
th = eh;
/* shorten text if necessary */
for (len = MIN(len, sizeof(buf) - 1); len && ew > w; len--)
drw_font_getexts(drw->fonts, text, len, &ew, NULL, markup);
for (len = MIN(len, sizeof(buf) - 1); len && ew > w; len--) {
drw_font_getexts(drw->fonts, text, len, &ew, &eh, markup);
if (eh > th)
th = eh;
}
if (len) {
memcpy(buf, text, len);
@@ -469,7 +481,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
; /* NOP */
if (render) {
ty = y + (h - drw->fonts->h) / 2;
ty = y + (h - th) / 2;
if (markup)
pango_layout_set_markup(drw->fonts->layout, buf, len);
else
@@ -701,7 +713,7 @@ drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w,
if (w)
*w = r.width / PANGO_SCALE;
if (h)
*h = font->h;
*h = r.height / PANGO_SCALE;
}
#else
void

257
dwm.c
View File

@@ -482,9 +482,12 @@ struct Monitor {
int gappiv; /* vertical gap between windows */
int gappoh; /* horizontal outer gaps */
int gappov; /* vertical outer gaps */
#if PERMON_VANITYGAPS_PATCH
int enablegaps; /* whether gaps are enabled */
#endif // PERMON_VANITYGAPS_PATCH
#endif // VANITYGAPS_PATCH
#if SETBORDERPX_PATCH
unsigned int borderpx;
int borderpx;
#endif // SETBORDERPX_PATCH
unsigned int seltags;
unsigned int sellt;
@@ -504,6 +507,9 @@ struct Monitor {
Client *clients;
Client *sel;
Client *stack;
#if FOCUSMASTER_RETURN_PATCH
Client *tagmarked[32];
#endif // FOCUSMASTER_RETURN_PATCH
Monitor *next;
Bar *bar;
const Layout *lt[2];
@@ -568,6 +574,9 @@ typedef struct {
#if RENAMED_SCRATCHPADS_PATCH
const char scratchkey;
#endif // RENAMED_SCRATCHPADS_PATCH
#if UNMANAGED_PATCH
int unmanaged;
#endif // UNMANAGED_PATCH
#if XKB_PATCH
int xkb_layout;
#endif // XKB_PATCH
@@ -676,11 +685,12 @@ static void killclient(const Arg *arg);
static void manage(Window w, XWindowAttributes *wa);
static void mappingnotify(XEvent *e);
static void maprequest(XEvent *e);
#if !FOCUSONCLICK_PATCH
static void motionnotify(XEvent *e);
#endif // FOCUSONCLICK_PATCH
static void movemouse(const Arg *arg);
static Client *nexttiled(Client *c);
#if NOBORDER_PATCH
static int noborder(Client *c);
#endif // NOBORDER_PATCH
#if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH
static void pop(Client *c);
#endif // !ZOOMSWAP_PATCH / TAGINTOSTACK_ALLMASTER_PATCH / TAGINTOSTACK_ONEMASTER_PATCH
@@ -775,6 +785,9 @@ static int xkbEventType = 0;
static int screen;
static int sw, sh; /* X display screen geometry width, height */
static int bh; /* bar geometry */
#if UNMANAGED_PATCH
static int unmanaged = 0; /* whether the window manager should manage the new window or not */
#endif // UNMANAGED_PATCH
static int lrpad; /* sum of left and right padding for text */
/* Some clients (e.g. alacritty) helpfully send configure requests with a new size or position
* when they detect that they have been moved to another monitor. This can cause visual glitches
@@ -811,9 +824,7 @@ static void (*handler[LASTEvent]) (XEvent *) = {
#endif // COMBO_PATCH / BAR_HOLDBAR_PATCH
[MappingNotify] = mappingnotify,
[MapRequest] = maprequest,
#if !FOCUSONCLICK_PATCH
[MotionNotify] = motionnotify,
#endif // FOCUSONCLICK_PATCH
[PropertyNotify] = propertynotify,
#if BAR_SYSTRAY_PATCH
[ResizeRequest] = resizerequest,
@@ -932,6 +943,9 @@ applyrules(Client *c)
c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2);
}
#endif // SCRATCHPADS_PATCH
#if UNMANAGED_PATCH
unmanaged = r->unmanaged;
#endif // UNMANAGED_PATCH
for (m = mons; m && m->num != r->monitor; m = m->next);
if (m)
c->mon = m;
@@ -954,6 +968,7 @@ applyrules(Client *c)
if (r->switchtag)
#endif // SWALLOW_PATCH
{
unfocus(selmon->sel, 1, NULL);
selmon = c->mon;
if (r->switchtag == 2 || r->switchtag == 4)
newtagset = c->mon->tagset[c->mon->seltags] ^ c->tags;
@@ -1097,6 +1112,11 @@ arrange(Monitor *m)
void
arrangemon(Monitor *m)
{
#if BAR_PADDING_SMART_PATCH
updatebarpos(selmon);
for (Bar *bar = selmon->bar; bar; bar = bar->next)
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
#endif // BAR_PADDING_SMART_PATCH
#if TAB_PATCH
updatebarpos(m);
XMoveResizeWindow(dpy, m->tabwin, m->wx, m->ty, m->ww, th);
@@ -1450,6 +1470,15 @@ configure(Client *c)
ce.width = c->w;
ce.height = c->h;
ce.border_width = c->bw;
#if NOBORDER_PATCH
if (noborder(c)) {
ce.width += c->bw * 2;
ce.height += c->bw * 2;
ce.border_width = 0;
}
#endif // NOBORDER_PATCH
ce.above = None;
ce.override_redirect = False;
XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce);
@@ -1489,8 +1518,8 @@ configurenotify(XEvent *e)
createpreview(m);
#endif // BAR_TAGPREVIEW_PATCH
}
focus(NULL);
arrange(NULL);
focus(NULL);
}
}
}
@@ -1676,7 +1705,7 @@ createmon(void)
bar->showbar = 1;
bar->external = 0;
#if BAR_BORDER_PATCH
bar->borderpx = borderpx;
bar->borderpx = (barborderpx ? barborderpx : borderpx);
#else
bar->borderpx = 0;
#endif // BAR_BORDER_PATCH
@@ -1761,6 +1790,10 @@ createmon(void)
}
#endif // PERTAG_PATCH
#if PERMON_VANITYGAPS_PATCH
m->enablegaps = 1;
#endif // PERMON_VANITYGAPS_PATCH
#if SEAMLESS_RESTART_PATCH
restoremonitorstate(m);
#endif // SEAMLESS_RESTART_PATCH
@@ -1813,6 +1846,11 @@ detach(Client *c)
#if SEAMLESS_RESTART_PATCH
c->idx = 0;
#endif // SEAMLESS_RESTART_PATCH
#if FOCUSMASTER_RETURN_PATCH
for (int i = 1; i < NUMTAGS; i++)
if (c == c->mon->tagmarked[i])
c->mon->tagmarked[i] = NULL;
#endif // FOCUSMASTER_RETURN_PATCH
for (tc = &c->mon->clients; *tc && *tc != c; tc = &(*tc)->next);
*tc = c->next;
@@ -2037,6 +2075,14 @@ expose(XEvent *e)
void
focus(Client *c)
{
#if FOCUSFOLLOWMOUSE_PATCH
if (!c || !ISVISIBLE(c))
c = getpointerclient();
#endif // FOCUSFOLLOWMOUSE_PATCH
#if STICKY_PATCH
if (!c || !ISVISIBLE(c))
for (c = selmon->stack; c && (!ISVISIBLE(c) || c->issticky); c = c->snext);
#endif // STICKY_PATCH
if (!c || !ISVISIBLE(c))
for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
if (selmon->sel && selmon->sel != c)
@@ -2471,8 +2517,10 @@ manage(Window w, XWindowAttributes *wa)
#endif // CENTER_TRANSIENT_WINDOWS_PATCH | CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH | CENTER_PATCH
} else {
#if SEAMLESS_RESTART_PATCH
if (!settings_restored)
if (!settings_restored || c->mon == NULL) {
c->mon = selmon;
settings_restored = 0;
}
#else
c->mon = selmon;
#endif // SEAMLESS_RESTART_PATCH
@@ -2498,6 +2546,29 @@ manage(Window w, XWindowAttributes *wa)
#endif // SWALLOW_PATCH
}
#if UNMANAGED_PATCH
if (unmanaged) {
XMapWindow(dpy, c->win);
if (unmanaged == 1)
XRaiseWindow(dpy, c->win);
else if (unmanaged == 2)
XLowerWindow(dpy, c->win);
updatewmhints(c);
if (!c->neverfocus)
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
#if BAR_SYSTRAY_PATCH
sendevent(c->win, wmatom[WMTakeFocus], NoEventMask, wmatom[WMTakeFocus], CurrentTime, 0, 0, 0);
#else
sendevent(c, wmatom[WMTakeFocus]);
#endif // BAR_SYSTRAY_PATCH
free(c);
unmanaged = 0;
return;
}
#endif // UNMANAGED_PATCH
if (c->x + WIDTH(c) > c->mon->wx + c->mon->ww)
c->x = c->mon->wx + c->mon->ww - WIDTH(c);
if (c->y + HEIGHT(c) > c->mon->wy + c->mon->wh)
@@ -2666,16 +2737,17 @@ maprequest(XEvent *e)
manage(ev->window, &wa);
}
#if !FOCUSONCLICK_PATCH
void
motionnotify(XEvent *e)
{
#if !FOCUSONCLICK_PATCH
static Monitor *mon = NULL;
Monitor *m;
Bar *bar;
#if LOSEFULLSCREEN_PATCH
Client *sel;
#endif // LOSEFULLSCREEN_PATCH
#endif // FOCUSONCLICK_PATCH
Bar *bar;
XMotionEvent *ev = &e->xmotion;
if ((bar = wintobar(ev->window))) {
@@ -2688,6 +2760,7 @@ motionnotify(XEvent *e)
hidetagpreview(selmon);
#endif // BAR_TAGPREVIEW_PATCH
#if !FOCUSONCLICK_PATCH
if (ev->window != root)
return;
if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
@@ -2702,8 +2775,8 @@ motionnotify(XEvent *e)
focus(NULL);
}
mon = m;
#endif // FOCUSONCLICK_PATCH
}
#endif // FOCUSONCLICK_PATCH
void
movemouse(const Arg *arg)
@@ -2804,10 +2877,63 @@ nexttiled(Client *c)
return c;
}
#if NOBORDER_PATCH
int
noborder(Client *c)
{
int monocle_layout = 0;
#if MONOCLE_LAYOUT
if (&monocle == c->mon->lt[c->mon->sellt]->arrange)
monocle_layout = 1;
#endif // MONOCLE_LAYOUT
#if DECK_LAYOUT
if (&deck == c->mon->lt[c->mon->sellt]->arrange && c->mon->nmaster == 0)
monocle_layout = 1;
#endif // DECK_LAYOUT
#if FLEXTILE_DELUXE_LAYOUT
if (&flextile == c->mon->lt[c->mon->sellt]->arrange && (
(c->mon->ltaxis[LAYOUT] == NO_SPLIT && c->mon->ltaxis[MASTER] == MONOCLE) ||
(c->mon->ltaxis[STACK] == MONOCLE && c->mon->nmaster == 0)
)) {
monocle_layout = 1;
}
#endif //FLEXTILE_DELUXE_LAYOUT
if (!monocle_layout && (nexttiled(c->mon->clients) != c || nexttiled(c->next)))
return 0;
if (c->isfloating)
return 0;
if (!c->mon->lt[c->mon->sellt]->arrange)
return 0;
#if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH
if (c->fakefullscreen != 1 && c->isfullscreen)
return 0;
#elif !FAKEFULLSCREEN_PATCH
if (c->isfullscreen)
return 0;
#endif // FAKEFULLSCREEN_CLIENT_PATCH
return 1;
}
#endif // NOBORDER_PATCH
#if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH
void
pop(Client *c)
{
#if FOCUSMASTER_RETURN_PATCH
int i;
for (i = 0; !(selmon->tagset[selmon->seltags] & 1 << i); i++);
i++;
c->mon->tagmarked[i] = nexttiled(c->mon->clients);
#endif // FOCUSMASTER_RETURN_PATCH
detach(c);
attach(c);
focus(c);
@@ -2951,31 +3077,9 @@ resizeclient(Client *c, int x, int y, int w, int h)
drawroundedcorners(c);
#endif // ROUNDED_CORNERS_PATCH
#if NOBORDER_PATCH
if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next))
#if MONOCLE_LAYOUT
|| &monocle == c->mon->lt[c->mon->sellt]->arrange
#endif // MONOCLE_LAYOUT
#if DECK_LAYOUT
|| (&deck == c->mon->lt[c->mon->sellt]->arrange &&
c->mon->nmaster == 0)
#endif // DECK_LAYOUT
#if FLEXTILE_DELUXE_LAYOUT
|| (&flextile == c->mon->lt[c->mon->sellt]->arrange && (
(c->mon->ltaxis[LAYOUT] == NO_SPLIT &&
c->mon->ltaxis[MASTER] == MONOCLE) ||
(c->mon->ltaxis[STACK] == MONOCLE &&
c->mon->nmaster == 0)))
#endif //FLEXTILE_DELUXE_LAYOUT
)
#if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH
&& (c->fakefullscreen == 1 || !c->isfullscreen)
#else
&& !c->isfullscreen
#endif // FAKEFULLSCREEN_CLIENT_PATCH
&& !c->isfloating
&& c->mon->lt[c->mon->sellt]->arrange) {
c->w = wc.width += c->bw * 2;
c->h = wc.height += c->bw * 2;
if (noborder(c)) {
wc.width += c->bw * 2;
wc.height += c->bw * 2;
wc.border_width = 0;
}
#endif // NOBORDER_PATCH
@@ -3209,7 +3313,6 @@ run(void)
event_fd, events[i].data.ptr, events[i].data.u32,
events[i].data.u64);
fprintf(stderr, " with events %d\n", events[i].events);
return;
}
}
}
@@ -3330,6 +3433,14 @@ sendmon(Client *c, Monitor *m)
#else
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
#endif // EMPTYVIEW_PATCH
#if SENDMON_CENTER_PATCH
c->x = m->mx + (m->mw - WIDTH(c)) / 2;
c->y = m->my + (m->mh - HEIGHT(c)) / 2;
#if SAVEFLOATS_PATCH
c->sfx = m->mx + (m->mw - c->sfw - 2 * c->bw) / 2;
c->sfy = m->my + (m->mh - c->sfh - 2 * c->bw) / 2;
#endif // SAVEFLOATS_PATCH
#endif // SENDMON_CENTER_PATCH
#if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH
attachx(c);
#else
@@ -3347,11 +3458,12 @@ sendmon(Client *c, Monitor *m)
if (hadfocus) {
focus(c);
restack(m);
} else
} else {
focus(NULL);
}
#else
focus(NULL);
arrange(NULL);
focus(NULL);
#endif // EXRESIZE_PATCH / SENDMON_KEEPFOCUS_PATCH
#if SWITCHTAG_PATCH
if (c->switchtag)
@@ -4074,6 +4186,7 @@ tag(const Arg *arg)
if (selmon->sel->switchtag)
selmon->sel->switchtag = 0;
#endif // SWITCHTAG_PATCH
arrange(selmon);
focus(NULL);
#if SWAPFOCUS_PATCH && PERTAG_PATCH
selmon->pertag->prevclient[selmon->pertag->curtag] = NULL;
@@ -4081,7 +4194,6 @@ tag(const Arg *arg)
if (tagmask & 1)
selmon->pertag->prevclient[tagindex] = NULL;
#endif // SWAPFOCUS_PATCH
arrange(selmon);
#if VIEWONTAG_PATCH
if ((arg->ui & TAGMASK) != selmon->tagset[selmon->seltags])
view(arg);
@@ -4171,10 +4283,21 @@ togglefloating(const Arg *arg)
#endif // !FAKEFULLSCREEN_PATCH
c->isfloating = !c->isfloating || c->isfixed;
#if !BAR_FLEXWINTITLE_PATCH
#if RENAMED_SCRATCHPADS_PATCH
if (c->scratchkey != 0 && c->isfloating)
XSetWindowBorder(dpy, c->win, scheme[SchemeScratchSel][ColFloat].pixel);
else if (c->scratchkey != 0)
XSetWindowBorder(dpy, c->win, scheme[SchemeScratchSel][ColBorder].pixel);
else if (c->isfloating)
XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel);
else
XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
#else
if (c->isfloating)
XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel);
else
XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
#endif // RENAMED_SCRATCHPADS_PATCH
#endif // BAR_FLEXWINTITLE_PATCH
if (c->isfloating) {
#if SAVEFLOATS_PATCH || EXRESIZE_PATCH
@@ -4213,13 +4336,13 @@ toggletag(const Arg *arg)
newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
if (newtags) {
selmon->sel->tags = newtags;
arrange(selmon);
focus(NULL);
#if SWAPFOCUS_PATCH && PERTAG_PATCH
for (tagmask = arg->ui & TAGMASK, tagindex = 1; tagmask!=0; tagmask >>= 1, tagindex++)
if (tagmask & 1)
selmon->pertag->prevclient[tagindex] = NULL;
#endif // SWAPFOCUS_PATCH
arrange(selmon);
}
#if BAR_EWMHTAGS_PATCH
updatecurrentdesktop();
@@ -4306,8 +4429,8 @@ toggleview(const Arg *arg)
#endif // PERTAGBAR_PATCH
#endif // PERTAG_PATCH
#if !TAGSYNC_PATCH
focus(NULL);
arrange(selmon);
focus(NULL);
#endif // TAGSYNC_PATCH
#if !EMPTYVIEW_PATCH
}
@@ -4318,8 +4441,8 @@ toggleview(const Arg *arg)
#if !EMPTYVIEW_PATCH
if (newtagset) {
#endif // EMPTYVIEW_PATCH
focus(NULL);
arrange(NULL);
focus(NULL);
#if !EMPTYVIEW_PATCH
}
#endif // EMPTYVIEW_PATCH
@@ -4338,13 +4461,24 @@ unfocus(Client *c, int setfocus, Client *nextfocus)
selmon->pertag->prevclient[selmon->pertag->curtag] = c;
#endif // SWAPFOCUS_PATCH
#if LOSEFULLSCREEN_PATCH
if (c->isfullscreen && ISVISIBLE(c) && c->mon == selmon && nextfocus && !nextfocus->isfloating)
if (c->isfullscreen && ISVISIBLE(c) && c->mon == selmon && nextfocus && !nextfocus->isfloating) {
#if RENAMED_SCRATCHPADS_PATCH && RENAMED_SCRATCHPADS_AUTO_HIDE_PATCH
#if FAKEFULLSCREEN_CLIENT_PATCH
if (c->scratchkey != 0 && c->fakefullscreen != 1)
togglescratch(&((Arg) {.v = (const char*[]){ &c->scratchkey, NULL } }));
#else
if (c->scratchkey != 0)
togglescratch(&((Arg) {.v = (const char*[]){ &c->scratchkey, NULL } }));
#endif // FAKEFULLSCREEN_CLIENT_PATCH
else
#endif // RENAMED_SCRATCHPADS_AUTO_HIDE_PATCH
#if FAKEFULLSCREEN_CLIENT_PATCH
if (c->fakefullscreen != 1)
setfullscreen(c, 0);
#else
setfullscreen(c, 0);
#endif // #if FAKEFULLSCREEN_CLIENT_PATCH
}
#endif // LOSEFULLSCREEN_PATCH
grabbuttons(c, 0);
#if !BAR_FLEXWINTITLE_PATCH
@@ -4456,9 +4590,9 @@ unmanage(Client *c, int destroyed)
if (s)
return;
#endif // SWALLOW_PATCH
arrange(m);
focus(NULL);
updateclientlist();
arrange(m);
#if SWITCHTAG_PATCH
if (switchtag && ((switchtag & TAGMASK) != selmon->tagset[selmon->seltags]))
view(&((Arg) { .ui = switchtag }));
@@ -4578,16 +4712,36 @@ updatebarpos(Monitor *m)
#if BAR_PADDING_VANITYGAPS_PATCH && VANITYGAPS_PATCH
#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH
if (!selmon || selmon->pertag->enablegaps[selmon->pertag->curtag])
#elif PERMON_VANITYGAPS_PATCH
if (!selmon || selmon->enablegaps)
#else
if (enablegaps)
#endif // PERTAG_VANITYGAPS_PATCH
{
#if BAR_PADDING_SMART_PATCH
unsigned int n; Client *c;
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
if (n > 1) {
y_pad = gappoh;
x_pad = gappov;
}
#else
y_pad = gappoh;
x_pad = gappov;
#endif // BAR_PADDING_SMART_PATCH
}
#elif BAR_PADDING_PATCH
#if BAR_PADDING_SMART_PATCH
unsigned int n; Client *c;
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
if (n > 1) {
y_pad = vertpad;
x_pad = sidepad;
}
#else
y_pad = vertpad;
x_pad = sidepad;
#endif // BAR_PADDING_SMART_PATCH
#endif // BAR_PADDING_PATCH | BAR_PADDING_VANITYGAPS_PATCH
#if INSETS_PATCH
@@ -4642,7 +4796,7 @@ updatebarpos(Monitor *m)
}
void
updateclientlist()
updateclientlist(void)
{
Client *c;
Monitor *m;
@@ -4953,12 +5107,12 @@ view(const Arg *arg)
}
selmon = origselmon;
#endif // TAGSYNC_PATCH
focus(NULL);
#if TAGSYNC_PATCH
arrange(NULL);
#else
arrange(selmon);
#endif // TAGSYNC_PATCH
focus(NULL);
#if BAR_EWMHTAGS_PATCH
updatecurrentdesktop();
#endif // BAR_EWMHTAGS_PATCH
@@ -5036,6 +5190,9 @@ void
zoom(const Arg *arg)
{
Client *c = selmon->sel;
#if FOCUSMASTER_RETURN_PATCH && ZOOMSWAP_PATCH
int i;
#endif // FOCUSMASTER_RETURN_PATCH
if (arg && arg->v)
c = (Client*)arg->v;
if (!c)
@@ -5089,6 +5246,12 @@ zoom(const Arg *arg)
cold = nexttiled(c->mon->clients);
if (c != cold && !at)
at = findbefore(c);
#if FOCUSMASTER_RETURN_PATCH
for (i = 0; !(selmon->tagset[selmon->seltags] & 1 << i); i++);
i++;
c->mon->tagmarked[i] = cold;
#endif // FOCUSMASTER_RETURN_PATCH
detach(c);
attach(c);
/* swap windows instead of pushing the previous one down */

13
justfile Normal file
View File

@@ -0,0 +1,13 @@
set shell := ["bash", "-c"]
# List just commands by default
default:
@just --list
# Update doom emacs and sync config
dwm-rebuild:
sudo make clean install
# Run polybar launch script
dwm-launch-polybar:
./polybar/launch.sh

View File

@@ -21,7 +21,7 @@ alttab()
/* redraw tab */
XRaiseWindow(dpy, alttabwin);
drawtab(ntabs, 0, m);
drawalttab(ntabs, 0, m);
}
void
@@ -66,7 +66,7 @@ alttabend()
}
void
drawtab(int nwins, int first, Monitor *m)
drawalttab(int nwins, int first, Monitor *m)
{
Client *c;
int i, h;
@@ -178,7 +178,7 @@ alttabstart(const Arg *arg)
i++;
}
drawtab(ntabs, 1, m);
drawalttab(ntabs, 1, m);
struct timespec ts = { .tv_sec = 0, .tv_nsec = 1000000 };

View File

@@ -1,5 +1,5 @@
#include <time.h>
static void drawtab(int nwins, int first, Monitor *m);
static void drawalttab(int nwins, int first, Monitor *m);
static void alttabstart(const Arg *arg);
static void alttabend();

81
patch/bar_launcher.c Normal file
View File

@@ -0,0 +1,81 @@
#if BAR_STATUS2D_PATCH
int
width_launcher(Bar *bar, BarArg *a)
{
int i, x = 0;
for (i = 0; i < LENGTH(launchers); i++) {
x += status2dtextlength(launchers[i].name) + lrpad;
}
return x;
}
int
draw_launcher(Bar *bar, BarArg *a)
{
int i, w = 0;;
for (i = 0; i < LENGTH(launchers); i++) {
w = status2dtextlength(launchers[i].name);
drawstatusbar(a, launchers[i].name);
a->x += w + lrpad;
}
return a->x ;
}
int
click_launcher(Bar *bar, Arg *arg, BarArg *a)
{
int i, x = 0;
for (i = 0; i < LENGTH(launchers); i++) {
x += status2dtextlength(launchers[i].name) + lrpad;
if (a->x < x) {
spawn(&launchers[i].command);
break;
}
}
return -1;
}
#else
int
width_launcher(Bar *bar, BarArg *a)
{
int i, x = 0;
for (i = 0; i < LENGTH(launchers); i++) {
x += TEXTW(launchers[i].name);
}
return x;
}
int
draw_launcher(Bar *bar, BarArg *a)
{
int i, x = 0, w = 0;;
for (i = 0; i < LENGTH(launchers); i++) {
w = TEXTW(launchers[i].name);
drw_text(drw, x, 0, w, bh, lrpad / 2, launchers[i].name, 0, True);
x += w;
}
return x;
}
int
click_launcher(Bar *bar, Arg *arg, BarArg *a)
{
int i, x = 0;
for (i = 0; i < LENGTH(launchers); i++) {
x += TEXTW(launchers[i].name);
if (a->x < x) {
spawn(&launchers[i].command);
break;
}
}
return -1;
}
#endif // BAR_STATUS2D_PATCH

8
patch/bar_launcher.h Normal file
View File

@@ -0,0 +1,8 @@
typedef struct {
char* name;
const Arg command;
} Launcher;
static int width_launcher(Bar *bar, BarArg *a);
static int draw_launcher(Bar *bar, BarArg *a);
static int click_launcher(Bar *bar, Arg *arg, BarArg *a);

View File

@@ -9,7 +9,7 @@ layoutmenu(const Arg *arg) {
s = fgets(c, sizeof(c), p);
pclose(p);
if (!s || *s == '\0' || c == '\0')
if (!s || *s == '\0' || c[0] == '\0')
return;
i = atoi(c);

View File

@@ -15,4 +15,3 @@ click_ltsymbol(Bar *bar, Arg *arg, BarArg *a)
{
return ClkLtSymbol;
}

View File

@@ -1,4 +1,3 @@
static int width_ltsymbol(Bar *bar, BarArg *a);
static int draw_ltsymbol(Bar *bar, BarArg *a);
static int click_ltsymbol(Bar *bar, Arg *arg, BarArg *a);

View File

@@ -102,6 +102,65 @@ click_pwrl_tags(Bar *bar, Arg *arg, BarArg *a)
if (i < NUMTAGS) {
arg->ui = 1 << i;
}
#if BAR_TAGPREVIEW_PATCH
if (selmon->previewshow != 0) {
hidetagpreview(selmon);
}
#endif // BAR_TAGPREVIEW_PATCH
return ClkTagBar;
}
int
hover_pwrl_tags(Bar *bar, BarArg *a, XMotionEvent *ev)
{
#if BAR_TAGPREVIEW_PATCH
int i = 0, x = lrpad / 2;
int px, py;
int plw = drw->fonts->h / 2 + 1;
Monitor *m = bar->mon;
#if VANITYGAPS_PATCH
int ov = gappov;
int oh = gappoh;
#else
int ov = 0;
int oh = 0;
#endif // VANITYGAPS_PATCH
#if BAR_HIDEVACANTTAGS_PATCH
Client *c;
unsigned int occ = 0;
for (c = bar->mon->clients; c; c = c->next)
occ |= c->tags == 255 ? 0 : c->tags;
#endif // BAR_HIDEVACANTTAGS_PATCH
do {
#if BAR_HIDEVACANTTAGS_PATCH
if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i))
continue;
#endif // BAR_HIDEVACANTTAGS_PATCH
x += TEXTW(tagicon(bar->mon, i)) + plw;
} while (a->x >= x && ++i < NUMTAGS);
if (i < NUMTAGS) {
if ((i + 1) != selmon->previewshow && !(selmon->tagset[selmon->seltags] & 1 << i)) {
if (bar->by > m->my + m->mh / 2) // bottom bar
py = bar->by - m->mh / scalepreview - oh;
else // top bar
py = bar->by + bar->bh + oh;
px = bar->bx + ev->x - m->mw / scalepreview / 2;
if (px + m->mw / scalepreview > m->mx + m->mw)
px = m->wx + m->ww - m->mw / scalepreview - ov;
else if (px < bar->bx)
px = m->wx + ov;
selmon->previewshow = i + 1;
showtagpreview(i, px, py);
} else if (selmon->tagset[selmon->seltags] & 1 << i) {
hidetagpreview(selmon);
}
} else if (selmon->previewshow != 0) {
hidetagpreview(selmon);
}
#endif // BAR_TAGPREVIEW_PATCH
return 1;
}

View File

@@ -1,4 +1,4 @@
static int width_pwrl_tags(Bar *bar, BarArg *a);
static int draw_pwrl_tags(Bar *bar, BarArg *a);
static int click_pwrl_tags(Bar *bar, Arg *arg, BarArg *a);
static int hover_pwrl_tags(Bar *bar, BarArg *a, XMotionEvent *ev);

View File

@@ -96,6 +96,7 @@ drawstatusbar(BarArg *a, char* stext)
#else
memcpy(text, stext, len);
#endif // BAR_STATUSCMD_PATCH
text[len] = '\0';
x += lrpad / 2;
drw_setscheme(drw, scheme[LENGTH(colors)]);

View File

@@ -94,6 +94,12 @@ draw_systray(Bar *bar, BarArg *a)
i->mon = bar->mon;
}
#if !BAR_ALPHA_PATCH
wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
XChangeWindowAttributes(dpy, systray->win, CWBackPixel, &wa);
XClearWindow(dpy, systray->win);
#endif // BAR_ALPHA_PATCH
XMoveResizeWindow(dpy, systray->win, bar->bx + a->x + lrpad / 2, (w ? bar->by + a->y + (a->h - systray->h) / 2: -systray->h), MAX(w, 1), systray->h);
return w;
}

View File

@@ -87,5 +87,55 @@ click_taglabels(Bar *bar, Arg *arg, BarArg *a)
if (i < NUMTAGS) {
arg->ui = 1 << i;
}
#if BAR_TAGPREVIEW_PATCH
if (selmon->previewshow != 0) {
hidetagpreview(selmon);
}
#endif // BAR_TAGPREVIEW_PATCH
return ClkTagBar;
}
int
hover_taglabels(Bar *bar, BarArg *a, XMotionEvent *ev)
{
#if BAR_TAGPREVIEW_PATCH
int i = 0, x = lrpad / 2;
int px, py;
Monitor *m = bar->mon;
#if VANITYGAPS_PATCH
int ov = gappov;
int oh = gappoh;
#else
int ov = 0;
int oh = 0;
#endif // VANITYGAPS_PATCH
do {
if (!m->taglabel[i][0])
continue;
x += TEXTW(m->taglabel[i]);
} while (a->x >= x && ++i < NUMTAGS);
if (i < NUMTAGS) {
if ((i + 1) != selmon->previewshow && !(selmon->tagset[selmon->seltags] & 1 << i)) {
if (bar->by > m->my + m->mh / 2) // bottom bar
py = bar->by - m->mh / scalepreview - oh;
else // top bar
py = bar->by + bar->bh + oh;
px = bar->bx + ev->x - m->mw / scalepreview / 2;
if (px + m->mw / scalepreview > m->mx + m->mw)
px = m->wx + m->ww - m->mw / scalepreview - ov;
else if (px < bar->bx)
px = m->wx + ov;
selmon->previewshow = i + 1;
showtagpreview(i, px, py);
} else if (selmon->tagset[selmon->seltags] & 1 << i) {
hidetagpreview(selmon);
}
} else if (selmon->previewshow != 0) {
hidetagpreview(selmon);
}
#endif // BAR_TAGPREVIEW_PATCH
return 1;
}

View File

@@ -2,4 +2,5 @@
static int width_taglabels(Bar *bar, BarArg *a);
static int draw_taglabels(Bar *bar, BarArg *a);
static int click_taglabels(Bar *bar, Arg *arg, BarArg *a);
static int click_taglabels(Bar *bar, Arg *arg, BarArg *a);
static int hover_taglabels(Bar *bar, BarArg *a, XMotionEvent *ev);

View File

@@ -88,6 +88,11 @@ click_tags(Bar *bar, Arg *arg, BarArg *a)
if (i < NUMTAGS) {
arg->ui = 1 << i;
}
#if BAR_TAGPREVIEW_PATCH
if (selmon->previewshow != 0) {
hidetagpreview(selmon);
}
#endif // BAR_TAGPREVIEW_PATCH
return ClkTagBar;
}

View File

@@ -51,7 +51,7 @@ togglewin(const Arg *arg)
Client *c = (Client*)arg->v;
if (!c)
return;
if (c == selmon->sel)
if (!HIDDEN(c) && c == selmon->sel)
hide(c);
else {
if (HIDDEN(c))

View File

@@ -22,8 +22,8 @@ combotag(const Arg *arg)
combo = 1;
selmon->sel->tags = arg->ui & TAGMASK;
}
focus(NULL);
arrange(selmon);
focus(NULL);
}
}

View File

@@ -22,10 +22,10 @@ distributetags(const Arg *arg)
#if TAGSYNC_PATCH
}
selmon = origselmon;
focus(NULL);
arrange(NULL);
#else
focus(NULL);
#else
arrange(selmon);
focus(NULL);
#endif // TAGSYNC_PATCH
}

View File

@@ -6,8 +6,8 @@ tagtoleft(const Arg *arg)
&& __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1
&& selmon->tagset[selmon->seltags] > 1) {
selmon->sel->tags >>= 1;
focus(NULL);
arrange(selmon);
focus(NULL);
}
}
@@ -19,8 +19,8 @@ tagtoright(const Arg *arg)
&& __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1
&& selmon->tagset[selmon->seltags] & (MASK >> 1)) {
selmon->sel->tags <<= 1;
focus(NULL);
arrange(selmon);
focus(NULL);
}
}

9
patch/focusfollowmouse.c Normal file
View File

@@ -0,0 +1,9 @@
Client *
getpointerclient(void)
{
Window dummy, win;
int di;
unsigned int dui;
XQueryPointer(dpy, root, &dummy, &win, &di, &di, &di, &di, &dui);
return wintoclient(win);
}

1
patch/focusfollowmouse.h Normal file
View File

@@ -0,0 +1 @@
static Client *getpointerclient(void);

View File

@@ -1,14 +1,42 @@
void
focusmaster(const Arg *arg)
{
Client *c;
Client *master;
Monitor *m = selmon;
#if FOCUSMASTER_RETURN_PATCH
int i;
#endif // FOCUSMASTER_RETURN_PATCH
if (selmon->nmaster < 1)
if (m->nmaster < 1)
return;
#if !FAKEFULLSCREEN_PATCH
#if FAKEFULLSCREEN_CLIENT_PATCH
if (!m->sel || (m->sel->isfullscreen && m->sel->fakefullscreen != 1 && lockfullscreen))
return;
#else
if (!m->sel || (m->sel->isfullscreen && lockfullscreen))
return;
#endif // FAKEFULLSCREEN_CLIENT_PATCH
#endif // FAKEFULLSCREEN_PATCH
master = nexttiled(m->clients);
if (!master)
return;
c = nexttiled(selmon->clients);
#if FOCUSMASTER_RETURN_PATCH
for (i = 0; !(m->tagset[m->seltags] & 1 << i); i++);
i++;
if (c)
focus(c);
if (m->sel == master) {
if (m->tagmarked[i] && ISVISIBLE(m->tagmarked[i]))
focus(m->tagmarked[i]);
} else {
m->tagmarked[i] = m->sel;
focus(master);
}
#else
focus(master);
#endif // FOCUSMASTER_RETURN_PATCH
restack(m);
}

View File

@@ -21,6 +21,9 @@
#if COMBO_PATCH
#include "combo.c"
#endif
#if BAR_LAUNCHER_PATCH
#include "bar_launcher.c"
#endif
#if BAR_LTSYMBOL_PATCH
#include "bar_ltsymbol.c"
#endif
@@ -151,7 +154,10 @@
#if FOCUSDIR_PATCH
#include "focusdir.c"
#endif
#if FOCUSMASTER_PATCH
#if FOCUSFOLLOWMOUSE_PATCH
#include "focusfollowmouse.c"
#endif
#if FOCUSMASTER_PATCH || FOCUSMASTER_RETURN_PATCH
#include "focusmaster.c"
#endif
#if FOCUSURGENT_PATCH
@@ -205,6 +211,9 @@
#if PERTAG_PATCH
#include "pertag.c"
#endif
#if PLACEDIR_PATCH
#include "placedir.c"
#endif
#if PLACEMOUSE_PATCH
#include "placemouse.c"
#endif

View File

@@ -24,6 +24,9 @@
#if BAR_HOLDBAR_PATCH
#include "bar_holdbar.h"
#endif
#if BAR_LAUNCHER_PATCH
#include "bar_launcher.h"
#endif
#if BAR_LTSYMBOL_PATCH
#include "bar_ltsymbol.h"
#endif
@@ -154,7 +157,10 @@
#if FOCUSADJACENTTAG_PATCH
#include "focusadjacenttag.h"
#endif
#if FOCUSMASTER_PATCH
#if FOCUSFOLLOWMOUSE_PATCH
#include "focusfollowmouse.h"
#endif
#if FOCUSMASTER_PATCH || FOCUSMASTER_RETURN_PATCH
#include "focusmaster.h"
#endif
#if FOCUSURGENT_PATCH
@@ -204,6 +210,9 @@
#if PERTAG_PATCH
#include "pertag.h"
#endif
#if PLACEDIR_PATCH
#include "placedir.h"
#endif
#if PLACEMOUSE_PATCH
#include "placemouse.h"
#endif

View File

@@ -643,7 +643,7 @@ arrange_tatami(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, in
if (j < ai + cats) {
/* Arrange cats (all excess clients that can't be tiled as mats). Cats sleep on mats. */
switch (cats) {
switch (cats) {
case 1: // fill
break;
case 2: // up and down

96
patch/placedir.c Normal file
View File

@@ -0,0 +1,96 @@
void
placedir(const Arg *arg)
{
Client *s = selmon->sel, *f = NULL, *c, *next, *fprior, *sprior;
if (!s || s->isfloating)
return;
unsigned int score = -1;
unsigned int client_score;
int dist;
int dirweight = 20;
next = s->next;
if (!next)
next = s->mon->clients;
for (c = next; c != s; c = next) {
next = c->next;
if (!next)
next = s->mon->clients;
if (!ISVISIBLE(c)) // || HIDDEN(c)
continue;
switch (arg->i) {
case 0: // left
dist = s->x - c->x - c->w;
client_score =
dirweight * MIN(abs(dist), abs(dist + s->mon->ww)) +
abs(s->y - c->y);
break;
case 1: // right
dist = c->x - s->x - s->w;
client_score =
dirweight * MIN(abs(dist), abs(dist + s->mon->ww)) +
abs(c->y - s->y);
break;
case 2: // up
dist = s->y - c->y - c->h;
client_score =
dirweight * MIN(abs(dist), abs(dist + s->mon->wh)) +
abs(s->x - c->x);
break;
default:
case 3: // down
dist = c->y - s->y - s->h;
client_score =
dirweight * MIN(abs(dist), abs(dist + s->mon->wh)) +
abs(c->x - s->x);
break;
}
if (((arg->i == 0 || arg->i == 2) && client_score <= score) || client_score < score) {
score = client_score;
f = c;
}
}
if (f && f != s) {
for (fprior = f->mon->clients; fprior && fprior->next != f; fprior = fprior->next);
for (sprior = s->mon->clients; sprior && sprior->next != s; sprior = sprior->next);
if (s == fprior) {
next = f->next;
if (sprior)
sprior->next = f;
else
f->mon->clients = f;
f->next = s;
s->next = next;
} else if (f == sprior) {
next = s->next;
if (fprior)
fprior->next = s;
else
s->mon->clients = s;
s->next = f;
f->next = next;
} else { // clients are not adjacent to each other
next = f->next;
f->next = s->next;
s->next = next;
if (fprior)
fprior->next = s;
else
s->mon->clients = s;
if (sprior)
sprior->next = f;
else
f->mon->clients = f;
}
arrange(f->mon);
}
}

1
patch/placedir.h Normal file
View File

@@ -0,0 +1 @@
static void placedir(const Arg *arg);

View File

@@ -66,12 +66,13 @@ togglescratch(const Arg *arg)
if (c->scratchkey != ((char**)arg->v)[0][0])
continue;
/* awesomebar / wintitleactions compatibility, unhide scratchpad if hidden
#if BAR_WINTITLEACTIONS_PATCH
/* unhide scratchpad if hidden */
if (HIDDEN(c)) {
XMapWindow(dpy, c->win);
setclientstate(c, NormalState);
}
*/
#endif // BAR_WINTITLEACTIONS_PATCH
/* Record the first found scratchpad client for focus purposes, but prioritise the
scratchpad on the current monitor if one exists */

View File

@@ -62,8 +62,8 @@ togglescratch(const Arg *arg)
if (found) {
if (newtagset) {
selmon->tagset[selmon->seltags] = newtagset;
focus(NULL);
arrange(selmon);
focus(NULL);
}
if (ISVISIBLE(found)) {
focus(found);

View File

@@ -6,8 +6,8 @@ scratchpad_hide()
if (selmon->sel) {
selmon->sel->tags = SCRATCHPAD_MASK;
selmon->sel->isfloating = 1;
focus(NULL);
arrange(selmon);
focus(NULL);
}
}
@@ -36,8 +36,8 @@ scratchpad_show()
if (scratchpad_last_showed->tags != SCRATCHPAD_MASK) {
scratchpad_last_showed->tags = SCRATCHPAD_MASK;
focus(NULL);
arrange(selmon);
focus(NULL);
return;
}

View File

@@ -39,12 +39,12 @@ persistclientstate(Client *c)
int
restoreclientstate(Client *c)
{
return getclienttags(c)
| getclientfields(c)
#if SAVEFLOATS_PATCH
| restorewindowfloatposition(c, c->mon ? c->mon : selmon)
#endif // SAVEFLOATS_PATCH
;
int restored = getclientfields(c);
getclienttags(c);
#if SAVEFLOATS_PATCH
restorewindowfloatposition(c, c->mon ? c->mon : selmon);
#endif // SAVEFLOATS_PATCH
return restored;
}
void setmonitorfields(Monitor *m)

View File

@@ -15,13 +15,15 @@ setborderpx(const Arg *arg)
int delta = 2 * (m->borderpx - prev_borderpx);
#if BAR_BORDER_PATCH
for (bar = m->bar; bar; bar = bar->next) {
bar->bh = bar->bh - 2 * bar->borderpx + 2 * m->borderpx;
bar->borderpx = m->borderpx;
if (!barborderpx) {
for (bar = m->bar; bar; bar = bar->next) {
bar->bh = bar->bh - 2 * bar->borderpx + 2 * m->borderpx;
bar->borderpx = m->borderpx;
}
updatebarpos(m);
for (bar = m->bar; bar; bar = bar->next)
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
}
updatebarpos(m);
for (bar = m->bar; bar; bar = bar->next)
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
#endif // BAR_BORDER_PATCH
for (c = m->clients; c; c = c->next) {

View File

@@ -6,7 +6,7 @@ shift(const Arg *arg, int clients)
unsigned int tagmask = 0;
#if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH
shifted.ui = selmon->tagset[selmon->seltags];
shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK;
#else
shifted.ui = selmon->tagset[selmon->seltags];
#endif // SCRATCHPADS_PATCH
@@ -18,6 +18,10 @@ shift(const Arg *arg, int clients)
for (c = selmon->clients; c && clients; c = c->next) {
if (c == selmon->sel)
continue;
#if STICKY_PATCH
if (c->issticky)
continue;
#endif // STICKY_PATCH
#if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH
if (!(c->tags & SPTAGMASK))
tagmask |= c->tags;

View File

@@ -13,6 +13,9 @@ swallow(Client *p, Client *c)
{
Client *s;
XWindowChanges wc;
#if NOBORDER_PATCH
int border_padding = 0;
#endif // NOBORDER_PATCH
if (c->noswallow > 0 || c->isterminal)
return 0;
@@ -46,9 +49,21 @@ swallow(Client *p, Client *c)
setfloatinghint(s);
#endif // BAR_EWMHTAGS_PATCH
#if NOBORDER_PATCH
wc.border_width = p->bw;
if (noborder(p)) {
wc.border_width = 0;
border_padding = p->bw * 2;
}
XConfigureWindow(dpy, p->win, CWBorderWidth, &wc);
XMoveResizeWindow(dpy, p->win, s->x, s->y, s->w + border_padding, s->h + border_padding);
#else
wc.border_width = p->bw;
XConfigureWindow(dpy, p->win, CWBorderWidth, &wc);
XMoveResizeWindow(dpy, p->win, s->x, s->y, s->w, s->h);
#endif // NOBORDER_PATCH
#if !BAR_FLEXWINTITLE_PATCH
XSetWindowBorder(dpy, p->win, scheme[SchemeNorm][ColBorder].pixel);
#endif // BAR_FLEXWINTITLE_PATCH
@@ -65,6 +80,9 @@ unswallow(Client *c)
{
XWindowChanges wc;
c->win = c->swallowing->win;
#if NOBORDER_PATCH
int border_padding = 0;
#endif // NOBORDER_PATCH
free(c->swallowing);
c->swallowing = NULL;
@@ -80,9 +98,20 @@ unswallow(Client *c)
arrange(c->mon);
XMapWindow(dpy, c->win);
#if NOBORDER_PATCH
wc.border_width = c->bw;
if (noborder(c)) {
wc.border_width = 0;
border_padding = c->bw * 2;
}
XConfigureWindow(dpy, c->win, CWBorderWidth, &wc);
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w + border_padding, c->h + border_padding);
#else
wc.border_width = c->bw;
XConfigureWindow(dpy, c->win, CWBorderWidth, &wc);
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
#endif // NOBORDER_PATCH
#if !BAR_FLEXWINTITLE_PATCH
XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
#endif // BAR_FLEXWINTITLE_PATCH
@@ -91,8 +120,8 @@ unswallow(Client *c)
setfloatinghint(c);
#endif // BAR_EWMHTAGS_PATCH
setclientstate(c, NormalState);
focus(NULL);
arrange(c->mon);
focus(NULL);
}
pid_t

View File

@@ -43,7 +43,7 @@ tagallmon(const Arg *arg)
}
}
focus(NULL);
arrange(NULL);
focus(NULL);
}

View File

@@ -37,8 +37,8 @@ tagothermon(const Arg *arg, int dir)
sendmon(sel, newmon);
if (arg->ui & TAGMASK) {
sel->tags = arg->ui & TAGMASK;
focus(NULL);
arrange(newmon);
focus(NULL);
}
}

View File

@@ -69,7 +69,7 @@ tagswapmon(const Arg *arg)
}
}
focus(NULL);
arrange(NULL);
focus(NULL);
}

View File

@@ -10,8 +10,15 @@ resizemousescroll(const Arg *arg)
if (!(c = selmon->sel))
return;
#if !FAKEFULLSCREEN_PATCH
#if FAKEFULLSCREEN_CLIENT_PATCH
if (c->isfullscreen && c->fakefullscreen != 1) /* no support resizing fullscreen windows by mouse */
return;
#else
if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */
return;
#endif // FAKEFULLSCREEN_CLIENT_PATCH
#endif // !FAKEFULLSCREEN_PATCH
restack(selmon);
if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess)

View File

@@ -1,5 +1,5 @@
/* Settings */
#if !PERTAG_VANITYGAPS_PATCH
#if !(PERTAG_VANITYGAPS_PATCH || PERMON_VANITYGAPS_PATCH)
static int enablegaps = 1;
#endif // PERTAG_VANITYGAPS_PATCH
@@ -69,10 +69,12 @@ setgapsex(const Arg *arg)
#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH
if (!selmon->pertag->enablegaps[selmon->pertag->curtag])
selmon->pertag->enablegaps[selmon->pertag->curtag] = 1;
#elif PERMON_VANITYGAPS_PATCH
selmon->enablegaps = 1;
#else
if (!enablegaps)
enablegaps = 1;
#endif // PERTAG_VANITYGAPS_PATCH
#endif // PERTAG_VANITYGAPS_PATCH | PERMON_VANITYGAPS_PATCH
setgaps(oh, ov, ih, iv);
}
@@ -83,24 +85,35 @@ togglegaps(const Arg *arg)
{
#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH
selmon->pertag->enablegaps[selmon->pertag->curtag] = !selmon->pertag->enablegaps[selmon->pertag->curtag];
#elif PERMON_VANITYGAPS_PATCH
selmon->enablegaps = !selmon->enablegaps;
#else
enablegaps = !enablegaps;
#endif // PERTAG_VANITYGAPS_PATCH
#endif // PERTAG_VANITYGAPS_PATCH | PERMON_VANITYGAPS_PATCH
#if BAR_PADDING_VANITYGAPS_PATCH
#if PERMON_VANITYGAPS_PATCH
updatebarpos(selmon);
for (Bar *bar = selmon->bar; bar; bar = bar->next)
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
#else
for (Monitor *m = mons; m; m = m->next) {
updatebarpos(m);
for (Bar *bar = m->bar; bar; bar = bar->next)
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
}
#endif // PERMON_VANITYGAPS_PATCH
#if BAR_SYSTRAY_PATCH
drawbarwin(systray->bar);
#endif // BAR_SYSTRAY_PATCH
#endif // BAR_PADDING_VANITYGAPS_PATCH
#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH
#if (PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH) || PERMON_VANITYGAPS_PATCH
arrange(selmon);
#else
arrange(NULL);
#endif // PERTAG_VANITYGAPS_PATCH
#endif // PERTAG_VANITYGAPS_PATCH | PERMON_VANITYGAPS_PATCH
}
static void
@@ -193,9 +206,11 @@ getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc)
unsigned int n, oe, ie;
#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH
oe = ie = m->pertag->enablegaps[m->pertag->curtag];
#elif PERMON_VANITYGAPS_PATCH
oe = ie = m->enablegaps;
#else
oe = ie = enablegaps;
#endif // PERTAG_VANITYGAPS_PATCH
#endif // PERTAG_VANITYGAPS_PATCH | PERMON_VANITYGAPS_PATCH
Client *c;
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);

View File

@@ -132,7 +132,11 @@ xrdb(const Arg *arg)
#endif // BAR_ALPHA_PATCH
ColCount
);
focus(NULL);
#if BAR_SYSTRAY_PATCH && !BAR_ALPHA_PATCH
if (systray) {
XMoveWindow(dpy, systray->win, -32000, -32000);
}
#endif // BAR_SYSTRAY_PATCH
arrange(NULL);
focus(NULL);
}

View File

@@ -8,6 +8,8 @@
#define BAR_FLEXWINTITLE_PATCH 0
#define BAR_LAUNCHER_PATCH 0
#define BAR_LAYOUTMENU_PATCH 0
#define BAR_LTSYMBOL_PATCH 0
@@ -51,9 +53,9 @@
#define BAR_TITLE_RIGHT_PAD_PATCH 0
#define BAR_TITLE_LEFT_PAD_PATCH 0
#define BAR_ACTIVETAGINDICATORBAR_PATCH N/A
#define BAR_ACTIVETAGINDICATORBAR_PATCH 0
#define BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH N/A
#define BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH 0
#define BAR_ALPHA_PATCH 0
@@ -71,7 +73,7 @@
#define BAR_CENTEREDWINDOWNAME_PATCH 0
#define BAR_CLIENTINDICATOR_PATCH N/A
#define BAR_CLIENTINDICATOR_PATCH 0
#define BAR_DMENUMATCHTOP_PATCH 0
@@ -91,6 +93,10 @@
#define BAR_PADDING_PATCH 0
#define BAR_PADDING_VANITYGAPS_PATCH 0
#define BAR_PADDING_SMART_PATCH 0
#define BAR_PANGO_PATCH 0
#define BAR_STATICSTATUS_PATCH 0
@@ -145,6 +151,8 @@
#define DISTRIBUTETAGS_PATCH 0
#define DO_NOT_DIE_ON_COLOR_ALLOCATION_FAILURE_PATCH 0
#define DRAGCFACT_PATCH 0
#define DRAGMFACT_PATCH 0
@@ -167,8 +175,12 @@
#define FOCUSDIR_PATCH 0
#define FOCUSFOLLOWMOUSE_PATCH 0
#define FOCUSMASTER_PATCH 0
#define FOCUSMASTER_RETURN_PATCH 0
#define FOCUSONCLICK_PATCH 0
#define FOCUSURGENT_PATCH 0
@@ -235,6 +247,10 @@
#define PERTAGBAR_PATCH 0
#define PERMON_VANITYGAPS_PATCH 0
#define PLACEDIR_PATCH 0
#define PLACEMOUSE_PATCH 1
#define PUSH_PATCH 0
@@ -273,6 +289,8 @@
#define SELFRESTART_PATCH 0
#define SENDMON_CENTER_PATCH 0
#define SENDMON_KEEPFOCUS_PATCH 0
#define SETBORDERPX_PATCH 0
@@ -345,6 +363,8 @@
#define UNFLOATVISIBLE_PATCH 1
#define UNMANAGED_PATCH 1
#define VANITYGAPS_PATCH 1
#define VANITYGAPS_MONOCLE_PATCH 0

View File

@@ -11,7 +11,7 @@ yellow = ${xrdb:color3:#F1FA8C}
green = ${xrdb:color2:#50FA7B}
orange = ${xrdb:color16:#FFB86C}
background = ${self.dark-gray}
background = #CC282A36
background-alt = ${self.light-gray}
foreground = ${self.white}
foreground-alt = ${self.lighter-gray}
@@ -20,8 +20,8 @@ secondary = ${self.blue}
alert = ${self.red}
; left
powermenu-foreground = ${self.background}
powermenu-background = ${self.blue}
powermenu-foreground = ${self.blue}
powermenu-background = ${self.background}
powermenu-underline = ${self.background}
powermenu-overline = ${self.background}
@@ -65,49 +65,67 @@ dwm-empty-background = ${self.background}
dwm-empty-underline = ${self.background}
dwm-empty-overline = ${self.background}
media-playing-foreground = ${self.background}
media-playing-background = ${self.green}
media-playing-foreground = ${self.green}
media-playing-background = ${self.background}
media-playing-underline = ${self.background}
media-playing-overline = ${self.background}
; center
tray-background = ${self.background}
; right
kernel-foreground = ${self.background}
kernel-background = ${self.orange}
system76-power-foreground = ${self.green}
system76-power-background = ${self.background}
system76-power-underline = ${self.background}
system76-power-overline = ${self.background}
kernel-foreground = ${self.orange}
kernel-background = ${self.background}
kernel-underline = ${self.background}
kernel-overline = ${self.background}
cpu-foreground = ${self.background}
cpu-background = ${self.purple}
cpu-foreground = ${self.purple}
cpu-background = ${self.background}
cpu-underline = ${self.background}
cpu-overline = ${self.background}
memory-foreground = ${self.background}
memory-background = ${self.blue}
memory-foreground = ${self.blue}
memory-background = ${self.background}
memory-underline = ${self.background}
memory-overline = ${self.background}
filesystem-foreground = ${self.background}
filesystem-background = ${self.pink}
filesystem-foreground = ${self.pink}
filesystem-background = ${self.background}
filesystem-underline = ${self.background}
filesystem-overline = ${self.background}
date-foreground = ${self.background}
date-background = ${self.yellow}
date-foreground = ${self.yellow}
date-background = ${self.background}
date-underline = ${self.background}
date-overline = ${self.background}
time-foreground = ${self.background}
time-background = ${self.purple}
time-foreground = ${self.purple}
time-background = ${self.background}
time-underline = ${self.background}
time-overline = ${self.background}
deadd-notification-center-foreground = ${self.background}
deadd-notification-center-background = ${self.green}
deadd-notification-center-foreground = ${self.green}
deadd-notification-center-background = ${self.background}
deadd-notification-center-underline = ${self.background}
deadd-notification-center-overline = ${self.background}
volume-foreground = ${self.background}
volume-background = ${self.red}
dunst-foreground = ${self.green}
dunst-background = ${self.background}
dunst-underline = ${self.background}
dunst-overline = ${self.background}
xfce4-notifyd-foreground = ${self.green}
xfce4-notifyd-background = ${self.background}
xfce4-notifyd-underline = ${self.background}
xfce4-notifyd-overline = ${self.background}
volume-foreground = ${self.red}
volume-background = ${self.background}
volume-underline = ${self.background}
volume-overline = ${self.background}
@@ -121,13 +139,15 @@ tray-scale = ${xrdb:polybar.tray-scale:1}
maxlen = ${xrdb:polybar.maxlen:50}
[intervals]
cpu = 1
date = 1
time = 1
filesystem = 900
memory = 1
media-playing = 1
kernel = 86400
media-playing = 1
system76-power = 86400
kernel = 86400
cpu = 1
memory = 1
filesystem = 600
date = 1
time = 1
dunst = 1
[global/wm]
; Adjust the _NET_WM_STRUT_PARTIAL top value
@@ -210,8 +230,8 @@ radius = 10.0
; Individual values can be defined using:
; {overline,underline}-size
; {overline,underline}-color
overline-size = 4
underline-size = 4
overline-size = 0
underline-size = 0
; Values applied to all borders
; Individual side values can be defined using:
@@ -250,11 +270,14 @@ module-margin = ${sizes.module-margin}
; font-3 = FontAwesome:size=10
; See the Fonts wiki page for more details
font-0 = "Ubuntu Nerd Font:style=Medium:size=11;3"
font-1 = "FiraCode Nerd Font:size=11;3"
font-1 = "MonaspiceNe NF:size=11;3"
font-2 = "DroidSansM Nerd Font:size=11;3"
font-3 = "IPAPGothic:size=11;3"
font-4 = "Baekmuk Dotum:size=11;3"
font-5 = "IPAPGothic:size=11;3"
font-6 = "NotoSansNerdFont:size=11;3"
font-7 = "NotoSansCJK:size=11;3"
font-8 = "NotoSansYi:size=11;3"
; Modules are added to one of the available blocks
; modules-left = cpu ram
@@ -262,7 +285,7 @@ font-5 = "IPAPGothic:size=11;3"
; modules-right = ipc clock
modules-left = powermenu-left powermenu powermenu-right dwm volume-left volume volume-right media-playing-left media-playing-change media-playing-prev media-playing-play-pause media-playing-next media-playing media-playing-right
; modules-center =
modules-right = kernel-left kernel kernel-right cpu-left cpu cpu-right memory-left memory memory-right filesystem-left filesystem filesystem-right date-left date date-right time-left time time-right deadd-notification-center-left deadd-notification-center deadd-notification-center-right
modules-right = kernel-left kernel kernel-right system76-power-left system76-power system76-power-right cpu-left cpu cpu-right memory-left memory memory-right filesystem-left filesystem filesystem-right date-left date date-right time-left time time-right dunst-left dunst-status dunst-clear dunst-history-view dunst-history-clear dunst-history-length dunst-right
; The separator will be inserted between the output of each module
separator = ""
@@ -312,7 +335,7 @@ tray-maxsize = ${sizes.tray-maxsize}
; ARGB color (e.g. #f00, #ff992a, #ddff1023)
; By default the tray container will use the bar
; background color.
tray-background = ${colors.background}
tray-background = ${colors.tray-background}
; Tray offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
tray-offset-x = 0
@@ -365,7 +388,7 @@ cursor-scroll = ns-resize
[module/powermenu-left]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.powermenu-background}
content-underline = ${colors.powermenu-underline}
content-overline = ${colors.powermenu-overline}
@@ -373,7 +396,7 @@ content-padding = ${sizes.module-padding}
[module/powermenu-right]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.powermenu-background}
content-underline = ${colors.powermenu-underline}
content-overline = ${colors.powermenu-overline}
@@ -382,7 +405,7 @@ content-padding = ${sizes.module-padding}
[module/powermenu]
type = custom/text
; content = " Menu"
content = ""
content = "󰀻"
; content = ""
; "content" has the same properties as "format-NAME"
@@ -397,7 +420,7 @@ content-padding = ${sizes.module-padding}
; click-middle = notify-send middle
; click-right = notify-send right
click-left = "rofi -show combi"
click-right = "/home/sravan/.scripts/control-center.sh --rofi"
click-right = "~/.scripts/control-center.sh --rofi"
; "scroll-(up|down)" will be executed using "/bin/sh -c $COMMAND"
; scroll-up = notify-send scroll up
@@ -511,7 +534,7 @@ label-empty-padding = ${sizes.module-dwm-padding}
[module/media-playing-left]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.media-playing-background}
content-underline = ${colors.media-playing-underline}
content-overline = ${colors.media-playing-overline}
@@ -519,7 +542,7 @@ content-padding = ${sizes.module-padding}
[module/media-playing-right]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.media-playing-background}
content-underline = ${colors.media-playing-underline}
content-overline = ${colors.media-playing-overline}
@@ -541,7 +564,7 @@ label-padding = 1
[module/media-playing-change]
type = custom/script
exec = /home/sravan/.config/dwm-flexipatch/polybar/scripts/get-media-source-icon.sh
exec = ~/.config/dwm-flexipatch/polybar/scripts/get-media-source-icon.sh
interval = ${intervals.media-playing}
format = <label>
label = %output%
@@ -551,24 +574,22 @@ label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --change"
click-left = "~/.scripts/playerctl.sh --change"
[module/media-playing-prev]
type = custom/script
exec = echo "󰒮"
format = <label>
label = %output%
label-foreground = ${colors.media-playing-foreground}
label-background = ${colors.media-playing-background}
label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --prev"
type = custom/text
content = "󰒮"
content-foreground = ${colors.media-playing-foreground}
content-background = ${colors.media-playing-background}
content-underline = ${colors.media-playing-underline}
content-overline = ${colors.media-playing-overline}
content-maxlen = ${sizes.maxlen}
content-padding = 1
click-left = "~/.scripts/playerctl.sh --prev"
[module/media-playing-play-pause]
type = custom/script
exec = /home/sravan/.config/dwm-flexipatch/polybar/scripts/get-media-status-icon.sh
exec = ~/.config/dwm-flexipatch/polybar/scripts/get-media-status-icon.sh
format = <label>
label = %output%
label-foreground = ${colors.media-playing-foreground}
@@ -577,24 +598,22 @@ label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --play-pause"
click-left = "~/.scripts/playerctl.sh --play-pause"
[module/media-playing-next]
type = custom/script
exec = echo "󰒭"
format = <label>
label = %output%
label-foreground = ${colors.media-playing-foreground}
label-background = ${colors.media-playing-background}
label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --next"
type = custom/text
content = "󰒭"
content-foreground = ${colors.media-playing-foreground}
content-background = ${colors.media-playing-background}
content-underline = ${colors.media-playing-underline}
content-overline = ${colors.media-playing-overline}
content-maxlen = ${sizes.maxlen}
content-padding = 1
click-left = "~/.scripts/playerctl.sh --next"
[module/date-left]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.date-background}
content-underline = ${colors.date-underline}
content-overline = ${colors.date-overline}
@@ -602,7 +621,7 @@ content-padding = ${sizes.module-padding}
[module/date-right]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.date-background}
content-underline = ${colors.date-underline}
content-overline = ${colors.date-overline}
@@ -635,7 +654,7 @@ format = <label>
; %date%
; %time%
; Default: %date%
label = " %date%"
label = " %date%"
; label-font = 3
label-foreground = ${colors.date-foreground}
label-background = ${colors.date-background}
@@ -645,7 +664,7 @@ label-padding = ${sizes.module-padding}
[module/time-left]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.time-background}
content-underline = ${colors.time-underline}
content-overline = ${colors.time-overline}
@@ -653,7 +672,7 @@ content-padding = ${sizes.module-padding}
[module/time-right]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.time-background}
content-underline = ${colors.time-underline}
content-overline = ${colors.time-overline}
@@ -696,7 +715,7 @@ label-padding = ${sizes.module-padding}
[module/kernel-left]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.kernel-background}
content-underline = ${colors.kernel-underline}
content-overline = ${colors.kernel-overline}
@@ -704,7 +723,7 @@ content-padding = ${sizes.module-padding}
[module/kernel-right]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.kernel-background}
content-underline = ${colors.kernel-underline}
content-overline = ${colors.kernel-overline}
@@ -734,7 +753,7 @@ interval = ${intervals.kernel}
; Available tags:
; <output> - deprecated
; <label> (default)
format = <label>
format = %{A1:kitty bash -c "fastfetch && sleep 15":}<label>%{A}
format-foreground = ${colors.kernel-foreground}
format-background = ${colors.kernel-background}
format-underline = ${colors.kernel-underline}
@@ -766,9 +785,81 @@ label-padding = ${sizes.module-padding}
; scroll-up = echo scroll up %counter%
; scroll-down = echo scroll down %counter%
[module/system76-power-left]
type = custom/text
content = " "
content-foreground = ${colors.system76-power-background}
content-underline = ${colors.system76-power-underline}
content-overline = ${colors.system76-power-overline}
content-padding = ${sizes.module-padding}
[module/system76-power-right]
type = custom/text
content = " "
content-foreground = ${colors.system76-power-background}
content-underline = ${colors.system76-power-underline}
content-overline = ${colors.system76-power-overline}
content-padding = ${sizes.module-padding}
[module/system76-power]
type = custom/script
; Available tokens:
; %counter%
; Command to be executed (using "/bin/sh -c [command]")
exec = echo "󰢮 $(sudo system76-power graphics)"
; Conditional command that, if defined, needs to exit successfully
; before the main exec command is invoked.
; Default: ""
; exec-if = pgrep -x myservice
; Will the script output continous content?
; Default: false
tail = false
; Seconds to sleep between updates
; Default: 5 (0 if `tail = true`)
interval = ${intervals.system76-power}
; Available tags:
; <output> - deprecated
; <label> (default)
format = <label>
format-foreground = ${colors.system76-power-foreground}
format-background = ${colors.system76-power-background}
format-underline = ${colors.system76-power-underline}
format-overline = ${colors.system76-power-overline}
; Available tokens:
; %output%
; Default: %output%
label = %output%
label-padding = ${sizes.module-padding}
; Available tokens:
; %counter%
; %pid%
;
; "click-(left|middle|right)" will be executed using "/bin/sh -c [command]"
click-left = nvidia-settings
; click-middle = echo middle %counter%
click-right = ~/.scripts/cpu-gpu.sh --rofi
; double-click-left = echo double left %counter%
; double-click-middle = echo double middle %counter%
; double-click-right = echo double right %counter%
; Available tokens:
; %counter%
; %pid%
;
; "scroll-(up|down)" will be executed using "/bin/sh -c [command]"
; scroll-up = echo scroll up %counter%
; scroll-down = echo scroll down %counter%
[module/cpu-left]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.cpu-background}
content-underline = ${colors.cpu-underline}
content-overline = ${colors.cpu-overline}
@@ -776,7 +867,7 @@ content-padding = ${sizes.module-padding}
[module/cpu-right]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.cpu-background}
content-underline = ${colors.cpu-underline}
content-overline = ${colors.cpu-overline}
@@ -801,7 +892,7 @@ format = %{A1:kitty btop:}<label>%{A}
; %percentage-sum% - Cumulative load on all cores
; %percentage-cores% - load percentage for each core
; %percentage-core[1-9]% - load percentage for specific core
label = %percentage%%
label = %percentage%%
label-padding = ${sizes.module-padding}
label-foreground = ${colors.cpu-foreground}
label-background = ${colors.cpu-background}
@@ -822,7 +913,7 @@ ramp-coreload-foreground = ${colors.cpu}
[module/memory-left]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.memory-background}
content-underline = ${colors.memory-underline}
content-overline = ${colors.memory-overline}
@@ -830,7 +921,7 @@ content-padding = ${sizes.module-padding}
[module/memory-right]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.memory-background}
content-underline = ${colors.memory-underline}
content-overline = ${colors.memory-overline}
@@ -873,7 +964,7 @@ format = %{A1:kitty btop:}<label>%{A}
; %gb_swap_free%
; %gb_swap_used%
label = 󰍛 %percentage_used%%
label = %percentage_used%%
label-padding = ${sizes.module-padding}
label-foreground = ${colors.memory-foreground}
label-background = ${colors.memory-background}
@@ -915,7 +1006,7 @@ ramp-free-foreground = ${colors.memory}
[module/filesystem-left]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.filesystem-background}
content-underline = ${colors.filesystem-underline}
content-overline = ${colors.filesystem-overline}
@@ -923,7 +1014,7 @@ content-padding = ${sizes.module-padding}
[module/filesystem-right]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.filesystem-background}
content-underline = ${colors.filesystem-underline}
content-overline = ${colors.filesystem-overline}
@@ -952,11 +1043,11 @@ spacing = ${sizes.module-margin}
; <bar-free>
; <bar-used>
; <ramp-capacity>
format-mounted = %{A1:filelight &:}<label-mounted>%{A}
format-mounted = %{A1:qdirstat &:}<label-mounted>%{A}
; Available tags:
; <label-unmounted> (default)
format-unmounted = %{A1:gnome-disks &:} <label-unmounted> %{A}
format-unmounted = %{A1:gnome-disks &:}<label-unmounted>%{A}
; Available tokens:
; %mountpoint%
@@ -987,7 +1078,7 @@ label-unmounted-padding = ${sizes.module-padding}
[module/deadd-notification-center-left]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.deadd-notification-center-background}
content-underline = ${colors.deadd-notification-center-underline}
content-overline = ${colors.deadd-notification-center-overline}
@@ -995,7 +1086,7 @@ content-padding = ${sizes.module-padding}
[module/deadd-notification-center-right]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.deadd-notification-center-background}
content-underline = ${colors.deadd-notification-center-underline}
content-overline = ${colors.deadd-notification-center-overline}
@@ -1014,9 +1105,118 @@ content-overline = ${colors.deadd-notification-center-overline}
content-padding = ${sizes.module-padding}
; "click-(left|middle|right)" will be executed using "/bin/sh -c $COMMAND"
click-left = "/home/sravan/.scripts/deadd.sh --toggle-center"
click-left = "~/.scripts/deadd.sh --toggle-center"
; click-middle = notify-send middle
click-right = "/home/sravan/.scripts/deadd.sh --rofi"
click-right = "~/.scripts/deadd.sh --rofi"
; "scroll-(up|down)" will be executed using "/bin/sh -c $COMMAND"
; scroll-up = notify-send scroll up
; scroll-down = notify-send scroll down
[module/dunst-left]
type = custom/text
content = " "
content-foreground = ${colors.dunst-background}
content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline}
content-padding = ${sizes.module-padding}
[module/dunst-right]
type = custom/text
content = " "
content-foreground = ${colors.dunst-background}
content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline}
content-padding = ${sizes.module-padding}
[module/dunst-status]
type = custom/script
exec = ~/.config/dwm-flexipatch/polybar/scripts/dunst-status.sh
interval = ${intervals.dunst}
format = <label>
label = %output%
label-foreground = ${colors.dunst-foreground}
label-background = ${colors.dunst-background}
label-underline = ${colors.dunst-underline}
label-overline = ${colors.dunst-overline}
label-padding = ${sizes.module-padding}
click-left = "~/.scripts/dunst.sh --dnd"
click-right = "~/.scripts/dunst.sh --rofi"
[module/dunst-clear]
type = custom/text
content = ""
content-foreground = ${colors.dunst-foreground}
content-background = ${colors.dunst-background}
content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline}
content-padding = 1
click-left = "~/.scripts/dunst.sh --close-all"
[module/dunst-history-view]
type = custom/text
content = "󰋚"
content-foreground = ${colors.dunst-foreground}
content-background = ${colors.dunst-background}
content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline}
content-padding = 1
click-left = "~/.scripts/dunst.sh --history"
[module/dunst-history-clear]
type = custom/text
content = "󰎟"
content-foreground = ${colors.dunst-foreground}
content-background = ${colors.dunst-background}
content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline}
content-padding = 1
click-left = "~/.scripts/dunst.sh --history-clear"
[module/dunst-history-length]
type = custom/script
exec = "dunstctl count history"
interval = ${intervals.dunst}
format = <label>
label = %output%
label-foreground = ${colors.dunst-foreground}
label-background = ${colors.dunst-background}
label-underline = ${colors.dunst-underline}
label-overline = ${colors.dunst-overline}
label-padding = 1
[module/xfce4-notifyd-left]
type = custom/text
content = " "
content-foreground = ${colors.xfce4-notifyd-background}
content-underline = ${colors.xfce4-notifyd-underline}
content-overline = ${colors.xfce4-notifyd-overline}
content-padding = ${sizes.module-padding}
[module/xfce4-notifyd-right]
type = custom/text
content = " "
content-foreground = ${colors.xfce4-notifyd-background}
content-underline = ${colors.xfce4-notifyd-underline}
content-overline = ${colors.xfce4-notifyd-overline}
content-padding = ${sizes.module-padding}
[module/xfce4-notifyd]
type = custom/text
content = "󰂚"
; "content" has the same properties as "format-NAME"
; content-background = #000
content-foreground = ${colors.xfce4-notifyd-foreground}
content-background = ${colors.xfce4-notifyd-background}
content-underline = ${colors.xfce4-notifyd-underline}
content-overline = ${colors.xfce4-notifyd-overline}
content-padding = ${sizes.module-padding}
; "click-(left|middle|right)" will be executed using "/bin/sh -c $COMMAND"
click-left = "~/.scripts/xfce4-notifyd.sh --toggle-center"
; click-middle = notify-send middle
click-right = "~/.scripts/xfce4-notifyd.sh --rofi"
; "scroll-(up|down)" will be executed using "/bin/sh -c $COMMAND"
; scroll-up = notify-send scroll up
@@ -1024,7 +1224,7 @@ click-right = "/home/sravan/.scripts/deadd.sh --rofi"
[module/volume-left]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.volume-background}
content-underline = ${colors.volume-underline}
content-overline = ${colors.volume-overline}
@@ -1032,7 +1232,7 @@ content-padding = ${sizes.module-padding}
[module/volume-right]
type = custom/text
content = ""
content = " "
content-foreground = ${colors.volume-background}
content-underline = ${colors.volume-underline}
content-overline = ${colors.volume-overline}

View File

@@ -1,11 +1,11 @@
#!/bin/bash
#!/usr/bin/env bash
BAR="mybar"
CONFIG="~/.config/dwm-flexipatch/polybar/config.ini"
NUM_MONITORS=0
CONNECTED_MONITORS=$(xrandr --query | grep " connected" | cut -d" " -f1)
TRAY_POS="center"
killall -q polybar
pkill polybar
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
rm /tmp/polybar.pids

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
isPaused=$(dunstctl is-paused)
if [[ "$isPaused" == "true" ]]; then
echo "󰂛"
else
echo "󰂚"
fi

View File

@@ -1,19 +0,0 @@
#!/bin/bash
mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then
echo " N/A"
else
artist=$(playerctl --player=playerctld metadata --format '{{ artist }}')
title=$(playerctl --player=playerctld metadata --format '{{ title }}')
if [[ $artist == "" ]]; then
artist="N/A"
fi
if [[ $title == "" ]]; then
title="N/A"
fi
echo "$title - $artist"
fi

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then

View File

@@ -1,5 +1,5 @@
#!/bin/bash
mediaStatus=$(/home/sravan/.config/dwm-flexipatch/polybar/scripts/get-media-status.sh)
#!/usr/bin/env bash
mediaStatus=$(~/.config/dwm-flexipatch/polybar/scripts/get-media-status.sh)
if [[ "$mediaStatus" == "N/A" ]]; then
echo "󰐎"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
if [[ "$mediaStatus" == "No player could handle this command" ]]; then

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
zscroll \
--length $(xrdb -get polybar.maxlen) \
--delay 0.2 \

View File

@@ -1,23 +0,0 @@
#!/bin/bash
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
updates_arch=0
fi
# if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then
if ! updates_aur=$(paru -Qum 2> /dev/null | wc -l); then
# if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then
# if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then
# if ! updates_aur=$(pikaur -Qua 2> /dev/null | wc -l); then
# if ! updates_aur=$(rua upgrade --printonly 2> /dev/null | wc -l); then
updates_aur=0
fi
updates=$((updates_arch + updates_aur))
# if [ "$updates" -gt 0 ]; then
# echo "# $updates"
# else
# echo ""
# fi
echo "$updates"