mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-10-26 09:44:21 +00:00
update cursortheme for HEAD
This commit is contained in:
parent
c676de59d5
commit
b828e21717
@ -1,75 +1,51 @@
|
|||||||
From 05a532202ec5aa989f790939d6006af79f80e938 Mon Sep 17 00:00:00 2001
|
From 55c22683c88c9816ceba6351a716fbe005555abd Mon Sep 17 00:00:00 2001
|
||||||
From: wochap <gean.marroquin@gmail.com>
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
Date: Wed, 6 Mar 2024 07:52:05 -0500
|
Date: Thu, 11 Apr 2024 12:43:29 -0500
|
||||||
Subject: [PATCH 1/2] apply Zakharchenko cursortheme patch, sync with v0.5
|
Subject: [PATCH] add ability to change cursor's theme and size
|
||||||
|
|
||||||
source: https://github.com/djpohly/dwl/wiki/cursortheme
|
|
||||||
---
|
---
|
||||||
config.def.h | 2 ++
|
config.def.h | 2 ++
|
||||||
dwl.c | 2 +-
|
dwl.c | 6 ++++--
|
||||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
2 files changed, 6 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index db0babc..aeb5174 100644
|
index 8847e58..3189d48 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -12,6 +12,8 @@ static const float focuscolor[] = COLOR(0x005577ff);
|
@@ -13,6 +13,8 @@ static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
||||||
static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can also use glsl colors */
|
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
||||||
+static const char cursortheme[] = NULL; /* theme from /usr/share/cursors/xorg-x11 */
|
+static const char cursortheme[] = ""; /* theme from /usr/share/cursors/xorg-x11 */
|
||||||
+static const unsigned int cursorsize = 24;
|
+static const unsigned int cursorsize = 24;
|
||||||
|
|
||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
#define TAGCOUNT (9)
|
#define TAGCOUNT (9)
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index ef27a1d..bd53fc0 100644
|
index bf763df..961e2f1 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -2299,7 +2299,7 @@ setup(void)
|
@@ -2274,7 +2274,9 @@ setup(void)
|
||||||
* Xcursor themes to source cursor images from and makes sure that cursor
|
|
||||||
* images are available at all scale factors on the screen (necessary for
|
|
||||||
* HiDPI support). Scaled cursors will be loaded with each output. */
|
|
||||||
- cursor_mgr = wlr_xcursor_manager_create(NULL, 24);
|
|
||||||
+ cursor_mgr = wlr_xcursor_manager_create(cursortheme, cursorsize);
|
|
||||||
setenv("XCURSOR_SIZE", "24", 1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
--
|
|
||||||
2.42.0
|
|
||||||
|
|
||||||
|
|
||||||
From 9563a0845c1ab1024732c8cf6dd7867957d488e1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: wochap <gean.marroquin@gmail.com>
|
|
||||||
Date: Mon, 18 Mar 2024 17:38:46 -0500
|
|
||||||
Subject: [PATCH 2/2] fix: sync cursorsize with env XCURSOR_SIZE
|
|
||||||
|
|
||||||
---
|
|
||||||
dwl.c | 4 +++-
|
|
||||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
|
||||||
index bd53fc0..c1121a8 100644
|
|
||||||
--- a/dwl.c
|
|
||||||
+++ b/dwl.c
|
|
||||||
@@ -2167,7 +2167,9 @@ setup(void)
|
|
||||||
{
|
|
||||||
int i, sig[] = {SIGCHLD, SIGINT, SIGTERM, SIGPIPE};
|
int i, sig[] = {SIGCHLD, SIGINT, SIGTERM, SIGPIPE};
|
||||||
struct sigaction sa = {.sa_flags = SA_RESTART, .sa_handler = handlesig};
|
struct sigaction sa = {.sa_flags = SA_RESTART, .sa_handler = handlesig};
|
||||||
+ char cursorsize_str[3];
|
+ char cursorsize_str[3];
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
+ sprintf(cursorsize_str, "%d", cursorsize);
|
+ sprintf(cursorsize_str, "%d", cursorsize);
|
||||||
|
|
||||||
for (i = 0; i < LENGTH(sig); i++)
|
for (i = 0; i < (int)LENGTH(sig); i++)
|
||||||
sigaction(sig[i], &sa, NULL);
|
sigaction(sig[i], &sa, NULL);
|
||||||
@@ -2300,7 +2302,7 @@ setup(void)
|
@@ -2412,8 +2414,8 @@ setup(void)
|
||||||
|
* Xcursor themes to source cursor images from and makes sure that cursor
|
||||||
* images are available at all scale factors on the screen (necessary for
|
* images are available at all scale factors on the screen (necessary for
|
||||||
* HiDPI support). Scaled cursors will be loaded with each output. */
|
* HiDPI support). Scaled cursors will be loaded with each output. */
|
||||||
cursor_mgr = wlr_xcursor_manager_create(cursortheme, cursorsize);
|
- cursor_mgr = wlr_xcursor_manager_create(NULL, 24);
|
||||||
- setenv("XCURSOR_SIZE", "24", 1);
|
- setenv("XCURSOR_SIZE", "24", 1);
|
||||||
|
+ cursor_mgr = wlr_xcursor_manager_create(cursortheme, cursorsize);
|
||||||
+ setenv("XCURSOR_SIZE", cursorsize_str, 1);
|
+ setenv("XCURSOR_SIZE", cursorsize_str, 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* wlr_cursor *only* displays an image on screen. It does not move around
|
* wlr_cursor *only* displays an image on screen. It does not move around
|
||||||
--
|
--
|
||||||
2.42.0
|
2.43.2
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user