From a9612bd4cf598d6074b014abcd2a3c5a8037dc2a Mon Sep 17 00:00:00 2001 From: Yigit Colakoglu Date: Sun, 25 Apr 2021 18:47:01 +0300 Subject: [PATCH] Made changes to some suckless utilities and some scripts --- .config/X11/xinitrc | 1 - .config/htop/htoprc | 2 +- .config/vim/plugin/plugins.vim | 1 - .config/weechat/sec.conf | 8 +- .config/zathura/zathurarc | 11 +- .local/bin/dmenu-books | 1 + .local/bin/lf-ueberzug-previewer | 1 - .local/bin/status-bar/weather | 100 +- .local/bin/zanotes | 32 + .local/share/dwm/autostart.sh | 42 +- .local/src/dwm/config.h | 1 + .local/src/dwm/dwm.c | 10 +- .local/src/dwm/keybinds.h | 6 +- .local/src/dwm/vanitygaps.c | 10 + .local/src/slock/config.h | 6 +- .local/src/slock/slock | Bin 23168 -> 23152 bytes .local/src/slock/slock.o | Bin 15992 -> 15536 bytes .local/src/surf/.gitignore | 1 + .local/src/surf/config.def.h | 212 ++ .local/src/surf/config.def.h.orig | 204 ++ .local/src/surf/config.h | 44 +- .local/src/surf/patches/surf-0.6-navhist.diff | 138 + .local/src/surf/patches/surf-0.7-omnibar.diff | 59 + .../patches/surf-0.7-smoothscrolling.diff | 238 ++ .../surf/patches/surf-2.0-externalpipe.diff | 93 + .../src/surf/patches/surf-2.0-homepage.diff | 24 + .../surf-bookmarks-20170722-723ff26.diff | 42 + .../surf-clipboard-20200112-a6a8878.diff | 67 + .../surf-history-20181009-2b71a22.diff | 107 + .../patches/surf-modal-20190209-d068a38.diff | 134 + .../surf-multijs-20190325-d068a38.diff | 101 + .../surf-spacesearch-20170408-b814567.diff | 26 + .local/src/surf/patches/surf-tip-navhist.diff | 138 + .local/src/surf/surf | Bin 0 -> 72168 bytes .local/src/surf/surf.c | 67 +- .local/src/surf/surf.c.orig | 2245 +++++++++++++++++ .local/src/surf/surf.o | Bin 0 -> 71512 bytes .local/src/surf/webext-surf.o | Bin 0 -> 4336 bytes .local/src/surf/webext-surf.so | Bin 0 -> 16640 bytes .local/src/tabbed/config.h | 4 +- .profile | 9 + 41 files changed, 4011 insertions(+), 174 deletions(-) create mode 100755 .local/bin/zanotes create mode 100644 .local/src/surf/.gitignore create mode 100644 .local/src/surf/config.def.h create mode 100644 .local/src/surf/config.def.h.orig create mode 100644 .local/src/surf/patches/surf-0.6-navhist.diff create mode 100644 .local/src/surf/patches/surf-0.7-omnibar.diff create mode 100644 .local/src/surf/patches/surf-0.7-smoothscrolling.diff create mode 100644 .local/src/surf/patches/surf-2.0-externalpipe.diff create mode 100644 .local/src/surf/patches/surf-2.0-homepage.diff create mode 100644 .local/src/surf/patches/surf-bookmarks-20170722-723ff26.diff create mode 100644 .local/src/surf/patches/surf-clipboard-20200112-a6a8878.diff create mode 100644 .local/src/surf/patches/surf-history-20181009-2b71a22.diff create mode 100644 .local/src/surf/patches/surf-modal-20190209-d068a38.diff create mode 100644 .local/src/surf/patches/surf-multijs-20190325-d068a38.diff create mode 100644 .local/src/surf/patches/surf-spacesearch-20170408-b814567.diff create mode 100644 .local/src/surf/patches/surf-tip-navhist.diff create mode 100755 .local/src/surf/surf create mode 100644 .local/src/surf/surf.c.orig create mode 100644 .local/src/surf/surf.o create mode 100644 .local/src/surf/webext-surf.o create mode 100755 .local/src/surf/webext-surf.so diff --git a/.config/X11/xinitrc b/.config/X11/xinitrc index d86aecaa..16e8f396 100755 --- a/.config/X11/xinitrc +++ b/.config/X11/xinitrc @@ -13,7 +13,6 @@ export XSESSION_PID="$$" source ~/.config/config.env - pactl upload-sample /usr/share/sounds/freedesktop/stereo/bell.oga x11-bell pactl load-module module-x11-bell sample=x11-bell display=$DISPLAY xset b 100 diff --git a/.config/htop/htoprc b/.config/htop/htoprc index cb4a9f35..d5fe6fa9 100644 --- a/.config/htop/htoprc +++ b/.config/htop/htoprc @@ -1,7 +1,7 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=47 +sort_key=46 sort_direction=1 hide_threads=0 hide_kernel_threads=1 diff --git a/.config/vim/plugin/plugins.vim b/.config/vim/plugin/plugins.vim index 978db79d..7d6f590a 100644 --- a/.config/vim/plugin/plugins.vim +++ b/.config/vim/plugin/plugins.vim @@ -5,7 +5,6 @@ Plug 'kaicataldo/material.vim' Plug 'itchyny/lightline.vim' Plug 'mengelbrecht/lightline-bufferline' Plug 'lambdalisue/nerdfont.vim' -Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } " Addons Plug 'scrooloose/nerdtree' diff --git a/.config/weechat/sec.conf b/.config/weechat/sec.conf index b5130455..11885f76 100644 --- a/.config/weechat/sec.conf +++ b/.config/weechat/sec.conf @@ -17,7 +17,7 @@ salt = on [data] __passphrase__ = on -oftc_password = "6FFD2A3519D4EF0A5D536F3EAD0717147EF2A93A31DC5844ABB53C21D5BFA4F4FDC4B28C6DA9AEA0B054170930E0772524C7624269E448" -sec.data.oftc_password = "110CA4CD81D793862408231A441E72221A58E37AD083F3B3904C36BD8381C9F34B8607CB5236FDF51C6788E452B6C5DDAED582FBFB96A68D025008E43C738613BCFC" -freenode = "F99A5C9A8F4B3503935C8D304FD6306D92ACCA9737BDAC958C28BB84824EAD608171F122641CC75774B99979A506979987AE5E26D4A769D3CFD13B" -rizon_password = "114694D58027869628E47C77A9C4FECBC13AD1A4AE558B161B8ADCF3E027270E4210B61D5D2009BDCB5A127275DFFC15BB4EFF422FF192415EC22D348FB484A455CE" +oftc_password = "E2F75D4F911F906735F2F5B072F89A6AE19F978A500E8D608595158505C43A83B77C83059D1EBD9CE1B7DC136786C7C0968582CEC3A46B" +sec.data.oftc_password = "59879149B253DCD9452CEC7CB35B3507C15C0DD2DBF0E1C20E846D4B4EA954B5D1AD104B08171CA0770EBE95326F5F4A0B9650A67A117FA7B42E665940B0B4433D91" +freenode = "0998875CD96E436D77C601C8B25DE3ADF932C976FF6A2630752930B58177566D09219A82E691B3022F0AA08946AA5D719A892810ACC018DDC7D1A5" +rizon_password = "DC71B05DC33507FC77BF164E2CC436236696FB501D1A5CF883E16A7BC1E488FF35E8B31DEFCDBC386E6C4D8EE6CF964AA89BFD3E0C6880734493AB129D08CE72B342" diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc index 81aaa42d..975eff70 100644 --- a/.config/zathura/zathurarc +++ b/.config/zathura/zathurarc @@ -19,8 +19,8 @@ set guioptions "" # zathurarc-dark set font "inconsolata 15" -set default-bg "#000000" #00 -set default-fg "#F7F7F6" #01 +set default-bg "#0f111a" #00 +set default-fg "#8d91a0" #01 set statusbar-fg "#B0B0B0" #04 set statusbar-bg "#202020" #01 @@ -47,11 +47,12 @@ set notification-bg "#90A959" #0B set notification-fg "#151515" #00 set recolor "true" -set recolor-lightcolor "#000000" #00 -set recolor-darkcolor "#E0E0E0" #06 +set recolor-lightcolor "#0F111A" #00 +set recolor-darkcolor "#E5E9F0" #06 set recolor-reverse-video "true" -set recolor-keephue "true" +#set recolor-keephue "true" map recolor +map feedkeys ":exec zanotes $FILE" diff --git a/.local/bin/dmenu-books b/.local/bin/dmenu-books index 4c894972..cb3906ca 100755 --- a/.local/bin/dmenu-books +++ b/.local/bin/dmenu-books @@ -9,6 +9,7 @@ if [ "$(date -r "$XDG_CACHE_HOME/calibrelib" "+%d-%m-%Y")" = "$(date '+%d-%m-%Y' books_raw=$(cat "$XDG_CACHE_HOME/calibrelib") else books_raw=$(calibredb --with-library "$LIBRARY" list --for-machine --fields="title,authors,formats") + echo "$books_raw" > "$XDG_CACHE_HOME/calibrelib" fi id="$(echo "$books_raw" |\ diff --git a/.local/bin/lf-ueberzug-previewer b/.local/bin/lf-ueberzug-previewer index 15687c96..5d7b63b6 100755 --- a/.local/bin/lf-ueberzug-previewer +++ b/.local/bin/lf-ueberzug-previewer @@ -89,7 +89,6 @@ case "$MIMETYPE" in text/* | */xml) # Syntax highlight if [ "$( stat --printf='%s' -- "$file" )" -gt "$HIGHLIGHT_SIZE_MAX" ]; then - notify-send 123 123123 exit 2 fi if [ "$( tput colors )" -ge 256 ]; then diff --git a/.local/bin/status-bar/weather b/.local/bin/status-bar/weather index 6f23b4e2..3975d105 100755 --- a/.local/bin/status-bar/weather +++ b/.local/bin/status-bar/weather @@ -6,54 +6,54 @@ weatherreport="${XDG_CACHE_HOME:-$HOME/.local/share}/weatherreport" weatherreportjson="${XDG_CACHE_HOME:-$HOME/.local/share}/weatherreportjson" WCODES=( - ["113"]="^c#ebcb8b^ " - ["116"]="^c#ebcb8b^杖" - ["119"]="^c#ffffff^摒" - ["122"]="^c#ffffff^ " - ["143"]="^c#ffffff^ " - ["176"]="^c#81a1c1^ " - ["179"]="^c#81a1c1^ " - ["182"]="^c#81a1c1^ " - ["185"]="^c#81a1c1^ " + ["113"]="^c#ebcb8b^" + ["116"]="^c#ebcb8b^" + ["119"]="^c#ffffff^" + ["122"]="^c#ffffff^" + ["143"]="^c#ffffff^" + ["176"]="^c#81a1c1^" + ["179"]="^c#81a1c1^" + ["182"]="^c#81a1c1^" + ["185"]="^c#81a1c1^" ["200"]="^c#81a1c1^ " - ["227"]="^c#ffffff^ " - ["230"]="^c#ffffff^ " - ["248"]="^c#ffffff^ " - ["260"]="^c#ffffff^ " - ["263"]="^c#81a1c1^ " - ["266"]="^c#81a1c1^ " - ["281"]="^c#81a1c1^ " - ["284"]="^c#81a1c1^ " - ["293"]="^c#81a1c1^ " - ["296"]="^c#81a1c1^ " - ["299"]="^c#81a1c1^ " - ["302"]="^c#81a1c1^ " - ["305"]="^c#81a1c1^ " - ["308"]="^c#81a1c1^ " - ["311"]="^c#81a1c1^ " - ["314"]="^c#81a1c1^ " - ["317"]="^c#81a1c1^ " - ["320"]="^c#ffffff^ " - ["323"]="^c#81a1c1^ " - ["326"]="^c#81a1c1^ " - ["329"]="^c#ffffff^ " - ["332"]="^c#ffffff^ " - ["335"]="^c#81a1c1^ " - ["338"]="^c#ffffff^ " - ["350"]="^c#81a1c1^ " - ["353"]="^c#81a1c1^ " - ["356"]="^c#81a1c1^ " - ["359"]="^c#81a1c1^ " - ["362"]="^c#81a1c1^ " - ["365"]="^c#81a1c1^ " - ["368"]="^c#81a1c1^ " - ["371"]="^c#81a1c1^ " - ["374"]="^c#81a1c1^ " - ["377"]="^c#81a1c1^ " - ["386"]="^c#81a1c1^ " - ["389"]="^c#81a1c1^ " - ["392"]="^c#81a1c1^ " - ["395"]="^c#81a1c1^ " + ["227"]="^c#ffffff^" + ["230"]="^c#ffffff^" + ["248"]="^c#ffffff^" + ["260"]="^c#ffffff^" + ["263"]="^c#81a1c1^" + ["266"]="^c#81a1c1^" + ["281"]="^c#81a1c1^" + ["284"]="^c#81a1c1^" + ["293"]="^c#81a1c1^" + ["296"]="^c#81a1c1^" + ["299"]="^c#81a1c1^" + ["302"]="^c#81a1c1^" + ["305"]="^c#81a1c1^" + ["308"]="^c#81a1c1^" + ["311"]="^c#81a1c1^" + ["314"]="^c#81a1c1^" + ["317"]="^c#81a1c1^" + ["320"]="^c#ffffff^" + ["323"]="^c#81a1c1^" + ["326"]="^c#81a1c1^" + ["329"]="^c#ffffff^" + ["332"]="^c#ffffff^" + ["335"]="^c#81a1c1^" + ["338"]="^c#ffffff^" + ["350"]="^c#81a1c1^" + ["353"]="^c#81a1c1^" + ["356"]="^c#81a1c1^" + ["359"]="^c#81a1c1^" + ["362"]="^c#81a1c1^" + ["365"]="^c#81a1c1^" + ["368"]="^c#81a1c1^" + ["371"]="^c#81a1c1^" + ["374"]="^c#81a1c1^" + ["377"]="^c#81a1c1^" + ["386"]="^c#81a1c1^" + ["389"]="^c#81a1c1^" + ["392"]="^c#81a1c1^" + ["395"]="^c#81a1c1^" ) getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;} @@ -67,11 +67,11 @@ showweather() { data=$(echo -ne $(echo $data | cut -d' ' -f 1-4)" ${WCODES[$(echo $data | cut -d' ' -f 5)]}") echo $data | awk -F' ' '{ if ($4 > 30) - print "^c#ffffff^ ^d^" $4 "kh "$5 " ^d^ " $1 "°C" + print "^c#ffffff^ ^d^" $4 "kh "$5 " ^d^" $1 "°C" else if ($2 < $3) - print "^c#ffffff^ ^d^" $3 "% "$5 " ^d^ " $1 "°C" + print "^c#ffffff^ ^d^" $3 "% "$5 " ^d^" $1 "°C" else - print "^c#81a1c1^ ^d^" $2 "% " $5 " ^d^ " $1 "°C"}' + print "^c#81a1c1^ ^d^" $2 "% " $5 " ^d^" $1 "°C"}' } case $BLOCK_BUTTON in diff --git a/.local/bin/zanotes b/.local/bin/zanotes new file mode 100755 index 00000000..c339472e --- /dev/null +++ b/.local/bin/zanotes @@ -0,0 +1,32 @@ +#!/bin/bash + +NOTES_FOLDER="$HOME/Documents/Notes" +JSON_DB="$NOTES_FOLDER/books.yml" + + +function exists_or_create() { + if [[ -f "$2" ]]; then + echo "Not Creating the note: File is already there" + else + echo -e "$1 \n$2" + echo -e "# Book: $1\n" > "$2" + cat <> $JSON_DB + - book: "$1" + hash: "$(basename $2)" + date: "$(date '+%d/%m/%Y %H:%M:%S')" +EOF + fi +} + +function add_annotation() { + xclip -out -selection clipboard >> "$1" + echo -e "\n> \n" >> $1 +} + + +hashed_filename="$NOTES_FOLDER/$(md5sum "$1" | cut -f1 -d' ').md" +filename=$(basename "$@") + + +exists_or_create "$filename" "$hashed_filename" +add_annotation "$hashed_filename" diff --git a/.local/share/dwm/autostart.sh b/.local/share/dwm/autostart.sh index 094d48fd..868944f8 100755 --- a/.local/share/dwm/autostart.sh +++ b/.local/share/dwm/autostart.sh @@ -7,7 +7,31 @@ redshift -r -l "$LATLONG" > /dev/null 2> /dev/null & dwmblocks > $XDG_RUNTIME_DIR/dwmblocks.out 2> $XDG_RUNTIME_DIR/dwmblocks.err & +~/.local/bin/devmon --exec-on-drive "notify-send -a '禍 drive mounted' '%l (%f) at %d '" \ + --exec-on-remove "notify-send -a '禍 drive removed' '%l (%f) from %d '" \ + --exec-on-unmount "notify-send -a '禍 drive unmounted' '%l (%f) from %d '" \ + --no-unmount --no-gui & + +clipmenud > $XDG_RUNTIME_DIR/clipmenud.out 2> $XDG_RUNTIME_DIR/clipmenud.err & +rm -f ~/.surf/tabbed-surf.xid +/bin/polkit-dumb-agent & +darkhttpd $HOME/.local/share/startpage/dist --port 9999 --daemon --addr 127.0.0.1 + ~/.local/bin/keyboard > $XDG_RUNTIME_DIR/keyboard.out 2> $XDG_RUNTIME_DIR/keyboard.err + +dunst & + + +touch ~/.cache/nextcloud-track +xss-lock -- slock & +picom --no-fading-openclose & + +xbanish -s & + +#tmux new-session -s weechat -d weechat > /dev/null 2> /dev/null + +~/.local/bin/firefox-sync + ~/.local/bin/mailsync & if [ "$NEXTCLOUD" = true ] ; then @@ -28,28 +52,10 @@ if [ "$ACTIVITYWATCHER" = true ] ; then fi mpd mpDris2 & -touch ~/.cache/nextcloud-track -xss-lock -- slock & -picom --no-fading-openclose & -~/.local/bin/firefox-sync curl 'http://yeetclock/setcolor?R=136&G=192&B=208' & -dunst & - -xbanish -s & - - -tmux new-session -s weechat -d weechat > /dev/null 2> /dev/null -~/.local/bin/devmon --exec-on-drive "notify-send -a '禍 drive mounted' '%l (%f) at %d '" \ - --exec-on-remove "notify-send -a '禍 drive removed' '%l (%f) from %d '" \ - --exec-on-unmount "notify-send -a '禍 drive unmounted' '%l (%f) from %d '" \ - --no-unmount --no-gui & -clipmenud > $XDG_RUNTIME_DIR/clipmenud.out 2> $XDG_RUNTIME_DIR/clipmenud.err & -rm -f ~/.surf/tabbed-surf.xid -/bin/polkit-dumb-agent & -darkhttpd $HOME/.local/share/startpage/dist --port 9999 --daemon --addr 127.0.0.1 diff --git a/.local/src/dwm/config.h b/.local/src/dwm/config.h index c728f95b..fcaf67fe 100644 --- a/.local/src/dwm/config.h +++ b/.local/src/dwm/config.h @@ -19,6 +19,7 @@ static const int nmaster = 1; /* number of clients in master area */ static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ #define FORCE_VSPLIT 1 /* nrowgrid layout: force two clients to always split vertically */ +#define PERTAG_PATCH 1 #include "vanitygaps.c" static const Layout layouts[] = { diff --git a/.local/src/dwm/dwm.c b/.local/src/dwm/dwm.c index c3d12680..9e10207b 100644 --- a/.local/src/dwm/dwm.c +++ b/.local/src/dwm/dwm.c @@ -340,15 +340,6 @@ static xcb_connection_t *xcon; #include "keybinds.h" #include "rules.h" -struct Pertag { - unsigned int curtag, prevtag; /* current and previous tag */ - int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */ - float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */ - unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */ - const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */ - int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */ -}; - /* compile-time check if all tags fit into an unsigned int bit array. */ struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; @@ -885,6 +876,7 @@ createmon(void) m->pertag->curtag = m->pertag->prevtag = 1; for (i = 0; i <= LENGTH(tags); i++) { + m->pertag->enablegaps[i] = 1; m->pertag->nmasters[i] = m->nmaster; m->pertag->mfacts[i] = m->mfact; diff --git a/.local/src/dwm/keybinds.h b/.local/src/dwm/keybinds.h index e841c96e..970c93f1 100644 --- a/.local/src/dwm/keybinds.h +++ b/.local/src/dwm/keybinds.h @@ -66,7 +66,7 @@ static const char *url[] = {"/home/yigit/.local/bin/dmenu_surf", NULL}; static const char *readbook[] = {"/home/yigit/.local/bin/dmenu-books", NULL}; static const char *edit[] = {"/home/yigit/.local/bin/dmenu-edit", NULL}; static const char *surf[] = {"/home/yigit/.local/bin/tabbed_surf", NULL}; -static const char *google[] = {"/home/yigit/.local/bin/menu-surfraw", "google", NULL}; +static const char *searx[] = {"/home/yigit/.local/bin/dmenu-searx", NULL}; static const char *youtube[] = {"/home/yigit/.local/bin/ytfzf_dmenu", NULL}; /* commands */ @@ -92,7 +92,6 @@ static Key keys[] = { { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } }, { MODKEY|Mod1Mask, XK_t, setlayout, {.v = &layouts[0]} }, /*tiled*/ { MODKEY|Mod1Mask, XK_f, setlayout, {.v = &layouts[1]} }, /*Spiral*/ - { MODKEY|Mod1Mask, XK_g, setlayout, {.v = &layouts[2]} }, /*Grid*/ { MODKEY|Mod1Mask, XK_c, setlayout, {.v = &layouts[3]} }, /*center*/ { MODKEY|Mod1Mask, XK_space, setlayout, {.v = &layouts[4]} }, /*Center floating*/ { MODKEY|Mod1Mask, XK_m, setlayout, {.v = &layouts[5]} }, /*monocle*/ @@ -105,6 +104,7 @@ static Key keys[] = { { MODKEY|ShiftMask, XK_a, tag, {.ui = ~0 } }, { MODKEY, XK_comma, focusmon, {.i = -1 } }, { MODKEY, XK_period, focusmon, {.i = +1 } }, + { MODKEY|Mod1Mask, XK_g, togglegaps, {0} }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, @@ -144,7 +144,7 @@ static Key keys[] = { { MODKEY, XK_r, spawn, {.v = readbook} }, { MODKEY|ShiftMask, XK_w, spawn, {.v = wallabag} }, { MODKEY, XK_w, spawn, {.v = wiki} }, - { MODKEY, XK_g, spawn, {.v = google} }, + { MODKEY, XK_g, spawn, {.v = searx} }, { MODKEY, XK_t, spawn, {.v = online_class} }, { MODKEY|ShiftMask, XK_m, spawn, {.v = mconnect} }, { MODKEY|ShiftMask, XK_d, spawn, {.v = udevil} }, diff --git a/.local/src/dwm/vanitygaps.c b/.local/src/dwm/vanitygaps.c index 73a936b5..d74986a9 100644 --- a/.local/src/dwm/vanitygaps.c +++ b/.local/src/dwm/vanitygaps.c @@ -25,6 +25,16 @@ static void getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int static void getfacts(Monitor *m, int msize, int ssize, float *mf, float *sf, int *mr, int *sr); static void setgaps(int oh, int ov, int ih, int iv); +struct Pertag { + unsigned int curtag, prevtag; /* current and previous tag */ + int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */ + float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */ + unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */ + const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */ + int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */ + int enablegaps[LENGTH(tags) + 1]; +}; + /* Settings */ #if !PERTAG_PATCH static int enablegaps = 1; diff --git a/.local/src/slock/config.h b/.local/src/slock/config.h index ef029c88..b44d6efe 100644 --- a/.local/src/slock/config.h +++ b/.local/src/slock/config.h @@ -12,11 +12,11 @@ static const char *colorname[NUMCOLS] = { static const int failonclear = 0; /*Enable blur*/ -//#define BLUR +#define BLUR /*Set blur radius*/ -static const int blurRadius=5; +static const int blurRadius=10; /*Enable Pixelation*/ -#define PIXELATION +//#define PIXELATION /*Set pixelation radius*/ static const int pixelSize=10; diff --git a/.local/src/slock/slock b/.local/src/slock/slock index 1b014f57fee857b41ca559fed43709af23170fb3..b2ce3f9a77757068eacc684b82954414540fd24b 100755 GIT binary patch delta 4671 zcmZ8l4RljQ7M_>%C#|I~DHH;tjT$@wq-_vrD^wer!i$6&q(wk}N~yIVNVTn?;7Pkl zSe}o#WuNX@{5gxRuDk2%q7_9}X$wM+=$?b@9t9SqsOVH$T3x}4VD`K7lFBkYc{BIU zo%{3MJ2UUKd6zWshSX}eb>uVAN{o)xZyWzoTE5+&^0yt!OJ5r&*4p(fsWxpe$(VDr zwMh3#qvwE<@Jk`C)M5f*BA&l3*}PwpuF`GEqx9~id}&;pE&1Lgy*14)eW$z4qx6on z4SFEmAyw%Qq>nOn7qmT={*(Ed>NQOdvQ=x>tg2qVa^3xn_iSif-f&Oj@`qM6G_6?E zb|Q1N6f`jlGsXYNG&Ko-GvS#PV+VdsV^*axW@azMy_Mi#VSFCb?1^o^gU1%OGtL{a zYSl2tQrSP^bVSUjumf>=xR_67hm+W~!bsz2GLXcM#{~?7Cia4U$~tPy4mTNLtZu2% zTa1oXx%Dht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B4udm#&qPnqa?aKNUZ4c&^%a(cb_|DM8_ZxUn zY%$$|c4DxA1n49<-ILD={xH$MO7I$jUnlq?_yy`)SSxc5uz?Z0B+}1_c(&;0Dz!jT93n(NUOz$sDanRJ%P6p zd=0@rC3q3RuM&JM!4>!)hGx{$IzrrS5F()lg5S$O@i?lcnJli#M8f(Bj{l;GbmtRq zB?MnW@bv`W#eE(}@J+&c3HuF+LZe?KxQpob5I;2fApAdscKa+`20m60S)h=ZMxJSa zyF?vL<(^57;KPJ%Bv!w@Lzv$ad??X>o%o?qE)%?o=%->`N>JoD54_&RA+)ImA@*=1 zj1$wCN$^bse~jR?c$O2qndq-4_-1@M5&`yd-(-htpGjj%*~IL1z8={9gdIlMw~$Re zOxWT4!ztr9n{0QTA!rV<`KRz0BWx~VyOEWzanBS-s(cp^&@iVFJUVq$Fq0tZfF|ZJ zjNl^)t`Z!*B=qMKd=$Z#nmE?X41%vRaAVi#n|2*>q!NRT1gC+2eTM)V(a$4(IKeIS zXxw)PN3Ris(Ztbyg42ZFy@Q`)L?6FP#mWWY2>g%`)X`rF?oJqh{^taz`rn%P?Mr=` z=qtoe58&`>Fsgw%x#aI zAvg^@#l&w9d>_#tPyEazxZ$Vmjj3m4OM|;@yLYCXD*k>zUo`F;I+%ACI+I&56=-L8 z`m_Q|YbKvPZMvn|%ePOPp45>EgwQ-U&22fI$y17^TYkvo>xX3WWkqgFZzkUkNQald kUo<^A7hej{8hHAB1>>>>>> +static char **plugindirs = (char*[]){ + "~/.surf/plugins/", + LIBPREFIX "/mozilla/plugins/", + NULL +}; + +/* Webkit default features */ +/* Highest priority value will be used. + * Default parameters are priority 0 + * Per-uri parameters are priority 1 + * Command parameters are priority 2 + */ +static Parameter defconfig[ParameterLast] = { + /* parameter Arg value priority */ + [AcceleratedCanvas] = { { .i = 1 }, }, + [AccessMicrophone] = { { .i = 0 }, }, + [AccessWebcam] = { { .i = 0 }, }, + [Certificate] = { { .i = 0 }, }, + [CaretBrowsing] = { { .i = 0 }, }, + [CookiePolicies] = { { .v = "@Aa" }, }, + [DefaultCharset] = { { .v = "UTF-8" }, }, + [DiskCache] = { { .i = 1 }, }, + [DNSPrefetch] = { { .i = 0 }, }, + [Ephemeral] = { { .i = 0 }, }, + [FileURLsCrossAccess] = { { .i = 0 }, }, + [FontSize] = { { .i = 12 }, }, + [FrameFlattening] = { { .i = 0 }, }, + [Geolocation] = { { .i = 0 }, }, + [HideBackground] = { { .i = 0 }, }, + [Inspector] = { { .i = 0 }, }, + [Java] = { { .i = 1 }, }, + [JavaScript] = { { .i = 1 }, }, + [KioskMode] = { { .i = 0 }, }, + [LoadImages] = { { .i = 1 }, }, + [MediaManualPlay] = { { .i = 1 }, }, + [Plugins] = { { .i = 1 }, }, + [PreferredLanguages] = { { .v = (char *[]){ NULL } }, }, + [RunInFullscreen] = { { .i = 0 }, }, + [ScrollBars] = { { .i = 1 }, }, + [ShowIndicators] = { { .i = 1 }, }, + [SiteQuirks] = { { .i = 1 }, }, + [SmoothScrolling] = { { .i = 0 }, }, + [SpellChecking] = { { .i = 0 }, }, + [SpellLanguages] = { { .v = ((char *[]){ "en_US", NULL }) }, }, + [StrictTLS] = { { .i = 1 }, }, + [Style] = { { .i = 1 }, }, + [WebGL] = { { .i = 0 }, }, + [ZoomLevel] = { { .f = 1.0 }, }, + [ClipboardNotPrimary] = { { .i = 1 }, }, +}; + +static UriParameters uriparams[] = { + { "(://|\\.)suckless\\.org(/|$)", { + [JavaScript] = { { .i = 0 }, 1 }, + [Plugins] = { { .i = 0 }, 1 }, + }, }, +}; + +/* default window size: width, height */ +static int winsize[] = { 800, 600 }; + +static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | + WEBKIT_FIND_OPTIONS_WRAP_AROUND; + +#define PROMPT_GO "Go:" +#define PROMPT_FIND "Find:" + +/* SETPROP(readprop, setprop, prompt)*/ +#define SETPROP(r, s, p) { \ + .v = (const char *[]){ "/bin/sh", "-c", \ + "prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \ + "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\")\" " \ + "| dmenu -p \"$4\" -w $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \ + "surf-setprop", winid, r, s, p, NULL \ + } \ +} + +/* DOWNLOAD(URI, referer) */ +#define DOWNLOAD(u, r) { \ + .v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\ + "curl -g -L -J -O -A \"$1\" -b \"$2\" -c \"$2\"" \ + " -e \"$3\" \"$4\"; read", \ + "surf-download", useragent, cookiefile, r, u, NULL \ + } \ +} + +/* PLUMB(URI) */ +/* This called when some URI which does not begin with "about:", + * "http://" or "https://" should be opened. + */ +#define PLUMB(u) {\ + .v = (const char *[]){ "/bin/sh", "-c", \ + "xdg-open \"$0\"", u, NULL \ + } \ +} + +/* VIDEOPLAY(URI) */ +#define VIDEOPLAY(u) {\ + .v = (const char *[]){ "/bin/sh", "-c", \ + "mpv --really-quiet \"$0\"", u, NULL \ + } \ +} + +/* styles */ +/* + * The iteration will stop at the first match, beginning at the beginning of + * the list. + */ +static SiteSpecific styles[] = { + /* regexp file in $styledir */ + { ".*", "default.css" }, +}; + +/* certificates */ +/* + * Provide custom certificate for urls + */ +static SiteSpecific certs[] = { + /* regexp file in $certdir */ + { "://suckless\\.org/", "suckless.org.crt" }, +}; + +#define MODKEY GDK_CONTROL_MASK + +/* hotkeys */ +/* + * If you use anything else but MODKEY and GDK_SHIFT_MASK, don't forget to + * edit the CLEANMASK() macro. + */ +static Key keys[] = { + /* modifier keyval function arg */ + { MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) }, + { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, + { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, + + { 0, GDK_KEY_Escape, 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 } }, + + { MODKEY, GDK_KEY_l, navigate, { .i = +1 } }, + { MODKEY, GDK_KEY_h, navigate, { .i = -1 } }, + + /* vertical and horizontal scrolling, in viewport percentage */ + { MODKEY, GDK_KEY_j, scrollv, { .i = +10 } }, + { MODKEY, GDK_KEY_k, scrollv, { .i = -10 } }, + { MODKEY, GDK_KEY_space, scrollv, { .i = +50 } }, + { MODKEY, GDK_KEY_b, scrollv, { .i = -50 } }, + { MODKEY, GDK_KEY_i, scrollh, { .i = +10 } }, + { MODKEY, GDK_KEY_u, scrollh, { .i = -10 } }, + + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } }, + { MODKEY, GDK_KEY_minus, zoom, { .i = -1 } }, + { MODKEY, GDK_KEY_plus, zoom, { .i = +1 } }, + + { MODKEY, GDK_KEY_p, clipboard, { .i = 1 } }, + { MODKEY, GDK_KEY_y, clipboard, { .i = 0 } }, + + { MODKEY, GDK_KEY_n, find, { .i = +1 } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } }, + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } }, + { MODKEY, GDK_KEY_t, showcert, { 0 } }, + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } }, + { 0, GDK_KEY_F11, togglefullscreen, { 0 } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_o, toggleinspector, { 0 } }, + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_c, toggle, { .i = CaretBrowsing } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_f, toggle, { .i = FrameFlattening } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_g, toggle, { .i = Geolocation } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_s, toggle, { .i = JavaScript } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_v, toggle, { .i = Plugins } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, +}; + +/* button definitions */ +/* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */ +static Button buttons[] = { + /* target event mask button function argument stop event */ + { OnLink, 0, 2, clicknewwindow, { .i = 0 }, 1 }, + { OnLink, MODKEY, 2, clicknewwindow, { .i = 1 }, 1 }, + { OnLink, MODKEY, 1, clicknewwindow, { .i = 1 }, 1 }, + { OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 }, + { OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 }, + { OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 }, +}; + +#define HOMEPAGE "https://duckduckgo.com/" diff --git a/.local/src/surf/config.def.h.orig b/.local/src/surf/config.def.h.orig new file mode 100644 index 00000000..9b13ae8d --- /dev/null +++ b/.local/src/surf/config.def.h.orig @@ -0,0 +1,204 @@ +/* modifier 0 means no modifier */ +static int surfuseragent = 1; /* Append Surf version to default WebKit user agent */ +static char *fulluseragent = ""; /* Or override the whole user agent string */ +static char *scriptfile = "~/.surf/script.js"; +static char *styledir = "~/.surf/styles/"; +static char *certdir = "~/.surf/certificates/"; +static char *cachedir = "~/.surf/cache/"; +static char *cookiefile = "~/.surf/cookies.txt"; +static char **plugindirs = (char*[]){ + "~/.surf/plugins/", + LIBPREFIX "/mozilla/plugins/", + NULL +}; + +/* Webkit default features */ +/* Highest priority value will be used. + * Default parameters are priority 0 + * Per-uri parameters are priority 1 + * Command parameters are priority 2 + */ +static Parameter defconfig[ParameterLast] = { + /* parameter Arg value priority */ + [AcceleratedCanvas] = { { .i = 1 }, }, + [AccessMicrophone] = { { .i = 0 }, }, + [AccessWebcam] = { { .i = 0 }, }, + [Certificate] = { { .i = 0 }, }, + [CaretBrowsing] = { { .i = 0 }, }, + [CookiePolicies] = { { .v = "@Aa" }, }, + [DefaultCharset] = { { .v = "UTF-8" }, }, + [DiskCache] = { { .i = 1 }, }, + [DNSPrefetch] = { { .i = 0 }, }, + [Ephemeral] = { { .i = 0 }, }, + [FileURLsCrossAccess] = { { .i = 0 }, }, + [FontSize] = { { .i = 12 }, }, + [FrameFlattening] = { { .i = 0 }, }, + [Geolocation] = { { .i = 0 }, }, + [HideBackground] = { { .i = 0 }, }, + [Inspector] = { { .i = 0 }, }, + [Java] = { { .i = 1 }, }, + [JavaScript] = { { .i = 1 }, }, + [KioskMode] = { { .i = 0 }, }, + [LoadImages] = { { .i = 1 }, }, + [MediaManualPlay] = { { .i = 1 }, }, + [Plugins] = { { .i = 1 }, }, + [PreferredLanguages] = { { .v = (char *[]){ NULL } }, }, + [RunInFullscreen] = { { .i = 0 }, }, + [ScrollBars] = { { .i = 1 }, }, + [ShowIndicators] = { { .i = 1 }, }, + [SiteQuirks] = { { .i = 1 }, }, + [SmoothScrolling] = { { .i = 0 }, }, + [SpellChecking] = { { .i = 0 }, }, + [SpellLanguages] = { { .v = ((char *[]){ "en_US", NULL }) }, }, + [StrictTLS] = { { .i = 1 }, }, + [Style] = { { .i = 1 }, }, + [WebGL] = { { .i = 0 }, }, + [ZoomLevel] = { { .f = 1.0 }, }, + [ClipboardNotPrimary] = { { .i = 1 }, }, +}; + +static UriParameters uriparams[] = { + { "(://|\\.)suckless\\.org(/|$)", { + [JavaScript] = { { .i = 0 }, 1 }, + [Plugins] = { { .i = 0 }, 1 }, + }, }, +}; + +/* default window size: width, height */ +static int winsize[] = { 800, 600 }; + +static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | + WEBKIT_FIND_OPTIONS_WRAP_AROUND; + +#define PROMPT_GO "Go:" +#define PROMPT_FIND "Find:" + +/* SETPROP(readprop, setprop, prompt)*/ +#define SETPROP(r, s, p) { \ + .v = (const char *[]){ "/bin/sh", "-c", \ + "prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \ + "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\")\" " \ + "| dmenu -p \"$4\" -w $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \ + "surf-setprop", winid, r, s, p, NULL \ + } \ +} + +/* DOWNLOAD(URI, referer) */ +#define DOWNLOAD(u, r) { \ + .v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\ + "curl -g -L -J -O -A \"$1\" -b \"$2\" -c \"$2\"" \ + " -e \"$3\" \"$4\"; read", \ + "surf-download", useragent, cookiefile, r, u, NULL \ + } \ +} + +/* PLUMB(URI) */ +/* This called when some URI which does not begin with "about:", + * "http://" or "https://" should be opened. + */ +#define PLUMB(u) {\ + .v = (const char *[]){ "/bin/sh", "-c", \ + "xdg-open \"$0\"", u, NULL \ + } \ +} + +/* VIDEOPLAY(URI) */ +#define VIDEOPLAY(u) {\ + .v = (const char *[]){ "/bin/sh", "-c", \ + "mpv --really-quiet \"$0\"", u, NULL \ + } \ +} + +/* styles */ +/* + * The iteration will stop at the first match, beginning at the beginning of + * the list. + */ +static SiteSpecific styles[] = { + /* regexp file in $styledir */ + { ".*", "default.css" }, +}; + +/* certificates */ +/* + * Provide custom certificate for urls + */ +static SiteSpecific certs[] = { + /* regexp file in $certdir */ + { "://suckless\\.org/", "suckless.org.crt" }, +}; + +#define MODKEY GDK_CONTROL_MASK + +/* hotkeys */ +/* + * If you use anything else but MODKEY and GDK_SHIFT_MASK, don't forget to + * edit the CLEANMASK() macro. + */ +static Key keys[] = { + /* modifier keyval function arg */ + { MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) }, + { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, + { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, + + { 0, GDK_KEY_Escape, 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 } }, + + { MODKEY, GDK_KEY_l, navigate, { .i = +1 } }, + { MODKEY, GDK_KEY_h, navigate, { .i = -1 } }, + + /* vertical and horizontal scrolling, in viewport percentage */ + { MODKEY, GDK_KEY_j, scrollv, { .i = +10 } }, + { MODKEY, GDK_KEY_k, scrollv, { .i = -10 } }, + { MODKEY, GDK_KEY_space, scrollv, { .i = +50 } }, + { MODKEY, GDK_KEY_b, scrollv, { .i = -50 } }, + { MODKEY, GDK_KEY_i, scrollh, { .i = +10 } }, + { MODKEY, GDK_KEY_u, scrollh, { .i = -10 } }, + + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } }, + { MODKEY, GDK_KEY_minus, zoom, { .i = -1 } }, + { MODKEY, GDK_KEY_plus, zoom, { .i = +1 } }, + + { MODKEY, GDK_KEY_p, clipboard, { .i = 1 } }, + { MODKEY, GDK_KEY_y, clipboard, { .i = 0 } }, + + { MODKEY, GDK_KEY_n, find, { .i = +1 } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } }, + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } }, + { MODKEY, GDK_KEY_t, showcert, { 0 } }, + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } }, + { 0, GDK_KEY_F11, togglefullscreen, { 0 } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_o, toggleinspector, { 0 } }, + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_c, toggle, { .i = CaretBrowsing } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_f, toggle, { .i = FrameFlattening } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_g, toggle, { .i = Geolocation } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_s, toggle, { .i = JavaScript } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_v, toggle, { .i = Plugins } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, +}; + +/* button definitions */ +/* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */ +static Button buttons[] = { + /* target event mask button function argument stop event */ + { OnLink, 0, 2, clicknewwindow, { .i = 0 }, 1 }, + { OnLink, MODKEY, 2, clicknewwindow, { .i = 1 }, 1 }, + { OnLink, MODKEY, 1, clicknewwindow, { .i = 1 }, 1 }, + { OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 }, + { OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 }, + { OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 }, +}; + +#define HOMEPAGE "https://duckduckgo.com/" diff --git a/.local/src/surf/config.h b/.local/src/surf/config.h index 2e84b96b..c159e626 100644 --- a/.local/src/surf/config.h +++ b/.local/src/surf/config.h @@ -58,7 +58,7 @@ static Parameter defconfig[ParameterLast] = { [Style] = { { .i = 1 }, }, [WebGL] = { { .i = 0 }, }, [ZoomLevel] = { { .f = 1.0 }, }, - [ClipboardNotPrimary] = { { .i = 1 }, }, + [ClipboardNotPrimary] = { { .i = 0 }, }, }; @@ -173,27 +173,26 @@ static char *editscreen[] = { "/bin/sh", "-c", "edit_screen.sh", NULL }; */ static Key keys[] = { /* modifier keyval function arg */ - { 0, GDK_KEY_i, insert, { .i = 1 } }, - { 0, GDK_KEY_Escape, insert, { .i = 0 } }, - { MODKEY, GDK_KEY_o, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) }, - { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, - { 0, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, - { MODKEY, GDK_KEY_b, spawn, BM_ADD("_SURF_URI") }, + { MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) }, + { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, + { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, { 0, GDK_KEY_Escape, 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 } }, - { 0, GDK_KEY_l, navigate, { .i = +1 } }, - { 0, GDK_KEY_h, navigate, { .i = -1 } }, + { MODKEY, GDK_KEY_l, navigate, { .i = +1 } }, + { MODKEY, GDK_KEY_h, navigate, { .i = -1 } }, /* vertical and horizontal scrolling, in viewport percentage */ - { 0, GDK_KEY_j, scrollv, { .i = +10 } }, - { 0, GDK_KEY_k, scrollv, { .i = -10 } }, - { 0, GDK_KEY_space, scrollv, { .i = +50 } }, - { 0, GDK_KEY_b, scrollv, { .i = -50 } }, - { 0, GDK_KEY_u, scrollh, { .i = -10 } }, + { MODKEY, GDK_KEY_j, scrollv, { .i = +10 } }, + { MODKEY, GDK_KEY_k, scrollv, { .i = -10 } }, + { MODKEY, GDK_KEY_space, scrollv, { .i = +50 } }, + { MODKEY, GDK_KEY_b, scrollv, { .i = -50 } }, + { MODKEY, GDK_KEY_i, scrollh, { .i = +10 } }, + { MODKEY, GDK_KEY_u, scrollh, { .i = -10 } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } }, @@ -202,11 +201,11 @@ static Key keys[] = { { MODKEY, GDK_KEY_minus, zoom, { .i = -1 } }, { MODKEY, GDK_KEY_plus, zoom, { .i = +1 } }, - { 0, GDK_KEY_p, clipboard, { .i = 1 } }, - { 0, GDK_KEY_y, clipboard, { .i = 0 } }, + { MODKEY, GDK_KEY_p, clipboard, { .i = 1 } }, + { MODKEY, GDK_KEY_y, clipboard, { .i = 0 } }, - { 0, GDK_KEY_n, find, { .i = +1 } }, - { GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } }, + { MODKEY, GDK_KEY_n, find, { .i = +1 } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } }, { MODKEY, GDK_KEY_t, showcert, { 0 } }, @@ -216,6 +215,7 @@ static Key keys[] = { { MODKEY|GDK_SHIFT_MASK, GDK_KEY_o, toggleinspector, { 0 } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_c, toggle, { .i = CaretBrowsing } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_f, toggle, { .i = FrameFlattening } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_g, toggle, { .i = Geolocation } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_s, toggle, { .i = JavaScript } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } }, @@ -223,10 +223,6 @@ static Key keys[] = { { MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, - { MODKEY, GDK_KEY_u, externalpipe, { .v = linkselect_curwin } }, - { MODKEY, GDK_KEY_y, externalpipe, { .v = linkyank } }, - { MODKEY, GDK_KEY_v, externalpipe, { .v = editscreen } }, - { MODKEY , GDK_KEY_Return, spawn, SETURI("_SURF_GO") }, }; /* button definitions */ @@ -234,8 +230,8 @@ static Key keys[] = { static Button buttons[] = { /* target event mask button function argument stop event */ { OnLink, 0, 2, clicknewwindow, { .i = 0 }, 1 }, - { OnLink, MODKEY, 2, clicknewwindow, { .i = 0 }, 1 }, - { OnLink, MODKEY, 1, clicknewwindow, { .i = 0 }, 1 }, + { OnLink, MODKEY, 2, clicknewwindow, { .i = 1 }, 1 }, + { OnLink, MODKEY, 1, clicknewwindow, { .i = 1 }, 1 }, { OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 }, { OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 }, { OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 }, diff --git a/.local/src/surf/patches/surf-0.6-navhist.diff b/.local/src/surf/patches/surf-0.6-navhist.diff new file mode 100644 index 00000000..2894da8b --- /dev/null +++ b/.local/src/surf/patches/surf-0.6-navhist.diff @@ -0,0 +1,138 @@ +diff --git a/config.def.h b/config.def.h +index a221c86..9840736 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -32,6 +32,16 @@ static Bool hidebackground = FALSE; + } \ + } + ++#define SELNAV { \ ++ .v = (char *[]){ "/bin/sh", "-c", \ ++ "prop=\"`xprop -id $0 _SURF_HIST" \ ++ " | sed -e 's/^.[^\"]*\"//' -e 's/\"$//' -e 's/\\\\\\n/\\n/g'" \ ++ " | dmenu -i -l 10`\"" \ ++ " && xprop -id $0 -f _SURF_NAV 8s -set _SURF_NAV \"$prop\"", \ ++ winid, NULL \ ++ } \ ++} ++ + /* DOWNLOAD(URI, referer) */ + #define DOWNLOAD(d, r) { \ + .v = (char *[]){ "/bin/sh", "-c", \ +@@ -67,6 +77,7 @@ static Key keys[] = { + + { MODKEY, GDK_l, navigate, { .i = +1 } }, + { MODKEY, GDK_h, navigate, { .i = -1 } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_h, selhist, SELNAV }, + + { MODKEY, GDK_j, scroll_v, { .i = +1 } }, + { MODKEY, GDK_k, scroll_v, { .i = -1 } }, +diff --git a/surf.c b/surf.c +index cebd469..8b6d751 100644 +--- a/surf.c ++++ b/surf.c +@@ -32,7 +32,7 @@ char *argv0; + #define COOKIEJAR_TYPE (cookiejar_get_type ()) + #define COOKIEJAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COOKIEJAR_TYPE, CookieJar)) + +-enum { AtomFind, AtomGo, AtomUri, AtomLast }; ++enum { AtomFind, AtomGo, AtomUri, AtomHist, AtomNav, AtomLast }; + + typedef union Arg Arg; + union Arg { +@@ -137,6 +137,8 @@ static void loadstatuschange(WebKitWebView *view, GParamSpec *pspec, + Client *c); + static void loaduri(Client *c, const Arg *arg); + static void navigate(Client *c, const Arg *arg); ++static void selhist(Client *c, const Arg *arg); ++static void navhist(Client *c, const Arg *arg); + static Client *newclient(void); + static void newwindow(Client *c, const Arg *arg, gboolean noembed); + static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d); +@@ -649,6 +651,59 @@ navigate(Client *c, const Arg *arg) { + webkit_web_view_go_back_or_forward(c->view, steps); + } + ++static void ++selhist(Client *c, const Arg *arg) { ++ WebKitWebBackForwardList *lst; ++ WebKitWebHistoryItem *cur; ++ gint i; ++ gchar *out; ++ gchar *tmp; ++ gchar *line; ++ ++ out = g_strdup(""); ++ ++ if(!(lst = webkit_web_view_get_back_forward_list(c->view))) ++ return; ++ ++ for(i = webkit_web_back_forward_list_get_back_length(lst); i > 0; i--) { ++ if(!(cur = webkit_web_back_forward_list_get_nth_item(lst, -i))) ++ break; ++ line = g_strdup_printf("%d: %s\n", -i, ++ webkit_web_history_item_get_original_uri(cur)); ++ tmp = g_strconcat(out, line, NULL); ++ g_free(out); ++ out = tmp; ++ } ++ ++ if((cur = webkit_web_back_forward_list_get_nth_item(lst, 0))) { ++ line = g_strdup_printf("%d: %s", 0, ++ webkit_web_history_item_get_original_uri(cur)); ++ tmp = g_strconcat(out, line, NULL); ++ g_free(out); ++ out = tmp; ++ } ++ ++ for(i = 1; i <= webkit_web_back_forward_list_get_forward_length(lst); i++) { ++ if(!(cur = webkit_web_back_forward_list_get_nth_item(lst, i))) ++ break; ++ line = g_strdup_printf("\n%d: %s", i, ++ webkit_web_history_item_get_original_uri(cur)); ++ tmp = g_strconcat(out, line, NULL); ++ g_free(out); ++ out = tmp; ++ } ++ ++ setatom(c, AtomHist, out); ++ g_free(out); ++ spawn(c, arg); ++} ++ ++static void ++navhist(Client *c, const Arg *arg) { ++ Arg a = { .i = atoi(arg->v) }; ++ navigate(c, &a); ++} ++ + static Client * + newclient(void) { + Client *c; +@@ -805,6 +860,7 @@ newclient(void) { + + setatom(c, AtomFind, ""); + setatom(c, AtomUri, "about:blank"); ++ setatom(c, AtomHist, ""); + if(hidebackground) + webkit_web_view_set_transparent(c->view, TRUE); + +@@ -923,6 +979,9 @@ processx(GdkXEvent *e, GdkEvent *event, gpointer d) { + arg.v = getatom(c, AtomGo); + loaduri(c, &arg); + return GDK_FILTER_REMOVE; ++ } else if(ev->atom == atoms[AtomNav]) { ++ arg.v = getatom(c, AtomNav); ++ navhist(c, &arg); + } + } + } +@@ -1004,6 +1063,8 @@ setup(void) { + atoms[AtomFind] = XInternAtom(dpy, "_SURF_FIND", False); + atoms[AtomGo] = XInternAtom(dpy, "_SURF_GO", False); + atoms[AtomUri] = XInternAtom(dpy, "_SURF_URI", False); ++ atoms[AtomHist] = XInternAtom(dpy, "_SURF_HIST", False); ++ atoms[AtomNav] = XInternAtom(dpy, "_SURF_NAV", False); + + /* dirs and files */ + cookiefile = buildpath(cookiefile); diff --git a/.local/src/surf/patches/surf-0.7-omnibar.diff b/.local/src/surf/patches/surf-0.7-omnibar.diff new file mode 100644 index 00000000..e00e5e38 --- /dev/null +++ b/.local/src/surf/patches/surf-0.7-omnibar.diff @@ -0,0 +1,59 @@ +diff --git a/config.def.h b/config.def.h +index 93a3d49..05d81de 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -65,6 +65,18 @@ static Bool allowgeolocation = TRUE; + } \ + } + ++#define ONLOAD(u) { \ ++ .v = (char *[]){"/bin/sh", "-c", \ ++ "~/.surf/omnibar addhist \"$0\"", u, NULL \ ++ } \ ++} ++ ++#define GOTO { \ ++ .v = (char *[]){"/bin/sh", "-c", \ ++ "~/.surf/omnibar goto \"$0\" \"$1\"", winid, "_SURF_GO", NULL \ ++ } \ ++} ++ + /* styles */ + /* + * The iteration will stop at the first match, beginning at the beginning of +@@ -112,7 +124,7 @@ static Key keys[] = { + { MODKEY, GDK_o, source, { 0 } }, + { MODKEY|GDK_SHIFT_MASK,GDK_o, inspector, { 0 } }, + +- { MODKEY, GDK_g, spawn, SETPROP("_SURF_URI", "_SURF_GO") }, ++ { MODKEY, GDK_g, spawn, GOTO }, + { MODKEY, GDK_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") }, + { MODKEY, GDK_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") }, + +diff --git a/surf.c b/surf.c +index f2170a4..c8fdab3 100644 +--- a/surf.c ++++ b/surf.c +@@ -789,11 +789,11 @@ loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c) + WebKitWebDataSource *src; + WebKitNetworkRequest *request; + SoupMessage *msg; +- char *uri; ++ char *uri = geturi(c); ++ Arg arg; + + switch (webkit_web_view_get_load_status (c->view)) { + case WEBKIT_LOAD_COMMITTED: +- uri = geturi(c); + if (strstr(uri, "https://") == uri) { + frame = webkit_web_view_get_main_frame(c->view); + src = webkit_web_frame_get_data_source(frame); +@@ -809,6 +809,8 @@ loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c) + setstyle(c, getstyle(uri)); + break; + case WEBKIT_LOAD_FINISHED: ++ arg = (Arg)ONLOAD(uri); ++ spawn(NULL, &arg); + c->progress = 100; + updatetitle(c); + if (diskcache) { diff --git a/.local/src/surf/patches/surf-0.7-smoothscrolling.diff b/.local/src/surf/patches/surf-0.7-smoothscrolling.diff new file mode 100644 index 00000000..ae252d2d --- /dev/null +++ b/.local/src/surf/patches/surf-0.7-smoothscrolling.diff @@ -0,0 +1,238 @@ +diff --git a/config.def.h b/config.def.h +index 93a3d49..fa7935c 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -83,50 +83,51 @@ static SiteStyle styles[] = { + * edit the CLEANMASK() macro. + */ + static Key keys[] = { +- /* modifier keyval function arg Focus */ +- { MODKEY|GDK_SHIFT_MASK,GDK_r, reload, { .b = TRUE } }, +- { MODKEY, GDK_r, reload, { .b = FALSE } }, +- { MODKEY|GDK_SHIFT_MASK,GDK_p, print, { 0 } }, +- +- { MODKEY, GDK_p, clipboard, { .b = TRUE } }, +- { MODKEY, GDK_y, clipboard, { .b = FALSE } }, +- +- { MODKEY|GDK_SHIFT_MASK,GDK_j, zoom, { .i = -1 } }, +- { MODKEY|GDK_SHIFT_MASK,GDK_k, zoom, { .i = +1 } }, +- { MODKEY|GDK_SHIFT_MASK,GDK_q, zoom, { .i = 0 } }, +- { MODKEY, GDK_minus, zoom, { .i = -1 } }, +- { MODKEY, GDK_plus, zoom, { .i = +1 } }, +- +- { MODKEY, GDK_l, navigate, { .i = +1 } }, +- { MODKEY, GDK_h, navigate, { .i = -1 } }, +- +- { MODKEY, GDK_j, scroll_v, { .i = +1 } }, +- { MODKEY, GDK_k, scroll_v, { .i = -1 } }, +- { MODKEY, GDK_b, scroll_v, { .i = -10000 } }, +- { MODKEY, GDK_space, scroll_v, { .i = +10000 } }, +- { MODKEY, GDK_i, scroll_h, { .i = +1 } }, +- { MODKEY, GDK_u, scroll_h, { .i = -1 } }, +- +- { 0, GDK_F11, fullscreen, { 0 } }, +- { 0, GDK_Escape, stop, { 0 } }, +- { MODKEY, GDK_o, source, { 0 } }, +- { MODKEY|GDK_SHIFT_MASK,GDK_o, inspector, { 0 } }, +- +- { MODKEY, GDK_g, spawn, SETPROP("_SURF_URI", "_SURF_GO") }, +- { MODKEY, GDK_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") }, +- { MODKEY, GDK_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") }, +- +- { MODKEY, GDK_n, find, { .b = TRUE } }, +- { MODKEY|GDK_SHIFT_MASK,GDK_n, find, { .b = FALSE } }, +- +- { MODKEY|GDK_SHIFT_MASK,GDK_c, toggle, { .v = "enable-caret-browsing" } }, +- { MODKEY|GDK_SHIFT_MASK,GDK_i, toggle, { .v = "auto-load-images" } }, +- { MODKEY|GDK_SHIFT_MASK,GDK_s, toggle, { .v = "enable-scripts" } }, +- { MODKEY|GDK_SHIFT_MASK,GDK_v, toggle, { .v = "enable-plugins" } }, +- { MODKEY|GDK_SHIFT_MASK,GDK_a, togglecookiepolicy, { 0 } }, +- { MODKEY|GDK_SHIFT_MASK,GDK_m, togglestyle, { 0 } }, +- { MODKEY|GDK_SHIFT_MASK,GDK_b, togglescrollbars, { 0 } }, +- { MODKEY|GDK_SHIFT_MASK,GDK_g, togglegeolocation, { 0 } }, ++ /* modifier keyval function arg Focus */ ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_r, reload, { .b = TRUE } }, ++ { MODKEY, GDK_KEY_r, reload, { .b = FALSE } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_p, print, { 0 } }, ++ ++ { MODKEY, GDK_KEY_p, clipboard, { .b = TRUE } }, ++ { MODKEY, GDK_KEY_y, clipboard, { .b = FALSE } }, ++ ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_j, zoom, { .i = -1 } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_k, zoom, { .i = +1 } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_q, zoom, { .i = 0 } }, ++ { MODKEY, GDK_KEY_minus, zoom, { .i = -1 } }, ++ { MODKEY, GDK_KEY_plus, zoom, { .i = +1 } }, ++ ++ { MODKEY, GDK_KEY_l, navigate, { .i = +1 } }, ++ { MODKEY, GDK_KEY_h, navigate, { .i = -1 } }, ++ ++ { MODKEY, GDK_KEY_j, scroll_v, { .i = +1 } }, ++ { MODKEY, GDK_KEY_k, scroll_v, { .i = -1 } }, ++ { MODKEY, GDK_KEY_b, scroll_v, { .i = -10000 } }, ++ { MODKEY, GDK_KEY_space, scroll_v, { .i = +10000 } }, ++ { MODKEY, GDK_KEY_i, scroll_h, { .i = +1 } }, ++ { MODKEY, GDK_KEY_u, scroll_h, { .i = -1 } }, ++ ++ { 0, GDK_KEY_F11, fullscreen, { 0 } }, ++ { 0, GDK_KEY_Escape, stop, { 0 } }, ++ { MODKEY, GDK_KEY_o, source, { 0 } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_o, inspector, { 0 } }, ++ ++ { MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO") }, ++ { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") }, ++ { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") }, ++ ++ { MODKEY, GDK_KEY_n, find, { .b = TRUE } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_n, find, { .b = FALSE } }, ++ ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_c, toggle, { .v = "enable-caret-browsing" } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_i, toggle, { .v = "auto-load-images" } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_s, toggle, { .v = "enable-scripts" } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_v, toggle, { .v = "enable-plugins" } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_a, togglecookiepolicy, { 0 } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_m, togglestyle, { 0 } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_b, togglescrollbars, { 0 } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_KEY_g, togglegeolocation, { 0 } }, ++ + }; + + /* button definitions */ +diff --git a/config.mk b/config.mk +index 9f85ea4..a070f88 100644 +--- a/config.mk ++++ b/config.mk +@@ -10,8 +10,8 @@ MANPREFIX = ${PREFIX}/share/man + X11INC = /usr/X11R6/include + X11LIB = /usr/X11R6/lib + +-GTKINC = `pkg-config --cflags gtk+-2.0 webkit-1.0` +-GTKLIB = `pkg-config --libs gtk+-2.0 webkit-1.0` ++GTKINC = `pkg-config --cflags gtk+-3.0 webkitgtk-3.0` ++GTKLIB = `pkg-config --libs gtk+-3.0 webkitgtk-3.0` + + # includes and libs + INCS = -I. -I/usr/include -I${X11INC} ${GTKINC} +diff --git a/surf.c b/surf.c +index 108485b..7a708d4 100644 +--- a/surf.c ++++ b/surf.c +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -100,7 +101,7 @@ typedef struct { + static Display *dpy; + static Atom atoms[AtomLast]; + static Client *clients = NULL; +-static GdkNativeWindow embed = 0; ++static Window embed = 0; + static gboolean showxid = FALSE; + static char winid[64]; + static gboolean usingproxy = 0; +@@ -627,9 +628,9 @@ getatom(Client *c, int a) + unsigned long ldummy; + unsigned char *p = NULL; + +- XGetWindowProperty(dpy, GDK_WINDOW_XID(GTK_WIDGET(c->win)->window), +- atoms[a], 0L, BUFSIZ, False, XA_STRING, +- &adummy, &idummy, &ldummy, &ldummy, &p); ++ XGetWindowProperty(dpy, GDK_WINDOW_XID(gtk_widget_get_window(GTK_WIDGET(c->win))), ++ atoms[a], 0L, BUFSIZ, False, XA_STRING, ++ &adummy, &idummy, &ldummy, &ldummy, &p); + if (p) + strncpy(buf, (char *)p, LENGTH(buf)-1); + else +@@ -873,6 +874,7 @@ newclient(void) + WebKitWebFrame *frame; + GdkGeometry hints = { 1, 1 }; + GdkScreen *screen; ++ GdkWindow *window; + gdouble dpi; + char *ua; + +@@ -902,6 +904,10 @@ newclient(void) + */ + gtk_window_set_role(GTK_WINDOW(c->win), "Surf"); + } ++ ++ gtk_widget_realize(GTK_WIDGET(c->win)); ++ window = gtk_widget_get_window(GTK_WIDGET(c->win)); ++ + gtk_window_set_default_size(GTK_WINDOW(c->win), 800, 600); + g_signal_connect(G_OBJECT(c->win), + "destroy", +@@ -914,10 +920,10 @@ newclient(void) + addaccelgroup(c); + + /* Pane */ +- c->pane = gtk_vpaned_new(); ++ c->pane = gtk_paned_new(GTK_ORIENTATION_VERTICAL); + + /* VBox */ +- c->vbox = gtk_vbox_new(FALSE, 0); ++ c->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); + gtk_paned_pack1(GTK_PANED(c->pane), c->vbox, TRUE, TRUE); + + /* Webview */ +@@ -999,8 +1005,8 @@ newclient(void) + gtk_widget_show(c->win); + gtk_window_set_geometry_hints(GTK_WINDOW(c->win), NULL, &hints, + GDK_HINT_MIN_SIZE); +- gdk_window_set_events(GTK_WIDGET(c->win)->window, GDK_ALL_EVENTS_MASK); +- gdk_window_add_filter(GTK_WIDGET(c->win)->window, processx, c); ++ gdk_window_set_events(window, GDK_ALL_EVENTS_MASK); ++ gdk_window_add_filter(window, processx, c); + webkit_web_view_set_full_content_zoom(c->view, TRUE); + + runscript(frame); +@@ -1034,7 +1040,7 @@ newclient(void) + * It is equivalent to firefox's "layout.css.devPixelsPerPx" setting. + */ + if (zoomto96dpi) { +- screen = gdk_window_get_screen(GTK_WIDGET(c->win)->window); ++ screen = gdk_window_get_screen(window); + dpi = gdk_screen_get_resolution(screen); + if (dpi != -1) { + g_object_set(G_OBJECT(settings), +@@ -1073,7 +1079,7 @@ newclient(void) + if (showxid) { + gdk_display_sync(gtk_widget_get_display(c->win)); + printf("%u\n", +- (guint)GDK_WINDOW_XID(GTK_WIDGET(c->win)->window)); ++ (guint)GDK_WINDOW_XID(window)); + fflush(NULL); + if (fclose(stdout) != 0) + die("Error closing stdout"); +@@ -1281,7 +1287,7 @@ void + setatom(Client *c, int a, const char *v) + { + XSync(dpy, False); +- XChangeProperty(dpy, GDK_WINDOW_XID(GTK_WIDGET(c->win)->window), ++ XChangeProperty(dpy, GDK_WINDOW_XID(gtk_widget_get_window(GTK_WIDGET(c->win))), + atoms[a], XA_STRING, 8, PropModeReplace, + (unsigned char *)v, strlen(v) + 1); + } +@@ -1302,7 +1308,7 @@ setup(void) + die("Can't install SIGHUP handler"); + gtk_init(NULL, NULL); + +- dpy = GDK_DISPLAY(); ++ dpy = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); + + /* atoms */ + atoms[AtomFind] = XInternAtom(dpy, "_SURF_FIND", False); +@@ -1634,7 +1640,7 @@ void + updatewinid(Client *c) + { + snprintf(winid, LENGTH(winid), "%u", +- (int)GDK_WINDOW_XID(GTK_WIDGET(c->win)->window)); ++ (int)GDK_WINDOW_XID(gtk_widget_get_window(GTK_WIDGET(c->win)))); + } + + void + diff --git a/.local/src/surf/patches/surf-2.0-externalpipe.diff b/.local/src/surf/patches/surf-2.0-externalpipe.diff new file mode 100644 index 00000000..ca62010d --- /dev/null +++ b/.local/src/surf/patches/surf-2.0-externalpipe.diff @@ -0,0 +1,93 @@ +diff --git a/surf.c b/surf.c +index 93a1629..ba53b94 100644 +--- a/surf.c ++++ b/surf.c +@@ -217,6 +217,7 @@ static void togglefullscreen(Client *c, const Arg *a); + static void togglecookiepolicy(Client *c, const Arg *a); + static void toggleinspector(Client *c, const Arg *a); + static void find(Client *c, const Arg *a); ++static void externalpipe(Client *c, const Arg *a); + + /* Buttons */ + static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h); +@@ -241,6 +242,80 @@ char *argv0; + /* configuration, allows nested code to access above variables */ + #include "config.h" + ++static void ++externalpipe_execute(char* buffer, Arg *arg) { ++ int to[2]; ++ void (*oldsigpipe)(int); ++ ++ if (pipe(to) == -1) ++ return; ++ ++ switch (fork()) { ++ case -1: ++ close(to[0]); ++ close(to[1]); ++ return; ++ case 0: ++ dup2(to[0], STDIN_FILENO); close(to[0]); close(to[1]); ++ execvp(((char **)arg->v)[0], (char **)arg->v); ++ fprintf(stderr, "st: execvp %s\n", ((char **)arg->v)[0]); ++ perror("failed"); ++ exit(0); ++ } ++ ++ close(to[0]); ++ oldsigpipe = signal(SIGPIPE, SIG_IGN); ++ write(to[1], buffer, strlen(buffer)); ++ close(to[1]); ++ signal(SIGPIPE, oldsigpipe); ++} ++ ++static void ++externalpipe_resource_done(WebKitWebResource *r, GAsyncResult *s, Arg *arg) ++{ ++ GError *gerr = NULL; ++ guchar *buffer = webkit_web_resource_get_data_finish(r, s, NULL, &gerr); ++ if (gerr == NULL) { ++ externalpipe_execute((char *) buffer, arg); ++ } else { ++ g_error_free(gerr); ++ } ++ g_free(buffer); ++} ++ ++static void ++externalpipe_js_done(WebKitWebView *wv, GAsyncResult *s, Arg *arg) ++{ ++ WebKitJavascriptResult *j = webkit_web_view_run_javascript_finish( ++ wv, s, NULL); ++ if (!j) { ++ return; ++ } ++ JSCValue *v = webkit_javascript_result_get_js_value(j); ++ if (jsc_value_is_string(v)) { ++ char *buffer = jsc_value_to_string(v); ++ externalpipe_execute(buffer, arg); ++ g_free(buffer); ++ } ++ webkit_javascript_result_unref(j); ++} ++ ++void ++externalpipe(Client *c, const Arg *arg) ++{ ++ if (curconfig[JavaScript].val.i) { ++ webkit_web_view_run_javascript( ++ c->view, "window.document.documentElement.outerHTML", ++ NULL, externalpipe_js_done, arg); ++ } else { ++ WebKitWebResource *resource = webkit_web_view_get_main_resource(c->view); ++ if (resource != NULL) { ++ webkit_web_resource_get_data( ++ resource, NULL, externalpipe_resource_done, arg); ++ } ++ } ++} ++ + void + usage(void) + { diff --git a/.local/src/surf/patches/surf-2.0-homepage.diff b/.local/src/surf/patches/surf-2.0-homepage.diff new file mode 100644 index 00000000..f32016f7 --- /dev/null +++ b/.local/src/surf/patches/surf-2.0-homepage.diff @@ -0,0 +1,24 @@ +diff --git a/config.def.h b/config.def.h +--- a/config.def.h ++++ b/config.def.h +@@ -164,3 +164,5 @@ static Button buttons[] = { + { OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 }, + { OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 }, + }; ++ ++#define HOMEPAGE "https://duckduckgo.com/" +diff --git a/surf.c b/surf.c +--- a/surf.c ++++ b/surf.c +@@ -1751,7 +1751,11 @@ main(int argc, char *argv[]) + if (argc > 0) + arg.v = argv[0]; + else ++#ifdef HOMEPAGE ++ arg.v = HOMEPAGE; ++#else + arg.v = "about:blank"; ++#endif + + setup(); + c = newclient(NULL); diff --git a/.local/src/surf/patches/surf-bookmarks-20170722-723ff26.diff b/.local/src/surf/patches/surf-bookmarks-20170722-723ff26.diff new file mode 100644 index 00000000..323ba55f --- /dev/null +++ b/.local/src/surf/patches/surf-bookmarks-20170722-723ff26.diff @@ -0,0 +1,42 @@ +diff --git a/config.def.h b/config.def.h +index 2e735bf..43ad9ab 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -69,8 +69,9 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | + #define SETPROP(r, s, p) { \ + .v = (const char *[]){ "/bin/sh", "-c", \ + "prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \ +- "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\")\" " \ +- "| dmenu -p \"$4\" -w $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \ ++ "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\" && cat ~/.surf/bookmarks)\" " \ ++ "| dmenu -l 10 -p \"$4\" -w $1)\" && " \ ++ "xprop -id $1 -f $3 8s -set $3 \"$prop\"", \ + "surf-setprop", winid, r, s, p, NULL \ + } \ + } +@@ -101,6 +102,17 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | + } \ + } + ++/* BM_ADD(readprop) */ ++#define BM_ADD(r) {\ ++ .v = (const char *[]){ "/bin/sh", "-c", \ ++ "(echo $(xprop -id $0 $1) | cut -d '\"' -f2 " \ ++ "| sed 's/.*https*:\\/\\/\\(www\\.\\)\\?//' && cat ~/.surf/bookmarks) " \ ++ "| awk '!seen[$0]++' > ~/.surf/bookmarks.tmp && " \ ++ "mv ~/.surf/bookmarks.tmp ~/.surf/bookmarks", \ ++ winid, r, NULL \ ++ } \ ++} ++ + /* styles */ + /* + * The iteration will stop at the first match, beginning at the beginning of +@@ -132,6 +144,7 @@ static Key keys[] = { + { MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) }, + { 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_m, spawn, BM_ADD("_SURF_URI") }, + + { 0, GDK_KEY_Escape, stop, { 0 } }, + { MODKEY, GDK_KEY_c, stop, { 0 } }, diff --git a/.local/src/surf/patches/surf-clipboard-20200112-a6a8878.diff b/.local/src/surf/patches/surf-clipboard-20200112-a6a8878.diff new file mode 100644 index 00000000..5c43025b --- /dev/null +++ b/.local/src/surf/patches/surf-clipboard-20200112-a6a8878.diff @@ -0,0 +1,67 @@ +From a6a8878bb6a203b589d559025b94a78214f22878 Mon Sep 17 00:00:00 2001 +From: Olivier Moreau +Date: Sun, 12 Jan 2020 11:23:11 +0000 +Subject: [PATCH] Added choice between PRIMARY and CLIPBOARD Gtk selections, as + a config option + +--- + config.def.h | 1 + + surf.c | 11 +++++++++-- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 34265f6..03bbe2b 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -48,6 +48,7 @@ static Parameter defconfig[ParameterLast] = { + [Style] = { { .i = 1 }, }, + [WebGL] = { { .i = 0 }, }, + [ZoomLevel] = { { .f = 1.0 }, }, ++ [ClipboardNotPrimary] = { { .i = 1 }, }, + }; + + static UriParameters uriparams[] = { +diff --git a/surf.c b/surf.c +index 2b54e3c..b8a9b2f 100644 +--- a/surf.c ++++ b/surf.c +@@ -82,6 +82,7 @@ typedef enum { + Style, + WebGL, + ZoomLevel, ++ ClipboardNotPrimary, + ParameterLast + } ParamName; + +@@ -291,6 +292,7 @@ static ParamName loadcommitted[] = { + SpellLanguages, + Style, + ZoomLevel, ++ ClipboardNotPrimary, + ParameterLast + }; + +@@ -1816,13 +1818,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); + } + } +-- +2.24.1 + diff --git a/.local/src/surf/patches/surf-history-20181009-2b71a22.diff b/.local/src/surf/patches/surf-history-20181009-2b71a22.diff new file mode 100644 index 00000000..40192c55 --- /dev/null +++ b/.local/src/surf/patches/surf-history-20181009-2b71a22.diff @@ -0,0 +1,107 @@ +diff -up surf-2.0/config.def.h surf-2.0-history/config.def.h +--- surf-2.0/config.def.h 2017-11-26 14:29:37.963786915 +0100 ++++ surf-2.0-history/config.def.h 2017-11-26 19:48:31.300096237 +0100 +@@ -6,6 +6,7 @@ static char *styledir = "~/.surf/s + static char *certdir = "~/.surf/certificates/"; + static char *cachedir = "~/.surf/cache/"; + static char *cookiefile = "~/.surf/cookies.txt"; ++static char *historyfile = "~/.surf/history.txt"; + + /* Webkit default features */ + /* Highest priority value will be used. +@@ -101,6 +102,11 @@ static WebKitFindOptions findopts = WEBK + } \ + } + ++#define SETURI(p) { .v = (char *[]){ "/bin/sh", "-c", \ ++"prop=\"`surf_history_dmenu.sh`\" &&" \ ++"xprop -id $1 -f $0 8s -set $0 \"$prop\"", \ ++p, winid, NULL } } ++ + /* styles */ + /* + * The iteration will stop at the first match, beginning at the beginning of +@@ -181,6 +187,7 @@ static Key keys[] = { + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } }, + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, ++ { MODKEY , GDK_KEY_Return, spawn, SETURI("_SURF_GO") }, + }; + + /* button definitions */ +Only in surf-2.0-history/: config.h +Only in surf-2.0: .git +Only in surf-2.0-history/: surf +diff -up surf-2.0/surf.c surf-2.0-history/surf.c +--- surf-2.0/surf.c 2017-11-26 14:29:37.963786915 +0100 ++++ surf-2.0-history/surf.c 2017-11-26 14:20:36.757100476 +0100 +@@ -171,6 +171,7 @@ static void newwindow(Client *c, const A + static void spawn(Client *c, const Arg *a); + static void destroyclient(Client *c); + static void cleanup(void); ++static void updatehistory(const char *u, const char *t); + + /* GTK/WebKit */ + static WebKitWebView *newview(Client *c, WebKitWebView *rv); +@@ -336,10 +337,11 @@ setup(void) + curconfig = defconfig; + + /* dirs and files */ +- cookiefile = buildfile(cookiefile); +- scriptfile = buildfile(scriptfile); +- cachedir = buildpath(cachedir); +- certdir = buildpath(certdir); ++ cookiefile = buildfile(cookiefile); ++ historyfile = buildfile(historyfile); ++ scriptfile = buildfile(scriptfile); ++ cachedir = buildpath(cachedir); ++ certdir = buildpath(certdir); + + gdkkb = gdk_seat_get_keyboard(gdk_display_get_default_seat(gdpy)); + +@@ -1042,12 +1044,28 @@ cleanup(void) + while (clients) + destroyclient(clients); + g_free(cookiefile); ++ g_free(historyfile); + g_free(scriptfile); + g_free(stylefile); + g_free(cachedir); + XCloseDisplay(dpy); + } + ++void ++updatehistory(const char *u, const char *t) ++{ ++ FILE *f; ++ f = fopen(historyfile, "a+"); ++ ++ char b[20]; ++ time_t now = time (0); ++ strftime (b, 20, "%Y-%m-%d %H:%M:%S", localtime (&now)); ++ fputs(b, f); ++ ++ fprintf(f, " %s %s\n", u, t); ++ fclose(f); ++} ++ + WebKitWebView * + newview(Client *c, WebKitWebView *rv) + { +@@ -1417,6 +1435,7 @@ loadfailedtls(WebKitWebView *v, gchar *u + return TRUE; + } + ++ + void + loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client *c) + { +@@ -1445,6 +1464,7 @@ loadchanged(WebKitWebView *v, WebKitLoad + break; + case WEBKIT_LOAD_FINISHED: + seturiparameters(c, uri, loadfinished); ++ updatehistory(uri, c->title); + /* Disabled until we write some WebKitWebExtension for + * manipulating the DOM directly. + evalscript(c, "document.documentElement.style.overflow = '%s'", +Only in surf-2.0-history/: surf.o diff --git a/.local/src/surf/patches/surf-modal-20190209-d068a38.diff b/.local/src/surf/patches/surf-modal-20190209-d068a38.diff new file mode 100644 index 00000000..f6508f07 --- /dev/null +++ b/.local/src/surf/patches/surf-modal-20190209-d068a38.diff @@ -0,0 +1,134 @@ +From 74a98d9600c50d50b9323cf8e459c88eb15da557 Mon Sep 17 00:00:00 2001 +From: efe +Date: Sat, 9 Feb 2019 13:16:51 -0500 +Subject: [PATCH] Modal behaviour, 'i' to insert 'Esc' to get to the normal + mode + +--- + config.def.h | 53 +++++++++++++++++++++++++++------------------------- + surf.c | 14 +++++++++++++- + 2 files changed, 41 insertions(+), 26 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 34265f6..8b7d5a2 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -130,41 +130,44 @@ static SiteSpecific certs[] = { + */ + static Key keys[] = { + /* modifier keyval function arg */ +- { MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) }, +- { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, +- { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, ++ { 0, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) }, ++ { 0, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, ++ { 0, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, + +- { 0, GDK_KEY_Escape, stop, { 0 } }, +- { MODKEY, GDK_KEY_c, stop, { 0 } }, ++ { 0, GDK_KEY_i, insert, { .i = 1 } }, ++ { 0, GDK_KEY_Escape, insert, { .i = 0 } }, + +- { MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } }, +- { MODKEY, GDK_KEY_r, reload, { .i = 0 } }, ++ { 0, GDK_KEY_c, stop, { 0 } }, + +- { MODKEY, GDK_KEY_l, navigate, { .i = +1 } }, +- { MODKEY, GDK_KEY_h, navigate, { .i = -1 } }, ++ { MODKEY, GDK_KEY_r, reload, { .i = 1 } }, ++ { 0, GDK_KEY_r, reload, { .i = 0 } }, ++ ++ { 0, GDK_KEY_l, navigate, { .i = +1 } }, ++ { 0, GDK_KEY_h, navigate, { .i = -1 } }, + + /* vertical and horizontal scrolling, in viewport percentage */ +- { MODKEY, GDK_KEY_j, scrollv, { .i = +10 } }, +- { MODKEY, GDK_KEY_k, scrollv, { .i = -10 } }, +- { MODKEY, GDK_KEY_space, scrollv, { .i = +50 } }, +- { MODKEY, GDK_KEY_b, scrollv, { .i = -50 } }, +- { MODKEY, GDK_KEY_i, scrollh, { .i = +10 } }, +- { MODKEY, GDK_KEY_u, scrollh, { .i = -10 } }, ++ { 0, GDK_KEY_j, scrollv, { .i = +10 } }, ++ { 0, GDK_KEY_k, scrollv, { .i = -10 } }, ++ { 0, GDK_KEY_space, scrollv, { .i = +50 } }, ++ { 0, GDK_KEY_b, scrollv, { .i = -50 } }, ++ { 0, GDK_KEY_i, scrollh, { .i = +10 } }, ++ { 0, GDK_KEY_u, scrollh, { .i = -10 } }, + + +- { MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } }, +- { MODKEY|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } }, +- { MODKEY|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } }, +- { MODKEY, GDK_KEY_minus, zoom, { .i = -1 } }, +- { MODKEY, GDK_KEY_plus, zoom, { .i = +1 } }, ++ { 0|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } }, ++ { 0|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } }, ++ { 0|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } }, ++ { 0, GDK_KEY_minus, zoom, { .i = -1 } }, ++ { 0|GDK_SHIFT_MASK, GDK_KEY_plus, zoom, { .i = +1 } }, ++ { 0, GDK_KEY_equal, zoom, { .i = 0 } }, + +- { MODKEY, GDK_KEY_p, clipboard, { .i = 1 } }, +- { MODKEY, GDK_KEY_y, clipboard, { .i = 0 } }, ++ { 0, GDK_KEY_p, clipboard, { .i = 1 } }, ++ { 0, GDK_KEY_y, clipboard, { .i = 0 } }, + +- { MODKEY, GDK_KEY_n, find, { .i = +1 } }, +- { MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } }, ++ { 0, GDK_KEY_n, find, { .i = +1 } }, ++ { 0|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } }, + +- { MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } }, ++ { MODKEY, GDK_KEY_p, print, { 0 } }, + { MODKEY, GDK_KEY_t, showcert, { 0 } }, + + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } }, +diff --git a/surf.c b/surf.c +index 2b54e3c..f4cbe68 100644 +--- a/surf.c ++++ b/surf.c +@@ -175,6 +175,7 @@ static void spawn(Client *c, const Arg *a); + static void msgext(Client *c, char type, const Arg *a); + static void destroyclient(Client *c); + static void cleanup(void); ++static int insertmode = 0; + + /* GTK/WebKit */ + static WebKitWebView *newview(Client *c, WebKitWebView *rv); +@@ -231,6 +232,7 @@ static void togglefullscreen(Client *c, const Arg *a); + static void togglecookiepolicy(Client *c, const Arg *a); + static void toggleinspector(Client *c, const Arg *a); + static void find(Client *c, const Arg *a); ++static void insert(Client *c, const Arg *a); + + /* Buttons */ + static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h); +@@ -1333,7 +1335,11 @@ winevent(GtkWidget *w, GdkEvent *e, Client *c) + updatetitle(c); + break; + case GDK_KEY_PRESS: +- if (!curconfig[KioskMode].val.i) { ++ if (!curconfig[KioskMode].val.i && ++ !insertmode || ++ CLEANMASK(e->key.state) == (MODKEY|GDK_SHIFT_MASK) || ++ CLEANMASK(e->key.state) == (MODKEY) || ++ gdk_keyval_to_lower(e->key.keyval) == (GDK_KEY_Escape)) { + for (i = 0; i < LENGTH(keys); ++i) { + if (gdk_keyval_to_lower(e->key.keyval) == + keys[i].keyval && +@@ -1947,6 +1953,12 @@ find(Client *c, const Arg *a) + } + } + ++void ++insert(Client *c, const Arg *a) ++{ ++ insertmode = (a->i); ++} ++ + void + clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h) + { +-- +2.20.1 + diff --git a/.local/src/surf/patches/surf-multijs-20190325-d068a38.diff b/.local/src/surf/patches/surf-multijs-20190325-d068a38.diff new file mode 100644 index 00000000..c676c754 --- /dev/null +++ b/.local/src/surf/patches/surf-multijs-20190325-d068a38.diff @@ -0,0 +1,101 @@ +From 8d8ca34a8e61733711e23ce43b88435bfdfd4962 Mon Sep 17 00:00:00 2001 +From: knary +Date: Mon, 25 Mar 2019 15:03:15 -0400 +Subject: [PATCH] This patch replaces scriptfile with an array of + scriptfiles[]. This allows for the inclusion of multiple javascript files + instead of filling up one file with multiple script plugins. + +--- + config.def.h | 4 +++- + surf.c | 23 +++++++++++++++-------- + 2 files changed, 18 insertions(+), 9 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 34265f6..7d7d68e 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -1,11 +1,13 @@ + /* modifier 0 means no modifier */ + static int surfuseragent = 1; /* Append Surf version to default WebKit user agent */ + static char *fulluseragent = ""; /* Or override the whole user agent string */ +-static char *scriptfile = "~/.surf/script.js"; + static char *styledir = "~/.surf/styles/"; + static char *certdir = "~/.surf/certificates/"; + static char *cachedir = "~/.surf/cache/"; + static char *cookiefile = "~/.surf/cookies.txt"; ++static char *scriptfiles[] = { ++ "~/.surf/script.js", ++}; + + /* Webkit default features */ + /* Highest priority value will be used. +diff --git a/surf.c b/surf.c +index 2b54e3c..34a75de 100644 +--- a/surf.c ++++ b/surf.c +@@ -337,9 +337,11 @@ setup(void) + + /* dirs and files */ + cookiefile = buildfile(cookiefile); +- scriptfile = buildfile(scriptfile); + cachedir = buildpath(cachedir); + certdir = buildpath(certdir); ++ for (i = 0; i < LENGTH(scriptfiles); i++) { ++ scriptfiles[i] = buildfile(scriptfiles[i]); ++ } + + gdkkb = gdk_seat_get_keyboard(gdk_display_get_default_seat(gdpy)); + +@@ -945,9 +947,11 @@ runscript(Client *c) + gchar *script; + gsize l; + +- if (g_file_get_contents(scriptfile, &script, &l, NULL) && l) +- evalscript(c, "%s", script); +- g_free(script); ++ for (int i = 0; i < LENGTH(scriptfiles); i++) { ++ if (g_file_get_contents(scriptfiles[i], &script, &l, NULL) && l) ++ evalscript(c, "%s", script); ++ g_free(script); ++ } + } + + void +@@ -1010,9 +1014,9 @@ newwindow(Client *c, const Arg *a, int noembed) + cmd[i++] = curconfig[Style].val.i ? "-M" : "-m" ; + cmd[i++] = curconfig[Inspector].val.i ? "-N" : "-n" ; + cmd[i++] = curconfig[Plugins].val.i ? "-P" : "-p" ; +- if (scriptfile && g_strcmp0(scriptfile, "")) { ++ if (scriptfiles[0] && g_strcmp0(scriptfiles[0], "")) { + cmd[i++] = "-r"; +- cmd[i++] = scriptfile; ++ cmd[i++] = scriptfiles[0]; + } + cmd[i++] = curconfig[JavaScript].val.i ? "-S" : "-s"; + cmd[i++] = curconfig[StrictTLS].val.i ? "-T" : "-t"; +@@ -1076,9 +1080,12 @@ cleanup(void) + close(pipein[0]); + close(pipeout[1]); + g_free(cookiefile); +- g_free(scriptfile); + g_free(stylefile); + g_free(cachedir); ++ for (int i = 0; i < LENGTH(scriptfiles); i++) { ++ g_free(scriptfiles[i]); ++ } ++ + XCloseDisplay(dpy); + } + +@@ -2067,7 +2074,7 @@ main(int argc, char *argv[]) + defconfig[Plugins].prio = 2; + break; + case 'r': +- scriptfile = EARGF(usage()); ++ scriptfiles[0] = EARGF(usage()); + break; + case 's': + defconfig[JavaScript].val.i = 0; +-- +2.21.0 + diff --git a/.local/src/surf/patches/surf-spacesearch-20170408-b814567.diff b/.local/src/surf/patches/surf-spacesearch-20170408-b814567.diff new file mode 100644 index 00000000..ad5c0feb --- /dev/null +++ b/.local/src/surf/patches/surf-spacesearch-20170408-b814567.diff @@ -0,0 +1,26 @@ +diff --git a/config.def.h b/config.def.h +index 6d3135e..75dc6a6 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -153,6 +153,8 @@ static Key keys[] = { + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, + }; + ++static char *searchengine = "https://duckduckgo.com/?q="; ++ + /* button definitions */ + /* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */ + static Button buttons[] = { +diff --git a/surf.c b/surf.c +index 93a1629..c20537e 100644 +--- a/surf.c ++++ b/surf.c +@@ -476,6 +476,8 @@ loaduri(Client *c, const Arg *a) + } else if (!stat(uri, &st) && (path = realpath(uri, NULL))) { + url = g_strdup_printf("file://%s", path); + free(path); ++ } else if (*uri == ' ') { ++ url = g_strdup_printf("%s%s", searchengine, uri + 1); + } else { + url = g_strdup_printf("http://%s", uri); + } diff --git a/.local/src/surf/patches/surf-tip-navhist.diff b/.local/src/surf/patches/surf-tip-navhist.diff new file mode 100644 index 00000000..81f071d1 --- /dev/null +++ b/.local/src/surf/patches/surf-tip-navhist.diff @@ -0,0 +1,138 @@ +diff --git a/config.def.h b/config.def.h +index 5245129..604028f 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -45,6 +45,16 @@ static Bool allowgeolocation = TRUE; + } \ + } + ++#define SELNAV { \ ++ .v = (char *[]){ "/bin/sh", "-c", \ ++ "prop=\"`xprop -id $0 _SURF_HIST" \ ++ " | sed -e 's/^.[^\"]*\"//' -e 's/\"$//' -e 's/\\\\\\n/\\n/g'" \ ++ " | dmenu -i -l 10`\"" \ ++ " && xprop -id $0 -f _SURF_NAV 8s -set _SURF_NAV \"$prop\"", \ ++ winid, NULL \ ++ } \ ++} ++ + /* DOWNLOAD(URI, referer) */ + #define DOWNLOAD(d, r) { \ + .v = (char *[]){ "/bin/sh", "-c", \ +@@ -99,6 +109,7 @@ static Key keys[] = { + + { MODKEY, GDK_l, navigate, { .i = +1 } }, + { MODKEY, GDK_h, navigate, { .i = -1 } }, ++ { MODKEY|GDK_SHIFT_MASK,GDK_h, selhist, SELNAV }, + + { MODKEY, GDK_j, scroll_v, { .i = +1 } }, + { MODKEY, GDK_k, scroll_v, { .i = -1 } }, +diff --git a/surf.c b/surf.c +index 0fae80b..1c09336 100644 +--- a/surf.c ++++ b/surf.c +@@ -36,7 +36,7 @@ char *argv0; + #define COOKIEJAR_TYPE (cookiejar_get_type ()) + #define COOKIEJAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COOKIEJAR_TYPE, CookieJar)) + +-enum { AtomFind, AtomGo, AtomUri, AtomLast }; ++enum { AtomFind, AtomGo, AtomUri, AtomHist, AtomNav, AtomLast }; + enum { + ClkDoc = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT, + ClkLink = WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK, +@@ -177,6 +177,8 @@ static void loadstatuschange(WebKitWebView *view, GParamSpec *pspec, + Client *c); + static void loaduri(Client *c, const Arg *arg); + static void navigate(Client *c, const Arg *arg); ++static void selhist(Client *c, const Arg *arg); ++static void navhist(Client *c, const Arg *arg); + static Client *newclient(void); + static void newwindow(Client *c, const Arg *arg, gboolean noembed); + static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d); +@@ -813,6 +815,59 @@ navigate(Client *c, const Arg *arg) { + webkit_web_view_go_back_or_forward(c->view, steps); + } + ++static void ++selhist(Client *c, const Arg *arg) { ++ WebKitWebBackForwardList *lst; ++ WebKitWebHistoryItem *cur; ++ gint i; ++ gchar *out; ++ gchar *tmp; ++ gchar *line; ++ ++ out = g_strdup(""); ++ ++ if(!(lst = webkit_web_view_get_back_forward_list(c->view))) ++ return; ++ ++ for(i = webkit_web_back_forward_list_get_back_length(lst); i > 0; i--) { ++ if(!(cur = webkit_web_back_forward_list_get_nth_item(lst, -i))) ++ break; ++ line = g_strdup_printf("%d: %s\n", -i, ++ webkit_web_history_item_get_original_uri(cur)); ++ tmp = g_strconcat(out, line, NULL); ++ g_free(out); ++ out = tmp; ++ } ++ ++ if((cur = webkit_web_back_forward_list_get_nth_item(lst, 0))) { ++ line = g_strdup_printf("%d: %s", 0, ++ webkit_web_history_item_get_original_uri(cur)); ++ tmp = g_strconcat(out, line, NULL); ++ g_free(out); ++ out = tmp; ++ } ++ ++ for(i = 1; i <= webkit_web_back_forward_list_get_forward_length(lst); i++) { ++ if(!(cur = webkit_web_back_forward_list_get_nth_item(lst, i))) ++ break; ++ line = g_strdup_printf("\n%d: %s", i, ++ webkit_web_history_item_get_original_uri(cur)); ++ tmp = g_strconcat(out, line, NULL); ++ g_free(out); ++ out = tmp; ++ } ++ ++ setatom(c, AtomHist, out); ++ g_free(out); ++ spawn(c, arg); ++} ++ ++static void ++navhist(Client *c, const Arg *arg) { ++ Arg a = { .i = atoi(arg->v) }; ++ navigate(c, &a); ++} ++ + static Client * + newclient(void) { + Client *c; +@@ -1014,6 +1069,7 @@ newclient(void) { + + setatom(c, AtomFind, ""); + setatom(c, AtomUri, "about:blank"); ++ setatom(c, AtomHist, ""); + if(hidebackground) + webkit_web_view_set_transparent(c->view, TRUE); + +@@ -1153,6 +1209,9 @@ processx(GdkXEvent *e, GdkEvent *event, gpointer d) { + loaduri(c, &arg); + + return GDK_FILTER_REMOVE; ++ } else if(ev->atom == atoms[AtomNav]) { ++ arg.v = getatom(c, AtomNav); ++ navhist(c, &arg); + } + } + } +@@ -1247,6 +1306,8 @@ setup(void) { + atoms[AtomFind] = XInternAtom(dpy, "_SURF_FIND", False); + atoms[AtomGo] = XInternAtom(dpy, "_SURF_GO", False); + atoms[AtomUri] = XInternAtom(dpy, "_SURF_URI", False); ++ atoms[AtomHist] = XInternAtom(dpy, "_SURF_HIST", False); ++ atoms[AtomNav] = XInternAtom(dpy, "_SURF_NAV", False); + + /* dirs and files */ + cookiefile = buildfile(cookiefile); diff --git a/.local/src/surf/surf b/.local/src/surf/surf new file mode 100755 index 0000000000000000000000000000000000000000..4b00c6636e77d7a36c491dc692c52d28267a0447 GIT binary patch literal 72168 zcmeFa3wTu3xjw#=Fc=Xs5e1@R9Wh`)1_Ba{Kr{h_i3W_^q+CowG9d#=X3R`Nz*{tc zjAL4AEuz&LZM9TuORc4dw*U%gt&OONcp=_!$DpKYk%O1~-gm9FCo98j&-wlS|MNWO zJWqE!`S$y+Z>{yM+qW)zdsos#kFuHu<8#F9p;#Ej?QZK1@m zGACd1mek{k{F+s~7}<7~>02^>+~~?Occrhow%%QzJ>ETj+^C>`)L2n&rcd4JGv^AEn2a(# ziVxt9I<$LT?gP9{CigCWytaLK$Mvn=SE{C5_Qv72uAOgnJs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q)bA-6kO3Wkr-_Y^8bv|wJPPSW=VZ@k*^ttQaGinEIGU$QAcDZD640=8+U@tYvMcsZ4>*y-x@oZUW}45r zVKdlp-I}OcYyzxL!Z5jAoTEQ!yUn57A#incBz8pv=X;pbSP|RvJsd-k*97pFJ{-_# zDq`QJ1wI6x47+<+#B&2iOp}X+xk^GT!`(GkQBP@U!?+qp+YU<{N0H>m<=|qeJ0~U3 zfSfJeD#yW{GV+k-+apno-D-?2lI;51pWYQ&gu7ah*x9pKRc157?yDwqW!M3!;Y?{! zU|~Dz0b*Vqc1avw=qUy!*}EvGc07+G46yfi(vQjX`~=Q(YBr`i_B#6G7C6Kq#~Qr0 z{!&McP1X5g`>4NX!&M$ne@Jke$l)pFi;OnN*a4M^(=!}?ZODl%)=PFasQR+A!Ty*x zr;?OXtiv@4vUhoqMs=Q>xdc;LeWquZB|&%q|(da>H9mTjzwVp-Te zZmt#!+0;&9pS%&lyN%6T)KqvA%4)rzWC(XSi5q0Q(6i2)tz`b7b*n0fQNk5!%blhm zBPCYvAdUf2a3gwSR>`yssA5^W6BmY42ZC+s4muA=!?|$5(rORuiZ<5`*+3>yEAHw^ z@qR-^V--7+>jgZ zNk%xdCLf)@u#01cieyw&s}Xi8r^zTgslaU0<-)!>q(QH%&V#`_?)j0y-8HjiGLk*b z5pG9CjYnz7h;{{;YVnPueCk#T(+q{^lV!Ebu0%NW9yN^TWs2(SB};~I+yEaTI7@KQ z*&GL&EjRw%^#3K`pI;Mx>*juT<$rgtzrV*n!*(wHE>4M0;Rc`fdw%_WzNTB6(WUzR zqLR091FWT5>;Id((ezA@Pru_({?FqEpE&#a_4odo{vO{Q@xsqYq@Bu-&n4u#h`%4h z|60G|0%)rEt2VbSL+_bBhyQ`8hVg1Ulcn+HKcfR4( zum2}_8S*RcgQow+?;paeU;o>9Nf9}Rcprogress, togglestats, pagestats, name); else - title = g_strdup_printf("%s %s:%s | %s", - insertmode ? "[INSERT] " : "", - pagestats, togglestats, name); + title = g_strdup_printf("%s:%s | %s", + togglestats, pagestats, name); gtk_window_set_title(GTK_WINDOW(c->win), title); g_free(title); @@ -751,16 +743,16 @@ void gettogglestats(Client *c) { togglestats[0] = cookiepolicy_set(cookiepolicy_get()); - togglestats[1] = curconfig[CaretBrowsing].val.i ? 'C' : '\0'; - togglestats[2] = curconfig[Geolocation].val.i ? 'G' : '\0'; - togglestats[3] = curconfig[DiskCache].val.i ? 'D' : '\0'; - togglestats[4] = curconfig[LoadImages].val.i ? 'I' : '\0'; - togglestats[5] = curconfig[JavaScript].val.i ? 'S' : '\0'; - togglestats[6] = curconfig[Plugins].val.i ? 'V' : '\0'; - togglestats[7] = curconfig[Style].val.i ? 'M' : '\0'; - togglestats[8] = curconfig[FrameFlattening].val.i ? 'F' : '\0'; - togglestats[9] = curconfig[Certificate].val.i ? 'X' : '\0'; - togglestats[10] = curconfig[StrictTLS].val.i ? 'T' : '\0'; + togglestats[1] = curconfig[CaretBrowsing].val.i ? 'C' : 'c'; + togglestats[2] = curconfig[Geolocation].val.i ? 'G' : 'g'; + togglestats[3] = curconfig[DiskCache].val.i ? 'D' : 'd'; + togglestats[4] = curconfig[LoadImages].val.i ? 'I' : 'i'; + togglestats[5] = curconfig[JavaScript].val.i ? 'S' : 's'; + togglestats[6] = curconfig[Plugins].val.i ? 'V' : 'v'; + togglestats[7] = curconfig[Style].val.i ? 'M' : 'm'; + togglestats[8] = curconfig[FrameFlattening].val.i ? 'F' : 'f'; + togglestats[9] = curconfig[Certificate].val.i ? 'X' : 'x'; + togglestats[10] = curconfig[StrictTLS].val.i ? 'T' : 't'; togglestats[11] = '\0'; } @@ -1183,7 +1175,6 @@ cleanup(void) close(spair[0]); close(spair[1]); g_free(cookiefile); - g_free(historyfile); g_free(stylefile); g_free(cachedir); for (int i = 0; i < LENGTH(scriptfiles); i++) { @@ -1193,21 +1184,6 @@ cleanup(void) XCloseDisplay(dpy); } -void -updatehistory(const char *u, const char *t) -{ - FILE *f; - f = fopen(historyfile, "a+"); - - char b[20]; - time_t now = time (0); - strftime (b, 20, "%Y-%m-%d %H:%M:%S", localtime (&now)); - fputs(b, f); - - fprintf(f, " %s %s\n", u, t); - fclose(f); -} - WebKitWebView * newview(Client *c, WebKitWebView *rv) { @@ -1465,11 +1441,7 @@ winevent(GtkWidget *w, GdkEvent *e, Client *c) updatetitle(c); break; case GDK_KEY_PRESS: - if (!curconfig[KioskMode].val.i && - !insertmode || - CLEANMASK(e->key.state) == (MODKEY|GDK_SHIFT_MASK) || - CLEANMASK(e->key.state) == (MODKEY) || - gdk_keyval_to_lower(e->key.keyval) == (GDK_KEY_Escape)) { + if (!curconfig[KioskMode].val.i) { for (i = 0; i < LENGTH(keys); ++i) { if (gdk_keyval_to_lower(e->key.keyval) == keys[i].keyval && @@ -1627,7 +1599,6 @@ loadfailedtls(WebKitWebView *v, gchar *uri, GTlsCertificate *cert, return TRUE; } - void loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client *c) { @@ -1658,7 +1629,6 @@ loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client *c) break; case WEBKIT_LOAD_FINISHED: seturiparameters(c, uri, loadfinished); - updatehistory(uri, c->title); /* Disabled until we write some WebKitWebExtension for * manipulating the DOM directly. evalscript(c, "document.documentElement.style.overflow = '%s'", @@ -2095,13 +2065,6 @@ find(Client *c, const Arg *a) } } -void -insert(Client *c, const Arg *a) -{ - insertmode = (a->i); - updatetitle(c); -} - void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h) { diff --git a/.local/src/surf/surf.c.orig b/.local/src/surf/surf.c.orig new file mode 100644 index 00000000..ebf236b7 --- /dev/null +++ b/.local/src/surf/surf.c.orig @@ -0,0 +1,2245 @@ +/* See LICENSE file for copyright and license details. + * + * To understand surf, start reading main(). + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "arg.h" +#include "common.h" + +#define LENGTH(x) (sizeof(x) / sizeof(x[0])) +#define CLEANMASK(mask) (mask & (MODKEY|GDK_SHIFT_MASK)) + +enum { AtomFind, AtomGo, AtomUri, AtomLast }; + +enum { + OnDoc = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT, + OnLink = WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK, + OnImg = WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE, + OnMedia = WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA, + OnEdit = WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE, + OnBar = WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR, + OnSel = WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION, + OnAny = OnDoc | OnLink | OnImg | OnMedia | OnEdit | OnBar | OnSel, +}; + +typedef enum { + AcceleratedCanvas, + AccessMicrophone, + AccessWebcam, + CaretBrowsing, + Certificate, + CookiePolicies, + DiskCache, + DefaultCharset, + DNSPrefetch, + Ephemeral, + FileURLsCrossAccess, + FontSize, + FrameFlattening, + Geolocation, + HideBackground, + Inspector, + Java, + JavaScript, + KioskMode, + LoadImages, + MediaManualPlay, + Plugins, + PreferredLanguages, + RunInFullscreen, + ScrollBars, + ShowIndicators, + SiteQuirks, + SmoothScrolling, + SpellChecking, + SpellLanguages, + StrictTLS, + Style, + WebGL, + ZoomLevel, + ClipboardNotPrimary, + ParameterLast +} ParamName; + +typedef union { + int i; + float f; + const void *v; +} Arg; + +typedef struct { + Arg val; + int prio; +} Parameter; + +typedef struct Client { + GtkWidget *win; + WebKitWebView *view; + WebKitWebInspector *inspector; + WebKitFindController *finder; + WebKitHitTestResult *mousepos; + GTlsCertificate *cert, *failedcert; + GTlsCertificateFlags tlserr; + Window xid; + guint64 pageid; + int progress, fullscreen, https, insecure, errorpage; + const char *title, *overtitle, *targeturi; + const char *needle; + struct Client *next; +} Client; + +typedef struct { + guint mod; + guint keyval; + void (*func)(Client *c, const Arg *a); + const Arg arg; +} Key; + +typedef struct { + unsigned int target; + unsigned int mask; + guint button; + void (*func)(Client *c, const Arg *a, WebKitHitTestResult *h); + const Arg arg; + unsigned int stopevent; +} Button; + +typedef struct { + const char *uri; + Parameter config[ParameterLast]; + regex_t re; +} UriParameters; + +typedef struct { + char *regex; + char *file; + regex_t re; +} SiteSpecific; + +/* Surf */ +static void die(const char *errstr, ...); +static void usage(void); +static void setup(void); +static void sigchld(int unused); +static void sighup(int unused); +static char *buildfile(const char *path); +static char *buildpath(const char *path); +static char *untildepath(const char *path); +static const char *getuserhomedir(const char *user); +static const char *getcurrentuserhomedir(void); +static Client *newclient(Client *c); +static void loaduri(Client *c, const Arg *a); +static const char *geturi(Client *c); +static void setatom(Client *c, int a, const char *v); +static const char *getatom(Client *c, int a); +static void updatetitle(Client *c); +static void gettogglestats(Client *c); +static void getpagestats(Client *c); +static WebKitCookieAcceptPolicy cookiepolicy_get(void); +static char cookiepolicy_set(const WebKitCookieAcceptPolicy p); +static void seturiparameters(Client *c, const char *uri, ParamName *params); +static void setparameter(Client *c, int refresh, ParamName p, const Arg *a); +static const char *getcert(const char *uri); +static void setcert(Client *c, const char *file); +static const char *getstyle(const char *uri); +static void setstyle(Client *c, const char *file); +static void runscript(Client *c); +static void evalscript(Client *c, const char *jsstr, ...); +static void updatewinid(Client *c); +static void handleplumb(Client *c, const char *uri); +static void newwindow(Client *c, const Arg *a, int noembed); +static void spawn(Client *c, const Arg *a); +static void msgext(Client *c, char type, const Arg *a); +static void destroyclient(Client *c); +static void cleanup(void); + +/* GTK/WebKit */ +static WebKitWebView *newview(Client *c, WebKitWebView *rv); +static void initwebextensions(WebKitWebContext *wc, Client *c); +static GtkWidget *createview(WebKitWebView *v, WebKitNavigationAction *a, + Client *c); +static gboolean buttonreleased(GtkWidget *w, GdkEvent *e, Client *c); +static GdkFilterReturn processx(GdkXEvent *xevent, GdkEvent *event, + gpointer d); +static gboolean winevent(GtkWidget *w, GdkEvent *e, Client *c); +static gboolean readsock(GIOChannel *s, GIOCondition ioc, gpointer unused); +static void showview(WebKitWebView *v, Client *c); +static GtkWidget *createwindow(Client *c); +static gboolean loadfailedtls(WebKitWebView *v, gchar *uri, + GTlsCertificate *cert, + GTlsCertificateFlags err, Client *c); +static void loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client *c); +static void progresschanged(WebKitWebView *v, GParamSpec *ps, Client *c); +static void titlechanged(WebKitWebView *view, GParamSpec *ps, Client *c); +static void mousetargetchanged(WebKitWebView *v, WebKitHitTestResult *h, + guint modifiers, Client *c); +static gboolean permissionrequested(WebKitWebView *v, + WebKitPermissionRequest *r, Client *c); +static gboolean decidepolicy(WebKitWebView *v, WebKitPolicyDecision *d, + WebKitPolicyDecisionType dt, Client *c); +static void decidenavigation(WebKitPolicyDecision *d, Client *c); +static void decidenewwindow(WebKitPolicyDecision *d, Client *c); +static void decideresource(WebKitPolicyDecision *d, Client *c); +static void insecurecontent(WebKitWebView *v, WebKitInsecureContentEvent e, + Client *c); +static void downloadstarted(WebKitWebContext *wc, WebKitDownload *d, + Client *c); +static void responsereceived(WebKitDownload *d, GParamSpec *ps, Client *c); +static void download(Client *c, WebKitURIResponse *r); +static void webprocessterminated(WebKitWebView *v, + WebKitWebProcessTerminationReason r, + Client *c); +static void closeview(WebKitWebView *v, Client *c); +static void destroywin(GtkWidget* w, Client *c); + +/* Hotkeys */ +static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d); +static void reload(Client *c, const Arg *a); +static void print(Client *c, const Arg *a); +static void showcert(Client *c, const Arg *a); +static void clipboard(Client *c, const Arg *a); +static void zoom(Client *c, const Arg *a); +static void scrollv(Client *c, const Arg *a); +static void scrollh(Client *c, const Arg *a); +static void navigate(Client *c, const Arg *a); +static void stop(Client *c, const Arg *a); +static void toggle(Client *c, const Arg *a); +static void togglefullscreen(Client *c, const Arg *a); +static void togglecookiepolicy(Client *c, const Arg *a); +static void toggleinspector(Client *c, const Arg *a); +static void find(Client *c, const Arg *a); +static void externalpipe(Client *c, const Arg *a); + +/* Buttons */ +static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h); +static void clicknewwindow(Client *c, const Arg *a, WebKitHitTestResult *h); +static void clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h); + +static char winid[64]; +static char togglestats[12]; +static char pagestats[2]; +static Atom atoms[AtomLast]; +static Window embed; +static int showxid; +static int cookiepolicy; +static Display *dpy; +static Client *clients; +static GdkDevice *gdkkb; +static char *stylefile; +static const char *useragent; +static Parameter *curconfig; +static int modparams[ParameterLast]; +static int spair[2]; +char *argv0; + +static ParamName loadtransient[] = { + Certificate, + CookiePolicies, + DiskCache, + DNSPrefetch, + FileURLsCrossAccess, + JavaScript, + LoadImages, + PreferredLanguages, + ShowIndicators, + StrictTLS, + ParameterLast +}; + +static ParamName loadcommitted[] = { + AcceleratedCanvas, +// AccessMicrophone, +// AccessWebcam, + CaretBrowsing, + DefaultCharset, + FontSize, + FrameFlattening, + Geolocation, + HideBackground, + Inspector, + Java, +// KioskMode, + MediaManualPlay, + Plugins, + RunInFullscreen, + ScrollBars, + SiteQuirks, + SmoothScrolling, + SpellChecking, + SpellLanguages, + Style, + ZoomLevel, + ClipboardNotPrimary, + ParameterLast +}; + +static ParamName loadfinished[] = { + ParameterLast +}; + +/* configuration, allows nested code to access above variables */ +#include "config.h" + +static void +externalpipe_execute(char* buffer, Arg *arg) { + int to[2]; + void (*oldsigpipe)(int); + + if (pipe(to) == -1) + return; + + switch (fork()) { + case -1: + close(to[0]); + close(to[1]); + return; + case 0: + dup2(to[0], STDIN_FILENO); close(to[0]); close(to[1]); + execvp(((char **)arg->v)[0], (char **)arg->v); + fprintf(stderr, "st: execvp %s\n", ((char **)arg->v)[0]); + perror("failed"); + exit(0); + } + + close(to[0]); + oldsigpipe = signal(SIGPIPE, SIG_IGN); + write(to[1], buffer, strlen(buffer)); + close(to[1]); + signal(SIGPIPE, oldsigpipe); +} + +static void +externalpipe_resource_done(WebKitWebResource *r, GAsyncResult *s, Arg *arg) +{ + GError *gerr = NULL; + guchar *buffer = webkit_web_resource_get_data_finish(r, s, NULL, &gerr); + if (gerr == NULL) { + externalpipe_execute((char *) buffer, arg); + } else { + g_error_free(gerr); + } + g_free(buffer); +} + +static void +externalpipe_js_done(WebKitWebView *wv, GAsyncResult *s, Arg *arg) +{ + WebKitJavascriptResult *j = webkit_web_view_run_javascript_finish( + wv, s, NULL); + if (!j) { + return; + } + JSCValue *v = webkit_javascript_result_get_js_value(j); + if (jsc_value_is_string(v)) { + char *buffer = jsc_value_to_string(v); + externalpipe_execute(buffer, arg); + g_free(buffer); + } + webkit_javascript_result_unref(j); +} + +void +externalpipe(Client *c, const Arg *arg) +{ + if (curconfig[JavaScript].val.i) { + webkit_web_view_run_javascript( + c->view, "window.document.documentElement.outerHTML", + NULL, externalpipe_js_done, arg); + } else { + WebKitWebResource *resource = webkit_web_view_get_main_resource(c->view); + if (resource != NULL) { + webkit_web_resource_get_data( + resource, NULL, externalpipe_resource_done, arg); + } + } +} + +void +die(const char *errstr, ...) +{ + va_list ap; + + va_start(ap, errstr); + vfprintf(stderr, errstr, ap); + va_end(ap); + exit(1); +} + +void +usage(void) +{ + die("usage: surf [-bBdDfFgGiIkKmMnNpPsStTvwxX]\n" + "[-a cookiepolicies ] [-c cookiefile] [-C stylefile] [-e xid]\n" + "[-r scriptfile] [-u useragent] [-z zoomlevel] [uri]\n"); +} + +void +setup(void) +{ + GIOChannel *gchanin; + GdkDisplay *gdpy; + int i, j; + + /* clean up any zombies immediately */ + sigchld(0); + if (signal(SIGHUP, sighup) == SIG_ERR) + die("Can't install SIGHUP handler"); + + if (!(dpy = XOpenDisplay(NULL))) + die("Can't open default display"); + + /* atoms */ + atoms[AtomFind] = XInternAtom(dpy, "_SURF_FIND", False); + atoms[AtomGo] = XInternAtom(dpy, "_SURF_GO", False); + atoms[AtomUri] = XInternAtom(dpy, "_SURF_URI", False); + + gtk_init(NULL, NULL); + + gdpy = gdk_display_get_default(); + + curconfig = defconfig; + + /* dirs and files */ + cookiefile = buildfile(cookiefile); + scriptfile = buildfile(scriptfile); + certdir = buildpath(certdir); + if (curconfig[Ephemeral].val.i) + cachedir = NULL; + else + cachedir = buildpath(cachedir); + + gdkkb = gdk_seat_get_keyboard(gdk_display_get_default_seat(gdpy)); + + if (socketpair(AF_UNIX, SOCK_DGRAM, 0, spair) < 0) { + fputs("Unable to create sockets\n", stderr); + spair[0] = spair[1] = -1; + } else { + gchanin = g_io_channel_unix_new(spair[0]); + g_io_channel_set_encoding(gchanin, NULL, NULL); + g_io_channel_set_flags(gchanin, g_io_channel_get_flags(gchanin) + | G_IO_FLAG_NONBLOCK, NULL); + g_io_channel_set_close_on_unref(gchanin, TRUE); + g_io_add_watch(gchanin, G_IO_IN, readsock, NULL); + } + + + for (i = 0; i < LENGTH(certs); ++i) { + if (!regcomp(&(certs[i].re), certs[i].regex, REG_EXTENDED)) { + certs[i].file = g_strconcat(certdir, "/", certs[i].file, + NULL); + } else { + fprintf(stderr, "Could not compile regex: %s\n", + certs[i].regex); + certs[i].regex = NULL; + } + } + + if (!stylefile) { + styledir = buildpath(styledir); + for (i = 0; i < LENGTH(styles); ++i) { + if (!regcomp(&(styles[i].re), styles[i].regex, + REG_EXTENDED)) { + styles[i].file = g_strconcat(styledir, "/", + styles[i].file, NULL); + } else { + fprintf(stderr, "Could not compile regex: %s\n", + styles[i].regex); + styles[i].regex = NULL; + } + } + g_free(styledir); + } else { + stylefile = buildfile(stylefile); + } + + for (i = 0; i < LENGTH(uriparams); ++i) { + if (regcomp(&(uriparams[i].re), uriparams[i].uri, + REG_EXTENDED)) { + fprintf(stderr, "Could not compile regex: %s\n", + uriparams[i].uri); + uriparams[i].uri = NULL; + continue; + } + + /* copy default parameters with higher priority */ + for (j = 0; j < ParameterLast; ++j) { + if (defconfig[j].prio >= uriparams[i].config[j].prio) + uriparams[i].config[j] = defconfig[j]; + } + } +} + +void +sigchld(int unused) +{ + if (signal(SIGCHLD, sigchld) == SIG_ERR) + die("Can't install SIGCHLD handler"); + while (waitpid(-1, NULL, WNOHANG) > 0) + ; +} + +void +sighup(int unused) +{ + Arg a = { .i = 0 }; + Client *c; + + for (c = clients; c; c = c->next) + reload(c, &a); +} + +char * +buildfile(const char *path) +{ + char *dname, *bname, *bpath, *fpath; + FILE *f; + + dname = g_path_get_dirname(path); + bname = g_path_get_basename(path); + + bpath = buildpath(dname); + g_free(dname); + + fpath = g_build_filename(bpath, bname, NULL); + g_free(bpath); + g_free(bname); + + if (!(f = fopen(fpath, "a"))) + die("Could not open file: %s\n", fpath); + + g_chmod(fpath, 0600); /* always */ + fclose(f); + + return fpath; +} + +static const char* +getuserhomedir(const char *user) +{ + struct passwd *pw = getpwnam(user); + + if (!pw) + die("Can't get user %s login information.\n", user); + + return pw->pw_dir; +} + +static const char* +getcurrentuserhomedir(void) +{ + const char *homedir; + const char *user; + struct passwd *pw; + + homedir = getenv("HOME"); + if (homedir) + return homedir; + + user = getenv("USER"); + if (user) + return getuserhomedir(user); + + pw = getpwuid(getuid()); + if (!pw) + die("Can't get current user home directory\n"); + + return pw->pw_dir; +} + +char * +buildpath(const char *path) +{ + char *apath, *fpath; + + if (path[0] == '~') + apath = untildepath(path); + else + apath = g_strdup(path); + + /* creating directory */ + if (g_mkdir_with_parents(apath, 0700) < 0) + die("Could not access directory: %s\n", apath); + + fpath = realpath(apath, NULL); + g_free(apath); + + return fpath; +} + +char * +untildepath(const char *path) +{ + char *apath, *name, *p; + const char *homedir; + + if (path[1] == '/' || path[1] == '\0') { + p = (char *)&path[1]; + homedir = getcurrentuserhomedir(); + } else { + if ((p = strchr(path, '/'))) + name = g_strndup(&path[1], p - (path + 1)); + else + name = g_strdup(&path[1]); + + homedir = getuserhomedir(name); + g_free(name); + } + apath = g_build_filename(homedir, p, NULL); + return apath; +} + +Client * +newclient(Client *rc) +{ + Client *c; + + if (!(c = calloc(1, sizeof(Client)))) + die("Cannot malloc!\n"); + + c->next = clients; + clients = c; + + c->progress = 100; + c->view = newview(c, rc ? rc->view : NULL); + + return c; +} + +void +loaduri(Client *c, const Arg *a) +{ + struct stat st; + char *url, *path, *apath; + const char *uri = a->v; + + if (g_strcmp0(uri, "") == 0) + return; + + if (g_str_has_prefix(uri, "http://") || + g_str_has_prefix(uri, "https://") || + g_str_has_prefix(uri, "file://") || + g_str_has_prefix(uri, "about:")) { + url = g_strdup(uri); + } else { + if (uri[0] == '~') + apath = untildepath(uri); + else + apath = (char *)uri; + if (!stat(apath, &st) && (path = realpath(apath, NULL))) { + url = g_strdup_printf("file://%s", path); + free(path); + } else { + url = g_strdup_printf("http://%s", uri); + } + if (apath != uri) + free(apath); + } + + setatom(c, AtomUri, url); + + if (strcmp(url, geturi(c)) == 0) { + reload(c, a); + } else { + webkit_web_view_load_uri(c->view, url); + updatetitle(c); + } + + g_free(url); +} + +const char * +geturi(Client *c) +{ + const char *uri; + + if (!(uri = webkit_web_view_get_uri(c->view))) + uri = "about:blank"; + return uri; +} + +void +setatom(Client *c, int a, const char *v) +{ + XChangeProperty(dpy, c->xid, + atoms[a], XA_STRING, 8, PropModeReplace, + (unsigned char *)v, strlen(v) + 1); + XSync(dpy, False); +} + +const char * +getatom(Client *c, int a) +{ + static char buf[BUFSIZ]; + Atom adummy; + int idummy; + unsigned long ldummy; + unsigned char *p = NULL; + + XSync(dpy, False); + XGetWindowProperty(dpy, c->xid, atoms[a], 0L, BUFSIZ, False, XA_STRING, + &adummy, &idummy, &ldummy, &ldummy, &p); + if (p) + strncpy(buf, (char *)p, LENGTH(buf) - 1); + else + buf[0] = '\0'; + XFree(p); + + return buf; +} + +void +updatetitle(Client *c) +{ + char *title; + const char *name = c->overtitle ? c->overtitle : + c->title ? c->title : ""; + + if (curconfig[ShowIndicators].val.i) { + gettogglestats(c); + getpagestats(c); + + if (c->progress != 100) + title = g_strdup_printf("[%i%%] %s:%s | %s", + c->progress, togglestats, pagestats, name); + else + title = g_strdup_printf("%s:%s | %s", + togglestats, pagestats, name); + + gtk_window_set_title(GTK_WINDOW(c->win), title); + g_free(title); + } else { + gtk_window_set_title(GTK_WINDOW(c->win), name); + } +} + +void +gettogglestats(Client *c) +{ + togglestats[0] = cookiepolicy_set(cookiepolicy_get()); + togglestats[1] = curconfig[CaretBrowsing].val.i ? 'C' : 'c'; + togglestats[2] = curconfig[Geolocation].val.i ? 'G' : 'g'; + togglestats[3] = curconfig[DiskCache].val.i ? 'D' : 'd'; + togglestats[4] = curconfig[LoadImages].val.i ? 'I' : 'i'; + togglestats[5] = curconfig[JavaScript].val.i ? 'S' : 's'; + togglestats[6] = curconfig[Plugins].val.i ? 'V' : 'v'; + togglestats[7] = curconfig[Style].val.i ? 'M' : 'm'; + togglestats[8] = curconfig[FrameFlattening].val.i ? 'F' : 'f'; + togglestats[9] = curconfig[Certificate].val.i ? 'X' : 'x'; + togglestats[10] = curconfig[StrictTLS].val.i ? 'T' : 't'; + togglestats[11] = '\0'; +} + +void +getpagestats(Client *c) +{ + if (c->https) + pagestats[0] = (c->tlserr || c->insecure) ? 'U' : 'T'; + else + pagestats[0] = '-'; + pagestats[1] = '\0'; +} + +WebKitCookieAcceptPolicy +cookiepolicy_get(void) +{ + switch (((char *)curconfig[CookiePolicies].val.v)[cookiepolicy]) { + case 'a': + return WEBKIT_COOKIE_POLICY_ACCEPT_NEVER; + case '@': + return WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY; + default: /* fallthrough */ + case 'A': + return WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS; + } +} + +char +cookiepolicy_set(const WebKitCookieAcceptPolicy p) +{ + switch (p) { + case WEBKIT_COOKIE_POLICY_ACCEPT_NEVER: + return 'a'; + case WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY: + return '@'; + default: /* fallthrough */ + case WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS: + return 'A'; + } +} + +void +seturiparameters(Client *c, const char *uri, ParamName *params) +{ + Parameter *config, *uriconfig = NULL; + int i, p; + + for (i = 0; i < LENGTH(uriparams); ++i) { + if (uriparams[i].uri && + !regexec(&(uriparams[i].re), uri, 0, NULL, 0)) { + uriconfig = uriparams[i].config; + break; + } + } + + curconfig = uriconfig ? uriconfig : defconfig; + + for (i = 0; (p = params[i]) != ParameterLast; ++i) { + switch(p) { + default: /* FALLTHROUGH */ + if (!(defconfig[p].prio < curconfig[p].prio || + defconfig[p].prio < modparams[p])) + continue; + case Certificate: + case CookiePolicies: + case Style: + setparameter(c, 0, p, &curconfig[p].val); + } + } +} + +void +setparameter(Client *c, int refresh, ParamName p, const Arg *a) +{ + GdkRGBA bgcolor = { 0 }; + WebKitSettings *s = webkit_web_view_get_settings(c->view); + + modparams[p] = curconfig[p].prio; + + switch (p) { + case AcceleratedCanvas: + webkit_settings_set_enable_accelerated_2d_canvas(s, a->i); + break; + case AccessMicrophone: + return; /* do nothing */ + case AccessWebcam: + return; /* do nothing */ + case CaretBrowsing: + webkit_settings_set_enable_caret_browsing(s, a->i); + refresh = 0; + break; + case Certificate: + if (a->i) + setcert(c, geturi(c)); + return; /* do not update */ + case CookiePolicies: + webkit_cookie_manager_set_accept_policy( + webkit_web_context_get_cookie_manager( + webkit_web_view_get_context(c->view)), + cookiepolicy_get()); + refresh = 0; + break; + case DiskCache: + webkit_web_context_set_cache_model( + webkit_web_view_get_context(c->view), a->i ? + WEBKIT_CACHE_MODEL_WEB_BROWSER : + WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER); + return; /* do not update */ + case DefaultCharset: + webkit_settings_set_default_charset(s, a->v); + return; /* do not update */ + case DNSPrefetch: + webkit_settings_set_enable_dns_prefetching(s, a->i); + return; /* do not update */ + case FileURLsCrossAccess: + webkit_settings_set_allow_file_access_from_file_urls(s, a->i); + webkit_settings_set_allow_universal_access_from_file_urls(s, a->i); + return; /* do not update */ + case FontSize: + webkit_settings_set_default_font_size(s, a->i); + return; /* do not update */ + case FrameFlattening: + webkit_settings_set_enable_frame_flattening(s, a->i); + break; + case Geolocation: + refresh = 0; + break; + case HideBackground: + if (a->i) + webkit_web_view_set_background_color(c->view, &bgcolor); + return; /* do not update */ + case Inspector: + webkit_settings_set_enable_developer_extras(s, a->i); + return; /* do not update */ + case Java: + webkit_settings_set_enable_java(s, a->i); + return; /* do not update */ + case JavaScript: + webkit_settings_set_enable_javascript(s, a->i); + break; + case KioskMode: + return; /* do nothing */ + case LoadImages: + webkit_settings_set_auto_load_images(s, a->i); + break; + case MediaManualPlay: + webkit_settings_set_media_playback_requires_user_gesture(s, a->i); + break; + case Plugins: + webkit_settings_set_enable_plugins(s, a->i); + break; + case PreferredLanguages: + return; /* do nothing */ + case RunInFullscreen: + return; /* do nothing */ + case ScrollBars: + /* Disabled until we write some WebKitWebExtension for + * manipulating the DOM directly. + enablescrollbars = !enablescrollbars; + evalscript(c, "document.documentElement.style.overflow = '%s'", + enablescrollbars ? "auto" : "hidden"); + */ + return; /* do not update */ + case ShowIndicators: + break; + case SmoothScrolling: + webkit_settings_set_enable_smooth_scrolling(s, a->i); + return; /* do not update */ + case SiteQuirks: + webkit_settings_set_enable_site_specific_quirks(s, a->i); + break; + case SpellChecking: + webkit_web_context_set_spell_checking_enabled( + webkit_web_view_get_context(c->view), a->i); + return; /* do not update */ + case SpellLanguages: + return; /* do nothing */ + case StrictTLS: + webkit_web_context_set_tls_errors_policy( + webkit_web_view_get_context(c->view), a->i ? + WEBKIT_TLS_ERRORS_POLICY_FAIL : + WEBKIT_TLS_ERRORS_POLICY_IGNORE); + break; + case Style: + webkit_user_content_manager_remove_all_style_sheets( + webkit_web_view_get_user_content_manager(c->view)); + if (a->i) + setstyle(c, getstyle(geturi(c))); + refresh = 0; + break; + case WebGL: + webkit_settings_set_enable_webgl(s, a->i); + break; + case ZoomLevel: + webkit_web_view_set_zoom_level(c->view, a->f); + return; /* do not update */ + default: + return; /* do nothing */ + } + + updatetitle(c); + if (refresh) + reload(c, a); +} + +const char * +getcert(const char *uri) +{ + int i; + + for (i = 0; i < LENGTH(certs); ++i) { + if (certs[i].regex && + !regexec(&(certs[i].re), uri, 0, NULL, 0)) + return certs[i].file; + } + + return NULL; +} + +void +setcert(Client *c, const char *uri) +{ + const char *file = getcert(uri); + char *host; + GTlsCertificate *cert; + + if (!file) + return; + + if (!(cert = g_tls_certificate_new_from_file(file, NULL))) { + fprintf(stderr, "Could not read certificate file: %s\n", file); + return; + } + + if ((uri = strstr(uri, "https://"))) { + uri += sizeof("https://") - 1; + host = g_strndup(uri, strchr(uri, '/') - uri); + webkit_web_context_allow_tls_certificate_for_host( + webkit_web_view_get_context(c->view), cert, host); + g_free(host); + } + + g_object_unref(cert); + +} + +const char * +getstyle(const char *uri) +{ + int i; + + if (stylefile) + return stylefile; + + for (i = 0; i < LENGTH(styles); ++i) { + if (styles[i].regex && + !regexec(&(styles[i].re), uri, 0, NULL, 0)) + return styles[i].file; + } + + return ""; +} + +void +setstyle(Client *c, const char *file) +{ + gchar *style; + + if (!g_file_get_contents(file, &style, NULL, NULL)) { + fprintf(stderr, "Could not read style file: %s\n", file); + return; + } + + webkit_user_content_manager_add_style_sheet( + webkit_web_view_get_user_content_manager(c->view), + webkit_user_style_sheet_new(style, + WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, + WEBKIT_USER_STYLE_LEVEL_USER, + NULL, NULL)); + + g_free(style); +} + +void +runscript(Client *c) +{ + gchar *script; + gsize l; + + if (g_file_get_contents(scriptfile, &script, &l, NULL) && l) + evalscript(c, "%s", script); + g_free(script); +} + +void +evalscript(Client *c, const char *jsstr, ...) +{ + va_list ap; + gchar *script; + + va_start(ap, jsstr); + script = g_strdup_vprintf(jsstr, ap); + va_end(ap); + + webkit_web_view_run_javascript(c->view, script, NULL, NULL, NULL); + g_free(script); +} + +void +updatewinid(Client *c) +{ + snprintf(winid, LENGTH(winid), "%lu", c->xid); +} + +void +handleplumb(Client *c, const char *uri) +{ + Arg a = (Arg)PLUMB(uri); + spawn(c, &a); +} + +void +newwindow(Client *c, const Arg *a, int noembed) +{ + int i = 0; + char tmp[64]; + const char *cmd[29], *uri; + const Arg arg = { .v = cmd }; + + cmd[i++] = argv0; + cmd[i++] = "-a"; + cmd[i++] = curconfig[CookiePolicies].val.v; + cmd[i++] = curconfig[ScrollBars].val.i ? "-B" : "-b"; + if (cookiefile && g_strcmp0(cookiefile, "")) { + cmd[i++] = "-c"; + cmd[i++] = cookiefile; + } + if (stylefile && g_strcmp0(stylefile, "")) { + cmd[i++] = "-C"; + cmd[i++] = stylefile; + } + cmd[i++] = curconfig[DiskCache].val.i ? "-D" : "-d"; + if (embed && !noembed) { + cmd[i++] = "-e"; + snprintf(tmp, LENGTH(tmp), "%lu", embed); + cmd[i++] = tmp; + } + cmd[i++] = curconfig[RunInFullscreen].val.i ? "-F" : "-f" ; + cmd[i++] = curconfig[Geolocation].val.i ? "-G" : "-g" ; + cmd[i++] = curconfig[LoadImages].val.i ? "-I" : "-i" ; + cmd[i++] = curconfig[KioskMode].val.i ? "-K" : "-k" ; + cmd[i++] = curconfig[Style].val.i ? "-M" : "-m" ; + cmd[i++] = curconfig[Inspector].val.i ? "-N" : "-n" ; + cmd[i++] = curconfig[Plugins].val.i ? "-P" : "-p" ; + if (scriptfile && g_strcmp0(scriptfile, "")) { + cmd[i++] = "-r"; + cmd[i++] = scriptfile; + } + cmd[i++] = curconfig[JavaScript].val.i ? "-S" : "-s"; + cmd[i++] = curconfig[StrictTLS].val.i ? "-T" : "-t"; + if (fulluseragent && g_strcmp0(fulluseragent, "")) { + cmd[i++] = "-u"; + cmd[i++] = fulluseragent; + } + if (showxid) + cmd[i++] = "-w"; + cmd[i++] = curconfig[Certificate].val.i ? "-X" : "-x" ; + /* do not keep zoom level */ + cmd[i++] = "--"; + if ((uri = a->v)) + cmd[i++] = uri; + cmd[i] = NULL; + + spawn(c, &arg); +} + +void +spawn(Client *c, const Arg *a) +{ + if (fork() == 0) { + if (dpy) + close(ConnectionNumber(dpy)); + close(spair[0]); + close(spair[1]); + setsid(); + execvp(((char **)a->v)[0], (char **)a->v); + fprintf(stderr, "%s: execvp %s", argv0, ((char **)a->v)[0]); + perror(" failed"); + exit(1); + } +} + +void +destroyclient(Client *c) +{ + Client *p; + + webkit_web_view_stop_loading(c->view); + /* Not needed, has already been called + gtk_widget_destroy(c->win); + */ + + for (p = clients; p && p->next != c; p = p->next) + ; + if (p) + p->next = c->next; + else + clients = c->next; + free(c); +} + +void +cleanup(void) +{ + while (clients) + destroyclient(clients); + + close(spair[0]); + close(spair[1]); + g_free(cookiefile); + g_free(scriptfile); + g_free(stylefile); + g_free(cachedir); + XCloseDisplay(dpy); +} + +WebKitWebView * +newview(Client *c, WebKitWebView *rv) +{ + WebKitWebView *v; + WebKitSettings *settings; + WebKitWebContext *context; + WebKitCookieManager *cookiemanager; + WebKitUserContentManager *contentmanager; + + /* Webview */ + if (rv) { + v = WEBKIT_WEB_VIEW(webkit_web_view_new_with_related_view(rv)); + } else { + settings = webkit_settings_new_with_settings( + "allow-file-access-from-file-urls", curconfig[FileURLsCrossAccess].val.i, + "allow-universal-access-from-file-urls", curconfig[FileURLsCrossAccess].val.i, + "auto-load-images", curconfig[LoadImages].val.i, + "default-charset", curconfig[DefaultCharset].val.v, + "default-font-size", curconfig[FontSize].val.i, + "enable-caret-browsing", curconfig[CaretBrowsing].val.i, + "enable-developer-extras", curconfig[Inspector].val.i, + "enable-dns-prefetching", curconfig[DNSPrefetch].val.i, + "enable-frame-flattening", curconfig[FrameFlattening].val.i, + "enable-html5-database", curconfig[DiskCache].val.i, + "enable-html5-local-storage", curconfig[DiskCache].val.i, + "enable-java", curconfig[Java].val.i, + "enable-javascript", curconfig[JavaScript].val.i, + "enable-plugins", curconfig[Plugins].val.i, + "enable-accelerated-2d-canvas", curconfig[AcceleratedCanvas].val.i, + "enable-site-specific-quirks", curconfig[SiteQuirks].val.i, + "enable-smooth-scrolling", curconfig[SmoothScrolling].val.i, + "enable-webgl", curconfig[WebGL].val.i, + "media-playback-requires-user-gesture", curconfig[MediaManualPlay].val.i, + NULL); +/* For more interesting settings, have a look at + * http://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html */ + + if (strcmp(fulluseragent, "")) { + webkit_settings_set_user_agent(settings, fulluseragent); + } else if (surfuseragent) { + webkit_settings_set_user_agent_with_application_details( + settings, "Surf", VERSION); + } + useragent = webkit_settings_get_user_agent(settings); + + contentmanager = webkit_user_content_manager_new(); + + if (curconfig[Ephemeral].val.i) { + context = webkit_web_context_new_ephemeral(); + } else { + context = webkit_web_context_new_with_website_data_manager( + webkit_website_data_manager_new( + "base-cache-directory", cachedir, + "base-data-directory", cachedir, + NULL)); + } + + + cookiemanager = webkit_web_context_get_cookie_manager(context); + + /* rendering process model, can be a shared unique one + * or one for each view */ + webkit_web_context_set_process_model(context, + WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); + /* TLS */ + webkit_web_context_set_tls_errors_policy(context, + curconfig[StrictTLS].val.i ? WEBKIT_TLS_ERRORS_POLICY_FAIL : + WEBKIT_TLS_ERRORS_POLICY_IGNORE); + /* disk cache */ + webkit_web_context_set_cache_model(context, + curconfig[DiskCache].val.i ? WEBKIT_CACHE_MODEL_WEB_BROWSER : + WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER); + /* plugins directories */ + for (; *plugindirs; ++plugindirs) + webkit_web_context_set_additional_plugins_directory( + context, *plugindirs); + + /* Currently only works with text file to be compatible with curl */ + if (!curconfig[Ephemeral].val.i) + webkit_cookie_manager_set_persistent_storage(cookiemanager, + cookiefile, WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT); + /* cookie policy */ + webkit_cookie_manager_set_accept_policy(cookiemanager, + cookiepolicy_get()); + /* languages */ + webkit_web_context_set_preferred_languages(context, + curconfig[PreferredLanguages].val.v); + webkit_web_context_set_spell_checking_languages(context, + curconfig[SpellLanguages].val.v); + webkit_web_context_set_spell_checking_enabled(context, + curconfig[SpellChecking].val.i); + + g_signal_connect(G_OBJECT(context), "download-started", + G_CALLBACK(downloadstarted), c); + g_signal_connect(G_OBJECT(context), "initialize-web-extensions", + G_CALLBACK(initwebextensions), c); + + v = g_object_new(WEBKIT_TYPE_WEB_VIEW, + "settings", settings, + "user-content-manager", contentmanager, + "web-context", context, + NULL); + } + + g_signal_connect(G_OBJECT(v), "notify::estimated-load-progress", + G_CALLBACK(progresschanged), c); + g_signal_connect(G_OBJECT(v), "notify::title", + G_CALLBACK(titlechanged), c); + g_signal_connect(G_OBJECT(v), "button-release-event", + G_CALLBACK(buttonreleased), c); + g_signal_connect(G_OBJECT(v), "close", + G_CALLBACK(closeview), c); + g_signal_connect(G_OBJECT(v), "create", + G_CALLBACK(createview), c); + g_signal_connect(G_OBJECT(v), "decide-policy", + G_CALLBACK(decidepolicy), c); + g_signal_connect(G_OBJECT(v), "insecure-content-detected", + G_CALLBACK(insecurecontent), c); + g_signal_connect(G_OBJECT(v), "load-failed-with-tls-errors", + G_CALLBACK(loadfailedtls), c); + g_signal_connect(G_OBJECT(v), "load-changed", + G_CALLBACK(loadchanged), c); + g_signal_connect(G_OBJECT(v), "mouse-target-changed", + G_CALLBACK(mousetargetchanged), c); + g_signal_connect(G_OBJECT(v), "permission-request", + G_CALLBACK(permissionrequested), c); + g_signal_connect(G_OBJECT(v), "ready-to-show", + G_CALLBACK(showview), c); + g_signal_connect(G_OBJECT(v), "web-process-terminated", + G_CALLBACK(webprocessterminated), c); + + return v; +} + +static gboolean +readsock(GIOChannel *s, GIOCondition ioc, gpointer unused) +{ + static char msg[MSGBUFSZ]; + GError *gerr = NULL; + gsize msgsz; + + if (g_io_channel_read_chars(s, msg, sizeof(msg), &msgsz, &gerr) != + G_IO_STATUS_NORMAL) { + if (gerr) { + fprintf(stderr, "surf: error reading socket: %s\n", + gerr->message); + g_error_free(gerr); + } + return TRUE; + } + if (msgsz < 2) { + fprintf(stderr, "surf: message too short: %d\n", msgsz); + return TRUE; + } + + return TRUE; +} + +void +initwebextensions(WebKitWebContext *wc, Client *c) +{ + GVariant *gv; + + if (spair[1] < 0) + return; + + gv = g_variant_new("i", spair[1]); + + webkit_web_context_set_web_extensions_initialization_user_data(wc, gv); + webkit_web_context_set_web_extensions_directory(wc, WEBEXTDIR); +} + +GtkWidget * +createview(WebKitWebView *v, WebKitNavigationAction *a, Client *c) +{ + Client *n; + + switch (webkit_navigation_action_get_navigation_type(a)) { + case WEBKIT_NAVIGATION_TYPE_OTHER: /* fallthrough */ + /* + * popup windows of type “other” are almost always triggered + * by user gesture, so inverse the logic here + */ +/* instead of this, compare destination uri to mouse-over uri for validating window */ + if (webkit_navigation_action_is_user_gesture(a)) + return NULL; + case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: /* fallthrough */ + case WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: /* fallthrough */ + case WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: /* fallthrough */ + case WEBKIT_NAVIGATION_TYPE_RELOAD: /* fallthrough */ + case WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED: + n = newclient(c); + break; + default: + return NULL; + } + + return GTK_WIDGET(n->view); +} + +gboolean +buttonreleased(GtkWidget *w, GdkEvent *e, Client *c) +{ + WebKitHitTestResultContext element; + int i; + + element = webkit_hit_test_result_get_context(c->mousepos); + + for (i = 0; i < LENGTH(buttons); ++i) { + if (element & buttons[i].target && + e->button.button == buttons[i].button && + CLEANMASK(e->button.state) == CLEANMASK(buttons[i].mask) && + buttons[i].func) { + buttons[i].func(c, &buttons[i].arg, c->mousepos); + return buttons[i].stopevent; + } + } + + return FALSE; +} + +GdkFilterReturn +processx(GdkXEvent *e, GdkEvent *event, gpointer d) +{ + Client *c = (Client *)d; + XPropertyEvent *ev; + Arg a; + + if (((XEvent *)e)->type == PropertyNotify) { + ev = &((XEvent *)e)->xproperty; + if (ev->state == PropertyNewValue) { + if (ev->atom == atoms[AtomFind]) { + find(c, NULL); + + return GDK_FILTER_REMOVE; + } else if (ev->atom == atoms[AtomGo]) { + a.v = getatom(c, AtomGo); + loaduri(c, &a); + + return GDK_FILTER_REMOVE; + } + } + } + return GDK_FILTER_CONTINUE; +} + +gboolean +winevent(GtkWidget *w, GdkEvent *e, Client *c) +{ + int i; + + switch (e->type) { + case GDK_ENTER_NOTIFY: + c->overtitle = c->targeturi; + updatetitle(c); + break; + case GDK_KEY_PRESS: + if (!curconfig[KioskMode].val.i) { + for (i = 0; i < LENGTH(keys); ++i) { + if (gdk_keyval_to_lower(e->key.keyval) == + keys[i].keyval && + CLEANMASK(e->key.state) == keys[i].mod && + keys[i].func) { + updatewinid(c); + keys[i].func(c, &(keys[i].arg)); + return TRUE; + } + } + } + case GDK_LEAVE_NOTIFY: + c->overtitle = NULL; + updatetitle(c); + break; + case GDK_WINDOW_STATE: + if (e->window_state.changed_mask == + GDK_WINDOW_STATE_FULLSCREEN) + c->fullscreen = e->window_state.new_window_state & + GDK_WINDOW_STATE_FULLSCREEN; + break; + default: + break; + } + + return FALSE; +} + +void +showview(WebKitWebView *v, Client *c) +{ + GdkRGBA bgcolor = { 0 }; + GdkWindow *gwin; + + c->finder = webkit_web_view_get_find_controller(c->view); + c->inspector = webkit_web_view_get_inspector(c->view); + + c->pageid = webkit_web_view_get_page_id(c->view); + c->win = createwindow(c); + + gtk_container_add(GTK_CONTAINER(c->win), GTK_WIDGET(c->view)); + gtk_widget_show_all(c->win); + gtk_widget_grab_focus(GTK_WIDGET(c->view)); + + gwin = gtk_widget_get_window(GTK_WIDGET(c->win)); + c->xid = gdk_x11_window_get_xid(gwin); + updatewinid(c); + if (showxid) { + gdk_display_sync(gtk_widget_get_display(c->win)); + puts(winid); + fflush(stdout); + } + + if (curconfig[HideBackground].val.i) + webkit_web_view_set_background_color(c->view, &bgcolor); + + if (!curconfig[KioskMode].val.i) { + gdk_window_set_events(gwin, GDK_ALL_EVENTS_MASK); + gdk_window_add_filter(gwin, processx, c); + } + + if (curconfig[RunInFullscreen].val.i) + togglefullscreen(c, NULL); + + if (curconfig[ZoomLevel].val.f != 1.0) + webkit_web_view_set_zoom_level(c->view, + curconfig[ZoomLevel].val.f); + + setatom(c, AtomFind, ""); + setatom(c, AtomUri, "about:blank"); +} + +GtkWidget * +createwindow(Client *c) +{ + char *wmstr; + GtkWidget *w; + + if (embed) { + w = gtk_plug_new(embed); + } else { + w = gtk_window_new(GTK_WINDOW_TOPLEVEL); + + wmstr = g_path_get_basename(argv0); + gtk_window_set_wmclass(GTK_WINDOW(w), wmstr, "Surf"); + g_free(wmstr); + + wmstr = g_strdup_printf("%s[%"PRIu64"]", "Surf", c->pageid); + gtk_window_set_role(GTK_WINDOW(w), wmstr); + g_free(wmstr); + + gtk_window_set_default_size(GTK_WINDOW(w), winsize[0], winsize[1]); + } + + g_signal_connect(G_OBJECT(w), "destroy", + G_CALLBACK(destroywin), c); + g_signal_connect(G_OBJECT(w), "enter-notify-event", + G_CALLBACK(winevent), c); + g_signal_connect(G_OBJECT(w), "key-press-event", + G_CALLBACK(winevent), c); + g_signal_connect(G_OBJECT(w), "leave-notify-event", + G_CALLBACK(winevent), c); + g_signal_connect(G_OBJECT(w), "window-state-event", + G_CALLBACK(winevent), c); + + return w; +} + +gboolean +loadfailedtls(WebKitWebView *v, gchar *uri, GTlsCertificate *cert, + GTlsCertificateFlags err, Client *c) +{ + GString *errmsg = g_string_new(NULL); + gchar *html, *pem; + + c->failedcert = g_object_ref(cert); + c->tlserr = err; + c->errorpage = 1; + + if (err & G_TLS_CERTIFICATE_UNKNOWN_CA) + g_string_append(errmsg, + "The signing certificate authority is not known.
"); + if (err & G_TLS_CERTIFICATE_BAD_IDENTITY) + g_string_append(errmsg, + "The certificate does not match the expected identity " + "of the site that it was retrieved from.
"); + if (err & G_TLS_CERTIFICATE_NOT_ACTIVATED) + g_string_append(errmsg, + "The certificate's activation time " + "is still in the future.
"); + if (err & G_TLS_CERTIFICATE_EXPIRED) + g_string_append(errmsg, "The certificate has expired.
"); + if (err & G_TLS_CERTIFICATE_REVOKED) + g_string_append(errmsg, + "The certificate has been revoked according to " + "the GTlsConnection's certificate revocation list.
"); + if (err & G_TLS_CERTIFICATE_INSECURE) + g_string_append(errmsg, + "The certificate's algorithm is considered insecure.
"); + if (err & G_TLS_CERTIFICATE_GENERIC_ERROR) + g_string_append(errmsg, + "Some error occurred validating the certificate.
"); + + g_object_get(cert, "certificate-pem", &pem, NULL); + html = g_strdup_printf("

