From 8b6f0e3164c19736e65b730196c36cc23ce52470 Mon Sep 17 00:00:00 2001 From: unknown <“filip.rabiega@gmail.com”> Date: Thu, 6 Aug 2026 19:27:18 +0200 Subject: change font --- open_selected.diff | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 open_selected.diff (limited to 'open_selected.diff') diff --git a/open_selected.diff b/open_selected.diff new file mode 100644 index 0000000..aa102a0 --- /dev/null +++ b/open_selected.diff @@ -0,0 +1,74 @@ +diff --git a/config.def.h b/config.def.h +index 2cd740a..d362d6b 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -176,6 +176,7 @@ static uint forcemousemod = ShiftMask; + */ + static MouseShortcut mshortcuts[] = { + /* mask button function argument release */ ++ { ControlMask, Button2, selopen, {.i = 0}, 1 }, + { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 }, + { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} }, + { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} }, +diff --git a/st.c b/st.c +index 2e3800e..f55facb 100644 +--- a/st.c ++++ b/st.c +@@ -1903,6 +1903,16 @@ strhandle(void) + if (narg > 1) + xsettitle(strescseq.args[1]); + return; ++ case 7: ++ if (strstr(strescseq.args[1], "file://") != strescseq.args[1]) { ++ fprintf(stderr, "erresc: dir %s must have prefix 'file://'\n", ++ strescseq.args[1]); ++ return; ++ } ++ if (chdir(strescseq.args[1] + 7) != 0) /* +7 to remove prefix */ ++ fprintf(stderr, "erresc: invalid directory %s\n", ++ strescseq.args[1]); ++ return; + case 52: + if (narg > 2 && allowwindowops) { + dec = base64dec(strescseq.args[2]); +diff --git a/x.c b/x.c +index d73152b..e44d61c 100644 +--- a/x.c ++++ b/x.c +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -55,6 +56,7 @@ static void clipcopy(const Arg *); + static void clippaste(const Arg *); + static void numlock(const Arg *); + static void selpaste(const Arg *); ++static void selopen(const Arg *); + static void zoom(const Arg *); + static void zoomabs(const Arg *); + static void zoomreset(const Arg *); +@@ -286,6 +288,20 @@ selpaste(const Arg *dummy) + xw.win, CurrentTime); + } + ++void ++selopen(const Arg *dummy) ++{ ++ pid_t chpid; ++ ++ if ((chpid = fork()) == 0) { ++ if (fork() == 0) ++ execlp("xdg-open", "xdg-open", getsel(), NULL); ++ exit(1); ++ } ++ if (chpid > 0) ++ waitpid(chpid, NULL, 0); ++} ++ + void + numlock(const Arg *dummy) + { -- cgit v1.2.3