mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2026-02-04 02:03:06 +00:00
Compare commits
2 Commits
66592a0507
...
6a8275950e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a8275950e | ||
|
|
55061ce6cd |
@ -1,9 +1,9 @@
|
|||||||
### Description
|
### Description
|
||||||
This patch is based in
|
This patch is based on the
|
||||||
[client-opacity](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/client-opacity/client-opacity.patch)
|
[client-opacity](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/client-opacity/client-opacity.patch)
|
||||||
patch. Add different opacities level if the client is focus or not.
|
patch. This patch adds differing opacity levels depending upon whether the client is focused or not.
|
||||||
|
|
||||||
The opacities levels can be change by short cuts.
|
The opacity levels can be change by short cuts.
|
||||||
|
|
||||||
```
|
```
|
||||||
[MODKEY]+[Ctrl]+[k] -> increase focus opacity
|
[MODKEY]+[Ctrl]+[k] -> increase focus opacity
|
||||||
|
|||||||
@ -16,8 +16,8 @@ index 95c2afa..b3170d1 100644
|
|||||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
/* This conforms to 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.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
|
static const float fullscreen_bg[] = {0.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
|
||||||
+static const float default_opacity = 0.70;
|
+static const float default_opacity_inactive = 0.70;
|
||||||
+static const float default_opacity_active = 1.00;
|
+static const float default_opacity_active = 1.00;
|
||||||
|
|
||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
#define TAGCOUNT (9)
|
#define TAGCOUNT (9)
|
||||||
@ -30,8 +30,8 @@ index 95c2afa..b3170d1 100644
|
|||||||
/* examples: */
|
/* examples: */
|
||||||
- { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
|
- { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
|
||||||
- { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
|
- { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
|
||||||
+ { "Gimp_EXAMPLE", NULL, 0, 1, default_opacity, -1 }, /* Start on currently visible tags floating, not tiled */
|
+ { "Gimp_EXAMPLE", NULL, 0, 1, default_opacity_inactive, -1 }, /* Start on currently visible tags floating, not tiled */
|
||||||
+ { "firefox_EXAMPLE", NULL, 1 << 8, 0, 1.0, -1 }, /* Start on ONLY tag "9" */
|
+ { "firefox_EXAMPLE", NULL, 1 << 8, 0, 1.00, -1 }, /* Start on ONLY tag "9" */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
@ -39,8 +39,8 @@ index 95c2afa..b3170d1 100644
|
|||||||
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
||||||
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
||||||
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
|
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
|
||||||
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_k, setopacitydefault, {.f = +0.1f} },
|
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_k, setopacityinactive, {.f = +0.1f} },
|
||||||
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_j, setopacitydefault, {.f = -0.1f} },
|
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_j, setopacityinactive, {.f = -0.1f} },
|
||||||
+ { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_K, setopacityactive, {.f = +0.1f} },
|
+ { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_K, setopacityactive, {.f = +0.1f} },
|
||||||
+ { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_J, setopacityactive, {.f = -0.1f} },
|
+ { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_J, setopacityactive, {.f = -0.1f} },
|
||||||
{ MODKEY, XKB_KEY_space, setlayout, {0} },
|
{ MODKEY, XKB_KEY_space, setlayout, {0} },
|
||||||
@ -56,7 +56,7 @@ index 12f441e..caafab1 100644
|
|||||||
int isfloating, isurgent, isfullscreen;
|
int isfloating, isurgent, isfullscreen;
|
||||||
+ float opacity;
|
+ float opacity;
|
||||||
+ float opacity_active;
|
+ float opacity_active;
|
||||||
+ float opacity_default;
|
+ float opacity_inactive;
|
||||||
uint32_t resize; /* configure serial of a pending resize */
|
uint32_t resize; /* configure serial of a pending resize */
|
||||||
} Client;
|
} Client;
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ index 12f441e..caafab1 100644
|
|||||||
static void setlayout(const Arg *arg);
|
static void setlayout(const Arg *arg);
|
||||||
static void setmfact(const Arg *arg);
|
static void setmfact(const Arg *arg);
|
||||||
static void setmon(Client *c, Monitor *m, uint32_t newtags);
|
static void setmon(Client *c, Monitor *m, uint32_t newtags);
|
||||||
+static void setopacitydefault(const Arg *arg);
|
+static void setopacityinactive(const Arg *arg);
|
||||||
+static void setopacityactive(const Arg *arg);
|
+static void setopacityactive(const Arg *arg);
|
||||||
static void setpsel(struct wl_listener *listener, void *data);
|
static void setpsel(struct wl_listener *listener, void *data);
|
||||||
static void setsel(struct wl_listener *listener, void *data);
|
static void setsel(struct wl_listener *listener, void *data);
|
||||||
@ -98,9 +98,9 @@ index 12f441e..caafab1 100644
|
|||||||
c->surface.xdg = toplevel->base;
|
c->surface.xdg = toplevel->base;
|
||||||
c->bw = borderpx;
|
c->bw = borderpx;
|
||||||
+ /* Set default opacity*/
|
+ /* Set default opacity*/
|
||||||
+ c->opacity_default = default_opacity;
|
+ c->opacity_inactive = default_opacity_inactive;
|
||||||
+ c->opacity_active = default_opacity_active;
|
+ c->opacity_active = default_opacity_active;
|
||||||
+ c->opacity = default_opacity;
|
+ c->opacity = default_opacity_inactive;
|
||||||
|
|
||||||
LISTEN(&toplevel->base->surface->events.commit, &c->commit, commitnotify);
|
LISTEN(&toplevel->base->surface->events.commit, &c->commit, commitnotify);
|
||||||
LISTEN(&toplevel->base->surface->events.map, &c->map, mapnotify);
|
LISTEN(&toplevel->base->surface->events.map, &c->map, mapnotify);
|
||||||
@ -116,7 +116,7 @@ index 12f441e..caafab1 100644
|
|||||||
client_set_border_color(old_c, bordercolor);
|
client_set_border_color(old_c, bordercolor);
|
||||||
|
|
||||||
client_activate_surface(old, 0);
|
client_activate_surface(old, 0);
|
||||||
+ old_c->opacity = old_c->opacity_default;
|
+ old_c->opacity = old_c->opacity_inactive;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printstatus();
|
printstatus();
|
||||||
@ -158,7 +158,7 @@ index 12f441e..caafab1 100644
|
|||||||
|
|
||||||
+
|
+
|
||||||
+void
|
+void
|
||||||
+setopacitydefault(const Arg *arg)
|
+setopacityinactive(const Arg *arg)
|
||||||
+{
|
+{
|
||||||
+ Client *sel = focustop(selmon);
|
+ Client *sel = focustop(selmon);
|
||||||
+ if (!sel)
|
+ if (!sel)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user