apply newterm patch
This commit is contained in:
parent
033298508e
commit
3240bec57c
9
config.h
9
config.h
@ -5,8 +5,8 @@
|
|||||||
*
|
*
|
||||||
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
|
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
|
||||||
*/
|
*/
|
||||||
static char *font = "mono:pixelsize=12:antialias=true:autohint=true";
|
static char *font = "monospace:pixelsize=32:antialias=true:autohint=true";
|
||||||
static char *font2[] = { "NotoColorEmoji:pixelsize=10:antialias=true:autohint=true" };
|
static char *font2[] = { "monospace:pixelsize=32:antialias=true:autohint=true" };
|
||||||
static int borderpx = 2;
|
static int borderpx = 2;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -245,6 +245,9 @@ static MouseShortcut mshortcuts[] = {
|
|||||||
static char *openurlcmd[] = { "/bin/sh", "-c", "st-urlhandler -o", "externalpipe", NULL };
|
static char *openurlcmd[] = { "/bin/sh", "-c", "st-urlhandler -o", "externalpipe", NULL };
|
||||||
static char *copyurlcmd[] = { "/bin/sh", "-c", "st-urlhandler -c", "externalpipe", NULL };
|
static char *copyurlcmd[] = { "/bin/sh", "-c", "st-urlhandler -c", "externalpipe", NULL };
|
||||||
static char *copyoutput[] = { "/bin/sh", "-c", "st-copyout", "externalpipe", NULL };
|
static char *copyoutput[] = { "/bin/sh", "-c", "st-copyout", "externalpipe", NULL };
|
||||||
|
static char *copyemailcmd[] = { "/bin/sh", "-c", "st-emailhandler", "externalpipe", NULL };
|
||||||
|
static char *weechat[] = { "/bin/sh", "-c", "st-weechatlinks", "externalpipe", NULL };
|
||||||
|
|
||||||
|
|
||||||
static Shortcut shortcuts[] = {
|
static Shortcut shortcuts[] = {
|
||||||
/* mask keysym function argument */
|
/* mask keysym function argument */
|
||||||
@ -280,9 +283,11 @@ static Shortcut shortcuts[] = {
|
|||||||
{ TERMMOD, XK_J, zoom, {.f = -1} },
|
{ TERMMOD, XK_J, zoom, {.f = -1} },
|
||||||
{ TERMMOD, XK_U, zoom, {.f = +2} },
|
{ TERMMOD, XK_U, zoom, {.f = +2} },
|
||||||
{ TERMMOD, XK_D, zoom, {.f = -2} },
|
{ TERMMOD, XK_D, zoom, {.f = -2} },
|
||||||
|
{ MODKEY, XK_Return, newterm, {.i = 0} },
|
||||||
{ MODKEY, XK_l, externalpipe, {.v = openurlcmd } },
|
{ MODKEY, XK_l, externalpipe, {.v = openurlcmd } },
|
||||||
{ MODKEY, XK_y, externalpipe, {.v = copyurlcmd } },
|
{ MODKEY, XK_y, externalpipe, {.v = copyurlcmd } },
|
||||||
{ MODKEY, XK_o, externalpipe, {.v = copyoutput } },
|
{ MODKEY, XK_o, externalpipe, {.v = copyoutput } },
|
||||||
|
{ MODKEY, XK_x, externalpipe, {.v = weechat} },
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
36
st.c
36
st.c
@ -20,6 +20,8 @@
|
|||||||
#include "st.h"
|
#include "st.h"
|
||||||
#include "win.h"
|
#include "win.h"
|
||||||
|
|
||||||
|
extern char *argv0;
|
||||||
|
|
||||||
#if defined(__linux)
|
#if defined(__linux)
|
||||||
#include <pty.h>
|
#include <pty.h>
|
||||||
#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
|
#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
|
||||||
@ -162,6 +164,7 @@ typedef struct {
|
|||||||
} STREscape;
|
} STREscape;
|
||||||
|
|
||||||
static void execsh(char *, char **);
|
static void execsh(char *, char **);
|
||||||
|
static int chdir_by_pid(pid_t pid);
|
||||||
static void stty(char **);
|
static void stty(char **);
|
||||||
static void sigchld(int);
|
static void sigchld(int);
|
||||||
static void ttywriteraw(const char *, size_t);
|
static void ttywriteraw(const char *, size_t);
|
||||||
@ -831,6 +834,7 @@ ttynew(const char *line, char *cmd, const char *out, char **args)
|
|||||||
if (pledge("stdio rpath tty proc", NULL) == -1)
|
if (pledge("stdio rpath tty proc", NULL) == -1)
|
||||||
die("pledge\n");
|
die("pledge\n");
|
||||||
#endif
|
#endif
|
||||||
|
fcntl(m, F_SETFD, FD_CLOEXEC);
|
||||||
close(s);
|
close(s);
|
||||||
cmdfd = m;
|
cmdfd = m;
|
||||||
signal(SIGCHLD, sigchld);
|
signal(SIGCHLD, sigchld);
|
||||||
@ -1082,6 +1086,38 @@ tswapscreen(void)
|
|||||||
tfulldirt();
|
tfulldirt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
newterm(const Arg* a)
|
||||||
|
{
|
||||||
|
int res;
|
||||||
|
switch (fork()) {
|
||||||
|
case -1:
|
||||||
|
die("fork failed: %s\n", strerror(errno));
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
switch (fork()) {
|
||||||
|
case -1:
|
||||||
|
die("fork failed: %s\n", strerror(errno));
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
chdir_by_pid(pid);
|
||||||
|
execlp("/proc/self/exe", argv0, NULL);
|
||||||
|
exit(1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
wait(NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int chdir_by_pid(pid_t pid) {
|
||||||
|
char buf[32];
|
||||||
|
snprintf(buf, sizeof buf, "/proc/%ld/cwd", (long)pid);
|
||||||
|
return chdir(buf);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
kscrolldown(const Arg* a)
|
kscrolldown(const Arg* a)
|
||||||
{
|
{
|
||||||
|
1
st.h
1
st.h
@ -89,6 +89,7 @@ void externalpipe(const Arg *);
|
|||||||
void kscrolldown(const Arg *);
|
void kscrolldown(const Arg *);
|
||||||
void kscrollup(const Arg *);
|
void kscrollup(const Arg *);
|
||||||
|
|
||||||
|
void newterm(const Arg *);
|
||||||
void printscreen(const Arg *);
|
void printscreen(const Arg *);
|
||||||
void printsel(const Arg *);
|
void printsel(const Arg *);
|
||||||
void sendbreak(const Arg *);
|
void sendbreak(const Arg *);
|
||||||
|
2
x.c
2
x.c
@ -834,7 +834,7 @@ xloadcolor(int i, const char *name, Color *ncolor)
|
|||||||
void
|
void
|
||||||
xloadalpha(void)
|
xloadalpha(void)
|
||||||
{
|
{
|
||||||
float const usedAlpha = focused ? alpha : alphaUnfocus;
|
float const usedAlpha = alpha;
|
||||||
if (opt_alpha) alpha = strtof(opt_alpha, NULL);
|
if (opt_alpha) alpha = strtof(opt_alpha, NULL);
|
||||||
dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * usedAlpha);
|
dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * usedAlpha);
|
||||||
dc.col[defaultbg].pixel &= 0x00FFFFFF;
|
dc.col[defaultbg].pixel &= 0x00FFFFFF;
|
||||||
|
Loading…
Reference in New Issue
Block a user