diff options
| author | Mike Vink <59492084+ivi-vink@users.noreply.github.com> | 2025-01-18 21:25:25 +0000 |
|---|---|---|
| committer | Mike Vink <59492084+ivi-vink@users.noreply.github.com> | 2025-01-19 12:39:25 +0000 |
| commit | 0f6de348ad935de38cadd10bde68515c63595836 (patch) | |
| tree | 2509f64255570f9938c8ab469a1ec11d516d247f | |
| parent | 75f4f4542766191f9597d48dfc726bdc269b1a89 (diff) | |
fixup
| l--------- | mut/lf/icons | 1 | ||||
| -rw-r--r-- | mut/surf/config.def.h | 13 | ||||
| -rw-r--r-- | mut/surf/surf.c | 11 | ||||
| -rw-r--r-- | profiles/graphical/suckless.nix | 1 |
4 files changed, 22 insertions, 4 deletions
diff --git a/mut/lf/icons b/mut/lf/icons deleted file mode 120000 index 853f171..0000000 --- a/mut/lf/icons +++ /dev/null @@ -1 +0,0 @@ -/nix/store/jr98r05zwc5v3bfmj1g3zk9842md3x9m-home-manager-files/.config/lf/icons
\ No newline at end of file diff --git a/mut/surf/config.def.h b/mut/surf/config.def.h index ef44721..1d27a0e 100644 --- a/mut/surf/config.def.h +++ b/mut/surf/config.def.h @@ -47,6 +47,7 @@ static Parameter defconfig[ParameterLast] = { [Style] = { { .i = 1 }, }, [WebGL] = { { .i = 0 }, }, [ZoomLevel] = { { .f = 1.0 }, }, + [ClipboardNotPrimary] = { { .i = 1 }, }, }; static UriParameters uriparams[] = { @@ -100,6 +101,14 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | } \ } +#define SR_SEARCH {\ + .v = (char *[]){\ + "/bin/sh", "-c", "xprop -id $0 -f _SURF_GO 8s -set _SURF_GO $(sr -p $(sr -elvi | tail -n +2 | cut -s -f1 | dmenu))", \ + winid, \ + NULL \ + } \ +} + /* styles */ /* * The iteration will stop at the first match, beginning at the beginning of @@ -132,8 +141,10 @@ static Key keys[] = { { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, + { MODKEY, GDK_KEY_s, spawn, SR_SEARCH }, + { 0, GDK_KEY_Escape, stop, { 0 } }, - { MODKEY, GDK_KEY_c, stop, { 0 } }, + /* { MODKEY, GDK_KEY_c, stop, { 0 } }, */ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } }, { MODKEY, GDK_KEY_r, reload, { .i = 0 } }, diff --git a/mut/surf/surf.c b/mut/surf/surf.c index bcd8d6a..d0ab984 100644 --- a/mut/surf/surf.c +++ b/mut/surf/surf.c @@ -83,6 +83,7 @@ typedef enum { Style, WebGL, ZoomLevel, + ClipboardNotPrimary, ParameterLast } ParamName; @@ -291,6 +292,7 @@ static ParamName loadcommitted[] = { SpellLanguages, Style, ZoomLevel, + ClipboardNotPrimary, ParameterLast }; @@ -1827,13 +1829,18 @@ showcert(Client *c, const Arg *a) void clipboard(Client *c, const Arg *a) { + /* User defined choice of selection, see config.h */ + GdkAtom selection = GDK_SELECTION_PRIMARY; + if (curconfig[ClipboardNotPrimary].val.i > 0) + selection = GDK_SELECTION_CLIPBOARD; + if (a->i) { /* load clipboard uri */ gtk_clipboard_request_text(gtk_clipboard_get( - GDK_SELECTION_PRIMARY), + selection), pasteuri, c); } else { /* copy uri */ gtk_clipboard_set_text(gtk_clipboard_get( - GDK_SELECTION_PRIMARY), c->targeturi + selection), c->targeturi ? c->targeturi : geturi(c), -1); } } diff --git a/profiles/graphical/suckless.nix b/profiles/graphical/suckless.nix index 2f12756..9d9617f 100644 --- a/profiles/graphical/suckless.nix +++ b/profiles/graphical/suckless.nix @@ -84,6 +84,7 @@ asciinema asciinema-agg fontconfig + surfraw ]; }; fonts = { |