Could not validate TLS for “%s”
%s

" + "

You can inspect the following certificate " + "with Ctrl-t (default keybinding).

" + "

%s

", uri, errmsg->str, pem); + g_free(pem); + g_string_free(errmsg, TRUE); + + webkit_web_view_load_alternate_html(c->view, html, uri, NULL); + g_free(html); + + return TRUE; +} + +void +loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client *c) +{ + const char *uri = geturi(c); + + switch (e) { + case WEBKIT_LOAD_STARTED: + setatom(c, AtomUri, uri); + c->title = uri; + c->https = c->insecure = 0; + seturiparameters(c, uri, loadtransient); + if (c->errorpage) + c->errorpage = 0; + else + g_clear_object(&c->failedcert); + break; + case WEBKIT_LOAD_REDIRECTED: + setatom(c, AtomUri, uri); + c->title = uri; + seturiparameters(c, uri, loadtransient); + break; + case WEBKIT_LOAD_COMMITTED: + setatom(c, AtomUri, uri); + c->title = uri; + seturiparameters(c, uri, loadcommitted); + c->https = webkit_web_view_get_tls_info(c->view, &c->cert, + &c->tlserr); + break; + case WEBKIT_LOAD_FINISHED: + seturiparameters(c, uri, loadfinished); + /* Disabled until we write some WebKitWebExtension for + * manipulating the DOM directly. + evalscript(c, "document.documentElement.style.overflow = '%s'", + enablescrollbars ? "auto" : "hidden"); + */ + runscript(c); + break; + } + updatetitle(c); +} + +void +progresschanged(WebKitWebView *v, GParamSpec *ps, Client *c) +{ + c->progress = webkit_web_view_get_estimated_load_progress(c->view) * + 100; + updatetitle(c); +} + +void +titlechanged(WebKitWebView *view, GParamSpec *ps, Client *c) +{ + c->title = webkit_web_view_get_title(c->view); + updatetitle(c); +} + +void +mousetargetchanged(WebKitWebView *v, WebKitHitTestResult *h, guint modifiers, + Client *c) +{ + WebKitHitTestResultContext hc = webkit_hit_test_result_get_context(h); + + /* Keep the hit test to know where is the pointer on the next click */ + c->mousepos = h; + + if (hc & OnLink) + c->targeturi = webkit_hit_test_result_get_link_uri(h); + else if (hc & OnImg) + c->targeturi = webkit_hit_test_result_get_image_uri(h); + else if (hc & OnMedia) + c->targeturi = webkit_hit_test_result_get_media_uri(h); + else + c->targeturi = NULL; + + c->overtitle = c->targeturi; + updatetitle(c); +} + +gboolean +permissionrequested(WebKitWebView *v, WebKitPermissionRequest *r, Client *c) +{ + ParamName param = ParameterLast; + + if (WEBKIT_IS_GEOLOCATION_PERMISSION_REQUEST(r)) { + param = Geolocation; + } else if (WEBKIT_IS_USER_MEDIA_PERMISSION_REQUEST(r)) { + if (webkit_user_media_permission_is_for_audio_device( + WEBKIT_USER_MEDIA_PERMISSION_REQUEST(r))) + param = AccessMicrophone; + else if (webkit_user_media_permission_is_for_video_device( + WEBKIT_USER_MEDIA_PERMISSION_REQUEST(r))) + param = AccessWebcam; + } else { + return FALSE; + } + + if (curconfig[param].val.i) + webkit_permission_request_allow(r); + else + webkit_permission_request_deny(r); + + return TRUE; +} + +gboolean +decidepolicy(WebKitWebView *v, WebKitPolicyDecision *d, + WebKitPolicyDecisionType dt, Client *c) +{ + switch (dt) { + case WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION: + decidenavigation(d, c); + break; + case WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION: + decidenewwindow(d, c); + break; + case WEBKIT_POLICY_DECISION_TYPE_RESPONSE: + decideresource(d, c); + break; + default: + webkit_policy_decision_ignore(d); + break; + } + return TRUE; +} + +void +decidenavigation(WebKitPolicyDecision *d, Client *c) +{ + WebKitNavigationAction *a = + webkit_navigation_policy_decision_get_navigation_action( + WEBKIT_NAVIGATION_POLICY_DECISION(d)); + + switch (webkit_navigation_action_get_navigation_type(a)) { + case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: /* fallthrough */ + case WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: /* fallthrough */ + case WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: /* fallthrough */ + case WEBKIT_NAVIGATION_TYPE_RELOAD: /* fallthrough */ + case WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED: /* fallthrough */ + case WEBKIT_NAVIGATION_TYPE_OTHER: /* fallthrough */ + default: + /* Do not navigate to links with a "_blank" target (popup) */ + if (webkit_navigation_policy_decision_get_frame_name( + WEBKIT_NAVIGATION_POLICY_DECISION(d))) { + webkit_policy_decision_ignore(d); + } else { + /* Filter out navigation to different domain ? */ + /* get action→urirequest, copy and load in new window+view + * on Ctrl+Click ? */ + webkit_policy_decision_use(d); + } + break; + } +} + +void +decidenewwindow(WebKitPolicyDecision *d, Client *c) +{ + Arg arg; + WebKitNavigationAction *a = + webkit_navigation_policy_decision_get_navigation_action( + WEBKIT_NAVIGATION_POLICY_DECISION(d)); + + + switch (webkit_navigation_action_get_navigation_type(a)) { + case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: /* fallthrough */ + case WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: /* fallthrough */ + case WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: /* fallthrough */ + case WEBKIT_NAVIGATION_TYPE_RELOAD: /* fallthrough */ + case WEBKIT_NAVIGATION_TYPE_FORM_RESUBMITTED: + /* Filter domains here */ +/* If the value of “mouse-button” is not 0, then the navigation was triggered by a mouse event. + * test for link clicked but no button ? */ + arg.v = webkit_uri_request_get_uri( + webkit_navigation_action_get_request(a)); + newwindow(c, &arg, 0); + break; + case WEBKIT_NAVIGATION_TYPE_OTHER: /* fallthrough */ + default: + break; + } + + webkit_policy_decision_ignore(d); +} + +void +decideresource(WebKitPolicyDecision *d, Client *c) +{ + int i, isascii = 1; + WebKitResponsePolicyDecision *r = WEBKIT_RESPONSE_POLICY_DECISION(d); + WebKitURIResponse *res = + webkit_response_policy_decision_get_response(r); + const gchar *uri = webkit_uri_response_get_uri(res); + + if (g_str_has_suffix(uri, "/favicon.ico")) { + webkit_policy_decision_ignore(d); + return; + } + + if (!g_str_has_prefix(uri, "http://") + && !g_str_has_prefix(uri, "https://") + && !g_str_has_prefix(uri, "about:") + && !g_str_has_prefix(uri, "file://") + && !g_str_has_prefix(uri, "data:") + && !g_str_has_prefix(uri, "blob:") + && strlen(uri) > 0) { + for (i = 0; i < strlen(uri); i++) { + if (!g_ascii_isprint(uri[i])) { + isascii = 0; + break; + } + } + if (isascii) { + handleplumb(c, uri); + webkit_policy_decision_ignore(d); + return; + } + } + + if (webkit_response_policy_decision_is_mime_type_supported(r)) { + webkit_policy_decision_use(d); + } else { + webkit_policy_decision_ignore(d); + download(c, res); + } +} + +void +insecurecontent(WebKitWebView *v, WebKitInsecureContentEvent e, Client *c) +{ + c->insecure = 1; +} + +void +downloadstarted(WebKitWebContext *wc, WebKitDownload *d, Client *c) +{ + g_signal_connect(G_OBJECT(d), "notify::response", + G_CALLBACK(responsereceived), c); +} + +void +responsereceived(WebKitDownload *d, GParamSpec *ps, Client *c) +{ + download(c, webkit_download_get_response(d)); + webkit_download_cancel(d); +} + +void +download(Client *c, WebKitURIResponse *r) +{ + Arg a = (Arg)DOWNLOAD(webkit_uri_response_get_uri(r), geturi(c)); + spawn(c, &a); +} + +void +webprocessterminated(WebKitWebView *v, WebKitWebProcessTerminationReason r, + Client *c) +{ + fprintf(stderr, "web process terminated: %s\n", + r == WEBKIT_WEB_PROCESS_CRASHED ? "crashed" : "no memory"); + closeview(v, c); +} + +void +closeview(WebKitWebView *v, Client *c) +{ + gtk_widget_destroy(c->win); +} + +void +destroywin(GtkWidget* w, Client *c) +{ + destroyclient(c); + if (!clients) + gtk_main_quit(); +} + +void +pasteuri(GtkClipboard *clipboard, const char *text, gpointer d) +{ + Arg a = {.v = text }; + if (text) + loaduri((Client *) d, &a); +} + +void +reload(Client *c, const Arg *a) +{ + if (a->i) + webkit_web_view_reload_bypass_cache(c->view); + else + webkit_web_view_reload(c->view); +} + +void +print(Client *c, const Arg *a) +{ + webkit_print_operation_run_dialog(webkit_print_operation_new(c->view), + GTK_WINDOW(c->win)); +} + +void +showcert(Client *c, const Arg *a) +{ + GTlsCertificate *cert = c->failedcert ? c->failedcert : c->cert; + GcrCertificate *gcrt; + GByteArray *crt; + GtkWidget *win; + GcrCertificateWidget *wcert; + + if (!cert) + return; + + g_object_get(cert, "certificate", &crt, NULL); + gcrt = gcr_simple_certificate_new(crt->data, crt->len); + g_byte_array_unref(crt); + + win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + wcert = gcr_certificate_widget_new(gcrt); + g_object_unref(gcrt); + + gtk_container_add(GTK_CONTAINER(win), GTK_WIDGET(wcert)); + gtk_widget_show_all(win); +} + +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( + selection), + pasteuri, c); + } else { /* copy uri */ + gtk_clipboard_set_text(gtk_clipboard_get( + selection), c->targeturi + ? c->targeturi : geturi(c), -1); + } +} + +void +zoom(Client *c, const Arg *a) +{ + if (a->i > 0) + webkit_web_view_set_zoom_level(c->view, + curconfig[ZoomLevel].val.f + 0.1); + else if (a->i < 0) + webkit_web_view_set_zoom_level(c->view, + curconfig[ZoomLevel].val.f - 0.1); + else + webkit_web_view_set_zoom_level(c->view, 1.0); + + curconfig[ZoomLevel].val.f = webkit_web_view_get_zoom_level(c->view); +} + +static void +msgext(Client *c, char type, const Arg *a) +{ + static char msg[MSGBUFSZ]; + int ret; + + if (spair[0] < 0) + return; + + if ((ret = snprintf(msg, sizeof(msg), "%c%c%c", c->pageid, type, a->i)) + >= sizeof(msg)) { + fprintf(stderr, "surf: message too long: %d\n", ret); + return; + } + + if (send(spair[0], msg, ret, 0) != ret) + fprintf(stderr, "surf: error sending: %u%c%d (%d)\n", + c->pageid, type, a->i, ret); +} + +void +scrollv(Client *c, const Arg *a) +{ + msgext(c, 'v', a); +} + +void +scrollh(Client *c, const Arg *a) +{ + msgext(c, 'h', a); +} + +void +navigate(Client *c, const Arg *a) +{ + if (a->i < 0) + webkit_web_view_go_back(c->view); + else if (a->i > 0) + webkit_web_view_go_forward(c->view); +} + +void +stop(Client *c, const Arg *a) +{ + webkit_web_view_stop_loading(c->view); +} + +void +toggle(Client *c, const Arg *a) +{ + curconfig[a->i].val.i ^= 1; + setparameter(c, 1, (ParamName)a->i, &curconfig[a->i].val); +} + +void +togglefullscreen(Client *c, const Arg *a) +{ + /* toggling value is handled in winevent() */ + if (c->fullscreen) + gtk_window_unfullscreen(GTK_WINDOW(c->win)); + else + gtk_window_fullscreen(GTK_WINDOW(c->win)); +} + +void +togglecookiepolicy(Client *c, const Arg *a) +{ + ++cookiepolicy; + cookiepolicy %= strlen(curconfig[CookiePolicies].val.v); + + setparameter(c, 0, CookiePolicies, NULL); +} + +void +toggleinspector(Client *c, const Arg *a) +{ + if (webkit_web_inspector_is_attached(c->inspector)) + webkit_web_inspector_close(c->inspector); + else if (curconfig[Inspector].val.i) + webkit_web_inspector_show(c->inspector); +} + +void +find(Client *c, const Arg *a) +{ + const char *s, *f; + + if (a && a->i) { + if (a->i > 0) + webkit_find_controller_search_next(c->finder); + else + webkit_find_controller_search_previous(c->finder); + } else { + s = getatom(c, AtomFind); + f = webkit_find_controller_get_search_text(c->finder); + + if (g_strcmp0(f, s) == 0) /* reset search */ + webkit_find_controller_search(c->finder, "", findopts, + G_MAXUINT); + + webkit_find_controller_search(c->finder, s, findopts, + G_MAXUINT); + + if (strcmp(s, "") == 0) + webkit_find_controller_search_finish(c->finder); + } +} + +void +clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h) +{ + navigate(c, a); +} + +void +clicknewwindow(Client *c, const Arg *a, WebKitHitTestResult *h) +{ + Arg arg; + + arg.v = webkit_hit_test_result_get_link_uri(h); + newwindow(c, &arg, a->i); +} + +void +clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h) +{ + Arg arg; + + arg = (Arg)VIDEOPLAY(webkit_hit_test_result_get_media_uri(h)); + spawn(c, &arg); +} + +int +main(int argc, char *argv[]) +{ + Arg arg; + Client *c; + + memset(&arg, 0, sizeof(arg)); + + /* command line args */ + ARGBEGIN { + case 'a': + defconfig[CookiePolicies].val.v = EARGF(usage()); + defconfig[CookiePolicies].prio = 2; + break; + case 'b': + defconfig[ScrollBars].val.i = 0; + defconfig[ScrollBars].prio = 2; + break; + case 'B': + defconfig[ScrollBars].val.i = 1; + defconfig[ScrollBars].prio = 2; + break; + case 'c': + cookiefile = EARGF(usage()); + break; + case 'C': + stylefile = EARGF(usage()); + break; + case 'd': + defconfig[DiskCache].val.i = 0; + defconfig[DiskCache].prio = 2; + break; + case 'D': + defconfig[DiskCache].val.i = 1; + defconfig[DiskCache].prio = 2; + break; + case 'e': + embed = strtol(EARGF(usage()), NULL, 0); + break; + case 'f': + defconfig[RunInFullscreen].val.i = 0; + defconfig[RunInFullscreen].prio = 2; + break; + case 'F': + defconfig[RunInFullscreen].val.i = 1; + defconfig[RunInFullscreen].prio = 2; + break; + case 'g': + defconfig[Geolocation].val.i = 0; + defconfig[Geolocation].prio = 2; + break; + case 'G': + defconfig[Geolocation].val.i = 1; + defconfig[Geolocation].prio = 2; + break; + case 'i': + defconfig[LoadImages].val.i = 0; + defconfig[LoadImages].prio = 2; + break; + case 'I': + defconfig[LoadImages].val.i = 1; + defconfig[LoadImages].prio = 2; + break; + case 'k': + defconfig[KioskMode].val.i = 0; + defconfig[KioskMode].prio = 2; + break; + case 'K': + defconfig[KioskMode].val.i = 1; + defconfig[KioskMode].prio = 2; + break; + case 'm': + defconfig[Style].val.i = 0; + defconfig[Style].prio = 2; + break; + case 'M': + defconfig[Style].val.i = 1; + defconfig[Style].prio = 2; + break; + case 'n': + defconfig[Inspector].val.i = 0; + defconfig[Inspector].prio = 2; + break; + case 'N': + defconfig[Inspector].val.i = 1; + defconfig[Inspector].prio = 2; + break; + case 'p': + defconfig[Plugins].val.i = 0; + defconfig[Plugins].prio = 2; + break; + case 'P': + defconfig[Plugins].val.i = 1; + defconfig[Plugins].prio = 2; + break; + case 'r': + scriptfile = EARGF(usage()); + break; + case 's': + defconfig[JavaScript].val.i = 0; + defconfig[JavaScript].prio = 2; + break; + case 'S': + defconfig[JavaScript].val.i = 1; + defconfig[JavaScript].prio = 2; + break; + case 't': + defconfig[StrictTLS].val.i = 0; + defconfig[StrictTLS].prio = 2; + break; + case 'T': + defconfig[StrictTLS].val.i = 1; + defconfig[StrictTLS].prio = 2; + break; + case 'u': + fulluseragent = EARGF(usage()); + break; + case 'v': + die("surf-"VERSION", see LICENSE for © details\n"); + case 'w': + showxid = 1; + break; + case 'x': + defconfig[Certificate].val.i = 0; + defconfig[Certificate].prio = 2; + break; + case 'X': + defconfig[Certificate].val.i = 1; + defconfig[Certificate].prio = 2; + break; + case 'z': + defconfig[ZoomLevel].val.f = strtof(EARGF(usage()), NULL); + defconfig[ZoomLevel].prio = 2; + break; + default: + usage(); + } ARGEND; + if (argc > 0) + arg.v = argv[0]; + else +#ifdef HOMEPAGE + arg.v = HOMEPAGE; +#else + arg.v = "about:blank"; +#endif + + setup(); + c = newclient(NULL); + showview(NULL, c); + + loaduri(c, &arg); + updatetitle(c); + + gtk_main(); + cleanup(); + + return 0; +} diff --git a/.local/src/surf/surf.o b/.local/src/surf/surf.o new file mode 100644 index 0000000000000000000000000000000000000000..7f9ff5f69cecffc9f392931f26cd0c18358cc7bb GIT binary patch literal 71512 zcmeIb34B!5`Tu{D07k@2a03j!O?*wB14#YVk zCA|=F9wuAWRUrBignvMAJ^ksOx@XTGzld5H8s4A(u%rK{)CUTvbxgTH*UXV2_F?8`vx`G=|!N@APK?jzr2DhUIzR|4G! z#}7))fpa&MomDosY!0Fs`{p4kO(LtidVDKBM%fL-kRrM~#G)!zF%|92)2r&>BhdA+ zZ^cWHtBeP;XLY^nTk!;LbVOpCDq|n;=Wa(x2091Q!V{&A6ehqN5!D; z8^#j{d|w|W-`mFpzV92xU0JE={Vns zuPnv&8G-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MDQXpCMFDh}ro+oc-qyHj?^m;%(?HxS+U{8o=k?{d7oXenIK)!^ikH>6$KVQc=2q z{v!Xly{7!hgs|tZ5SdFKRkM A1poj5 literal 0 HcmV?d00001 diff --git a/.local/src/surf/webext-surf.o b/.local/src/surf/webext-surf.o new file mode 100644 index 0000000000000000000000000000000000000000..627caf5eeea94b4f578495ff67416c4b5d56d08a GIT binary patch literal 4336 zcmbuCU5pb|6o7BrRVqJi1;ItsjM6pB&kikuSpi9xUD*532murb592VMZHH}V)|n|? zkVHcRp=lcRNsVv%;?IL7CIpDt5SO^b2V>%+4?JNc!5Ck3L)7)0+k4yFq4T0AnYs6T z=jWbtJ9}sL&HecU(MW^{iIBads|iZT%&P7@$EG=wAgjm`TEC|hXmem_7$|K_qzAJ% z=)y!gj!v|dPp9%N(5|CSTRV~dg17oL`%V4@dq_?u|+P@J1-^C5Jg&C#nkGH=>E zpN{hxEK#6a+6yKxE`w^XV#Tz6Q#mWUW%#=4Z$M%{l*H}zz?H_+HE%g{q&Z7mSW}Y%<{auRbx{j;3re3h@qT)HmvQA^CC5egf^a7_%Pu%I)iYeDT;6wfnCq5po9;2I;Fq># zGnvgpg{_%QyICCp|IAi7f|^#b zKgR2ioI6Y+v#H32mCNGqz!oXMpX9c8am&UMsd{uGk%=~zCsJdH_}B_E2sp=mF5}32 zqL&hJ4*Lw4YJmK{)W<|(egAR^@K`^0paUVCJv%+NBxq47KkEq?_7H(Q_-BD4N`D&W z$a4rm1RsJqav>rP^%!|r;Lf-PX6Qf4NjDPxMb?fxo5aW?y#Tb$j6B%aHqI{xB6e^- z9N;fmA^f`#{&NWbErbui zgWIp)wZK=yFD#xX@jFa}_#Y18r4W80gntmizYO6&gm8Xvjd)deN;QZ$zDUI@s#$I% zr#&@8)ciQRJ&&_2-nQdy2hk?;2ltKTwSxx^9NB+VJ36*6zh5Io&2luOq{D$$)-Ww9 zu17q-0B0$gnsF`Lp8_{_vT9SVY2tFzmaoB}!J%u~p5@qD(e$+$I7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B1%9i3QHvOLqo703%JPt3kcs6-i5U=T<)S!MbeEvn4Ytwj?YzG`;!^1=ZFqV z0j{&**5^ErY26MR>Ua($+0(j@D7{~R8ZYR>T`<)K*ZO2n>qDac{*xZjPO!&!2jXcR zNtD(J{{B-RZifo48OUCh0U~-*Dw3SyN8`U&+G9U>p>?UG<8r`g4^R1d@iPHK6?#8& z)~|5@q4-x??)44I?}vZ4J*{(z@^5meD2sIKG$Ym@bM4c5m?({x?1?9e)7afUt(%EH zPl5BbPyY7%>}h>Xl)_2+{_&4X`wgU^$cm)L373@mEl&%Z1RU$s&9FRUa^r9RQJ+1n z>xq7s3?-%Z2|fZ9{H=iAW9j{$@{s-d#1qBuv$)14dwNe$@WO;bdV-td3CH;0+#`E> zpP+ng%F8A>+0i`0mvW3B$?3i0<#hl;X%@sel0DH=AaUC>RjSGh_poCrDr86W9KddS zdXG6Q?MaW^`1uz=fEe}vh$=LXNc)UnoulH^MCBzQ*uGSEq-4L^K|}?0vA8MCJs}at z=cL1u{2>Q_AG#L)ssD8U!Rv$iE-c0I=q5p*@;Rq=Nf+19LH4_E5E_3bMM?ek{|33H BOBDbB literal 0 HcmV?d00001 diff --git a/.local/src/tabbed/config.h b/.local/src/tabbed/config.h index 54b9c9c3..45035ded 100644 --- a/.local/src/tabbed/config.h +++ b/.local/src/tabbed/config.h @@ -39,8 +39,8 @@ static Key keys[] = { { MODKEY|ShiftMask, XK_Return, focusonce, { 0 } }, { MODKEY|ShiftMask, XK_Return, spawn, { 0 } }, - { ShiftMask, XK_k, rotate, { .i = +1 } }, - { ShiftMask, XK_j, rotate, { .i = -1 } }, + { MODKEY, XK_l, rotate, { .i = +1 } }, + { MODKEY, XK_h, rotate, { .i = -1 } }, { Mod1Mask|ShiftMask, XK_j, movetab, { .i = -1 } }, { Mod1Mask|ShiftMask, XK_k, movetab, { .i = +1 } }, { MODKEY, XK_Tab, rotate, { .i = 0 } }, diff --git a/.profile b/.profile index f730c47a..6b6fa312 100755 --- a/.profile +++ b/.profile @@ -98,4 +98,13 @@ if [ "$DISPLAY" = "" ] && [ "$(tty)" = /dev/tty1 ]; then fi exit fi +# Start sway if logged in from tty2 +if [ "$DISPLAY" = "" ] && [ "$(tty)" = /dev/tty2 ]; then + if [ "$DBUS_SESSION_BUS_ADDRESS" = "" ] && [ ! $(command -v dbus-run-session) = "" ]; then + exec dbus-run-session sway 2> $XDG_RUNTIME_DIR/sway.err > $XDG_RUNTIME_DIR/sway + else + exec sway 2> $XDG_RUNTIME_DIR/sway.err > $XDG_RUNTIME_DIR/sway + fi + exit +fi