mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-22 07:15:59 +01:00
change alpha with keyboard shortcut C-F11/C-F12
This commit is contained in:
parent
e187610a23
commit
73a6020865
2 changed files with 17 additions and 0 deletions
2
config.h
2
config.h
|
@ -267,6 +267,8 @@ static Shortcut shortcuts[] = {
|
||||||
{ MODKEY, XK_Down, kscrolldown, {.i = 1} },
|
{ MODKEY, XK_Down, kscrolldown, {.i = 1} },
|
||||||
{ MODKEY, XK_u, kscrollup, {.i = -1} },
|
{ MODKEY, XK_u, kscrollup, {.i = -1} },
|
||||||
{ MODKEY, XK_d, kscrolldown, {.i = -1} },
|
{ MODKEY, XK_d, kscrolldown, {.i = -1} },
|
||||||
|
{ ControlMask, XK_F11, changealpha, {.f = -0.05} },
|
||||||
|
{ ControlMask, XK_F12, changealpha, {.f = +0.05} },
|
||||||
{ TERMMOD, XK_Up, zoom, {.f = +1} },
|
{ TERMMOD, XK_Up, zoom, {.f = +1} },
|
||||||
{ TERMMOD, XK_Down, zoom, {.f = -1} },
|
{ TERMMOD, XK_Down, zoom, {.f = -1} },
|
||||||
{ TERMMOD, XK_K, zoom, {.f = +1} },
|
{ TERMMOD, XK_K, zoom, {.f = +1} },
|
||||||
|
|
15
x.c
15
x.c
|
@ -68,6 +68,7 @@ static void clipcopy(const Arg *);
|
||||||
static void clippaste(const Arg *);
|
static void clippaste(const Arg *);
|
||||||
static void numlock(const Arg *);
|
static void numlock(const Arg *);
|
||||||
static void selpaste(const Arg *);
|
static void selpaste(const Arg *);
|
||||||
|
static void changealpha(const Arg *);
|
||||||
static void zoom(const Arg *);
|
static void zoom(const Arg *);
|
||||||
static void zoomabs(const Arg *);
|
static void zoomabs(const Arg *);
|
||||||
static void zoomreset(const Arg *);
|
static void zoomreset(const Arg *);
|
||||||
|
@ -303,6 +304,20 @@ numlock(const Arg *dummy)
|
||||||
win.mode ^= MODE_NUMLOCK;
|
win.mode ^= MODE_NUMLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
changealpha(const Arg *arg)
|
||||||
|
{
|
||||||
|
if((alpha > 0 && arg->f < 0) || (alpha < 1 && arg->f > 0))
|
||||||
|
alpha += arg->f;
|
||||||
|
if(alpha < 0)
|
||||||
|
alpha = 0;
|
||||||
|
if(alpha > 1)
|
||||||
|
alpha = 1;
|
||||||
|
|
||||||
|
xloadcols();
|
||||||
|
redraw();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
zoom(const Arg *arg)
|
zoom(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue